diff options
author | Wu Fengguang <wfg@linux.intel.com> | 2008-11-21 20:40:53 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-11-22 05:14:48 -0500 |
commit | 03284c8f23440479de79e8cbf368085ea872884e (patch) | |
tree | a81466daa2babe9a6d9981612240a50bd6a2c4ae /sound | |
parent | cc02b83c904592ce8714787094256a9bf8e24b6f (diff) |
ALSA: hda - make HDMI messages more user friendly
- make some messages more user friendly
- add message prefix "HDMI:" to indicate the problem's domain
(also easier to do `dmesg | grep HDMI` ;-)
Signed-off-by: Wu Fengguang <wfg@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/hda/hda_eld.c | 30 | ||||
-rw-r--r-- | sound/pci/hda/patch_intelhdmi.c | 32 |
2 files changed, 32 insertions, 30 deletions
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c index 8740e7be8b24..3f10961a17b4 100644 --- a/sound/pci/hda/hda_eld.c +++ b/sound/pci/hda/hda_eld.c | |||
@@ -168,11 +168,11 @@ static unsigned char hdmi_get_eld_byte(struct hda_codec *codec, hda_nid_t nid, | |||
168 | AC_VERB_GET_HDMI_ELDD, byte_index); | 168 | AC_VERB_GET_HDMI_ELDD, byte_index); |
169 | 169 | ||
170 | #ifdef BE_PARANOID | 170 | #ifdef BE_PARANOID |
171 | printk(KERN_INFO "ELD data byte %d: 0x%x\n", byte_index, val); | 171 | printk(KERN_INFO "HDMI: ELD data byte %d: 0x%x\n", byte_index, val); |
172 | #endif | 172 | #endif |
173 | 173 | ||
174 | if ((val & AC_ELDD_ELD_VALID) == 0) { | 174 | if ((val & AC_ELDD_ELD_VALID) == 0) { |
175 | snd_printd(KERN_INFO "Invalid ELD data byte %d\n", | 175 | snd_printd(KERN_INFO "HDMI: invalid ELD data byte %d\n", |
176 | byte_index); | 176 | byte_index); |
177 | val = 0; | 177 | val = 0; |
178 | } | 178 | } |
@@ -208,7 +208,7 @@ static void hdmi_update_short_audio_desc(struct cea_sad *a, | |||
208 | switch (a->format) { | 208 | switch (a->format) { |
209 | case AUDIO_CODING_TYPE_REF_STREAM_HEADER: | 209 | case AUDIO_CODING_TYPE_REF_STREAM_HEADER: |
210 | snd_printd(KERN_INFO | 210 | snd_printd(KERN_INFO |
211 | "audio coding type 0 not expected in ELD\n"); | 211 | "HDMI: audio coding type 0 not expected\n"); |
212 | break; | 212 | break; |
213 | 213 | ||
214 | case AUDIO_CODING_TYPE_LPCM: | 214 | case AUDIO_CODING_TYPE_LPCM: |
@@ -254,7 +254,7 @@ static void hdmi_update_short_audio_desc(struct cea_sad *a, | |||
254 | if (a->format == AUDIO_CODING_XTYPE_HE_REF_CT || | 254 | if (a->format == AUDIO_CODING_XTYPE_HE_REF_CT || |
255 | a->format >= AUDIO_CODING_XTYPE_FIRST_RESERVED) { | 255 | a->format >= AUDIO_CODING_XTYPE_FIRST_RESERVED) { |
256 | snd_printd(KERN_INFO | 256 | snd_printd(KERN_INFO |
257 | "audio coding xtype %d not expected in ELD\n", | 257 | "HDMI: audio coding xtype %d not expected\n", |
258 | a->format); | 258 | a->format); |
259 | a->format = 0; | 259 | a->format = 0; |
260 | } else | 260 | } else |
@@ -276,7 +276,8 @@ static int hdmi_update_eld(struct hdmi_eld *e, | |||
276 | e->eld_ver = GRAB_BITS(buf, 0, 3, 5); | 276 | e->eld_ver = GRAB_BITS(buf, 0, 3, 5); |
277 | if (e->eld_ver != ELD_VER_CEA_861D && | 277 | if (e->eld_ver != ELD_VER_CEA_861D && |
278 | e->eld_ver != ELD_VER_PARTIAL) { | 278 | e->eld_ver != ELD_VER_PARTIAL) { |
279 | snd_printd(KERN_INFO "Unknown ELD version %d\n", e->eld_ver); | 279 | snd_printd(KERN_INFO "HDMI: Unknown ELD version %d\n", |
280 | e->eld_ver); | ||
280 | goto out_fail; | 281 | goto out_fail; |
281 | } | 282 | } |
282 | 283 | ||
@@ -300,17 +301,17 @@ static int hdmi_update_eld(struct hdmi_eld *e, | |||
300 | e->product_id = get_unaligned_le16(buf + 18); | 301 | e->product_id = get_unaligned_le16(buf + 18); |
301 | 302 | ||
302 | if (mnl > ELD_MAX_MNL) { | 303 | if (mnl > ELD_MAX_MNL) { |
303 | snd_printd(KERN_INFO "MNL is reserved value %d\n", mnl); | 304 | snd_printd(KERN_INFO "HDMI: MNL is reserved value %d\n", mnl); |
304 | goto out_fail; | 305 | goto out_fail; |
305 | } else if (ELD_FIXED_BYTES + mnl > size) { | 306 | } else if (ELD_FIXED_BYTES + mnl > size) { |
306 | snd_printd(KERN_INFO "out of range MNL %d\n", mnl); | 307 | snd_printd(KERN_INFO "HDMI: out of range MNL %d\n", mnl); |
307 | goto out_fail; | 308 | goto out_fail; |
308 | } else | 309 | } else |
309 | strlcpy(e->monitor_name, buf + ELD_FIXED_BYTES, mnl); | 310 | strlcpy(e->monitor_name, buf + ELD_FIXED_BYTES, mnl); |
310 | 311 | ||
311 | for (i = 0; i < e->sad_count; i++) { | 312 | for (i = 0; i < e->sad_count; i++) { |
312 | if (ELD_FIXED_BYTES + mnl + 3 * (i + 1) > size) { | 313 | if (ELD_FIXED_BYTES + mnl + 3 * (i + 1) > size) { |
313 | snd_printd(KERN_INFO "out of range SAD %d\n", i); | 314 | snd_printd(KERN_INFO "HDMI: out of range SAD %d\n", i); |
314 | goto out_fail; | 315 | goto out_fail; |
315 | } | 316 | } |
316 | hdmi_update_short_audio_desc(e->sad + i, | 317 | hdmi_update_short_audio_desc(e->sad + i, |
@@ -339,7 +340,8 @@ static int hdmi_eld_valid(struct hda_codec *codec, hda_nid_t nid) | |||
339 | present = (present & AC_PINSENSE_PRESENCE); | 340 | present = (present & AC_PINSENSE_PRESENCE); |
340 | 341 | ||
341 | #ifdef CONFIG_SND_DEBUG_VERBOSE | 342 | #ifdef CONFIG_SND_DEBUG_VERBOSE |
342 | printk(KERN_INFO "pinp = %d, eldv = %d\n", !!present, !!eldv); | 343 | printk(KERN_INFO "HDMI: sink_present = %d, eld_valid = %d\n", |
344 | !!present, !!eldv); | ||
343 | #endif | 345 | #endif |
344 | 346 | ||
345 | return eldv && present; | 347 | return eldv && present; |
@@ -365,11 +367,11 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld, | |||
365 | size = snd_hdmi_get_eld_size(codec, nid); | 367 | size = snd_hdmi_get_eld_size(codec, nid); |
366 | if (size == 0) { | 368 | if (size == 0) { |
367 | /* wfg: workaround for ASUS P5E-VM HDMI board */ | 369 | /* wfg: workaround for ASUS P5E-VM HDMI board */ |
368 | snd_printd(KERN_INFO "ELD buf size is 0, force 128\n"); | 370 | snd_printd(KERN_INFO "HDMI: ELD buf size is 0, force 128\n"); |
369 | size = 128; | 371 | size = 128; |
370 | } | 372 | } |
371 | if (size < ELD_FIXED_BYTES || size > PAGE_SIZE) { | 373 | if (size < ELD_FIXED_BYTES || size > PAGE_SIZE) { |
372 | snd_printd(KERN_INFO "Invalid ELD buf size %d\n", size); | 374 | snd_printd(KERN_INFO "HDMI: invalid ELD buf size %d\n", size); |
373 | return -ERANGE; | 375 | return -ERANGE; |
374 | } | 376 | } |
375 | 377 | ||
@@ -404,7 +406,7 @@ static void hdmi_show_short_audio_desc(struct cea_sad *a) | |||
404 | else | 406 | else |
405 | buf2[0] = '\0'; | 407 | buf2[0] = '\0'; |
406 | 408 | ||
407 | printk(KERN_INFO "supports coding type %s:" | 409 | printk(KERN_INFO "HDMI: supports coding type %s:" |
408 | " channels = %d, rates =%s%s\n", | 410 | " channels = %d, rates =%s%s\n", |
409 | cea_audio_coding_type_names[a->format], | 411 | cea_audio_coding_type_names[a->format], |
410 | a->channels, | 412 | a->channels, |
@@ -428,14 +430,14 @@ void snd_hdmi_show_eld(struct hdmi_eld *e) | |||
428 | { | 430 | { |
429 | int i; | 431 | int i; |
430 | 432 | ||
431 | printk(KERN_INFO "detected monitor %s at connection type %s\n", | 433 | printk(KERN_INFO "HDMI: detected monitor %s at connection type %s\n", |
432 | e->monitor_name, | 434 | e->monitor_name, |
433 | eld_connection_type_names[e->conn_type]); | 435 | eld_connection_type_names[e->conn_type]); |
434 | 436 | ||
435 | if (e->spk_alloc) { | 437 | if (e->spk_alloc) { |
436 | char buf[SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE]; | 438 | char buf[SND_PRINT_CHANNEL_ALLOCATION_ADVISED_BUFSIZE]; |
437 | snd_print_channel_allocation(e->spk_alloc, buf, sizeof(buf)); | 439 | snd_print_channel_allocation(e->spk_alloc, buf, sizeof(buf)); |
438 | printk(KERN_INFO "available speakers:%s\n", buf); | 440 | printk(KERN_INFO "HDMI: available speakers:%s\n", buf); |
439 | } | 441 | } |
440 | 442 | ||
441 | for (i = 0; i < e->sad_count; i++) | 443 | for (i = 0; i < e->sad_count; i++) |
diff --git a/sound/pci/hda/patch_intelhdmi.c b/sound/pci/hda/patch_intelhdmi.c index 4a48011ae35b..fe08bef897cd 100644 --- a/sound/pci/hda/patch_intelhdmi.c +++ b/sound/pci/hda/patch_intelhdmi.c | |||
@@ -286,7 +286,7 @@ static void hdmi_set_channel_count(struct hda_codec *codec, int chs) | |||
286 | AC_VERB_SET_CVT_CHAN_COUNT, chs - 1); | 286 | AC_VERB_SET_CVT_CHAN_COUNT, chs - 1); |
287 | 287 | ||
288 | if (chs != hdmi_get_channel_count(codec)) | 288 | if (chs != hdmi_get_channel_count(codec)) |
289 | snd_printd(KERN_INFO "Channel count expect=%d, real=%d\n", | 289 | snd_printd(KERN_INFO "HDMI channel count: expect %d, get %d\n", |
290 | chs, hdmi_get_channel_count(codec)); | 290 | chs, hdmi_get_channel_count(codec)); |
291 | } | 291 | } |
292 | 292 | ||
@@ -299,7 +299,7 @@ static void hdmi_debug_channel_mapping(struct hda_codec *codec) | |||
299 | for (i = 0; i < 8; i++) { | 299 | for (i = 0; i < 8; i++) { |
300 | slot = snd_hda_codec_read(codec, CVT_NID, 0, | 300 | slot = snd_hda_codec_read(codec, CVT_NID, 0, |
301 | AC_VERB_GET_HDMI_CHAN_SLOT, i); | 301 | AC_VERB_GET_HDMI_CHAN_SLOT, i); |
302 | printk(KERN_DEBUG "ASP channel %d => slot %d\n", | 302 | printk(KERN_DEBUG "HDMI: ASP channel %d => slot %d\n", |
303 | slot >> 4, slot & 0x7); | 303 | slot >> 4, slot & 0x7); |
304 | } | 304 | } |
305 | #endif | 305 | #endif |
@@ -326,12 +326,12 @@ static void hdmi_debug_dip_size(struct hda_codec *codec) | |||
326 | int size; | 326 | int size; |
327 | 327 | ||
328 | size = snd_hdmi_get_eld_size(codec, PIN_NID); | 328 | size = snd_hdmi_get_eld_size(codec, PIN_NID); |
329 | printk(KERN_DEBUG "ELD buf size is %d\n", size); | 329 | printk(KERN_DEBUG "HDMI: ELD buf size is %d\n", size); |
330 | 330 | ||
331 | for (i = 0; i < 8; i++) { | 331 | for (i = 0; i < 8; i++) { |
332 | size = snd_hda_codec_read(codec, PIN_NID, 0, | 332 | size = snd_hda_codec_read(codec, PIN_NID, 0, |
333 | AC_VERB_GET_HDMI_DIP_SIZE, i); | 333 | AC_VERB_GET_HDMI_DIP_SIZE, i); |
334 | printk(KERN_DEBUG "DIP GP[%d] buf size is %d\n", i, size); | 334 | printk(KERN_DEBUG "HDMI: DIP GP[%d] buf size is %d\n", i, size); |
335 | } | 335 | } |
336 | #endif | 336 | #endif |
337 | } | 337 | } |
@@ -359,8 +359,8 @@ static void hdmi_clear_dip_buffers(struct hda_codec *codec) | |||
359 | break; | 359 | break; |
360 | } | 360 | } |
361 | snd_printd(KERN_INFO | 361 | snd_printd(KERN_INFO |
362 | "DIP GP[%d] buf reported size=%d, written=%d\n", | 362 | "HDMI: DIP GP[%d] buf reported size=%d, written=%d\n", |
363 | i, size, j); | 363 | i, size, j); |
364 | } | 364 | } |
365 | #endif | 365 | #endif |
366 | } | 366 | } |
@@ -498,7 +498,9 @@ static void hdmi_intrinsic_event(struct hda_codec *codec, unsigned int res) | |||
498 | int pind = !!(res & AC_UNSOL_RES_PD); | 498 | int pind = !!(res & AC_UNSOL_RES_PD); |
499 | int eldv = !!(res & AC_UNSOL_RES_ELDV); | 499 | int eldv = !!(res & AC_UNSOL_RES_ELDV); |
500 | 500 | ||
501 | printk(KERN_INFO "HDMI intrinsic event: PD=%d ELDV=%d\n", pind, eldv); | 501 | printk(KERN_INFO |
502 | "HDMI hot plug event: Presence_Detect=%d ELD_Valid=%d\n", | ||
503 | pind, eldv); | ||
502 | 504 | ||
503 | if (pind && eldv) { | 505 | if (pind && eldv) { |
504 | hdmi_parse_eld(codec); | 506 | hdmi_parse_eld(codec); |
@@ -512,13 +514,13 @@ static void hdmi_non_intrinsic_event(struct hda_codec *codec, unsigned int res) | |||
512 | int cp_state = !!(res & AC_UNSOL_RES_CP_STATE); | 514 | int cp_state = !!(res & AC_UNSOL_RES_CP_STATE); |
513 | int cp_ready = !!(res & AC_UNSOL_RES_CP_READY); | 515 | int cp_ready = !!(res & AC_UNSOL_RES_CP_READY); |
514 | 516 | ||
515 | printk(KERN_INFO "HDMI non-intrinsic event: " | 517 | printk(KERN_INFO |
516 | "SUBTAG=0x%x CP_STATE=%d CP_READY=%d\n", | 518 | "HDMI content protection event: SUBTAG=0x%x CP_STATE=%d CP_READY=%d\n", |
517 | subtag, | 519 | subtag, |
518 | cp_state, | 520 | cp_state, |
519 | cp_ready); | 521 | cp_ready); |
520 | 522 | ||
521 | /* who cares? */ | 523 | /* TODO */ |
522 | if (cp_state) | 524 | if (cp_state) |
523 | ; | 525 | ; |
524 | if (cp_ready) | 526 | if (cp_ready) |
@@ -532,9 +534,7 @@ static void intel_hdmi_unsol_event(struct hda_codec *codec, unsigned int res) | |||
532 | int subtag = (res & AC_UNSOL_RES_SUBTAG) >> AC_UNSOL_RES_SUBTAG_SHIFT; | 534 | int subtag = (res & AC_UNSOL_RES_SUBTAG) >> AC_UNSOL_RES_SUBTAG_SHIFT; |
533 | 535 | ||
534 | if (tag != INTEL_HDMI_EVENT_TAG) { | 536 | if (tag != INTEL_HDMI_EVENT_TAG) { |
535 | snd_printd(KERN_INFO | 537 | snd_printd(KERN_INFO "Unexpected HDMI event tag 0x%x\n", tag); |
536 | "Unexpected HDMI unsolicited event tag 0x%x\n", | ||
537 | tag); | ||
538 | return; | 538 | return; |
539 | } | 539 | } |
540 | 540 | ||