* [PATCH] fbdev: ssd1307fb: allow reset-gpios is missing
@ 2017-01-15 11:21 Icenowy Zheng
2017-01-16 8:02 ` Maxime Ripard
0 siblings, 1 reply; 11+ 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] 11+ messages in thread
* Re: [PATCH] fbdev: ssd1307fb: allow reset-gpios is missing
@ 2017-01-16 8:02 ` Maxime Ripard
0 siblings, 0 replies; 11+ messages in thread
From: Maxime Ripard @ 2017-01-16 8:02 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Rob Herring, David Airlie, devicetree, linux-kernel, linux-fbdev
[-- Attachment #1: Type: text/plain, Size: 527 bytes --]
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
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] fbdev: ssd1307fb: allow reset-gpios is missing
@ 2017-01-16 8:02 ` Maxime Ripard
0 siblings, 0 replies; 11+ messages in thread
From: Maxime Ripard @ 2017-01-16 8:02 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Rob Herring, David Airlie, devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 547 bytes --]
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-ymACFijhrKM@public.gmane.org>
Unfortunately, a similar patch has been sent a couple of times
already:
https://www.spinics.net/lists/devicetree/msg158330.html
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] fbdev: ssd1307fb: allow reset-gpios is missing
@ 2017-01-16 8:02 ` Maxime Ripard
0 siblings, 0 replies; 11+ messages in thread
From: Maxime Ripard @ 2017-01-16 8:02 UTC (permalink / raw)
To: Icenowy Zheng
Cc: Rob Herring, David Airlie, devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 527 bytes --]
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
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] fbdev: ssd1307fb: allow reset-gpios is missing
2017-01-17 7:40 ` Maxime Ripard
@ 2017-01-17 23:29 ` Andy Shevchenko
-1 siblings, 0 replies; 11+ messages in thread
From: Andy Shevchenko @ 2017-01-17 23:29 UTC (permalink / raw)
To: Maxime Ripard
Cc: Icenowy Zheng, David Airlie, linux-fbdev, Rob Herring,
linux-kernel, devicetree
On Tue, Jan 17, 2017 at 9:40 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> 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.
>
>> There are really boards that needs this function.
>
> Then you can accelerate its inclusion by reviewing it.
Perhaps someone eventually adds drivers/reset/reset-gpio.c and uses
devm_get_reset_optional_exclusive() instead?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] fbdev: ssd1307fb: allow reset-gpios is missing
@ 2017-01-17 23:29 ` Andy Shevchenko
0 siblings, 0 replies; 11+ messages in thread
From: Andy Shevchenko @ 2017-01-17 23:29 UTC (permalink / raw)
To: Maxime Ripard
Cc: Icenowy Zheng, David Airlie, linux-fbdev, Rob Herring,
linux-kernel, devicetree
On Tue, Jan 17, 2017 at 9:40 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> 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.
>
>> There are really boards that needs this function.
>
> Then you can accelerate its inclusion by reviewing it.
Perhaps someone eventually adds drivers/reset/reset-gpio.c and uses
devm_get_reset_optional_exclusive() instead?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] fbdev: ssd1307fb: allow reset-gpios is missing
@ 2017-01-17 16:58 Icenowy Zheng
0 siblings, 0 replies; 11+ 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] 11+ messages in thread
* Re: [PATCH] fbdev: ssd1307fb: allow reset-gpios is missing
@ 2017-01-17 7:40 ` Maxime Ripard
0 siblings, 0 replies; 11+ messages in thread
From: Maxime Ripard @ 2017-01-17 7:40 UTC (permalink / raw)
To: Icenowy Zheng
Cc: David Airlie, linux-fbdev, Rob Herring, linux-kernel, devicetree
[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]
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.
> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] fbdev: ssd1307fb: allow reset-gpios is missing
@ 2017-01-17 7:40 ` Maxime Ripard
0 siblings, 0 replies; 11+ messages in thread
From: Maxime Ripard @ 2017-01-17 7:40 UTC (permalink / raw)
To: Icenowy Zheng
Cc: David Airlie, linux-fbdev-u79uwXL29TY76Z2rM5mHXA, Rob Herring,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]
On Mon, Jan 16, 2017 at 05:50:21PM +0800, Icenowy Zheng wrote:
>
> 2017年1月16日 16:02于 Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>写道:
> >
> > 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-ymACFijhrKM@public.gmane.org>
> >
> > 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.
> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] fbdev: ssd1307fb: allow reset-gpios is missing
@ 2017-01-17 7:40 ` Maxime Ripard
0 siblings, 0 replies; 11+ messages in thread
From: Maxime Ripard @ 2017-01-17 7:40 UTC (permalink / raw)
To: Icenowy Zheng
Cc: David Airlie, linux-fbdev-u79uwXL29TY76Z2rM5mHXA, Rob Herring,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
devicetree-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]
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.
> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] fbdev: ssd1307fb: allow reset-gpios is missing
@ 2017-01-16 9:50 Icenowy Zheng
2017-01-17 7:40 ` Maxime Ripard
0 siblings, 1 reply; 11+ 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] 11+ messages in thread
end of thread, other threads:[~2017-01-17 23:29 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-15 11:21 [PATCH] fbdev: ssd1307fb: allow reset-gpios is missing Icenowy Zheng
2017-01-16 8:02 ` Maxime Ripard
2017-01-16 8:02 ` Maxime Ripard
2017-01-16 8:02 ` Maxime Ripard
2017-01-16 9:50 Icenowy Zheng
2017-01-17 7:40 ` Maxime Ripard
2017-01-17 7:40 ` Maxime Ripard
2017-01-17 7:40 ` Maxime Ripard
2017-01-17 23:29 ` Andy Shevchenko
2017-01-17 23:29 ` Andy Shevchenko
2017-01-17 16:58 Icenowy Zheng
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.