X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fps3%2Fps3av_cmd.c;h=11eb50318fec9ce093e6b9ef99e6fd858c4ead20;hb=8ebcfc8bcb55261cf01fc302d707fbba46242bf1;hp=f72f5ddf18e4e38e735ea9698e0645453879fcf9;hpb=2e85622042cb5fd56a606e884651ffde52f21028;p=linux-2.6-omap-h63xx.git diff --git a/drivers/ps3/ps3av_cmd.c b/drivers/ps3/ps3av_cmd.c index f72f5ddf18e..11eb50318fe 100644 --- a/drivers/ps3/ps3av_cmd.c +++ b/drivers/ps3/ps3av_cmd.c @@ -512,7 +512,6 @@ static const u32 ps3av_ns_table[][5] = { static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid) { u32 av_vid, ns_val; - u8 *p = ns; int d; d = ns_val = 0; @@ -551,24 +550,22 @@ static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid) else ns_val = ps3av_ns_table[PS3AV_CMD_AUDIO_FS_44K-BASE][d]; - *p++ = ns_val & 0x000000FF; - *p++ = (ns_val & 0x0000FF00) >> 8; - *p = (ns_val & 0x00FF0000) >> 16; + *ns++ = ns_val & 0x000000FF; + *ns++ = (ns_val & 0x0000FF00) >> 8; + *ns = (ns_val & 0x00FF0000) >> 16; } #undef BASE static u8 ps3av_cnv_enable(u32 source, const u8 *enable) { - const u8 *p; u8 ret = 0; if (source == PS3AV_CMD_AUDIO_SOURCE_SPDIF) { ret = 0x03; } else if (source == PS3AV_CMD_AUDIO_SOURCE_SERIAL) { - p = enable; - ret = ((p[0] << 4) + (p[1] << 5) + (p[2] << 6) + (p[3] << 7)) | - 0x01; + ret = ((enable[0] << 4) + (enable[1] << 5) + (enable[2] << 6) + + (enable[3] << 7)) | 0x01; } else printk(KERN_ERR "%s failed, source:%x\n", __func__, source); return ret; @@ -576,11 +573,9 @@ static u8 ps3av_cnv_enable(u32 source, const u8 *enable) static u8 ps3av_cnv_fifomap(const u8 *map) { - const u8 *p; u8 ret = 0; - p = map; - ret = p[0] + (p[1] << 2) + (p[2] << 4) + (p[3] << 6); + ret = map[0] + (map[1] << 2) + (map[2] << 4) + (map[3] << 6); return ret; } @@ -665,9 +660,10 @@ u32 ps3av_cmd_set_av_audio_param(void *p, u32 port, } /* default cs val */ -static const u8 ps3av_mode_cs_info[] = { +u8 ps3av_mode_cs_info[] = { 0x00, 0x09, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00 }; +EXPORT_SYMBOL_GPL(ps3av_mode_cs_info); #define CS_44 0x00 #define CS_48 0x02 @@ -682,7 +678,7 @@ void ps3av_cmd_set_audio_mode(struct ps3av_pkt_audio_mode *audio, u32 avport, u32 ch, u32 fs, u32 word_bits, u32 format, u32 source) { - int spdif_through, spdif_bitstream; + int spdif_through; int i; if (!(ch | fs | format | word_bits | source)) { @@ -692,7 +688,6 @@ void ps3av_cmd_set_audio_mode(struct ps3av_pkt_audio_mode *audio, u32 avport, format = PS3AV_CMD_AUDIO_FORMAT_PCM; source = PS3AV_CMD_AUDIO_SOURCE_SERIAL; } - spdif_through = spdif_bitstream = 0; /* XXX not supported */ /* audio mode */ memset(audio, 0, sizeof(*audio)); @@ -782,16 +777,17 @@ void ps3av_cmd_set_audio_mode(struct ps3av_pkt_audio_mode *audio, u32 avport, break; } + /* non-audio bit */ + spdif_through = audio->audio_cs_info[0] & 0x02; + /* pass through setting */ if (spdif_through && (avport == PS3AV_CMD_AVPORT_SPDIF_0 || - avport == PS3AV_CMD_AVPORT_SPDIF_1)) { + avport == PS3AV_CMD_AVPORT_SPDIF_1 || + avport == PS3AV_CMD_AVPORT_HDMI_0 || + avport == PS3AV_CMD_AVPORT_HDMI_1)) { audio->audio_word_bits = PS3AV_CMD_AUDIO_WORD_BITS_16; - audio->audio_source = PS3AV_CMD_AUDIO_SOURCE_SPDIF; - if (spdif_bitstream) { - audio->audio_format = PS3AV_CMD_AUDIO_FORMAT_BITSTREAM; - audio->audio_cs_info[0] |= CS_BIT; - } + audio->audio_format = PS3AV_CMD_AUDIO_FORMAT_BITSTREAM; } } @@ -927,72 +923,6 @@ int ps3av_cmd_video_get_monitor_info(struct ps3av_pkt_av_get_monitor_info *info, return res; } -#ifdef PS3AV_DEBUG -void ps3av_cmd_av_hw_conf_dump(const struct ps3av_pkt_av_get_hw_conf *hw_conf) -{ - printk("av_h_conf:num of hdmi:%d\n", hw_conf->num_of_hdmi); - printk("av_h_conf:num of avmulti:%d\n", hw_conf->num_of_avmulti); - printk("av_h_conf:num of spdif:%d\n", hw_conf->num_of_spdif); -} - -void ps3av_cmd_av_monitor_info_dump(const struct ps3av_pkt_av_get_monitor_info *monitor_info) -{ - const struct ps3av_info_monitor *info = &monitor_info->info; - const struct ps3av_info_audio *audio = info->audio; - int i; - - printk("Monitor Info: size%d\n", monitor_info->send_hdr.size); - - printk("avport:%02x\n", info->avport); - printk("monitor_id:"); - for (i = 0; i < 10; i++) - printk("%02x ", info->monitor_id[i]); - printk("\nmonitor_type:%02x\n", info->monitor_type); - printk("monitor_name:"); - for (i = 0; i < 16; i++) - printk("%c", info->monitor_name[i]); - - /* resolution */ - printk("\nresolution_60: bits:%08x native:%08x\n", - info->res_60.res_bits, info->res_60.native); - printk("resolution_50: bits:%08x native:%08x\n", - info->res_50.res_bits, info->res_50.native); - printk("resolution_other: bits:%08x native:%08x\n", - info->res_other.res_bits, info->res_other.native); - printk("resolution_vesa: bits:%08x native:%08x\n", - info->res_vesa.res_bits, info->res_vesa.native); - - /* color space */ - printk("color space rgb:%02x\n", info->cs.rgb); - printk("color space yuv444:%02x\n", info->cs.yuv444); - printk("color space yuv422:%02x\n", info->cs.yuv422); - - /* color info */ - printk("color info red:X %04x Y %04x\n", - info->color.red_x, info->color.red_y); - printk("color info green:X %04x Y %04x\n", - info->color.green_x, info->color.green_y); - printk("color info blue:X %04x Y %04x\n", - info->color.blue_x, info->color.blue_y); - printk("color info white:X %04x Y %04x\n", - info->color.white_x, info->color.white_y); - printk("color info gamma: %08x\n", info->color.gamma); - - /* other info */ - printk("supported_AI:%02x\n", info->supported_ai); - printk("speaker_info:%02x\n", info->speaker_info); - printk("num of audio:%02x\n", info->num_of_audio_block); - - /* audio block */ - for (i = 0; i < info->num_of_audio_block; i++) { - printk("audio[%d] type:%02x max_ch:%02x fs:%02x sbit:%02x\n", - i, audio->type, audio->max_num_of_ch, audio->fs, - audio->sbit); - audio++; - } -} -#endif /* PS3AV_DEBUG */ - #define PS3AV_AV_LAYOUT_0 (PS3AV_CMD_AV_LAYOUT_32 \ | PS3AV_CMD_AV_LAYOUT_44 \ | PS3AV_CMD_AV_LAYOUT_48)