]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From: Takashi Iwai <tiwai@suse.de> |
2 | Subject: ALSA: Fix sample rate of Lenovo Ideapad to 44.1kHz | |
3 | Patch-mainline: | |
4 | References: bnc#480391 | |
5 | ||
6 | Noises can be heard on analog outputs of (some model of) Lenovo | |
7 | Ideapad due to the hardware problem, and the only workaround right now | |
8 | is to fix the sample rate to 44.1kHz. | |
9 | ||
10 | Signed-off-by: Takashi Iwai <tiwai@suse.de> | |
11 | Acked-by: Takashi Iwai <tiwai@suse.de> | |
12 | ||
13 | --- | |
14 | sound/pci/hda/patch_realtek.c | 34 +++++++++++++++++++++++++++++++--- | |
15 | 1 file changed, 31 insertions(+), 3 deletions(-) | |
16 | ||
17 | --- a/sound/pci/hda/patch_realtek.c | |
18 | +++ b/sound/pci/hda/patch_realtek.c | |
19 | @@ -12339,6 +12339,27 @@ static int alc269_auto_create_analog_inp | |
20 | #define alc269_pcm_digital_playback alc880_pcm_digital_playback | |
21 | #define alc269_pcm_digital_capture alc880_pcm_digital_capture | |
22 | ||
23 | +static struct hda_pcm_stream alc269_44k_pcm_analog_playback = { | |
24 | + .substreams = 1, | |
25 | + .channels_min = 2, | |
26 | + .channels_max = 8, | |
27 | + .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ | |
28 | + /* NID is set in alc_build_pcms */ | |
29 | + .ops = { | |
30 | + .open = alc880_playback_pcm_open, | |
31 | + .prepare = alc880_playback_pcm_prepare, | |
32 | + .cleanup = alc880_playback_pcm_cleanup | |
33 | + }, | |
34 | +}; | |
35 | + | |
36 | +static struct hda_pcm_stream alc269_44k_pcm_analog_capture = { | |
37 | + .substreams = 1, | |
38 | + .channels_min = 2, | |
39 | + .channels_max = 2, | |
40 | + .rates = SNDRV_PCM_RATE_44100, /* fixed rate */ | |
41 | + /* NID is set in alc_build_pcms */ | |
42 | +}; | |
43 | + | |
44 | /* | |
45 | * BIOS auto configuration | |
46 | */ | |
47 | @@ -12540,9 +12561,16 @@ static int patch_alc269(struct hda_codec | |
48 | setup_preset(spec, &alc269_presets[board_config]); | |
49 | ||
50 | spec->stream_name_analog = "ALC269 Analog"; | |
51 | - spec->stream_analog_playback = &alc269_pcm_analog_playback; | |
52 | - spec->stream_analog_capture = &alc269_pcm_analog_capture; | |
53 | - | |
54 | + if (codec->subsystem_id == 0x17aa3bf8) { | |
55 | + /* Due to a hardware problem on Lenovo Ideadpad, we need to | |
56 | + * fix the sample rate of analog I/O to 44.1kHz | |
57 | + */ | |
58 | + spec->stream_analog_playback = &alc269_44k_pcm_analog_playback; | |
59 | + spec->stream_analog_capture = &alc269_44k_pcm_analog_capture; | |
60 | + } else { | |
61 | + spec->stream_analog_playback = &alc269_pcm_analog_playback; | |
62 | + spec->stream_analog_capture = &alc269_pcm_analog_capture; | |
63 | + } | |
64 | spec->stream_name_digital = "ALC269 Digital"; | |
65 | spec->stream_digital_playback = &alc269_pcm_digital_playback; | |
66 | spec->stream_digital_capture = &alc269_pcm_digital_capture; |