aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorJani Nikula <ext-jani.1.nikula@nokia.com>2010-04-09 05:25:59 -0400
committerTomi Valkeinen <tomi.valkeinen@nokia.com>2010-08-03 08:18:47 -0400
commit006db7b4304303f014a0c13f479715885b603e9f (patch)
treee65c3cb6437c9cd171bd4250e7dc1727737d77bc /drivers/video/omap2
parent1cbc8703e1c510a245a7bd5e269987402ffc9e18 (diff)
OMAP: DSS2: Taal: Add panel hardware reset
Issue a proper reset pulse on the reset line instead of just doing power on/off. Signed-off-by: Jani Nikula <ext-jani.1.nikula@nokia.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/displays/panel-taal.c44
1 files changed, 40 insertions, 4 deletions
diff --git a/drivers/video/omap2/displays/panel-taal.c b/drivers/video/omap2/displays/panel-taal.c
index d2e2ac7444e0..8fbb94e2bf5d 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -490,6 +490,22 @@ static struct attribute_group taal_attr_group = {
490 .attrs = taal_attrs, 490 .attrs = taal_attrs,
491}; 491};
492 492
493static void taal_hw_reset(struct omap_dss_device *dssdev)
494{
495 if (dssdev->reset_gpio == -1)
496 return;
497
498 gpio_set_value(dssdev->reset_gpio, 1);
499 udelay(10);
500 /* reset the panel */
501 gpio_set_value(dssdev->reset_gpio, 0);
502 /* assert reset for at least 10us */
503 udelay(10);
504 gpio_set_value(dssdev->reset_gpio, 1);
505 /* wait 5ms after releasing reset */
506 msleep(5);
507}
508
493static int taal_probe(struct omap_dss_device *dssdev) 509static int taal_probe(struct omap_dss_device *dssdev)
494{ 510{
495 struct backlight_properties props; 511 struct backlight_properties props;
@@ -527,6 +543,8 @@ static int taal_probe(struct omap_dss_device *dssdev)
527 543
528 dev_set_drvdata(&dssdev->dev, td); 544 dev_set_drvdata(&dssdev->dev, td);
529 545
546 taal_hw_reset(dssdev);
547
530 /* if no platform set_backlight() defined, presume DSI backlight 548 /* if no platform set_backlight() defined, presume DSI backlight
531 * control */ 549 * control */
532 memset(&props, 0, sizeof(struct backlight_properties)); 550 memset(&props, 0, sizeof(struct backlight_properties));
@@ -628,6 +646,9 @@ static void taal_remove(struct omap_dss_device *dssdev)
628 cancel_delayed_work_sync(&td->esd_work); 646 cancel_delayed_work_sync(&td->esd_work);
629 destroy_workqueue(td->esd_wq); 647 destroy_workqueue(td->esd_wq);
630 648
649 /* reset, to be sure that the panel is in a valid state */
650 taal_hw_reset(dssdev);
651
631 kfree(td); 652 kfree(td);
632} 653}
633 654
@@ -654,6 +675,8 @@ static int taal_power_on(struct omap_dss_device *dssdev)
654 goto err0; 675 goto err0;
655 } 676 }
656 677
678 taal_hw_reset(dssdev);
679
657 omapdss_dsi_vc_enable_hs(TCH, false); 680 omapdss_dsi_vc_enable_hs(TCH, false);
658 681
659 r = taal_sleep_out(td); 682 r = taal_sleep_out(td);
@@ -704,6 +727,10 @@ static int taal_power_on(struct omap_dss_device *dssdev)
704 727
705 return 0; 728 return 0;
706err: 729err:
730 dev_err(&dssdev->dev, "error while enabling panel, issuing HW reset\n");
731
732 taal_hw_reset(dssdev);
733
707 omapdss_dsi_display_disable(dssdev); 734 omapdss_dsi_display_disable(dssdev);
708err0: 735err0:
709 dsi_bus_unlock(); 736 dsi_bus_unlock();
@@ -716,16 +743,24 @@ err0:
716static void taal_power_off(struct omap_dss_device *dssdev) 743static void taal_power_off(struct omap_dss_device *dssdev)
717{ 744{
718 struct taal_data *td = dev_get_drvdata(&dssdev->dev); 745 struct taal_data *td = dev_get_drvdata(&dssdev->dev);
746 int r;
719 747
720 dsi_bus_lock(); 748 dsi_bus_lock();
721 749
722 cancel_delayed_work(&td->esd_work); 750 cancel_delayed_work(&td->esd_work);
723 751
724 taal_dcs_write_0(DCS_DISPLAY_OFF); 752 r = taal_dcs_write_0(DCS_DISPLAY_OFF);
725 taal_sleep_in(td); 753 if (!r) {
754 r = taal_sleep_in(td);
755 /* wait a bit so that the message goes through */
756 msleep(10);
757 }
726 758
727 /* wait a bit so that the message goes through */ 759 if (r) {
728 msleep(10); 760 dev_err(&dssdev->dev,
761 "error disabling panel, issuing HW reset\n");
762 taal_hw_reset(dssdev);
763 }
729 764
730 omapdss_dsi_display_disable(dssdev); 765 omapdss_dsi_display_disable(dssdev);
731 766
@@ -1186,6 +1221,7 @@ err:
1186 dev_err(&dssdev->dev, "performing LCD reset\n"); 1221 dev_err(&dssdev->dev, "performing LCD reset\n");
1187 1222
1188 taal_power_off(dssdev); 1223 taal_power_off(dssdev);
1224 taal_hw_reset(dssdev);
1189 taal_power_on(dssdev); 1225 taal_power_on(dssdev);
1190 1226
1191 dsi_bus_unlock(); 1227 dsi_bus_unlock();