aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/displays/panel-taal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2/displays/panel-taal.c')
-rw-r--r--drivers/video/omap2/displays/panel-taal.c79
1 files changed, 65 insertions, 14 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index 58293203fc0..484a6184476 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -620,14 +620,12 @@ static void taal_remove(struct omap_dss_device *dssdev)
620 kfree(td); 620 kfree(td);
621} 621}
622 622
623static int taal_enable(struct omap_dss_device *dssdev) 623static int taal_power_on(struct omap_dss_device *dssdev)
624{ 624{
625 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 625 struct taal_data *td = dev_get_drvdata(&dssdev->dev);
626 u8 id1, id2, id3; 626 u8 id1, id2, id3;
627 int r; 627 int r;
628 628
629 dev_dbg(&dssdev->dev, "enable\n");
630
631 if (dssdev->platform_enable) { 629 if (dssdev->platform_enable) {
632 r = dssdev->platform_enable(dssdev); 630 r = dssdev->platform_enable(dssdev);
633 if (r) 631 if (r)
@@ -637,6 +635,16 @@ static int taal_enable(struct omap_dss_device *dssdev)
637 /* it seems we have to wait a bit until taal is ready */ 635 /* it seems we have to wait a bit until taal is ready */
638 msleep(5); 636 msleep(5);
639 637
638 dsi_bus_lock();
639
640 r = omapdss_dsi_display_enable(dssdev);
641 if (r) {
642 dev_err(&dssdev->dev, "failed to enable DSI\n");
643 goto err0;
644 }
645
646 omapdss_dsi_vc_enable_hs(TCH, false);
647
640 r = taal_sleep_out(td); 648 r = taal_sleep_out(td);
641 if (r) 649 if (r)
642 goto err; 650 goto err;
@@ -675,19 +683,27 @@ static int taal_enable(struct omap_dss_device *dssdev)
675 td->intro_printed = true; 683 td->intro_printed = true;
676 } 684 }
677 685
686 omapdss_dsi_vc_enable_hs(TCH, true);
687
688 dsi_bus_unlock();
689
678 return 0; 690 return 0;
679err: 691err:
692 dsi_bus_unlock();
693
694 omapdss_dsi_display_disable(dssdev);
695err0:
680 if (dssdev->platform_disable) 696 if (dssdev->platform_disable)
681 dssdev->platform_disable(dssdev); 697 dssdev->platform_disable(dssdev);
682 698
683 return r; 699 return r;
684} 700}
685 701
686static void taal_disable(struct omap_dss_device *dssdev) 702static void taal_power_off(struct omap_dss_device *dssdev)
687{ 703{
688 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 704 struct taal_data *td = dev_get_drvdata(&dssdev->dev);
689 705
690 dev_dbg(&dssdev->dev, "disable\n"); 706 dsi_bus_lock();
691 707
692 cancel_delayed_work(&td->esd_work); 708 cancel_delayed_work(&td->esd_work);
693 709
@@ -697,32 +713,67 @@ static void taal_disable(struct omap_dss_device *dssdev)
697 /* wait a bit so that the message goes through */ 713 /* wait a bit so that the message goes through */
698 msleep(10); 714 msleep(10);
699 715
716 omapdss_dsi_display_disable(dssdev);
717
700 if (dssdev->platform_disable) 718 if (dssdev->platform_disable)
701 dssdev->platform_disable(dssdev); 719 dssdev->platform_disable(dssdev);
702 720
703 td->enabled = 0; 721 td->enabled = 0;
722
723 dsi_bus_unlock();
724}
725
726static int taal_enable(struct omap_dss_device *dssdev)
727{
728 int r;
729 dev_dbg(&dssdev->dev, "enable\n");
730
731 if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED)
732 return -EINVAL;
733
734 r = taal_power_on(dssdev);
735 if (r)
736 return r;
737
738 dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
739
740 return r;
741}
742
743static void taal_disable(struct omap_dss_device *dssdev)
744{
745 dev_dbg(&dssdev->dev, "disable\n");
746
747 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE)
748 taal_power_off(dssdev);
749
750 dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
704} 751}
705 752
706static int taal_suspend(struct omap_dss_device *dssdev) 753static int taal_suspend(struct omap_dss_device *dssdev)
707{ 754{
708 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 755 dev_dbg(&dssdev->dev, "suspend\n");
709 struct backlight_device *bldev = td->bldev;
710 756
711 bldev->props.power = FB_BLANK_POWERDOWN; 757 if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
712 taal_bl_update_status(bldev); 758 return -EINVAL;
759
760 taal_power_off(dssdev);
761 dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
713 762
714 return 0; 763 return 0;
715} 764}
716 765
717static int taal_resume(struct omap_dss_device *dssdev) 766static int taal_resume(struct omap_dss_device *dssdev)
718{ 767{
719 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 768 int r;
720 struct backlight_device *bldev = td->bldev; 769 dev_dbg(&dssdev->dev, "resume\n");
721 770
722 bldev->props.power = FB_BLANK_UNBLANK; 771 if (dssdev->state != OMAP_DSS_DISPLAY_SUSPENDED)
723 taal_bl_update_status(bldev); 772 return -EINVAL;
724 773
725 return 0; 774 r = taal_power_on(dssdev);
775 dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
776 return r;
726} 777}
727 778
728static void taal_framedone_cb(int err, void *data) 779static void taal_framedone_cb(int err, void *data)