All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/panel: simple: Support reset GPIOs
@ 2019-12-24 14:21 ` Miquel Raynal
  0 siblings, 0 replies; 8+ messages in thread
From: Miquel Raynal @ 2019-12-24 14:21 UTC (permalink / raw)
  To: Thierry Reding, Sam Ravnborg, David Airlie, Daniel Vetter
  Cc: linux-kernel, dri-devel, Paul Kocialkowski, Maxime Chevallier,
	Thomas Petazzoni, Miquel Raynal

The panel common bindings provide a gpios-reset property. Let's
support it in the simple driver.

Two fields are added to the panel description structure: the time to
assert the reset and the time to wait right after before starting to
interact with it in any manner. In case these default values are not
filled but the GPIO is present in the DT, default values are applied.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---

Changes since v1:
* Add two parameters in the panel description structure.
* Ensure the reset is asserted the right amount of time and the
  deasserted before continuing if a reset GPIO is given.

 drivers/gpu/drm/panel/panel-simple.c | 32 +++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 28fa6ba7b767..ac6f6b5d200d 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -38,6 +38,9 @@
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_panel.h>
 
+#define MIN_DEFAULT_RESET_US 10
+#define MIN_DEFAULT_WAIT_US 10
+
 /**
  * @modes: Pointer to array of fixed modes appropriate for this panel.  If
  *         only one mode then this can just be the address of this the mode.
@@ -94,6 +97,10 @@ struct panel_desc {
 
 	u32 bus_format;
 	u32 bus_flags;
+
+	/* Minimum reset duration and wait period after it in us */
+	u32 reset_time;
+	u32 reset_wait;
 };
 
 struct panel_simple {
@@ -109,6 +116,7 @@ struct panel_simple {
 	struct i2c_adapter *ddc;
 
 	struct gpio_desc *enable_gpio;
+	struct gpio_desc *reset_gpio;
 
 	struct drm_display_mode override_mode;
 };
@@ -432,12 +440,34 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
 	if (IS_ERR(panel->supply))
 		return PTR_ERR(panel->supply);
 
+	panel->reset_gpio = devm_gpiod_get_optional(dev, "reset",
+						    GPIOD_OUT_HIGH);
+	if (IS_ERR(panel->reset_gpio)) {
+		err = PTR_ERR(panel->reset_gpio);
+		if (err != -EPROBE_DEFER)
+			dev_err(dev, "failed to request reset pin: %d\n", err);
+		return err;
+	} else if (panel->reset_gpio) {
+		u32 reset_time = panel->desc->reset_time;
+		u32 reset_wait = panel->desc->reset_wait;
+
+		if (!reset_time)
+			reset_time = MIN_DEFAULT_RESET_US;
+
+		if (!reset_wait)
+			reset_wait = MIN_DEFAULT_WAIT_US;
+
+		usleep_range(reset_time, 2 * reset_time);
+		gpiod_set_value_cansleep(panel->reset_gpio, 0);
+		usleep_range(reset_wait, 2 * reset_wait);
+	}
+
 	panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
 						     GPIOD_OUT_LOW);
 	if (IS_ERR(panel->enable_gpio)) {
 		err = PTR_ERR(panel->enable_gpio);
 		if (err != -EPROBE_DEFER)
-			dev_err(dev, "failed to request GPIO: %d\n", err);
+			dev_err(dev, "failed to request enable pin: %d\n", err);
 		return err;
 	}
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v2] drm/panel: simple: Support reset GPIOs
@ 2019-12-24 14:21 ` Miquel Raynal
  0 siblings, 0 replies; 8+ messages in thread
From: Miquel Raynal @ 2019-12-24 14:21 UTC (permalink / raw)
  To: Thierry Reding, Sam Ravnborg, David Airlie, Daniel Vetter
  Cc: linux-kernel, dri-devel, Maxime Chevallier, Paul Kocialkowski,
	Thomas Petazzoni, Miquel Raynal

