Changeset 772 for GPL/trunk/alsa-kernel/pci/ac97
- Timestamp:
- Apr 19, 2025, 8:08:37 PM (7 months ago)
- Location:
- GPL/trunk
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
alsa-kernel/pci/ac97/ac97_codec.c (modified) (6 diffs)
-
alsa-kernel/pci/ac97/ac97_patch.c (modified) (4 diffs)
-
alsa-kernel/pci/ac97/ac97_pcm.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-6.6-LTS (added) merged: 765,768-769 /GPL/branches/uniaud32-exp (added) merged: 735-741,743-744,748-751,753-760,762-764 /GPL/branches/uniaud32-next merged: 718-734
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/pci/ac97/ac97_codec.c
r717 r772 153 153 { 0x4e534331, 0xffffffff, "LM4549", NULL, NULL }, 154 154 { 0x4e534350, 0xffffffff, "LM4550", patch_lm4550, NULL }, // volume wrap fix 155 { 0x50534304, 0xffffffff, "UCB1400", patch_ucb1400, NULL },156 155 { 0x53494c20, 0xffffffe0, "Si3036,8", mpatch_si3036, mpatch_si3036, AC97_MODEM_PATCH }, 157 156 { 0x53544d02, 0xffffffff, "ST7597", NULL, NULL }, … … 2057 2056 if (err < 0) { 2058 2057 ac97_err(ac97, "Can't register ac97 bus\n"); 2058 put_device(&ac97->dev); 2059 2059 ac97->dev.bus = NULL; 2060 2060 return err; … … 2121 2121 }; 2122 2122 2123 if (rac97) 2124 *rac97 = NULL; 2125 if (snd_BUG_ON(!bus || !template)) 2123 if (snd_BUG_ON(!bus || !template || !rac97)) 2126 2124 return -EINVAL; 2125 *rac97 = NULL; 2127 2126 if (snd_BUG_ON(template->num >= 4)) 2128 2127 return -EINVAL; … … 2709 2708 static void set_ctl_name(char *dst, const char *src, const char *suffix) 2710 2709 { 2711 if (suffix) 2712 sprintf(dst, "%s %s", src, suffix); 2713 else 2714 strcpy(dst, src); 2715 } 2710 const size_t msize = SNDRV_CTL_ELEM_ID_NAME_MAXLEN; 2711 2712 if (suffix) { 2713 if (snprintf(dst, msize, "%s %s", src, suffix) >= msize) 2714 pr_warn("ALSA: AC97 control name '%s %s' truncated to '%s'\n", 2715 src, suffix, dst); 2716 } else { 2717 if (strscpy(dst, src, msize) < 0) 2718 pr_warn("ALSA: AC97 control name '%s' truncated to '%s'\n", 2719 src, dst); 2720 } 2721 } 2716 2722 2717 2723 /* remove the control with the given name and optional suffix */ … … 2740 2746 { 2741 2747 struct snd_kcontrol *kctl = ctl_find(ac97, src, suffix); 2748 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 2749 2742 2750 if (kctl) { 2743 set_ctl_name(kctl->id.name, dst, suffix); 2751 set_ctl_name(name, dst, suffix); 2752 snd_ctl_rename(ac97->bus->card, kctl, name); 2744 2753 return 0; 2745 2754 } … … 2760 2769 { 2761 2770 struct snd_kcontrol *kctl1, *kctl2; 2771 char name[SNDRV_CTL_ELEM_ID_NAME_MAXLEN]; 2772 2762 2773 kctl1 = ctl_find(ac97, s1, suffix); 2763 2774 kctl2 = ctl_find(ac97, s2, suffix); 2764 2775 if (kctl1 && kctl2) { 2765 set_ctl_name(kctl1->id.name, s2, suffix); 2766 set_ctl_name(kctl2->id.name, s1, suffix); 2776 set_ctl_name(name, s2, suffix); 2777 snd_ctl_rename(ac97->bus->card, kctl1, name); 2778 2779 set_ctl_name(name, s1, suffix); 2780 snd_ctl_rename(ac97->bus->card, kctl2, name); 2781 2767 2782 return 0; 2768 2783 } -
GPL/trunk/alsa-kernel/pci/ac97/ac97_patch.c
r703 r772 3432 3432 const char *name) 3433 3433 { 3434 struct snd_ctl_elem_id id; 3435 memset(&id, 0, sizeof(id)); 3436 id.iface = SNDRV_CTL_ELEM_IFACE_MIXER; 3437 strcpy(id.name, name); 3438 return snd_ctl_find_id(ac97->bus->card, &id); 3434 return snd_ctl_find_id_mixer(ac97->bus->card, name); 3439 3435 } 3440 3436 … … 3445 3441 { 3446 3442 struct snd_kcontrol *kctl; 3447 const char * const *s;3448 3443 int err; 3449 3444 … … 3455 3450 return err; 3456 3451 3457 for (s = followers; *s; s++) { 3458 struct snd_kcontrol *sctl; 3459 3460 sctl = snd_ac97_find_mixer_ctl(ac97, *s); 3461 if (!sctl) { 3462 dev_dbg(ac97->bus->card->dev, 3463 "Cannot find follower %s, skipped\n", *s); 3464 continue; 3465 } 3466 err = snd_ctl_add_follower(kctl, sctl); 3467 if (err < 0) 3468 return err; 3469 } 3470 return 0; 3452 return snd_ctl_add_followers(ac97->bus->card, kctl, followers); 3471 3453 } 3472 3454 … … 3938 3920 return 0; 3939 3921 } 3940 3941 /*3942 * UCB1400 codec (http://www.semiconductors.philips.com/acrobat_download/datasheets/UCB1400-02.pdf)3943 */3944 static const struct snd_kcontrol_new snd_ac97_controls_ucb1400[] = {3945 /* enable/disable headphone driver which allows direct connection to3946 stereo headphone without the use of external DC blocking3947 capacitors */3948 AC97_SINGLE("Headphone Driver", 0x6a, 6, 1, 0),3949 /* Filter used to compensate the DC offset is added in the ADC to remove idle3950 tones from the audio band. */3951 AC97_SINGLE("DC Filter", 0x6a, 4, 1, 0),3952 /* Control smart-low-power mode feature. Allows automatic power down3953 of unused blocks in the ADC analog front end and the PLL. */3954 AC97_SINGLE("Smart Low Power Mode", 0x6c, 4, 3, 0),3955 };3956 3957 static int patch_ucb1400_specific(struct snd_ac97 * ac97)3958 {3959 int idx, err;3960 for (idx = 0; idx < ARRAY_SIZE(snd_ac97_controls_ucb1400); idx++) {3961 err = snd_ctl_add(ac97->bus->card, snd_ctl_new1(&snd_ac97_controls_ucb1400[idx], ac97));3962 if (err < 0)3963 return err;3964 }3965 return 0;3966 }3967 3968 static const struct snd_ac97_build_ops patch_ucb1400_ops = {3969 .build_specific = patch_ucb1400_specific,3970 };3971 3972 static int patch_ucb1400(struct snd_ac97 * ac97)3973 {3974 ac97->build_ops = &patch_ucb1400_ops;3975 /* enable headphone driver and smart low power mode by default */3976 snd_ac97_write_cache(ac97, 0x6a, 0x0050);3977 snd_ac97_write_cache(ac97, 0x6c, 0x0030);3978 return 0;3979 } -
GPL/trunk/alsa-kernel/pci/ac97/ac97_pcm.c
r679 r772 232 232 * for SPDIF). 233 233 * 234 * The valid registers are AC97_P MC_MIC_ADC_RATE,234 * The valid registers are AC97_PCM_MIC_ADC_RATE, 235 235 * AC97_PCM_FRONT_DAC_RATE, AC97_PCM_LR_ADC_RATE. 236 236 * AC97_PCM_SURR_DAC_RATE and AC97_PCM_LFE_DAC_RATE are accepted
Note:
See TracChangeset
for help on using the changeset viewer.
