* [PATCH 1/5] fbdev: omap2: panel-dpi: in .disable first disable backlight then display
@ 2015-12-10 13:11 Uwe Kleine-König
2015-12-10 13:11 ` [PATCH 4/5] fbdev: omap2: panel-dpi: allow specification of a reset gpio Uwe Kleine-König
2015-12-16 17:16 ` [PATCH 1/5] fbdev: omap2: panel-dpi: in .disable first disable backlight then display Tomi Valkeinen
0 siblings, 2 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2015-12-10 13:11 UTC (permalink / raw)
To: linux-fbdev
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
This makes .disable operate in reverse order compared to .enable.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/video/fbdev/omap2/displays-new/panel-dpi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
index f7be3489f744..06b6e611e4b2 100644
--- a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
+++ b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
@@ -102,12 +102,12 @@ static void panel_dpi_disable(struct omap_dss_device *dssdev)
if (!omapdss_device_is_enabled(dssdev))
return;
- if (ddata->enable_gpio)
- gpiod_set_value_cansleep(ddata->enable_gpio, 0);
-
if (gpio_is_valid(ddata->backlight_gpio))
gpio_set_value_cansleep(ddata->backlight_gpio, 0);
+ if (ddata->enable_gpio)
+ gpiod_set_value_cansleep(ddata->enable_gpio, 0);
+
in->ops.dpi->disable(in);
dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
--
2.6.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/5] fbdev: omap2: panel-dpi: allow specification of a reset gpio
@ 2015-12-10 13:11 ` Uwe Kleine-König
2015-12-16 17:35 ` Tomi Valkeinen
0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2015-12-10 13:11 UTC (permalink / raw)
To: linux-fbdev
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Some displays have a reset input. To assert that the display is
functional the reset gpio must be deasserted.
Teach the driver to get and drive such a gpio accordingly.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Documentation/devicetree/bindings/video/panel-dpi.txt | 1 +
drivers/video/fbdev/omap2/displays-new/panel-dpi.c | 7 +++++++
2 files changed, 8 insertions(+)
diff --git a/Documentation/devicetree/bindings/video/panel-dpi.txt b/Documentation/devicetree/bindings/video/panel-dpi.txt
index a40180b05bab..1a1d8f6f884f 100644
--- a/Documentation/devicetree/bindings/video/panel-dpi.txt
+++ b/Documentation/devicetree/bindings/video/panel-dpi.txt
@@ -7,6 +7,7 @@ Required properties:
Optional properties:
- label: a symbolic name for the panel
- enable-gpios: panel enable gpio
+- reset-gpios: GPIO to control the RESET pin
Required nodes:
- "panel-timing" containing video timings
diff --git a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
index 1216341a0d19..7e2f9e0813dc 100644
--- a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
+++ b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
@@ -32,6 +32,7 @@ struct panel_drv_data {
int backlight_gpio;
struct gpio_desc *enable_gpio;
+ struct gpio_desc *reset_gpio;
};
#define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev)
@@ -83,6 +84,7 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev)
if (r)
return r;
+ gpiod_set_value_cansleep(ddata->reset_gpio, 0);
gpiod_set_value_cansleep(ddata->enable_gpio, 1);
if (gpio_is_valid(ddata->backlight_gpio))
@@ -211,6 +213,11 @@ static int panel_dpi_probe_of(struct platform_device *pdev)
if (IS_ERR(ddata->enable_gpio))
return PTR_ERR(ddata->enable_gpio);
+ ddata->reset_gpio = devm_gpiod_get_optional(&pdev->dev,
+ "reset", GPIOD_OUT_HIGH);
+ if (IS_ERR(ddata->reset_gpio))
+ return PTR_ERR(ddata->reset_gpio);
+
ddata->backlight_gpio = -ENOENT;
r = of_get_display_timing(node, "panel-timing", &timing);
--
2.6.2
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/5] fbdev: omap2: panel-dpi: in .disable first disable backlight then display
2015-12-10 13:11 [PATCH 1/5] fbdev: omap2: panel-dpi: in .disable first disable backlight then display Uwe Kleine-König
2015-12-10 13:11 ` [PATCH 4/5] fbdev: omap2: panel-dpi: allow specification of a reset gpio Uwe Kleine-König
@ 2015-12-16 17:16 ` Tomi Valkeinen
1 sibling, 0 replies; 6+ messages in thread
From: Tomi Valkeinen @ 2015-12-16 17:16 UTC (permalink / raw)
To: linux-fbdev
[-- Attachment #1: Type: text/plain, Size: 1231 bytes --]
On 10/12/15 15:11, Uwe Kleine-König wrote:
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> This makes .disable operate in reverse order compared to .enable.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> drivers/video/fbdev/omap2/displays-new/panel-dpi.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> index f7be3489f744..06b6e611e4b2 100644
> --- a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> +++ b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> @@ -102,12 +102,12 @@ static void panel_dpi_disable(struct omap_dss_device *dssdev)
> if (!omapdss_device_is_enabled(dssdev))
> return;
>
> - if (ddata->enable_gpio)
> - gpiod_set_value_cansleep(ddata->enable_gpio, 0);
> -
> if (gpio_is_valid(ddata->backlight_gpio))
> gpio_set_value_cansleep(ddata->backlight_gpio, 0);
>
> + if (ddata->enable_gpio)
> + gpiod_set_value_cansleep(ddata->enable_gpio, 0);
> +
> in->ops.dpi->disable(in);
>
> dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
>
Thanks, queued for 4.5.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 4/5] fbdev: omap2: panel-dpi: allow specification of a reset gpio
2015-12-10 13:11 ` [PATCH 4/5] fbdev: omap2: panel-dpi: allow specification of a reset gpio Uwe Kleine-König
@ 2015-12-16 17:35 ` Tomi Valkeinen
[not found] ` <5671A0E2.7000909-l0cyMroinI0@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Tomi Valkeinen @ 2015-12-16 17:35 UTC (permalink / raw)
To: linux-fbdev
[-- Attachment #1: Type: text/plain, Size: 2963 bytes --]
On 10/12/15 15:11, Uwe Kleine-König wrote:
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> Some displays have a reset input. To assert that the display is
> functional the reset gpio must be deasserted.
>
> Teach the driver to get and drive such a gpio accordingly.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Documentation/devicetree/bindings/video/panel-dpi.txt | 1 +
> drivers/video/fbdev/omap2/displays-new/panel-dpi.c | 7 +++++++
> 2 files changed, 8 insertions(+)
DT changes should be posted to devicetree@vger.kernel.org. And, I think,
the binding document changes are usually as a separate patch.
> diff --git a/Documentation/devicetree/bindings/video/panel-dpi.txt b/Documentation/devicetree/bindings/video/panel-dpi.txt
> index a40180b05bab..1a1d8f6f884f 100644
> --- a/Documentation/devicetree/bindings/video/panel-dpi.txt
> +++ b/Documentation/devicetree/bindings/video/panel-dpi.txt
> @@ -7,6 +7,7 @@ Required properties:
> Optional properties:
> - label: a symbolic name for the panel
> - enable-gpios: panel enable gpio
> +- reset-gpios: GPIO to control the RESET pin
>
> Required nodes:
> - "panel-timing" containing video timings
> diff --git a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> index 1216341a0d19..7e2f9e0813dc 100644
> --- a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> +++ b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> @@ -32,6 +32,7 @@ struct panel_drv_data {
> int backlight_gpio;
>
> struct gpio_desc *enable_gpio;
> + struct gpio_desc *reset_gpio;
> };
>
> #define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev)
> @@ -83,6 +84,7 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev)
> if (r)
> return r;
>
> + gpiod_set_value_cansleep(ddata->reset_gpio, 0);
> gpiod_set_value_cansleep(ddata->enable_gpio, 1);
>
> if (gpio_is_valid(ddata->backlight_gpio))
> @@ -211,6 +213,11 @@ static int panel_dpi_probe_of(struct platform_device *pdev)
> if (IS_ERR(ddata->enable_gpio))
> return PTR_ERR(ddata->enable_gpio);
>
> + ddata->reset_gpio = devm_gpiod_get_optional(&pdev->dev,
> + "reset", GPIOD_OUT_HIGH);
> + if (IS_ERR(ddata->reset_gpio))
> + return PTR_ERR(ddata->reset_gpio);
> +
> ddata->backlight_gpio = -ENOENT;
>
> r = of_get_display_timing(node, "panel-timing", &timing);
>
This looks a bit odd to me. This only ever sets the reset gpio to 0, on
panel enable. If we never toggle the reset, it could be set to 0 at
probe time, right?
Reset is a bit tricky. I've seen panels where you have to have only a
short reset pulse (reset high, wait a short time, reset low). If you
leave the reset high, the panel draws extra power.
So I think the best we can do in a generic way is just to ensure the
reset is not asserted.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 4/5] fbdev: omap2: panel-dpi: allow specification of a reset gpio
[not found] ` <5671A0E2.7000909-l0cyMroinI0@public.gmane.org>
@ 2015-12-20 10:33 ` Uwe Kleine-König
0 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2015-12-20 10:33 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: Uwe Kleine-König, Jean-Christophe Plagniol-Villard,
linux-omap-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
[Cc += devicetree@vger.kernel.org]
Hello Tomi,
On Wed, Dec 16, 2015 at 07:35:30PM +0200, Tomi Valkeinen wrote:
>
> On 10/12/15 15:11, Uwe Kleine-König wrote:
> > From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >
> > Some displays have a reset input. To assert that the display is
> > functional the reset gpio must be deasserted.
> >
> > Teach the driver to get and drive such a gpio accordingly.
> >
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > ---
> > Documentation/devicetree/bindings/video/panel-dpi.txt | 1 +
> > drivers/video/fbdev/omap2/displays-new/panel-dpi.c | 7 +++++++
> > 2 files changed, 8 insertions(+)
>
> DT changes should be posted to devicetree@vger.kernel.org. And, I think,
> the binding document changes are usually as a separate patch.
Right for devicetree@vger.kernel.org, but separate patches for bindings
is news to me. Anyhow, I can split this off if you prefer.
> > diff --git a/Documentation/devicetree/bindings/video/panel-dpi.txt b/Documentation/devicetree/bindings/video/panel-dpi.txt
> > index a40180b05bab..1a1d8f6f884f 100644
> > --- a/Documentation/devicetree/bindings/video/panel-dpi.txt
> > +++ b/Documentation/devicetree/bindings/video/panel-dpi.txt
> > @@ -7,6 +7,7 @@ Required properties:
> > Optional properties:
> > - label: a symbolic name for the panel
> > - enable-gpios: panel enable gpio
> > +- reset-gpios: GPIO to control the RESET pin
> >
> > Required nodes:
> > - "panel-timing" containing video timings
> > diff --git a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> > index 1216341a0d19..7e2f9e0813dc 100644
> > --- a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> > +++ b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> > @@ -32,6 +32,7 @@ struct panel_drv_data {
> > int backlight_gpio;
> >
> > struct gpio_desc *enable_gpio;
> > + struct gpio_desc *reset_gpio;
> > };
> >
> > #define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev)
> > @@ -83,6 +84,7 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev)
> > if (r)
> > return r;
> >
> > + gpiod_set_value_cansleep(ddata->reset_gpio, 0);
> > gpiod_set_value_cansleep(ddata->enable_gpio, 1);
> >
> > if (gpio_is_valid(ddata->backlight_gpio))
> > @@ -211,6 +213,11 @@ static int panel_dpi_probe_of(struct platform_device *pdev)
> > if (IS_ERR(ddata->enable_gpio))
> > return PTR_ERR(ddata->enable_gpio);
> >
> > + ddata->reset_gpio = devm_gpiod_get_optional(&pdev->dev,
> > + "reset", GPIOD_OUT_HIGH);
> > + if (IS_ERR(ddata->reset_gpio))
> > + return PTR_ERR(ddata->reset_gpio);
> > +
> > ddata->backlight_gpio = -ENOENT;
> >
> > r = of_get_display_timing(node, "panel-timing", &timing);
> >
>
> This looks a bit odd to me. This only ever sets the reset gpio to 0, on
> panel enable. If we never toggle the reset, it could be set to 0 at
> probe time, right?
>
> Reset is a bit tricky. I've seen panels where you have to have only a
> short reset pulse (reset high, wait a short time, reset low). If you
> leave the reset high, the panel draws extra power.
>
> So I think the best we can do in a generic way is just to ensure the
> reset is not asserted.
Good idea, will implement this in v2.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 4/5] fbdev: omap2: panel-dpi: allow specification of a reset gpio
@ 2015-12-20 10:33 ` Uwe Kleine-König
0 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2015-12-20 10:33 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: Uwe Kleine-König, Jean-Christophe Plagniol-Villard,
linux-omap-u79uwXL29TY76Z2rM5mHXA, kernel-bIcnvbaLZ9MEGnE8C9+IrQ,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
[Cc += devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org]
Hello Tomi,
On Wed, Dec 16, 2015 at 07:35:30PM +0200, Tomi Valkeinen wrote:
>
> On 10/12/15 15:11, Uwe Kleine-König wrote:
> > From: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> >
> > Some displays have a reset input. To assert that the display is
> > functional the reset gpio must be deasserted.
> >
> > Teach the driver to get and drive such a gpio accordingly.
> >
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> > ---
> > Documentation/devicetree/bindings/video/panel-dpi.txt | 1 +
> > drivers/video/fbdev/omap2/displays-new/panel-dpi.c | 7 +++++++
> > 2 files changed, 8 insertions(+)
>
> DT changes should be posted to devicetree-u79uwXL29TaiAVqoAR/hOA@public.gmane.org And, I think,
> the binding document changes are usually as a separate patch.
Right for devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, but separate patches for bindings
is news to me. Anyhow, I can split this off if you prefer.
> > diff --git a/Documentation/devicetree/bindings/video/panel-dpi.txt b/Documentation/devicetree/bindings/video/panel-dpi.txt
> > index a40180b05bab..1a1d8f6f884f 100644
> > --- a/Documentation/devicetree/bindings/video/panel-dpi.txt
> > +++ b/Documentation/devicetree/bindings/video/panel-dpi.txt
> > @@ -7,6 +7,7 @@ Required properties:
> > Optional properties:
> > - label: a symbolic name for the panel
> > - enable-gpios: panel enable gpio
> > +- reset-gpios: GPIO to control the RESET pin
> >
> > Required nodes:
> > - "panel-timing" containing video timings
> > diff --git a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> > index 1216341a0d19..7e2f9e0813dc 100644
> > --- a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> > +++ b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> > @@ -32,6 +32,7 @@ struct panel_drv_data {
> > int backlight_gpio;
> >
> > struct gpio_desc *enable_gpio;
> > + struct gpio_desc *reset_gpio;
> > };
> >
> > #define to_panel_data(p) container_of(p, struct panel_drv_data, dssdev)
> > @@ -83,6 +84,7 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev)
> > if (r)
> > return r;
> >
> > + gpiod_set_value_cansleep(ddata->reset_gpio, 0);
> > gpiod_set_value_cansleep(ddata->enable_gpio, 1);
> >
> > if (gpio_is_valid(ddata->backlight_gpio))
> > @@ -211,6 +213,11 @@ static int panel_dpi_probe_of(struct platform_device *pdev)
> > if (IS_ERR(ddata->enable_gpio))
> > return PTR_ERR(ddata->enable_gpio);
> >
> > + ddata->reset_gpio = devm_gpiod_get_optional(&pdev->dev,
> > + "reset", GPIOD_OUT_HIGH);
> > + if (IS_ERR(ddata->reset_gpio))
> > + return PTR_ERR(ddata->reset_gpio);
> > +
> > ddata->backlight_gpio = -ENOENT;
> >
> > r = of_get_display_timing(node, "panel-timing", &timing);
> >
>
> This looks a bit odd to me. This only ever sets the reset gpio to 0, on
> panel enable. If we never toggle the reset, it could be set to 0 at
> probe time, right?
>
> Reset is a bit tricky. I've seen panels where you have to have only a
> short reset pulse (reset high, wait a short time, reset low). If you
> leave the reset high, the panel draws extra power.
>
> So I think the best we can do in a generic way is just to ensure the
> reset is not asserted.
Good idea, will implement this in v2.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-12-20 10:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-10 13:11 [PATCH 1/5] fbdev: omap2: panel-dpi: in .disable first disable backlight then display Uwe Kleine-König
2015-12-10 13:11 ` [PATCH 4/5] fbdev: omap2: panel-dpi: allow specification of a reset gpio Uwe Kleine-König
2015-12-16 17:35 ` Tomi Valkeinen
[not found] ` <5671A0E2.7000909-l0cyMroinI0@public.gmane.org>
2015-12-20 10:33 ` Uwe Kleine-König
2015-12-20 10:33 ` Uwe Kleine-König
2015-12-16 17:16 ` [PATCH 1/5] fbdev: omap2: panel-dpi: in .disable first disable backlight then display Tomi Valkeinen
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.