The panel common bindings provide a gpios-reset property. Let's
support it in the simple driver.

Two fields are added to the panel description structure: the time to
assert the reset and the time to wait right after before starting to
interact with it in any manner. In case these default values are not
filled but the GPIO is present in the DT, default values are applied.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---

Changes since v1:
* Add two parameters in the panel description structure.
* Ensure the reset is asserted the right amount of time and the
  deasserted before continuing if a reset GPIO is given.

 drivers/gpu/drm/panel/panel-simple.c | 32 +++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 28fa6ba7b767..ac6f6b5d200d 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -38,6 +38,9 @@
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_panel.h>
 
+#define MIN_DEFAULT_RESET_US 10
+#define MIN_DEFAULT_WAIT_US 10
+
 /**
  * @modes: Pointer to array of fixed modes appropriate for this panel.  If
  *         only one mode then this can just be the address of this the mode.
@@ -94,6 +97,10 @@ struct panel_desc {
 
 	u32 bus_format;
 	u32 bus_flags;
+
+	/* Minimum reset duration and wait period after it in us */
+	u32 reset_time;
+	u32 reset_wait;
 };
 
 struct panel_simple {
@@ -109,6 +116,7 @@ struct panel_simple {
 	struct i2c_adapter *ddc;
 
 	struct gpio_desc *enable_gpio;
+	struct gpio_desc *reset_gpio;
 
 	struct drm_display_mode override_mode;
 };
@@ -432,12 +440,34 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
 	if (IS_ERR(panel->supply))
 		return PTR_ERR(panel->supply);
 
+	panel->reset_gpio = devm_gpiod_get_optional(dev, "reset",
+						    GPIOD_OUT_HIGH);
+	if (IS_ERR(panel->reset_gpio)) {
+		err = PTR_ERR(panel->reset_gpio);
+		if (err != -EPROBE_DEFER)
+			dev_err(dev, "failed to request reset pin: %d\n", err);
+		return err;
+	} else if (panel->reset_gpio) {
+		u32 reset_time = panel->desc->reset_time;
+		u32 reset_wait = panel->desc->reset_wait;
+
+		if (!reset_time)
+			reset_time = MIN_DEFAULT_RESET_US;
+
+		if (!reset_wait)
+			reset_wait = MIN_DEFAULT_WAIT_US;
+
+		usleep_range(reset_time, 2 * reset_time);
+		gpiod_set_value_cansleep(panel->reset_gpio, 0);
+		usleep_range(reset_wait, 2 * reset_wait);
+	}
+
 	panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
 						     GPIOD_OUT_LOW);
 	if (IS_ERR(panel->enable_gpio)) {
 		err = PTR_ERR(panel->enable_gpio);
 		if (err != -EPROBE_DEFER)
-			dev_err(dev, "failed to request GPIO: %d\n", err);
+			dev_err(dev, "failed to request enable pin: %d\n", err);
 		return err;
 	}
 
-- 
2.20.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] drm/panel: simple: Support reset GPIOs
  2019-12-24 14:21 ` Miquel Raynal
@ 2020-01-02 17:27   ` Sam Ravnborg
  -1 siblings, 0 replies; 8+ messages in thread
From: Sam Ravnborg @ 2020-01-02 17:27 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Thierry Reding, David Airlie, Daniel Vetter, linux-kernel,
	dri-devel, Paul Kocialkowski, Maxime Chevallier,
	Thomas Petazzoni

Hi Miquel

On Tue, Dec 24, 2019 at 03:21:34PM +0100, Miquel Raynal wrote:
> The panel common bindings provide a gpios-reset property. Let's
> support it in the simple driver.
> 
> Two fields are added to the panel description structure: the time to
> assert the reset and the time to wait right after before starting to
> interact with it in any manner. In case these default values are not
> filled but the GPIO is present in the DT, default values are applied.

Wehn we discussed this the last time you wrote:

