Lines Matching +full:cs +full:- +full:x
1 // SPDX-License-Identifier: GPL-2.0-only
28 int cs; member
33 .cs = PS3AV_CMD_VIDEO_CS_RGB_8,
37 .cs = PS3AV_CMD_VIDEO_CS_RGB_10,
41 .cs = PS3AV_CMD_VIDEO_CS_RGB_12,
45 .cs = PS3AV_CMD_VIDEO_CS_YUV444_8,
49 .cs = PS3AV_CMD_VIDEO_CS_YUV444_10,
53 .cs = PS3AV_CMD_VIDEO_CS_YUV444_12,
57 .cs = PS3AV_CMD_VIDEO_CS_YUV422_8,
61 .cs = PS3AV_CMD_VIDEO_CS_YUV422_10,
65 .cs = PS3AV_CMD_VIDEO_CS_YUV422_12,
69 .cs = PS3AV_CMD_VIDEO_CS_XVYCC_8,
73 .cs = PS3AV_CMD_VIDEO_CS_XVYCC_10,
77 .cs = PS3AV_CMD_VIDEO_CS_XVYCC_12,
83 static u32 ps3av_cs_video2av(int cs) in ps3av_cs_video2av() argument
88 if (ps3av_cs_video2av_table[i].cs == cs) in ps3av_cs_video2av()
94 static u32 ps3av_cs_video2av_bitlen(int cs) in ps3av_cs_video2av_bitlen() argument
99 if (ps3av_cs_video2av_table[i].cs == cs) in ps3av_cs_video2av_bitlen()
160 printk(KERN_ERR "PS3AV_CID_VIDEO_INIT: failed %x\n", res); in ps3av_cmd_init()
174 printk(KERN_ERR "PS3AV_CID_AUDIO_INIT: failed %x\n", res); in ps3av_cmd_init()
189 printk(KERN_ERR "PS3AV_CID_AV_INIT: failed %x\n", res); in ps3av_cmd_init()
208 printk(KERN_ERR "PS3AV_CID_AV_FIN: failed %x\n", res); in ps3av_cmd_fin()
219 return -EINVAL; in ps3av_cmd_av_video_mute()
236 printk(KERN_ERR "PS3AV_CID_AV_VIDEO_MUTE: failed %x\n", res); in ps3av_cmd_av_video_mute()
258 "PS3AV_CID_AV_VIDEO_DISABLE_SIG: failed %x port:%x\n", in ps3av_cmd_av_video_disable_sig()
280 printk(KERN_ERR "PS3AV_CID_AV_TV_MUTE: failed %x port:%x\n", in ps3av_cmd_av_tv_mute()
302 printk(KERN_ERR "PS3AV_CID_AV_ENABLE_EVENT: failed %x\n", res); in ps3av_cmd_enable_event()
322 printk(KERN_ERR "PS3AV_CID_AV_HDMI_MODE: failed %x\n", res); in ps3av_cmd_av_hdmi_mode()
333 if (video_vid == -1) in ps3av_cmd_set_av_video_cs()
335 if (cs_out == -1) in ps3av_cmd_set_av_video_cs()
337 if (aspect == -1) in ps3av_cmd_set_av_video_cs()
342 &av_video_cs->send_hdr); in ps3av_cmd_set_av_video_cs()
343 av_video_cs->avport = avport; in ps3av_cmd_set_av_video_cs()
345 av_video_cs->av_vid = ps3av_vid_video2av(video_vid); in ps3av_cmd_set_av_video_cs()
346 av_video_cs->av_cs_out = ps3av_cs_video2av(cs_out); in ps3av_cmd_set_av_video_cs()
348 av_video_cs->av_cs_in = ps3av_cs_video2av(PS3AV_CMD_VIDEO_CS_RGB_8); in ps3av_cmd_set_av_video_cs()
349 av_video_cs->bitlen_out = ps3av_cs_video2av_bitlen(cs_out); in ps3av_cmd_set_av_video_cs()
351 av_video_cs->super_white = PS3AV_CMD_AV_SUPER_WHITE_ON; in ps3av_cmd_set_av_video_cs()
353 av_video_cs->super_white = PS3AV_CMD_AV_SUPER_WHITE_OFF; in ps3av_cmd_set_av_video_cs()
354 av_video_cs->aspect = aspect; in ps3av_cmd_set_av_video_cs()
356 av_video_cs->dither = PS3AV_CMD_AV_DITHER_ON in ps3av_cmd_set_av_video_cs()
360 av_video_cs->dither = PS3AV_CMD_AV_DITHER_OFF; in ps3av_cmd_set_av_video_cs()
370 u32 x, y; in ps3av_cmd_set_video_mode() local
373 if (video_vid == -1) in ps3av_cmd_set_video_mode()
375 if (video_fmt == -1) in ps3av_cmd_set_video_mode()
378 if (ps3av_video_mode2res(id, &x, &y)) in ps3av_cmd_set_video_mode()
384 &video_mode->send_hdr); in ps3av_cmd_set_video_mode()
385 video_mode->video_head = head; in ps3av_cmd_set_video_mode()
388 video_mode->video_vid = PS3AV_CMD_VIDEO_VID_480I_A; in ps3av_cmd_set_video_mode()
390 video_mode->video_vid = video_vid; in ps3av_cmd_set_video_mode()
391 video_mode->width = (u16) x; in ps3av_cmd_set_video_mode()
392 video_mode->height = (u16) y; in ps3av_cmd_set_video_mode()
393 video_mode->pitch = video_mode->width * 4; /* line_length */ in ps3av_cmd_set_video_mode()
394 video_mode->video_out_format = PS3AV_CMD_VIDEO_OUT_FORMAT_RGB_12BIT; in ps3av_cmd_set_video_mode()
395 video_mode->video_format = ps3av_video_fmt_table[video_fmt].format; in ps3av_cmd_set_video_mode()
397 video_mode->video_cl_cnv = PS3AV_CMD_VIDEO_CL_CNV_DISABLE_LUT; in ps3av_cmd_set_video_mode()
399 video_mode->video_cl_cnv = PS3AV_CMD_VIDEO_CL_CNV_ENABLE_LUT; in ps3av_cmd_set_video_mode()
400 video_mode->video_order = ps3av_video_fmt_table[video_fmt].order; in ps3av_cmd_set_video_mode()
402 pr_debug("%s: video_mode:vid:%x width:%d height:%d pitch:%d out_format:%d format:%x order:%x\n", in ps3av_cmd_set_video_mode()
403 __func__, video_vid, video_mode->width, video_mode->height, in ps3av_cmd_set_video_mode()
404 video_mode->pitch, video_mode->video_out_format, in ps3av_cmd_set_video_mode()
405 video_mode->video_format, video_mode->video_order); in ps3av_cmd_set_video_mode()
430 printk(KERN_ERR "PS3AV_CID_VIDEO_FORMAT: failed %x\n", res); in ps3av_cmd_video_format_black()
442 return -EINVAL; in ps3av_cmd_av_audio_mute()
460 printk(KERN_ERR "PS3AV_CID_AV_AUDIO_MUTE: failed %x\n", res); in ps3av_cmd_av_audio_mute()
485 printk(KERN_ERR "%s failed, fs:%x\n", __func__, fs); in ps3av_cnv_mclk()
493 [PS3AV_CMD_AUDIO_FS_44K-BASE] = { 6272, 6272, 17836, 17836, 8918 },
494 [PS3AV_CMD_AUDIO_FS_48K-BASE] = { 6144, 6144, 11648, 11648, 5824 },
495 [PS3AV_CMD_AUDIO_FS_88K-BASE] = { 12544, 12544, 35672, 35672, 17836 },
496 [PS3AV_CMD_AUDIO_FS_96K-BASE] = { 12288, 12288, 23296, 23296, 11648 },
497 [PS3AV_CMD_AUDIO_FS_176K-BASE] = { 25088, 25088, 71344, 71344, 35672 },
498 [PS3AV_CMD_AUDIO_FS_192K-BASE] = { 24576, 24576, 46592, 46592, 23296 }
533 printk(KERN_ERR "%s failed, vid:%x\n", __func__, video_vid); in ps3av_cnv_ns()
538 printk(KERN_ERR "%s failed, fs:%x\n", __func__, fs); in ps3av_cnv_ns()
540 ns_val = ps3av_ns_table[PS3AV_CMD_AUDIO_FS_44K-BASE][d]; in ps3av_cnv_ns()
559 printk(KERN_ERR "%s failed, source:%x\n", __func__, source); in ps3av_cnv_enable()
586 printk(KERN_ERR "%s failed, word_bits:%x\n", __func__, in ps3av_cnv_inputlen()
596 printk(KERN_ERR "%s failed, num_of_ch:%x\n", __func__, in ps3av_cnv_layout()
607 info->pb1.cc = mode->audio_num_of_ch + 1; /* CH2:0x01 --- CH8:0x07 */ in ps3av_cnv_info()
608 info->pb1.ct = 0; in ps3av_cnv_info()
609 info->pb2.sf = 0; in ps3av_cnv_info()
610 info->pb2.ss = 0; in ps3av_cnv_info()
612 info->pb3 = 0; /* check mode->audio_format ?? */ in ps3av_cnv_info()
613 info->pb4 = mode->audio_layout; in ps3av_cnv_info()
614 info->pb5.dm = mode->audio_downmix; in ps3av_cnv_info()
615 info->pb5.lsv = mode->audio_downmix_level; in ps3av_cnv_info()
633 ¶m->send_hdr); in ps3av_cmd_set_av_audio_param()
635 param->avport = port; in ps3av_cmd_set_av_audio_param()
636 param->mclk = ps3av_cnv_mclk(audio_mode->audio_fs) | 0x80; in ps3av_cmd_set_av_audio_param()
637 ps3av_cnv_ns(param->ns, audio_mode->audio_fs, video_vid); in ps3av_cmd_set_av_audio_param()
638 param->enable = ps3av_cnv_enable(audio_mode->audio_source, in ps3av_cmd_set_av_audio_param()
639 audio_mode->audio_enable); in ps3av_cmd_set_av_audio_param()
640 param->swaplr = 0x09; in ps3av_cmd_set_av_audio_param()
641 param->fifomap = ps3av_cnv_fifomap(audio_mode->audio_map); in ps3av_cmd_set_av_audio_param()
642 param->inputctrl = 0x49; in ps3av_cmd_set_av_audio_param()
643 param->inputlen = ps3av_cnv_inputlen(audio_mode->audio_word_bits); in ps3av_cmd_set_av_audio_param()
644 param->layout = ps3av_cnv_layout(audio_mode->audio_num_of_ch); in ps3av_cmd_set_av_audio_param()
645 ps3av_cnv_info(¶m->info, audio_mode); in ps3av_cmd_set_av_audio_param()
646 ps3av_cnv_chstat(param->chstat, audio_mode->audio_cs_info); in ps3av_cmd_set_av_audio_param()
651 /* default cs val */
683 ps3av_set_hdr(PS3AV_CID_AUDIO_MODE, sizeof(*audio), &audio->send_hdr); in ps3av_cmd_set_audio_mode()
685 audio->avport = (u8) avport; in ps3av_cmd_set_audio_mode()
686 audio->mask = 0x0FFF; /* XXX set all */ in ps3av_cmd_set_audio_mode()
687 audio->audio_num_of_ch = ch; in ps3av_cmd_set_audio_mode()
688 audio->audio_fs = fs; in ps3av_cmd_set_audio_mode()
689 audio->audio_word_bits = word_bits; in ps3av_cmd_set_audio_mode()
690 audio->audio_format = format; in ps3av_cmd_set_audio_mode()
691 audio->audio_source = source; in ps3av_cmd_set_audio_mode()
695 audio->audio_enable[3] = 1; in ps3av_cmd_set_audio_mode()
698 audio->audio_enable[2] = 1; in ps3av_cmd_set_audio_mode()
699 audio->audio_enable[1] = 1; in ps3av_cmd_set_audio_mode()
703 audio->audio_enable[0] = 1; in ps3av_cmd_set_audio_mode()
708 audio->audio_swap[i] = PS3AV_CMD_AUDIO_SWAP_0; /* no swap */ in ps3av_cmd_set_audio_mode()
711 audio->audio_map[0] = PS3AV_CMD_AUDIO_MAP_OUTPUT_0; in ps3av_cmd_set_audio_mode()
712 audio->audio_map[1] = PS3AV_CMD_AUDIO_MAP_OUTPUT_1; in ps3av_cmd_set_audio_mode()
713 audio->audio_map[2] = PS3AV_CMD_AUDIO_MAP_OUTPUT_2; in ps3av_cmd_set_audio_mode()
714 audio->audio_map[3] = PS3AV_CMD_AUDIO_MAP_OUTPUT_3; in ps3av_cmd_set_audio_mode()
721 audio->audio_layout = PS3AV_CMD_AUDIO_LAYOUT_8CH; in ps3av_cmd_set_audio_mode()
724 audio->audio_layout = PS3AV_CMD_AUDIO_LAYOUT_6CH; in ps3av_cmd_set_audio_mode()
728 audio->audio_layout = PS3AV_CMD_AUDIO_LAYOUT_2CH; in ps3av_cmd_set_audio_mode()
732 audio->audio_layout = PS3AV_CMD_AUDIO_LAYOUT_2CH; in ps3av_cmd_set_audio_mode()
736 audio->audio_downmix = PS3AV_CMD_AUDIO_DOWNMIX_PERMITTED; in ps3av_cmd_set_audio_mode()
738 audio->audio_downmix_level = 0; /* 0dB */ in ps3av_cmd_set_audio_mode()
742 audio->audio_cs_info[i] = ps3av_mode_cs_info[i]; in ps3av_cmd_set_audio_mode()
746 audio->audio_cs_info[3] &= ~CS_MASK; in ps3av_cmd_set_audio_mode()
747 audio->audio_cs_info[3] |= CS_44; in ps3av_cmd_set_audio_mode()
750 audio->audio_cs_info[3] &= ~CS_MASK; in ps3av_cmd_set_audio_mode()
751 audio->audio_cs_info[3] |= CS_88; in ps3av_cmd_set_audio_mode()
754 audio->audio_cs_info[3] &= ~CS_MASK; in ps3av_cmd_set_audio_mode()
755 audio->audio_cs_info[3] |= CS_96; in ps3av_cmd_set_audio_mode()
758 audio->audio_cs_info[3] &= ~CS_MASK; in ps3av_cmd_set_audio_mode()
759 audio->audio_cs_info[3] |= CS_176; in ps3av_cmd_set_audio_mode()
762 audio->audio_cs_info[3] &= ~CS_MASK; in ps3av_cmd_set_audio_mode()
763 audio->audio_cs_info[3] |= CS_192; in ps3av_cmd_set_audio_mode()
769 /* non-audio bit */ in ps3av_cmd_set_audio_mode()
770 spdif_through = audio->audio_cs_info[0] & 0x02; in ps3av_cmd_set_audio_mode()
778 audio->audio_word_bits = PS3AV_CMD_AUDIO_WORD_BITS_16; in ps3av_cmd_set_audio_mode()
779 audio->audio_format = PS3AV_CMD_AUDIO_FORMAT_BITSTREAM; in ps3av_cmd_set_audio_mode()
788 sizeof(*audio_mode), &audio_mode->send_hdr); in ps3av_cmd_audio_mode()
794 printk(KERN_ERR "PS3AV_CID_AUDIO_MODE: failed %x\n", res); in ps3av_cmd_audio_mode()
805 return -EINVAL; in ps3av_cmd_audio_mute()
823 printk(KERN_ERR "PS3AV_CID_AUDIO_MUTE: failed %x\n", res); in ps3av_cmd_audio_mute()
846 printk(KERN_ERR "PS3AV_CID_AUDIO_ACTIVE:%x failed %x\n", cid, in ps3av_cmd_audio_active()
860 &avb->send_hdr); in ps3av_cmd_avb_param()
866 pr_debug("%s: PS3AV_CID_AVB_PARAM: failed %x\n", __func__, in ps3av_cmd_avb_param()
880 res = ps3av_do_pkt(PS3AV_CID_AV_GET_HW_CONF, sizeof(hw_conf->send_hdr), in ps3av_cmd_av_get_hw_conf()
881 sizeof(*hw_conf), &hw_conf->send_hdr); in ps3av_cmd_av_get_hw_conf()
887 printk(KERN_ERR "PS3AV_CID_AV_GET_HW_CONF: failed %x\n", res); in ps3av_cmd_av_get_hw_conf()
898 info->avport = avport; in ps3av_cmd_video_get_monitor_info()
901 sizeof(info->send_hdr) + sizeof(info->avport) + in ps3av_cmd_video_get_monitor_info()
902 sizeof(info->reserved), in ps3av_cmd_video_get_monitor_info()
903 sizeof(*info), &info->send_hdr); in ps3av_cmd_video_get_monitor_info()
909 printk(KERN_ERR "PS3AV_CID_AV_GET_MONITOR_INFO: failed %x\n", in ps3av_cmd_video_get_monitor_info()