diff options
author | Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> | 2007-10-16 04:29:40 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-16 12:43:20 -0400 |
commit | eea820ab0b189d74620dca376817a2e599eb1ab1 (patch) | |
tree | ded7c5bcb90266f801b23f85e9fbeca5fb5ecfe1 /drivers | |
parent | 828b23fc8794d1ac679e1695a9d9e0341e43752e (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')
-rw-r--r-- | drivers/ps3/ps3av.c | 72 | ||||
-rw-r--r-- | drivers/ps3/ps3av_cmd.c | 66 |
2 files changed, 67 insertions, 71 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 | ||
659 | static 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 | |||
659 | static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf, | 717 | static 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, | |||
727 | static int ps3av_get_hw_conf(struct ps3av *ps3av) | 785 | static 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 */ |
diff --git a/drivers/ps3/ps3av_cmd.c b/drivers/ps3/ps3av_cmd.c index 83d7e8fdbfea..7f880c26122f 100644 --- a/drivers/ps3/ps3av_cmd.c +++ b/drivers/ps3/ps3av_cmd.c | |||
@@ -922,72 +922,6 @@ int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *info, | |||
922 | return res; | 922 | return res; |
923 | } | 923 | } |
924 | 924 | ||
925 | #ifdef PS3AV_DEBUG | ||
926 | void ps3av_cmd_av_hw_conf_dump(const struct ps3av_pkt_av_get_hw_conf *hw_conf) | ||
927 | { | ||
928 | printk("av_h_conf:num of hdmi:%d\n", hw_conf->num_of_hdmi); | ||
929 | printk("av_h_conf:num of avmulti:%d\n", hw_conf->num_of_avmulti); | ||
930 | printk("av_h_conf:num of spdif:%d\n", hw_conf->num_of_spdif); | ||
931 | } | ||
932 | |||
933 | void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *monitor_info) | ||
934 | { | ||
935 | const struct ps3av_info_monitor *info = &monitor_info->info; | ||
936 | const struct ps3av_info_audio *audio = info->audio; | ||
937 | int i; | ||
938 | |||
939 | printk("Monitor Info: size%d\n", monitor_info->send_hdr.size); | ||
940 | |||
941 | printk("avport:%02x\n", info->avport); | ||
942 | printk("monitor_id:"); | ||
943 | for (i = 0; i < 10; i++) | ||
944 | printk("%02x ", info->monitor_id[i]); | ||
945 | printk("\nmonitor_type:%02x\n", info->monitor_type); | ||
946 | printk("monitor_name:"); | ||
947 | for (i = 0; i < 16; i++) | ||
948 | printk("%c", info->monitor_name[i]); | ||
949 | |||
950 | /* resolution */ | ||
951 | printk("\nresolution_60: bits:%08x native:%08x\n", | ||
952 | info->res_60.res_bits, info->res_60.native); | ||
953 | printk("resolution_50: bits:%08x native:%08x\n", | ||
954 | info->res_50.res_bits, info->res_50.native); | ||
955 | printk("resolution_other: bits:%08x native:%08x\n", | ||
956 | info->res_other.res_bits, info->res_other.native); | ||
957 | printk("resolution_vesa: bits:%08x native:%08x\n", | ||
958 | info->res_vesa.res_bits, info->res_vesa.native); | ||
959 | |||
960 | /* color space */ | ||
961 | printk("color space rgb:%02x\n", info->cs.rgb); | ||
962 | printk("color space yuv444:%02x\n", info->cs.yuv444); | ||
963 | printk("color space yuv422:%02x\n", info->cs.yuv422); | ||
964 | |||
965 | /* color info */ | ||
966 | printk("color info red:X %04x Y %04x\n", | ||
967 | info->color.red_x, info->color.red_y); | ||
968 | printk("color info green:X %04x Y %04x\n", | ||
969 | info->color.green_x, info->color.green_y); | ||
970 | printk("color info blue:X %04x Y %04x\n", | ||
971 | info->color.blue_x, info->color.blue_y); | ||
972 | printk("color info white:X %04x Y %04x\n", | ||
973 | info->color.white_x, info->color.white_y); | ||
974 | printk("color info gamma: %08x\n", info->color.gamma); | ||
975 | |||
976 | /* other info */ | ||
977 | printk("supported_AI:%02x\n", info->supported_ai); | ||
978 | printk("speaker_info:%02x\n", info->speaker_info); | ||
979 | printk("num of audio:%02x\n", info->num_of_audio_block); | ||
980 | |||
981 | /* audio block */ | ||
982 | for (i = 0; i < info->num_of_audio_block; i++) { | ||
983 | printk("audio[%d] type:%02x max_ch:%02x fs:%02x sbit:%02x\n", | ||
984 | i, audio->type, audio->max_num_of_ch, audio->fs, | ||
985 | audio->sbit); | ||
986 | audio++; | ||
987 | } | ||
988 | } | ||
989 | #endif /* PS3AV_DEBUG */ | ||
990 | |||
991 | #define PS3AV_AV_LAYOUT_0 (PS3AV_CMD_AV_LAYOUT_32 \ | 925 | #define PS3AV_AV_LAYOUT_0 (PS3AV_CMD_AV_LAYOUT_32 \ |
992 | | PS3AV_CMD_AV_LAYOUT_44 \ | 926 | | PS3AV_CMD_AV_LAYOUT_44 \ |
993 | | PS3AV_CMD_AV_LAYOUT_48) | 927 | | PS3AV_CMD_AV_LAYOUT_48) |