Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157857
b: refs/heads/master
c: fd72d00
h: refs/heads/master
i:
  157855: 0d32e11
v: v3
  • Loading branch information
Wu Fengguang authored and Takashi Iwai committed Aug 24, 2009
1 parent f251719 commit e43d3fd
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 454e134d0e9e38421830f26426c66f37a6d39465
refs/heads/master: fd72d008465d45db63d7f8931eea6a04e05916d6
10 changes: 10 additions & 0 deletions trunk/sound/pci/hda/hda_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,16 @@ static inline u32 get_wcaps(struct hda_codec *codec, hda_nid_t nid)
/* get the widget type from widget capability bits */
#define get_wcaps_type(wcaps) (((wcaps) & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT)

static inline unsigned int get_wcaps_channels(u32 wcaps)
{
unsigned int chans;

chans = (wcaps & AC_WCAP_CHAN_CNT_EXT) >> 13;
chans = ((chans << 1) | 1) + 1;

return chans;
}

u32 query_amp_caps(struct hda_codec *codec, hda_nid_t nid, int direction);
int snd_hda_override_amp_caps(struct hda_codec *codec, hda_nid_t nid, int dir,
unsigned int caps);
Expand Down
4 changes: 1 addition & 3 deletions trunk/sound/pci/hda/hda_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,9 +515,7 @@ static void print_codec_info(struct snd_info_entry *entry,
snd_iprintf(buffer, "Node 0x%02x [%s] wcaps 0x%x:", nid,
get_wid_type_name(wid_type), wid_caps);
if (wid_caps & AC_WCAP_STEREO) {
unsigned int chans;
chans = (wid_caps & AC_WCAP_CHAN_CNT_EXT) >> 13;
chans = ((chans << 1) | 1) + 1;
unsigned int chans = get_wcaps_channels(wid_caps);
if (chans == 2)
snd_iprintf(buffer, " Stereo");
else
Expand Down
3 changes: 1 addition & 2 deletions trunk/sound/pci/hda/patch_atihdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,7 @@ static int atihdmi_build_pcms(struct hda_codec *codec)
/* FIXME: we must check ELD and change the PCM parameters dynamically
*/
chans = get_wcaps(codec, CVT_NID);
chans = (chans & AC_WCAP_CHAN_CNT_EXT) >> 13;
chans = ((chans << 1) | 1) + 1;
chans = get_wcaps_channels(chans);
info->stream[SNDRV_PCM_STREAM_PLAYBACK].channels_max = chans;

return 0;
Expand Down

0 comments on commit e43d3fd

Please sign in to comment.