All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <ext-jani.1.nikula@nokia.com>
To: Tomi.Valkeinen@nokia.com, tony@atomide.com
Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org,
	ext-jani.1.nikula@nokia.com
Subject: [PATCH v2 01/21] OMAP: DSS2: Taal: Add panel hardware reset
Date: Mon, 03 May 2010 06:18:21 +0000	[thread overview]
Message-ID: <1ef57e99d69aaf89b8e61074aa8ce2e5f6632d28.1272621452.git.ext-jani.1.nikula@nokia.com> (raw)
In-Reply-To: <cover.1272621452.git.ext-jani.1.nikula@nokia.com>

From: Jani Nikula <ext-jani.1.nikula@nokia.com>

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>
---
 drivers/video/omap2/displays/panel-taal.c |   44 ++++++++++++++++++++++++++--
 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 aaf5d30..43fce5f 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -488,6 +488,22 @@ static struct attribute_group taal_attr_group = {
 	.attrs = taal_attrs,
 };
 
+static void taal_hw_reset(struct omap_dss_device *dssdev)
+{
+	if (dssdev->reset_gpio = -1)
+		return;
+
+	gpio_set_value(dssdev->reset_gpio, 1);
+	udelay(10);
+	/* reset the panel */
+	gpio_set_value(dssdev->reset_gpio, 0);
+	/* assert reset for at least 10us */
+	udelay(10);
+	gpio_set_value(dssdev->reset_gpio, 1);
+	/* wait 5ms after releasing reset */
+	msleep(5);
+}
+
 static int taal_probe(struct omap_dss_device *dssdev)
 {
 	struct backlight_properties props;
@@ -585,6 +601,8 @@ static int taal_probe(struct omap_dss_device *dssdev)
 		goto err4;
 	}
 
+	taal_hw_reset(dssdev);
+
 	return 0;
 err4:
 	if (td->use_ext_te) {
@@ -626,6 +644,9 @@ static void taal_remove(struct omap_dss_device *dssdev)
 	cancel_delayed_work_sync(&td->esd_work);
 	destroy_workqueue(td->esd_wq);
 
+	/* reset, to be sure that the panel is in a valid state */
+	taal_hw_reset(dssdev);
+
 	kfree(td);
 }
 
@@ -652,6 +673,8 @@ static int taal_power_on(struct omap_dss_device *dssdev)
 		goto err0;
 	}
 
+	taal_hw_reset(dssdev);
+
 	omapdss_dsi_vc_enable_hs(TCH, false);
 
 	r = taal_sleep_out(td);
@@ -702,6 +725,10 @@ static int taal_power_on(struct omap_dss_device *dssdev)
 
 	return 0;
 err:
+	dev_err(&dssdev->dev, "error while enabling panel, issuing HW reset\n");
+
+	taal_hw_reset(dssdev);
+
 	omapdss_dsi_display_disable(dssdev);
 err0:
 	dsi_bus_unlock();
