Devicetree
 help / color / mirror / Atom feed
* Re: [PATCH] fbdev: ssd1307fb: allow reset-gpios is missing
@ 2017-01-16  9:50 Icenowy Zheng
       [not found] ` <20170117042658.QtsSkpPN-/icbEWb855g0PDqKvflMoHmW9unr2Ajn@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Icenowy Zheng @ 2017-01-16  9:50 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: David Airlie, linux-fbdev, Rob Herring, linux-kernel, devicetree


2017年1月16日 16:02于 Maxime Ripard <maxime.ripard@free-electrons.com>写道:
>
> On Sun, Jan 15, 2017 at 07:21:46PM +0800, Icenowy Zheng wrote: 
> > Currently some SSD1306 OLED modules are sold without a reset pin (only 
> > VCC, GND, SCK, SDA four pins). 
> > 
> > Add support for missing reset-gpios property. 
> > 
> > Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz> 
>
> Unfortunately, a similar patch has been sent a couple of times 
> already: 
> https://www.spinics.net/lists/devicetree/msg158330.html 

Why is it never merged?

There are really boards that needs this function.

>
> Maxime 
>
> -- 
> Maxime Ripard, Free Electrons 
> Embedded Linux and Kernel engineering 
> http://free-electrons.com 

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [PATCH] fbdev: ssd1307fb: allow reset-gpios is missing
@ 2017-01-17 16:58 Icenowy Zheng
  0 siblings, 0 replies; 6+ messages in thread
From: Icenowy Zheng @ 2017-01-17 16:58 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: David Airlie, Rob Herring, linux-fbdev, linux-kernel, devicetree


2017年1月17日 15:40于 Maxime Ripard <maxime.ripard@free-electrons.com>写道:
>
> On Mon, Jan 16, 2017 at 05:50:21PM +0800, Icenowy Zheng wrote: 
> > 
> > 2017年1月16日 16:02于 Maxime Ripard <maxime.ripard@free-electrons.com>写道: 
> > > 
> > > On Sun, Jan 15, 2017 at 07:21:46PM +0800, Icenowy Zheng wrote: 
> > > > Currently some SSD1306 OLED modules are sold without a reset pin (only 
> > > > VCC, GND, SCK, SDA four pins). 
> > > > 
> > > > Add support for missing reset-gpios property. 
> > > > 
> > > > Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz> 
> > > 
> > > Unfortunately, a similar patch has been sent a couple of times 
> > > already: 
> > > https://www.spinics.net/lists/devicetree/msg158330.html 
> > 
> > Why is it never merged? 
>
> It was sent 4 days ago... 
>
> And since you didn't have the right maintainers in the cc list, yours 
> didn't have a chance to be merged either. 

That patch is better.

Ignore mine.

>
> > There are really boards that needs this function. 
>
> Then  you can accelerate its inclusion by reviewing it. 
>
> Maxime 
>
> -- 
> Maxime Ripard, Free Electrons 
> Embedded Linux and Kernel engineering 
> http://free-electrons.com 

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH] fbdev: ssd1307fb: allow reset-gpios is missing
@ 2017-01-15 11:21 Icenowy Zheng
       [not found] ` <20170115112146.1787-1-icenowy-ymACFijhrKM@public.gmane.org>
  0 siblings, 1 reply; 6+ messages in thread
From: Icenowy Zheng @ 2017-01-15 11:21 UTC (permalink / raw)
  To: Rob Herring, David Airlie, Maxime Ripard
  Cc: devicetree, linux-kernel, linux-fbdev, Icenowy Zheng

Currently some SSD1306 OLED modules are sold without a reset pin (only
VCC, GND, SCK, SDA four pins).

Add support for missing reset-gpios property.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
---
 .../devicetree/bindings/display/ssd1307fb.txt      |  2 +-
 drivers/video/fbdev/ssd1307fb.c                    | 34 ++++++++++++----------
 2 files changed, 20 insertions(+), 16 deletions(-)

