Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Geert Uytterhoeven and committed by
Linus Torvalds
eea820ab 828b23fc

+67 -78
+67 -5
drivers/ps3/ps3av.c
··· 656 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 717 static int ps3av_auto_videomode(struct ps3av_pkt_av_get_hw_conf *av_hw_conf, 660 718 int boot) 661 719 { ··· 729 671 if (res < 0) 730 672 return -1; 731 673 732 - ps3av_cmd_av_monitor_info_dump(&monitor_info); 674 + ps3av_monitor_info_dump(&monitor_info); 733 675 info = &monitor_info.info; 734 676 /* check DVI */ 735 677 if (info->monitor_type == PS3AV_MONITOR_TYPE_DVI) { ··· 785 727 static int ps3av_get_hw_conf(struct ps3av *ps3av) 786 728 { 787 729 int i, j, k, res; 730 + const struct ps3av_pkt_av_get_hw_conf *hw_conf; 788 731 789 732 /* get av_hw_conf */ 790 733 res = ps3av_cmd_av_get_hw_conf(&ps3av->av_hw_conf); 791 734 if (res < 0) 792 735 return -1; 793 736 794 - ps3av_cmd_av_hw_conf_dump(&ps3av->av_hw_conf); 737 + hw_conf = &ps3av->av_hw_conf; 738 + pr_debug("av_h_conf: num of hdmi: %u\n", hw_conf->num_of_hdmi); 739 + pr_debug("av_h_conf: num of avmulti: %u\n", hw_conf->num_of_avmulti); 740 + pr_debug("av_h_conf: num of spdif: %u\n", hw_conf->num_of_spdif); 795 741 796 742 for (i = 0; i < PS3AV_HEAD_MAX; i++) 797 743 ps3av->head[i] = PS3AV_CMD_VIDEO_HEAD_A + i; 798 744 for (i = 0; i < PS3AV_OPT_PORT_MAX; i++) 799 745 ps3av->opt_port[i] = PS3AV_CMD_AVPORT_SPDIF_0 + i; 800 - for (i = 0; i < ps3av->av_hw_conf.num_of_hdmi; i++) 746 + for (i = 0; i < hw_conf->num_of_hdmi; i++) 801 747 ps3av->av_port[i] = PS3AV_CMD_AVPORT_HDMI_0 + i; 802 - for (j = 0; j < ps3av->av_hw_conf.num_of_avmulti; j++) 748 + for (j = 0; j < hw_conf->num_of_avmulti; j++) 803 749 ps3av->av_port[i + j] = PS3AV_CMD_AVPORT_AVMULTI_0 + j; 804 - for (k = 0; k < ps3av->av_hw_conf.num_of_spdif; k++) 750 + for (k = 0; k < hw_conf->num_of_spdif; k++) 805 751 ps3av->av_port[i + j + k] = PS3AV_CMD_AVPORT_SPDIF_0 + k; 806 752 807 753 /* set all audio port */
-66
drivers/ps3/ps3av_cmd.c
··· 922 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 925 #define PS3AV_AV_LAYOUT_0 (PS3AV_CMD_AV_LAYOUT_32 \ 992 926 | PS3AV_CMD_AV_LAYOUT_44 \ 993 927 | PS3AV_CMD_AV_LAYOUT_48)
-7
include/asm-powerpc/ps3av.h
··· 697 697 extern int ps3av_cmd_audio_active(int, u32); 698 698 extern int ps3av_cmd_avb_param(struct ps3av_pkt_avb_param *, u32); 699 699 extern int ps3av_cmd_av_get_hw_conf(struct ps3av_pkt_av_get_hw_conf *); 700 - #ifdef PS3AV_DEBUG 701 - extern void ps3av_cmd_av_hw_conf_dump(const struct ps3av_pkt_av_get_hw_conf *); 702 - extern void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *); 703 - #else 704 - static inline void ps3av_cmd_av_hw_conf_dump(const struct ps3av_pkt_av_get_hw_conf *hw_conf) {} 705 - static inline void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *monitor_info) {} 706 - #endif 707 700 extern int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *, 708 701 u32); 709 702