"""
my hardware is:

LVDS IP <----------> LVDS to RGB bridge <------------> Panel

While there is a simple "RGB to LVDS" bridge driver, there is none
doing the work the other way around. In my case, the bridge has a reset
pin.

As until now there is no way to represent the "LVDS to RGB" bridge and
because the bindings already document such reset pin, I decided to add
support for it in the simple panel driver.
"""

Based on the information provided it seems that the correct way is to
add a "LVDS to RGB bridge" and then let the bridge handle the reset
functionality.

It is obviously much more code to do it this way but then
other panels using the same type of brigde have the
same functionality without adding bridge functionality to the panel.

	Sam

> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
> 
> Changes since v1:
> * Add two parameters in the panel description structure.
> * Ensure the reset is asserted the right amount of time and the
>   deasserted before continuing if a reset GPIO is given.
> 
>  drivers/gpu/drm/panel/panel-simple.c | 32 +++++++++++++++++++++++++++-
>  1 file changed, 31 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index 28fa6ba7b767..ac6f6b5d200d 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -38,6 +38,9 @@
>  #include <drm/drm_mipi_dsi.h>
>  #include <drm/drm_panel.h>
>  
> +#define MIN_DEFAULT_RESET_US 10
> +#define MIN_DEFAULT_WAIT_US 10
> +
>  /**
>   * @modes: Pointer to array of fixed modes appropriate for this panel.  If
>   *         only one mode then this can just be the address of this the mode.
> @@ -94,6 +97,10 @@ struct panel_desc {
>  
>  	u32 bus_format;
>  	u32 bus_flags;
> +
> +	/* Minimum reset duration and wait period after it in us */
> +	u32 reset_time;
> +	u32 reset_wait;
>  };
>  
>  struct panel_simple {
> @@ -109,6 +116,7 @@ struct panel_simple {
>  	struct i2c_adapter *ddc;
>  
>  	struct gpio_desc *enable_gpio;
> +	struct gpio_desc *reset_gpio;
>  
>  	struct drm_display_mode override_mode;
>  };
> @@ -432,12 +440,34 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
>  	if (IS_ERR(panel->supply))
>  		return PTR_ERR(panel->supply);
>  
> +	panel->reset_gpio = devm_gpiod_get_optional(dev, "reset",
> +						    GPIOD_OUT_HIGH);
> +	if (IS_ERR(panel->reset_gpio)) {
> +		err = PTR_ERR(panel->reset_gpio);
> +		if (err != -EPROBE_DEFER)
> +			dev_err(dev, "failed to request reset pin: %d\n", err);
> +		return err;
> +	} else if (panel->reset_gpio) {
> +		u32 reset_time = panel->desc->reset_time;
> +		u32 reset_wait = panel->desc->reset_wait;
> +
> +		if (!reset_time)
> +			reset_time = MIN_DEFAULT_RESET_US;
> +
> +		if (!reset_wait)
> +			reset_wait = MIN_DEFAULT_WAIT_US;
> +
> +		usleep_range(reset_time, 2 * reset_time);
> +		gpiod_set_value_cansleep(panel->reset_gpio, 0);
> +		usleep_range(reset_wait, 2 * reset_wait);
> +	}
> +
>  	panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
>  						     GPIOD_OUT_LOW);
>  	if (IS_ERR(panel->enable_gpio)) {
>  		err = PTR_ERR(panel->enable_gpio);
>  		if (err != -EPROBE_DEFER)
> -			dev_err(dev, "failed to request GPIO: %d\n", err);
> +			dev_err(dev, "failed to request enable pin: %d\n", err);
>  		return err;
>  	}
>  
> -- 
> 2.20.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] drm/panel: simple: Support reset GPIOs
@ 2020-01-02 17:27   ` Sam Ravnborg
  0 siblings, 0 replies; 8+ messages in thread
From: Sam Ravnborg @ 2020-01-02 17:27 UTC (permalink / raw)
  To: Miquel Raynal
  Cc: Thomas Petazzoni, David Airlie, linux-kernel, dri-devel,
	Maxime Chevallier, Paul Kocialkowski, Thierry Reding

Hi Miquel

On Tue, Dec 24, 2019 at 03:21:34PM +0100, Miquel Raynal wrote:
> The panel common bindings provide a gpios-reset property. Let's
> support it in the simple driver.
> 
> Two fields are added to the panel description structure: the time to
> assert the reset and the time to wait right after before starting to
> interact with it in any manner. In case these default values are not
> filled but the GPIO is present in the DT, default values are applied.

Wehn we discussed this the last time you wrote:

"""
my hardware is:

LVDS IP <----------> LVDS to RGB bridge <------------> Panel

While there is a simple "RGB to LVDS" bridge driver, there is none
doing the work the other way around. In my case, the bridge has a reset
pin.

As until now there is no way to represent the "LVDS to RGB" bridge and
because the bindings already document such reset pin, I decided to add
support for it in the simple panel driver.
"""

Based on the information provided it seems that the correct way is to
add a "LVDS to RGB bridge" and then let the bridge handle the reset
functionality.

It is obviously much more code to do it this way but then
other panels using the same type of brigde have the
same functionality without adding bridge functionality to the panel.

	Sam

> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
> 
> Changes since v1:
> * Add two parameters in the panel description structure.
> * Ensure the reset is asserted the right amount of time and the
>   deasserted before continuing if a reset GPIO is given.
> 
>  drivers/gpu/drm/panel/panel-simple.c | 32 +++++++++++++++++++++++++++-
>  1 file changed, 31 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index 28fa6ba7b767..ac6f6b5d200d 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -38,6 +38,9 @@
>  #include <drm/drm_mipi_dsi.h>
>  #include <drm/drm_panel.h>
>  
> +#define MIN_DEFAULT_RESET_US 10
> +#define MIN_DEFAULT_WAIT_US 10
> +
>  /**
>   * @modes: Pointer to array of fixed modes appropriate for this panel.  If
>   *         only one mode then this can just be the address of this the mode.
> @@ -94,6 +97,10 @@ struct panel_desc {
>  
>  	u32 bus_format;
>  	u32 bus_flags;
> +
> +	/* Minimum reset duration and wait period after it in us */
> +	u32 reset_time;
> +	u32 reset_wait;
>  };
>  
>  struct panel_simple {
> @@ -109,6 +116,7 @@ struct panel_simple {
>  	struct i2c_adapter *ddc;
>  
>  	struct gpio_desc *enable_gpio;
> +	struct gpio_desc *reset_gpio;
>  
>  	struct drm_display_mode override_mode;
>  };
> @@ -432,12 +440,34 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
>  	if (IS_ERR(panel->supply))
>  		return PTR_ERR(panel->supply);
>  
> +	panel->reset_gpio = devm_gpiod_get_optional(dev, "reset",
> +						    GPIOD_OUT_HIGH);
> +	if (IS_ERR(panel->reset_gpio)) {
> +		err = PTR_ERR(panel->reset_gpio);
> +		if (err != -EPROBE_DEFER)
> +			dev_err(dev, "failed to request reset pin: %d\n", err);
> +		return err;
> +	} else if (panel->reset_gpio) {
> +		u32 reset_time = panel->desc->reset_time;
> +		u32 reset_wait = panel->desc->reset_wait;
> +
> +		if (!reset_time)
> +			reset_time = MIN_DEFAULT_RESET_US;
> +
> +		if (!reset_wait)
> +			reset_wait = MIN_DEFAULT_WAIT_US;
> +
> +		usleep_range(reset_time, 2 * reset_time);
> +		gpiod_set_value_cansleep(panel->reset_gpio, 0);
> +		usleep_range(reset_wait, 2 * reset_wait);
> +	}
> +
>  	panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
>  						     GPIOD_OUT_LOW);
>  	if (IS_ERR(panel->enable_gpio)) {
>  		err = PTR_ERR(panel->enable_gpio);
>  		if (err != -EPROBE_DEFER)
> -			dev_err(dev, "failed to request GPIO: %d\n", err);
> +			dev_err(dev, "failed to request enable pin: %d\n", err);
>  		return err;
>  	}
>  
> -- 
> 2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] drm/panel: simple: Support reset GPIOs
  2020-01-02 17:27   ` Sam Ravnborg
