Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=897cc188f7f0e402b92a4a6a9e234b45c612eb42 Commit: 897cc188f7f0e402b92a4a6a9e234b45c612eb42 Parent: f9acba4347ac2145456aa8dedaab3d74761da42a Author: Takashi Iwai <[EMAIL PROTECTED]> AuthorDate: Tue May 29 19:01:37 2007 +0200 Committer: Jaroslav Kysela <[EMAIL PROTECTED]> CommitDate: Thu May 31 09:06:04 2007 +0200
[ALSA] hda-codec - Fix STAC922x capture boost level STAC922x provides the capture boost level up to 4, but actually it works only up to 2. Since the range of the mixer is automatically defined from amp-capability bits, we need to override the value beforehand. snd_hda_override_amp_caps() is introduced for this purpose. The function patch_stac922x() calls this for NID 0x12 (Mux Capture Volume). This should fix another recording problem on Intel Macs. Signed-off-by: Takashi Iwai <[EMAIL PROTECTED]> Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]> --- sound/pci/hda/hda_codec.c | 13 +++++++++++++ sound/pci/hda/hda_local.h | 2 ++ sound/pci/hda/patch_sigmatel.c | 7 +++++++ 3 files changed, 22 insertions(+), 0 deletions(-) diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index 8e89d56..f87f8f0 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c @@ -713,6 +713,19 @@ static u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction) return info->amp_caps; } +int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, + unsigned int caps) +{ + struct hda_amp_info *info; + + info = get_alloc_amp_hash(codec, HDA_HASH_KEY(nid, dir, 0)); + if (!info) + return -EINVAL; + info->amp_caps = caps; + info->status |= INFO_AMP_CAPS; + return 0; +} + /* * read the current volume to info * if the cache exists, read the cache value. diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h index be12b88..f91ea5e 100644 --- a/sound/pci/hda/hda_local.h +++ b/sound/pci/hda/hda_local.h @@ -277,5 +277,7 @@ static inline u32 get_wcaps(struct hda_codec *codec, hda_nid_t nid) return codec->wcaps[nid - codec->start_nid]; } +int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir, + unsigned int caps); #endif /* __SOUND_HDA_LOCAL_H */ diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 33fc7cd..e3964fc 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c @@ -2159,6 +2159,13 @@ static int patch_stac927x(struct hda_codec *codec) codec->patch_ops = stac92xx_patch_ops; + /* Fix Mux capture level; max to 2 */ + snd_hda_override_amp_caps(codec, 0x12, HDA_OUTPUT, + (0 << AC_AMPCAP_OFFSET_SHIFT) | + (2 << AC_AMPCAP_NUM_STEPS_SHIFT) | + (0x27 << AC_AMPCAP_STEP_SIZE_SHIFT) | + (0 << AC_AMPCAP_MUTE_SHIFT)); + return 0; } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html