@@ -714,16 +741,24 @@ err0:
 static void taal_power_off(struct omap_dss_device *dssdev)
 {
 	struct taal_data *td = dev_get_drvdata(&dssdev->dev);
+	int r;
 
 	dsi_bus_lock();
 
 	cancel_delayed_work(&td->esd_work);
 
-	taal_dcs_write_0(DCS_DISPLAY_OFF);
-	taal_sleep_in(td);
+	r = taal_dcs_write_0(DCS_DISPLAY_OFF);
+	if (!r) {
+		r = taal_sleep_in(td);
+		/* wait a bit so that the message goes through */
+		msleep(10);
+	}
 
-	/* wait a bit so that the message goes through */
-	msleep(10);
+	if (r) {
+		dev_err(&dssdev->dev,
+				"error disabling panel, issuing HW reset\n");
+		taal_hw_reset(dssdev);
+	}
 
 	omapdss_dsi_display_disable(dssdev);
 
@@ -1184,6 +1219,7 @@ err:
 	dev_err(&dssdev->dev, "performing LCD reset\n");
 
 	taal_power_off(dssdev);
+	taal_hw_reset(dssdev);
 	taal_power_on(dssdev);
 
 	dsi_bus_unlock();
-- 
1.6.5.2


WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <ext-jani.1.nikula@nokia.com>
To: Tomi.Valkeinen@nokia.com, tony@atomide.com
Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org,
	ext-jani.1.nikula@nokia.com
Subject: [PATCH v2 01/21] OMAP: DSS2: Taal: Add panel hardware reset
Date: Mon,  3 May 2010 09:18:21 +0300	[thread overview]
Message-ID: <1ef57e99d69aaf89b8e61074aa8ce2e5f6632d28.1272621452.git.ext-jani.1.nikula@nokia.com> (raw)
In-Reply-To: <cover.1272621452.git.ext-jani.1.nikula@nokia.com>
In-Reply-To: <cover.1272621452.git.ext-jani.1.nikula@nokia.com>

From: Jani Nikula <ext-jani.1.nikula@nokia.com>

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>
---
 drivers/video/omap2/displays/panel-taal.c |   44 ++++++++++++++++++++++++++--
 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 aaf5d30..43fce5f 100644
--- a/drivers/video/omap2/displays/panel-taal.c
+++ b/drivers/video/omap2/displays/panel-taal.c
@@ -488,6 +488,22 @@ static struct attribute_group taal_attr_group = {
 	.attrs = taal_attrs,
 };
 
+static void taal_hw_reset(struct omap_dss_device *dssdev)
+{
+	if (dssdev->reset_gpio == -1)
+		return;
+
+	gpio_set_value(dssdev->reset_gpio, 1);
+	udelay(10);
+	/* reset the panel */
+	gpio_set_value(dssdev->reset_gpio, 0);
+	/* assert reset for at least 10us */
+	udelay(10);
+	gpio_set_value(dssdev->reset_gpio, 1);
+	/* wait 5ms after releasing reset */
+	msleep(5);
+}
+
 static int taal_probe(struct omap_dss_device *dssdev)
 {
 	struct backlight_properties props;
@@ -585,6 +601,8 @@ static int taal_probe(struct omap_dss_device *dssdev)
 		goto err4;
 	}
 
+	taal_hw_reset(dssdev);
+
 	return 0;
 err4:
 	if (td->use_ext_te) {
@@ -626,6 +644,9 @@ static void taal_remove(struct omap_dss_device *dssdev)
 	cancel_delayed_work_sync(&td->esd_work);
 	destroy_workqueue(td->esd_wq);
 
+	/* reset, to be sure that the panel is in a valid state */
+	taal_hw_reset(dssdev);
+
 	kfree(td);
 }
 
@@ -652,6 +673,8 @@ static int taal_power_on(struct omap_dss_device *dssdev)
 		goto err0;
 	}
 
+	taal_hw_reset(dssdev);
+
 	omapdss_dsi_vc_enable_hs(TCH, false);
 
 	r = taal_sleep_out(td);
@@ -702,6 +725,10 @@ static int taal_power_on(struct omap_dss_device *dssdev)
 
 	return 0;
 err:
+	dev_err(&dssdev->dev, "error while enabling panel, issuing HW reset\n");
+
+	taal_hw_reset(dssdev);
+
 	omapdss_dsi_display_disable(dssdev);
 err0:
 	dsi_bus_unlock();
