aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ps3/ps3av.c58
1 files changed, 38 insertions, 20 deletions
diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c
index 85e21614f868..a1f63cb849d2 100644
--- a/drivers/ps3/ps3av.c
+++ b/drivers/ps3/ps3av.c
@@ -491,10 +491,10 @@ static int ps3av_set_videomode(void)
491 return 0; 491 return 0;
492} 492}
493 493
494static void ps3av_set_videomode_cont(u32 id, u32 old_id) 494static void ps3av_set_videomode_packet(u32 id)
495{ 495{
496 struct ps3av_pkt_avb_param avb_param; 496 struct ps3av_pkt_avb_param avb_param;
497 int i; 497 unsigned int i;
498 u32 len = 0, av_video_cs; 498 u32 len = 0, av_video_cs;
499 const struct avset_video_mode *video_mode; 499 const struct avset_video_mode *video_mode;
500 int res; 500 int res;
@@ -507,24 +507,6 @@ static void ps3av_set_videomode_cont(u32 id, u32 old_id)
507 ps3av->av_hw_conf.num_of_avmulti; 507 ps3av->av_hw_conf.num_of_avmulti;
508 avb_param.num_of_av_audio_pkt = 0; 508 avb_param.num_of_av_audio_pkt = 0;
509 509
510 /* video signal off */
511 ps3av_set_video_disable_sig();
512
513 /* Retail PS3 product doesn't support this */
514 if (id & PS3AV_MODE_HDCP_OFF) {
515 res = ps3av_cmd_av_hdmi_mode(PS3AV_CMD_AV_HDMI_HDCP_OFF);
516 if (res == PS3AV_STATUS_UNSUPPORTED_HDMI_MODE)
517 dev_dbg(&ps3av->dev->core, "Not supported\n");
518 else if (res)
519 dev_dbg(&ps3av->dev->core,
520 "ps3av_cmd_av_hdmi_mode failed\n");
521 } else if (old_id & PS3AV_MODE_HDCP_OFF) {
522 res = ps3av_cmd_av_hdmi_mode(PS3AV_CMD_AV_HDMI_MODE_NORMAL);
523 if (res < 0 && res != PS3AV_STATUS_UNSUPPORTED_HDMI_MODE)
524 dev_dbg(&ps3av->dev->core,
525 "ps3av_cmd_av_hdmi_mode failed\n");
526 }
527
528 /* video_pkt */ 510 /* video_pkt */
529 for (i = 0; i < avb_param.num_of_video_pkt; i++) 511 for (i = 0; i < avb_param.num_of_video_pkt; i++)
530 len += ps3av_cmd_set_video_mode(&avb_param.buf[len], 512 len += ps3av_cmd_set_video_mode(&avb_param.buf[len],
@@ -555,6 +537,42 @@ static void ps3av_set_videomode_cont(u32 id, u32 old_id)
555 __func__); 537 __func__);
556 else if (res) 538 else if (res)
557 dev_dbg(&ps3av->dev->core, "ps3av_cmd_avb_param failed\n"); 539 dev_dbg(&ps3av->dev->core, "ps3av_cmd_avb_param failed\n");
540}
541
542static void ps3av_set_videomode_cont(u32 id, u32 old_id)
543{
544 static int vesa = 0;
545 int res;
546
547 /* video signal off */
548 ps3av_set_video_disable_sig();
549
550 /*
551 * AV backend needs non-VESA mode setting at least one time
552 * when VESA mode is used.
553 */
554 if (vesa == 0 && (id & PS3AV_MODE_MASK) >= 11) {
555 /* vesa mode */
556 ps3av_set_videomode_packet(2); /* 480P */
557 }
558 vesa = 1;
559
560 /* Retail PS3 product doesn't support this */
561 if (id & PS3AV_MODE_HDCP_OFF) {
562 res = ps3av_cmd_av_hdmi_mode(PS3AV_CMD_AV_HDMI_HDCP_OFF);
563 if (res == PS3AV_STATUS_UNSUPPORTED_HDMI_MODE)
564 dev_dbg(&ps3av->dev->core, "Not supported\n");
565 else if (res)
566 dev_dbg(&ps3av->dev->core,
567 "ps3av_cmd_av_hdmi_mode failed\n");
568 } else if (old_id & PS3AV_MODE_HDCP_OFF) {
569 res = ps3av_cmd_av_hdmi_mode(PS3AV_CMD_AV_HDMI_MODE_NORMAL);
570 if (res < 0 && res != PS3AV_STATUS_UNSUPPORTED_HDMI_MODE)
571 dev_dbg(&ps3av->dev->core,
572 "ps3av_cmd_av_hdmi_mode failed\n");
573 }
574
575 ps3av_set_videomode_packet(id);
558 576
559 msleep(1500); 577 msleep(1500);
560 /* av video mute */ 578 /* av video mute */