@ 2020-01-06  9:10     ` Miquel Raynal
  -1 siblings, 0 replies; 8+ messages in thread
From: Miquel Raynal @ 2020-01-06  9:10 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Thierry Reding, David Airlie, Daniel Vetter, linux-kernel,
	dri-devel, Paul Kocialkowski, Maxime Chevallier,
	Thomas Petazzoni

Hi Sam,

Sam Ravnborg <sam@ravnborg.org> wrote on Thu, 2 Jan 2020 18:27:00 +0100:

> Hi Miquel
> 
> On Tue, Dec 24, 2019 at 03:21:34PM +0100, Miquel Raynal wrote:
> > The panel common bindings provide a gpios-reset property. Let's
> > support it in the simple driver.
> > 
> > Two fields are added to the panel description structure: the time to
> > assert the reset and the time to wait right after before starting to
> > interact with it in any manner. In case these default values are not
> > filled but the GPIO is present in the DT, default values are applied.  
> 
> Wehn we discussed this the last time you wrote:
> 
> """
> my hardware is:
> 
> LVDS IP <----------> LVDS to RGB bridge <------------> Panel
> 
> While there is a simple "RGB to LVDS" bridge driver, there is none
> doing the work the other way around. In my case, the bridge has a reset
> pin.
> 
> As until now there is no way to represent the "LVDS to RGB" bridge and
> because the bindings already document such reset pin, I decided to add
> support for it in the simple panel driver.
> """
> 
> Based on the information provided it seems that the correct way is to
> add a "LVDS to RGB bridge" and then let the bridge handle the reset
> functionality.

This I agree, but we are talking about my current situation. 

> 
> It is obviously much more code to do it this way but then
> other panels using the same type of brigde have the
> same functionality without adding bridge functionality to the panel.

This, I do not fully agree as bindings for the panel reset already
exist and we could have a reset on both: the bridge and the panel.
I choose to use a wrong (private) DT representation because I am not
willing to add an LVDS->RGB bridge: as you say, it is much more work to
do. But, IMHO, this is not related to the patch. If you consider this
patch wrong because a panel cannot have a reset, then it should be
stated clearly and maybe removed from the bindings?

Anyway if you think this change can't be useful, let's put it aside.

Thanks for your time,
Miquèl


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] drm/panel: simple: Support reset GPIOs
@ 2020-01-06  9:10     ` Miquel Raynal
  0 siblings, 0 replies; 8+ messages in thread
