Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 270383
b: refs/heads/master
c: af65cbf
h: refs/heads/master
i:
  270381: d4b7ddc
  270379: 5316c28
  270375: 58c9e11
  270367: 6841ffa
v: v3
  • Loading branch information
Pierre-Louis Bossart authored and Takashi Iwai committed Oct 6, 2011
1 parent d511dab commit 687e79c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 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: 7c2f8e4009d4b66c8458e3a5c20510b4262853bb
refs/heads/master: af65cbf296a07c4a52079324fbefdfc9bd2622a3
2 changes: 1 addition & 1 deletion trunk/sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -5205,7 +5205,7 @@ EXPORT_SYMBOL_HDA(snd_array_free);
* @buf: the string buffer to write
* @buflen: the max buffer length
*
* used by hda_proc.c and hda_eld.c
* used by hda_proc.c
*/
void snd_print_pcm_rates(int pcm, char *buf, int buflen)
{
Expand Down
24 changes: 22 additions & 2 deletions trunk/sound/pci/hda/hda_eld.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,26 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld,
return ret;
}

/**
* SNDRV_PCM_RATE_* and AC_PAR_PCM values don't match, print correct rates with
* hdmi-specific routine.
*/
static void hdmi_print_pcm_rates(int pcm, char *buf, int buflen)
{
static unsigned int alsa_rates[] = {
5512, 8000, 11025, 16000, 22050, 32000, 44100, 48000, 88200,
96000, 176400, 192000, 384000
};
int i, j;

for (i = 0, j = 0; i < ARRAY_SIZE(alsa_rates); i++)
if (pcm & (1 << i))
j += snprintf(buf + j, buflen - j, " %d",
alsa_rates[i]);

buf[j] = '\0'; /* necessary when j == 0 */
}

static void hdmi_show_short_audio_desc(struct cea_sad *a)
{
char buf[SND_PRINT_RATES_ADVISED_BUFSIZE];
Expand All @@ -371,7 +391,7 @@ static void hdmi_show_short_audio_desc(struct cea_sad *a)
if (!a->format)
return;

snd_print_pcm_rates(a->rates, buf, sizeof(buf));
hdmi_print_pcm_rates(a->rates, buf, sizeof(buf));

if (a->format == AUDIO_CODING_TYPE_LPCM)
snd_print_pcm_bits(a->sample_bits, buf2 + 8, sizeof(buf2) - 8);
Expand Down Expand Up @@ -430,7 +450,7 @@ static void hdmi_print_sad_info(int i, struct cea_sad *a,
i, a->format, cea_audio_coding_type_names[a->format]);
snd_iprintf(buffer, "sad%d_channels\t\t%d\n", i, a->channels);

snd_print_pcm_rates(a->rates, buf, sizeof(buf));
hdmi_print_pcm_rates(a->rates, buf, sizeof(buf));
snd_iprintf(buffer, "sad%d_rates\t\t[0x%x]%s\n", i, a->rates, buf);

if (a->format == AUDIO_CODING_TYPE_LPCM) {
Expand Down

0 comments on commit 687e79c

Please sign in to comment.