aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ps3/ps3av.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>2007-10-16 04:29:40 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:20 -0400
commiteea820ab0b189d74620dca376817a2e599eb1ab1 (patch)
treeded7c5bcb90266f801b23f85e9fbeca5fb5ecfe1 /drivers/ps3/ps3av.c
parent828b23fc8794d1ac679e1695a9d9e0341e43752e (diff)
ps3av: eliminate PS3AV_DEBUG
ps3av: eliminate PS3AV_DEBUG - Move ps3av_cmd_av_monitor_info_dump from ps3av_cmd.c to ps3av.c, as it's used there only - Integrate ps3av_cmd_av_hw_conf_dump() into its sole user - Use pr_debug() for printing debug info Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Signed-off-by: Antonino Daplas <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/ps3/ps3av.c')
-rw-r--r--drivers/ps3/ps3av.c72
1 files changed, 67 insertions, 5 deletions
diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c
index a1f63cb849d2..c1bcad66ce75 100644
--- a/drivers/ps3/ps3av.c
+++ b/drivers/ps3/ps3av.c
@@ -656,6 +656,64 @@ static int ps3av_hdmi_get_vid(struct ps3av_info_monitor *info)
656 return vid; 656 return vid;
657} 657}
658 658
659static void ps3av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *monitor_info)
660{
661 const struct ps3av_info_monitor *info = &monitor_info->info;
662 const struct ps3av_info_audio *audio = info->audio;
663 char id[sizeof(info->monitor_id)*3+1];
664 int i;
665
666 pr_debug("Monitor Info: size %u\n", monitor_info->send_hdr.size);
667
668 pr_debug("avport: %02x\n", info->avport);
669 for (i = 0; i < sizeof(info->monitor_id); i++)
670 sprintf(&id[i*3], " %02x", info->monitor_id[i]);
671 pr_debug("monitor_id: %s\n", id);
672 pr_debug("monitor_type: %02x\n", info->monitor_type);
673 pr_debug("monitor_name: %.*s\n", (int)sizeof(info->monitor_name),
674 info->monitor_name);
675
676 /* resolution */
677 pr_debug("resolution_60: bits: %08x native: %08x\n",
678 info->res_60.res_bits, info->res_60.native);
679 pr_debug("resolution_50: bits: %08x native: %08x\n",
680 info->res_50.res_bits, info->res_50.native);
681 pr_debug("resolution_other: bits: %08x native: %08x\n",
682 info->res_other.res_bits, info->res_other.native);
683 pr_debug("resolution_vesa: bits: %08x native: %08x\n",
684 info->res_vesa.res_bits, info->res_vesa.native);
685
686 /* color space */
687 pr_debug("color space rgb: %02x\n", info->cs.rgb);
688 pr_debug("color space yuv444: %02x\n", info->cs.yuv444);
689 pr_debug("color space yuv422: %02x\n", info->cs.yuv422);
690
691 /* color info */
692 pr_debug("color info red: X %04x Y %04x\n", info->color.red_x,
693 info->color.red_y);
694 pr_debug("color info green: X %04x Y %04x\n", info->color.green_x,
695 info->color.green_y);
696 pr_debug("color info blue: X %04x Y %04x\n", info->color.blue_x,
697 info->color.blue_y);
698 pr_debug("color info white: X %04x Y %04x\n", info->color.white_x,
699 info->color.white_y);
700 pr_debug("color info gamma: %08x\n", info->color.gamma);
701
702 /* other info */
703 pr_debug("supported_AI: %02x\n", info->supported_ai);
704 pr_debug("speaker_info: %02x\n", info->speaker_info);
705 pr_debug("num of audio: %02x\n", info->num_of_audio_block);
706
707 /* audio block */
708 for (i = 0; i < info->num_of_audio_block; i++) {
709 pr_debug("audio[%d] type: %02x max_ch: %02x fs: %02x sbit: "
710 "%02x\n",
711 i, audio->type, audio->max_num_of_ch, audio->fs,
712 audio->sbit);
713 audio++;
714 }
715}
716
659static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf, 717static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf,
660 int boot) 718 int boot)
661{ 719{
@@ -671,7 +729,7 @@ static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf,
671 if (res < 0) 729 if (res < 0)
672 return -1; 730 return -1;
673 731
674 ps3av_cmd_av_monitor_info_dump(&monitor_info); 732 ps3av_monitor_info_dump(&monitor_info);
675 info = &monitor_info.info; 733 info = &monitor_info.info;
676 /* check DVI */ 734 /* check DVI */
677 if (info->monitor_type == PS3AV_MONITOR_TYPE_DVI) { 735 if (info->monitor_type == PS3AV_MONITOR_TYPE_DVI) {
@@ -727,23 +785,27 @@ static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf,
727static int ps3av_get_hw_conf(struct ps3av *ps3av) 785static int ps3av_get_hw_conf(struct ps3av *ps3av)
728{ 786{
729 int i, j, k, res; 787 int i, j, k, res;
788 const struct ps3av_pkt_av_get_hw_conf *hw_conf;
730 789
731 /* get av_hw_conf */ 790 /* get av_hw_conf */
732 res = ps3av_cmd_av_get_hw_conf(&ps3av->av_hw_conf); 791 res = ps3av_cmd_av_get_hw_conf(&ps3av->av_hw_conf);
733 if (res < 0) 792 if (res < 0)
734 return -1; 793 return -1;
735 794
736 ps3av_cmd_av_hw_conf_dump(&ps3av->av_hw_conf); 795 hw_conf = &ps3av->av_hw_conf;
796 pr_debug("av_h_conf: num of hdmi: %u\n", hw_conf->num_of_hdmi);
797 pr_debug("av_h_conf: num of avmulti: %u\n", hw_conf->num_of_avmulti);
798 pr_debug("av_h_conf: num of spdif: %u\n", hw_conf->num_of_spdif);
737 799
738 for (i = 0; i < PS3AV_HEAD_MAX; i++) 800 for (i = 0; i < PS3AV_HEAD_MAX; i++)
739 ps3av->head[i] = PS3AV_CMD_VIDEO_HEAD_A + i; 801 ps3av->head[i] = PS3AV_CMD_VIDEO_HEAD_A + i;
740 for (i = 0; i < PS3AV_OPT_PORT_MAX; i++) 802 for (i = 0; i < PS3AV_OPT_PORT_MAX; i++)
741 ps3av->opt_port[i] = PS3AV_CMD_AVPORT_SPDIF_0 + i; 803 ps3av->opt_port[i] = PS3AV_CMD_AVPORT_SPDIF_0 + i;
742 for (i = 0; i < ps3av->av_hw_conf.num_of_hdmi; i++) 804 for (i = 0; i < hw_conf->num_of_hdmi; i++)
743 ps3av->av_port[i] = PS3AV_CMD_AVPORT_HDMI_0 + i; 805 ps3av->av_port[i] = PS3AV_CMD_AVPORT_HDMI_0 + i;
744 for (j = 0; j < ps3av->av_hw_conf.num_of_avmulti; j++) 806 for (j = 0; j < hw_conf->num_of_avmulti; j++)
745 ps3av->av_port[i + j] = PS3AV_CMD_AVPORT_AVMULTI_0 + j; 807 ps3av->av_port[i + j] = PS3AV_CMD_AVPORT_AVMULTI_0 + j;
746 for (k = 0; k < ps3av->av_hw_conf.num_of_spdif; k++) 808 for (k = 0; k < hw_conf->num_of_spdif; k++)
747 ps3av->av_port[i + j + k] = PS3AV_CMD_AVPORT_SPDIF_0 + k; 809 ps3av->av_port[i + j + k] = PS3AV_CMD_AVPORT_SPDIF_0 + k;
748 810
749 /* set all audio port */ 811 /* set all audio port */