@@ -714,16 +741,24 @@ err0:
 static void taal_power_off(struct omap_dss_device *dssdev)
 {
 	struct taal_data *td = dev_get_drvdata(&dssdev->dev);
+	int r;
 
 	dsi_bus_lock();
 
 	cancel_delayed_work(&td->esd_work);
 
-	taal_dcs_write_0(DCS_DISPLAY_OFF);
-	taal_sleep_in(td);
+	r = taal_dcs_write_0(DCS_DISPLAY_OFF);
+	if (!r) {
+		r = taal_sleep_in(td);
+		/* wait a bit so that the message goes through */
+		msleep(10);
+	}
 
-	/* wait a bit so that the message goes through */
-	msleep(10);
+	if (r) {
+		dev_err(&dssdev->dev,
+				"error disabling panel, issuing HW reset\n");
+		taal_hw_reset(dssdev);
+	}
 
 	omapdss_dsi_display_disable(dssdev);
 
@@ -1184,6 +1219,7 @@ err:
 	dev_err(&dssdev->dev, "performing LCD reset\n");
 
 	taal_power_off(dssdev);
+	taal_hw_reset(dssdev);
 	taal_power_on(dssdev);
 
 	dsi_bus_unlock();
-- 
1.6.5.2


  reply	other threads:[~2010-05-03  6:18 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-03  6:18 [PATCH v2 00/21] OMAP: DSS2: Taal panel driver updates Jani Nikula
2010-05-03  6:18 ` Jani Nikula
2010-05-03  6:18 ` Jani Nikula [this message]
2010-05-03  6:18   ` [PATCH v2 01/21] OMAP: DSS2: Taal: Add panel hardware reset Jani Nikula
2010-05-03  6:18   ` [PATCH v2 02/21] OMAP: DSS2: Taal: add locks to taal_bl_update_status Jani Nikula
2010-05-03  6:18     ` Jani Nikula
2010-05-03  6:18     ` [PATCH v2 03/21] OMAP: DSS2: Taal: Add locks to protect taal data access Jani Nikula
2010-05-03  6:18       ` Jani Nikula
2010-05-03  6:18       ` [PATCH v2 04/21] OMAP: DSS2: Taal: Cosmetic improvement to backlight properties initialization Jani Nikula
2010-05-03  6:18         ` Jani Nikula
2010-05-03  6:18         ` [PATCH v2 05/21] OMAP: DSS2: Taal: Remove platform enable/disable Jani Nikula
2010-05-03  6:18           ` Jani Nikula
2010-05-03  6:18           ` [PATCH v2 06/21] OMAP: DSS2: Taal: Fix request_irq() error handling Jani Nikula
2010-05-03  6:18             ` Jani Nikula
2010-05-03  6:18             ` [PATCH v2 07/21] OMAP: DSS2: Taal: Remove ESD work cancel from driver probe " Jani Nikula
2010-05-03  6:18               ` Jani Nikula
2010-05-03  6:18               ` [PATCH v2 08/21] OMAP: DSS2: Taal: Improve taal_power_on() " Jani Nikula
2010-05-03  6:18                 ` Jani Nikula
2010-05-03  6:18                 ` [PATCH v2 09/21] OMAP: DSS2: Taal: Bail out from taal_run_test() if panel is not enabled Jani Nikula
2010-05-03  6:18                   ` Jani Nikula
2010-05-03  6:18                   ` [PATCH v2 10/21] OMAP: DSS2: Taal: Change DSI bus locking to avoid deadlock in ESD work Jani Nikula
2010-05-03  6:18                     ` Jani Nikula
2010-05-03  6:18                     ` [PATCH v2 11/21] OMAP: DSS2: Taal: Check taal_power_on() return value in taal_resume() Jani Nikula
2010-05-03  6:18                       ` Jani Nikula
2010-05-03  6:18                       ` [PATCH v2 12/21] OMAP: DSS2: Taal: Change ESD work management Jani Nikula
2010-05-03  6:18                         ` Jani Nikula
2010-05-03  6:18                         ` [PATCH v2 13/21] OMAP: DSS2: Taal: Change probe error handling labels Jani Nikula
2010-05-03  6:18                           ` Jani Nikula
2010-05-03  6:18                           ` [PATCH v2 14/21] OMAP: DSS2: Taal: Add proper external TE support Jani Nikula
2010-05-03  6:18                             ` Jani Nikula
2010-05-03  6:18                             ` [PATCH v2 15/21] OMAP: DSS2: Add Nokia DSI command mode panel configuration struct Jani Nikula
2010-05-03  6:18                               ` Jani Nikula
2010-05-03  6:18                               ` [PATCH v2 16/21] OMAP: DSS2: Taal: Use Nokia DSI panel data Jani Nikula
2010-05-03  6:18                                 ` Jani Nikula
2010-05-03  6:18                                 ` [PATCH v2 17/21] OMAP: DSS2: Taal: Configure ESD check in " Jani Nikula
2010-05-03  6:18                                   ` Jani Nikula
2010-05-03  6:18                                   ` [PATCH v2 18/21] OMAP: DSS2: Taal: Add panel specific configuration structure Jani Nikula
2010-05-03  6:18                                     ` Jani Nikula
2010-05-03  6:18                                     ` [PATCH v2 19/21] OMAP: DSS2: Taal: Print panel name in addition to revision Jani Nikula
2010-05-03  6:18                                       ` Jani Nikula
2010-05-03  6:18                                       ` [PATCH v2 20/21] OMAP: DSS2: Taal: Add regulator configuration support Jani Nikula
2010-05-03  6:18                                         ` Jani Nikula
2010-05-03  6:18                                         ` [PATCH v2 21/21] OMAP: DSS2: Taal: CABC workaround is Taal specific Jani Nikula
2010-05-03  6:18                                           ` Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1ef57e99d69aaf89b8e61074aa8ce2e5f6632d28.1272621452.git.ext-jani.1.nikula@nokia.com \
    --to=ext-jani.1.nikula@nokia.com \
    --cc=Tomi.Valkeinen@nokia.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.