From: Miquel Raynal @ 2020-01-06  9:10 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Thomas Petazzoni, David Airlie, linux-kernel, dri-devel,
	Maxime Chevallier, Paul Kocialkowski, Thierry Reding

Hi Sam,

Sam Ravnborg <sam@ravnborg.org> wrote on Thu, 2 Jan 2020 18:27:00 +0100:

> Hi Miquel
> 
> On Tue, Dec 24, 2019 at 03:21:34PM +0100, Miquel Raynal wrote:
> > The panel common bindings provide a gpios-reset property. Let's
> > support it in the simple driver.
> > 
> > Two fields are added to the panel description structure: the time to
> > assert the reset and the time to wait right after before starting to
> > interact with it in any manner. In case these default values are not
> > filled but the GPIO is present in the DT, default values are applied.  
> 
> Wehn we discussed this the last time you wrote:
> 
> """
> my hardware is:
> 
> LVDS IP <----------> LVDS to RGB bridge <------------> Panel
> 
> While there is a simple "RGB to LVDS" bridge driver, there is none
> doing the work the other way around. In my case, the bridge has a reset
> pin.
> 
> As until now there is no way to represent the "LVDS to RGB" bridge and
> because the bindings already document such reset pin, I decided to add
> support for it in the simple panel driver.
> """
> 
> Based on the information provided it seems that the correct way is to
> add a "LVDS to RGB bridge" and then let the bridge handle the reset
> functionality.