diff --git a/Documentation/devicetree/bindings/display/ssd1307fb.txt b/Documentation/devicetree/bindings/display/ssd1307fb.txt
index eb31ed47a283..a4541b13b706 100644
--- a/Documentation/devicetree/bindings/display/ssd1307fb.txt
+++ b/Documentation/devicetree/bindings/display/ssd1307fb.txt
@@ -8,13 +8,13 @@ Required properties:
          0x3c or 0x3d
   - pwm: Should contain the pwm to use according to the OF device tree PWM
          specification [0]. Only required for the ssd1307.
-  - reset-gpios: Should contain the GPIO used to reset the OLED display
   - solomon,height: Height in pixel of the screen driven by the controller
   - solomon,width: Width in pixel of the screen driven by the controller
   - solomon,page-offset: Offset of pages (band of 8 pixels) that the screen is
     mapped to.
 
 Optional properties:
+  - reset-gpios: Should contain the GPIO used to reset the OLED display
   - reset-active-low: Is the reset gpio is active on physical low?
   - solomon,segment-no-remap: Display needs normal (non-inverted) data column
                               to segment mapping
diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index 2925d5ce8d3e..e2b51a091ed4 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -563,8 +563,8 @@ static int ssd1307fb_probe(struct i2c_client *client,
 
 	par->reset = of_get_named_gpio(client->dev.of_node,
 					 "reset-gpios", 0);
-	if (!gpio_is_valid(par->reset)) {
-		ret = -EINVAL;
+	if (!gpio_is_valid(par->reset) && par->reset != -ENOENT) {
+		ret = par->reset;
 		goto fb_alloc_error;
 	}
 
@@ -642,23 +642,27 @@ static int ssd1307fb_probe(struct i2c_client *client,
 
 	fb_deferred_io_init(info);
 
-	ret = devm_gpio_request_one(&client->dev, par->reset,
-				    GPIOF_OUT_INIT_HIGH,
-				    "oled-reset");
-	if (ret) {
-		dev_err(&client->dev,
-			"failed to request gpio %d: %d\n",
-			par->reset, ret);
-		goto reset_oled_error;
+	if (par->reset != -ENOENT) {
+		ret = devm_gpio_request_one(&client->dev, par->reset,
+					    GPIOF_OUT_INIT_HIGH,
+					    "oled-reset");
+		if (ret) {
+			dev_err(&client->dev,
+				"failed to request gpio %d: %d\n",
+				par->reset, ret);
+			goto reset_oled_error;
+		}
 	}
 
 	i2c_set_clientdata(client, info);
 
-	/* Reset the screen */
-	gpio_set_value(par->reset, 0);
-	udelay(4);
-	gpio_set_value(par->reset, 1);
-	udelay(4);
+	if (par->reset != -ENOENT) {
+		/* Reset the screen */
+		gpio_set_value(par->reset, 0);
+		udelay(4);
+		gpio_set_value(par->reset, 1);
+		udelay(4);
+	}
 
 	ret = ssd1307fb_init(par);
 	if (ret)
-- 
2.11.0

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

end of thread, other threads:[~2017-01-17 23:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-16  9:50 [PATCH] fbdev: ssd1307fb: allow reset-gpios is missing Icenowy Zheng
     [not found] ` <20170117042658.QtsSkpPN-/icbEWb855g0PDqKvflMoHmW9unr2Ajn@public.gmane.org>
2017-01-17  7:40   ` Maxime Ripard
2017-01-17 23:29     ` Andy Shevchenko
  -- strict thread matches above, loose matches on Subject: below --
2017-01-17 16:58 Icenowy Zheng
2017-01-15 11:21 Icenowy Zheng
     [not found] ` <20170115112146.1787-1-icenowy-ymACFijhrKM@public.gmane.org>
2017-01-16  8:02   ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox