aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorWu Fengguang <wfg@linux.intel.com>2008-11-18 19:56:16 -0500
committerTakashi Iwai <tiwai@suse.de>2008-11-19 01:35:28 -0500
commit903b21d8b7bb49d3438abdd7b9d4145511e1cba2 (patch)
tree5b2815ba603a942f44d93fec47186d581c312ad2 /sound/pci
parent5457a98039cebf20b564b5c3d73a50615e2b2696 (diff)
ALSA: hda: make global snd_print_channel_allocation()
code refactor: make a global function snd_print_channel_allocation(). Signed-off-by: Wu Fengguang <wfg@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/hda_eld.c11
-rw-r--r--sound/pci/hda/hda_local.h3
2 files changed, 8 insertions, 6 deletions
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c
index 7fa065cd1d9c..18078de0abcc 100644
--- a/sound/pci/hda/hda_eld.c
+++ b/sound/pci/hda/hda_eld.c
@@ -407,8 +407,7 @@ static void hdmi_show_short_audio_desc(struct cea_sad *a)
407 printk(KERN_INFO "profile: %d\n", a->profile); 407 printk(KERN_INFO "profile: %d\n", a->profile);
408} 408}
409 409
410#define HDMI_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE 80 410void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen)
411static void hdmi_print_channel_allocation(int spk_alloc, char *buf, int buflen)
412{ 411{
413 int i, j; 412 int i, j;
414 413
@@ -425,7 +424,7 @@ static void hdmi_print_channel_allocation(int spk_alloc, char *buf, int buflen)
425void snd_hdmi_show_eld(struct sink_eld *e) 424void snd_hdmi_show_eld(struct sink_eld *e)
426{ 425{
427 int i; 426 int i;
428 char buf[HDMI_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE]; 427 char buf[SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE];
429 428
430 printk(KERN_INFO "ELD buffer size is %d\n", e->eld_size); 429 printk(KERN_INFO "ELD buffer size is %d\n", e->eld_size);
431 printk(KERN_INFO "ELD baseline len is %d*4\n", e->baseline_len); 430 printk(KERN_INFO "ELD baseline len is %d*4\n", e->baseline_len);
@@ -446,7 +445,7 @@ void snd_hdmi_show_eld(struct sink_eld *e)
446 eld_connection_type_names[e->conn_type]); 445 eld_connection_type_names[e->conn_type]);
447 printk(KERN_INFO "monitor name is %s\n", e->monitor_name); 446 printk(KERN_INFO "monitor name is %s\n", e->monitor_name);
448 447
449 hdmi_print_channel_allocation(e->spk_alloc, buf, sizeof(buf)); 448 snd_print_channel_allocation(e->spk_alloc, buf, sizeof(buf));
450 printk(KERN_INFO "speaker allocations: (0x%x)%s\n", e->spk_alloc, buf); 449 printk(KERN_INFO "speaker allocations: (0x%x)%s\n", e->spk_alloc, buf);
451 450
452 for (i = 0; i < e->sad_count; i++) 451 for (i = 0; i < e->sad_count; i++)
@@ -484,7 +483,7 @@ static void hdmi_print_eld_info(struct snd_info_entry *entry,
484 struct snd_info_buffer *buffer) 483 struct snd_info_buffer *buffer)
485{ 484{
486 struct sink_eld *e = entry->private_data; 485 struct sink_eld *e = entry->private_data;
487 char buf[HDMI_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE]; 486 char buf[SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE];
488 int i; 487 int i;
489 488
490 snd_iprintf(buffer, "monitor name\t\t%s\n", e->monitor_name); 489 snd_iprintf(buffer, "monitor name\t\t%s\n", e->monitor_name);
@@ -501,7 +500,7 @@ static void hdmi_print_eld_info(struct snd_info_entry *entry,
501 snd_iprintf(buffer, "support_ai\t\t%d\n", e->support_ai); 500 snd_iprintf(buffer, "support_ai\t\t%d\n", e->support_ai);
502 snd_iprintf(buffer, "audio_sync_delay\t%d\n", e->aud_synch_delay); 501 snd_iprintf(buffer, "audio_sync_delay\t%d\n", e->aud_synch_delay);
503 502
504 hdmi_print_channel_allocation(e->spk_alloc, buf, sizeof(buf)); 503 snd_print_channel_allocation(e->spk_alloc, buf, sizeof(buf));
505 snd_iprintf(buffer, "speakers\t\t[0x%x] %s\n", e->spk_alloc, buf); 504 snd_iprintf(buffer, "speakers\t\t[0x%x] %s\n", e->spk_alloc, buf);
506 505
507 snd_iprintf(buffer, "sad_count\t\t%d\n", e->sad_count); 506 snd_iprintf(buffer, "sad_count\t\t%d\n", e->sad_count);
diff --git a/sound/pci/hda/hda_local.h b/sound/pci/hda/hda_local.h
index 02ac7321e5e4..0baa9b816ca8 100644
--- a/sound/pci/hda/hda_local.h
+++ b/sound/pci/hda/hda_local.h
@@ -493,4 +493,7 @@ inline int snd_hda_eld_proc_new(struct hda_codec *codec, struct sink_eld *eld)
493} 493}
494#endif 494#endif
495 495
496#define SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE 80
497void snd_print_channel_allocation(int spk_alloc, char *buf, int buflen);
498
496#endif /* __SOUND_HDA_LOCAL_H */ 499#endif /* __SOUND_HDA_LOCAL_H */