This I agree, but we are talking about my current situation. 

> 
> It is obviously much more code to do it this way but then
> other panels using the same type of brigde have the
> same functionality without adding bridge functionality to the panel.

This, I do not fully agree as bindings for the panel reset already
exist and we could have a reset on both: the bridge and the panel.
I choose to use a wrong (private) DT representation because I am not
willing to add an LVDS->RGB bridge: as you say, it is much more work to
do. But, IMHO, this is not related to the patch. If you consider this
patch wrong because a panel cannot have a reset, then it should be
stated clearly and maybe removed from the bindings?

Anyway if you think this change can't be useful, let's put it aside.

Thanks for your time,
Miquèl

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] drm/panel: simple: Support reset GPIOs
  2020-01-06  9:10     ` Miquel Raynal
@ 2020-04-29 13:45       ` Wadim Egorov
  -1 siblings, 0 replies; 8+ messages in thread
From: Wadim Egorov @ 2020-04-29 13:45 UTC (permalink / raw)
  To: Miquel Raynal, Sam Ravnborg
  Cc: Thomas Petazzoni, David Airlie, linux-kernel, dri-devel,
	Maxime Chevallier, Paul Kocialkowski, Thierry Reding

Hi Sam,

you've asked in another thread [1] if there is any known simple panel
that requires a reset. We have a Densitron DMT070WSNLCMI-1E Panel
(compatible to avic,tm070ddh03) with some reset timing requirements, [2]
Page 20. So it would be nice to see this patch accepted.

[1] https://patchwork.kernel.org/patch/11292207/
[2]
https://www.densitron.com/sites/default/files/2019-09/DMT070WSNLCMI-1E%20Rev%20A.pdf

Regards,
Wadim

On 06.01.20 10:10, Miquel Raynal wrote:
> Hi Sam,
>
> Sam Ravnborg <sam@ravnborg.org> wrote on Thu, 2 Jan 2020 18:27:00 +0100:
>
>> Hi Miquel
>>
>> On Tue, Dec 24, 2019 at 03:21:34PM +0100, Miquel Raynal wrote:
>>> The panel common bindings provide a gpios-reset property. Let's
>>> support it in the simple driver.
>>>
>>> Two fields are added to the panel description structure: the time to
>>> assert the reset and the time to wait right after before starting to
>>> interact with it in any manner. In case these default values are not
>>> filled but the GPIO is present in the DT, default values are applied.  
>> Wehn we discussed this the last time you wrote:
>>
>> """
>> my hardware is:
>>
>> LVDS IP <----------> LVDS to RGB bridge <------------> Panel
>>
>> While there is a simple "RGB to LVDS" bridge driver, there is none
>> doing the work the other way around. In my case, the bridge has a reset
>> pin.
>>
>> As until now there is no way to represent the "LVDS to RGB" bridge and
>> because the bindings already document such reset pin, I decided to add
>> support for it in the simple panel driver.
>> """
>>
>> Based on the information provided it seems that the correct way is to
>> add a "LVDS to RGB bridge" and then let the bridge handle the reset
>> functionality.
> This I agree, but we are talking about my current situation. 
>
>> It is obviously much more code to do it this way but then
>> other panels using the same type of brigde have the
>> same functionality without adding bridge functionality to the panel.
> This, I do not fully agree as bindings for the panel reset already
> exist and we could have a reset on both: the bridge and the panel.
> I choose to use a wrong (private) DT representation because I am not
> willing to add an LVDS->RGB bridge: as you say, it is much more work to
> do. But, IMHO, this is not related to the patch. If you consider this
> patch wrong because a panel cannot have a reset, then it should be
> stated clearly and maybe removed from the bindings?
>
> Anyway if you think this change can't be useful, let's put it aside.
>
> Thanks for your time,
> Miquèl
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] drm/panel: simple: Support reset GPIOs
@ 2020-04-29 13:45       ` Wadim Egorov
  0 siblings, 0 replies; 8+ messages in thread
From: Wadim Egorov @ 2020-04-29 13:45 UTC (permalink / raw)
  To: Miquel Raynal, Sam Ravnborg
  Cc: David Airlie, linux-kernel, dri-devel, Maxime Chevallier,
	Paul Kocialkowski, Thierry Reding, Thomas Petazzoni

Hi Sam,

you've asked in another thread [1] if there is any known simple panel
that requires a reset. We have a Densitron DMT070WSNLCMI-1E Panel
(compatible to avic,tm070ddh03) with some reset timing requirements, [2]
Page 20. So it would be nice to see this patch accepted.

[1] https://patchwork.kernel.org/patch/11292207/
[2]
https://www.densitron.com/sites/default/files/2019-09/DMT070WSNLCMI-1E%20Rev%20A.pdf

Regards,
Wadim

On 06.01.20 10:10, Miquel Raynal wrote:
> Hi Sam,
>
> Sam Ravnborg <sam@ravnborg.org> wrote on Thu, 2 Jan 2020 18:27:00 +0100:
>
>> Hi Miquel
>>
>> On Tue, Dec 24, 2019 at 03:21:34PM +0100, Miquel Raynal wrote:
>>> The panel common bindings provide a gpios-reset property. Let's
>>> support it in the simple driver.
>>>
>>> Two fields are added to the panel description structure: the time to
>>> assert the reset and the time to wait right after before starting to
>>> interact with it in any manner. In case these default values are not
>>> filled but the GPIO is present in the DT, default values are applied.  
>> Wehn we discussed this the last time you wrote:
>>
>> """
>> my hardware is:
>>
>> LVDS IP <----------> LVDS to RGB bridge <------------> Panel
>>
>> While there is a simple "RGB to LVDS" bridge driver, there is none
>> doing the work the other way around. In my case, the bridge has a reset
>> pin.
>>
>> As until now there is no way to represent the "LVDS to RGB" bridge and
>> because the bindings already document such reset pin, I decided to add
>> support for it in the simple panel driver.
>> """
>>
>> Based on the information provided it seems that the correct way is to
>> add a "LVDS to RGB bridge" and then let the bridge handle the reset
>> functionality.
> This I agree, but we are talking about my current situation. 
>
>> It is obviously much more code to do it this way but then
>> other panels using the same type of brigde have the
>> same functionality without adding bridge functionality to the panel.
> This, I do not fully agree as bindings for the panel reset already
> exist and we could have a reset on both: the bridge and the panel.
> I choose to use a wrong (private) DT representation because I am not
> willing to add an LVDS->RGB bridge: as you say, it is much more work to
> do. But, IMHO, this is not related to the patch. If you consider this
> patch wrong because a panel cannot have a reset, then it should be
> stated clearly and maybe removed from the bindings?
>
> Anyway if you think this change can't be useful, let's put it aside.
>
> Thanks for your time,
> Miquèl
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-04-29 14:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-24 14:21 [PATCH v2] drm/panel: simple: Support reset GPIOs Miquel Raynal
2019-12-24 14:21 ` Miquel Raynal
2020-01-02 17:27 ` Sam Ravnborg
2020-01-02 17:27   ` Sam Ravnborg
2020-01-06  9:10   ` Miquel Raynal
2020-01-06  9:10     ` Miquel Raynal
2020-04-29 13:45     ` Wadim Egorov
2020-04-29 13:45       ` Wadim Egorov

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.