* [PATCH v3 0/5] drm/solomon: Add SSD130x OLED displays SPI support
@ 2022-04-12 16:27 Javier Martinez Canillas
2022-04-12 16:27 ` [PATCH v3 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings Javier Martinez Canillas
2022-04-12 16:27 ` [PATCH v3 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers Javier Martinez Canillas
0 siblings, 2 replies; 6+ messages in thread
From: Javier Martinez Canillas @ 2022-04-12 16:27 UTC (permalink / raw)
To: linux-kernel
Cc: Geert Uytterhoeven, Neil Armstrong, Rob Herring, Andy Shevchenko,
dri-devel, Mark Brown, Chen-Yu Tsai, Javier Martinez Canillas,
Chen-Yu Tsai, Daniel Vetter, David Airlie, Krzysztof Kozlowski,
Maxime Ripard, Maxime Ripard, Rob Herring, YueHaibing, devicetree
Hello,
This series adds a ssd130x-spi driver that provides a 4-wire SPI transport
support for SSD130x OLED controllers that can be accessed over a SPI bus.
The driver is quite similar to existing ssd130x-i2c driver that is used by
I2C controllers, but there is a difference in the protocol used by SSD130x
depending on the transport used. The details are in patch #4 description.
Patch #1 just makes the current ssd130x-i2c compatible strings in the DT
binding to be deprecated, and add new ones that don't have an "fb-i2c".
Patch #2 extends the DT binding with the properties needed to support SPI.
Patch #3 adds the new compatible strings to the OF device ID table in the
ssd130x-i2c DRM driver and deprecate the old ones.
Patch #4 moves the device info for the different SSD130x variants from
the ssd130x-i2c transport driver to the ssd130x core driver.
Finally patch #5 adds the ssd130x-spi DRM driver for the OLED controllers
that come with a 4-wire SPI interface, instead of an I2C interface.
This is a v3 that addresses the issues pointed out in v2.
Best regards,
Javier
Changes in v3:
- Drop the "sinowealth,sh1106-i2c", wasn't in a released version (Chen-Yu Tsai)
- Continue enforcing required properties for deprecated strings (Maxime Ripard)
- Add a comment to the properties required for SPI (Geert Uytterhoeven)
- Drop the "sinowealth,sh1106-i2c", wasn't in a released version (Chen-Yu Tsai)
- s/it/they in the commit description (Geert Uytterhoeven)
- Drop unnecessary blank line (Geert Uytterhoeven)
- Export variants array and use &info[ID] in device table (Andy Shevchenko)
- Drop ssd130x_spi_get_dc() helper and open code it (Geert Uytterhoeven)
- Export variants array and use &info[ID] in device table (Andy Shevchenko)
- Add Geert Uytterhoeven's Reviewed-by tag to patches.
Changes in v2:
- Drop the -i2c suffixes from the compatible strings too (Geert Uytterhoeven)
- Don't add compatible strings with an "-spi" suffix (Geert Uytterhoeven)
- Use the compatible strings that don't have "fb-i2c" (Geert Uytterhoeven).
- Drop ssd13x_variant_to_info() and just use the array index (Neil Armstrong).
- Add the same compatible strings than I2C (Geert Uytterhoeven)
- Add Mark Brown's Acked-by tag to all patches.
Javier Martinez Canillas (5):
dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings
dt-bindings: display: ssd1307fb: Extend schema for SPI controllers
drm/solomon: Add ssd130x new compatible strings and deprecate old
ones.
drm/solomon: Move device info from ssd130x-i2c to the core driver
drm/solomon: Add SSD130x OLED displays SPI support
.../bindings/display/solomon,ssd1307fb.yaml | 82 ++++++--
drivers/gpu/drm/solomon/Kconfig | 9 +
drivers/gpu/drm/solomon/Makefile | 1 +
drivers/gpu/drm/solomon/ssd130x-i2c.c | 62 +++---
drivers/gpu/drm/solomon/ssd130x-spi.c | 177 ++++++++++++++++++
drivers/gpu/drm/solomon/ssd130x.c | 36 +++-
drivers/gpu/drm/solomon/ssd130x.h | 14 ++
7 files changed, 324 insertions(+), 57 deletions(-)
create mode 100644 drivers/gpu/drm/solomon/ssd130x-spi.c
--
2.35.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v3 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings
2022-04-12 16:27 [PATCH v3 0/5] drm/solomon: Add SSD130x OLED displays SPI support Javier Martinez Canillas
@ 2022-04-12 16:27 ` Javier Martinez Canillas
2022-04-12 16:27 ` [PATCH v3 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers Javier Martinez Canillas
1 sibling, 0 replies; 6+ messages in thread
From: Javier Martinez Canillas @ 2022-04-12 16:27 UTC (permalink / raw)
To: linux-kernel
Cc: Geert Uytterhoeven, Neil Armstrong, Rob Herring, Andy Shevchenko,
dri-devel, Mark Brown, Chen-Yu Tsai, Javier Martinez Canillas,
Geert Uytterhoeven, Daniel Vetter, David Airlie,
Krzysztof Kozlowski, Maxime Ripard, Rob Herring, devicetree
The current compatible strings for SSD130x I2C controllers contain both an
"fb" and "-i2c" suffixes. It seems to indicate that are for a fbdev driver
and also that are for devices that can be accessed over an I2C bus.
But a DT is supposed to describe the hardware and not Linux implementation
details. So let's deprecate those compatible strings and add new ones that
only contain the vendor and device name, without any of these suffixes.
These will just describe the device and can be matched by both I2C and SPI
DRM drivers. The required properties should still be enforced for old ones.
While being there, just drop the "sinowealth,sh1106-i2c" compatible string
since that was never present in a released Linux version.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Changes in v3:
- Drop the "sinowealth,sh1106-i2c", wasn't in a released version (Chen-Yu Tsai)
- Continue enforcing required properties for deprecated strings (Maxime Ripard)
Changes in v2:
- Drop the -i2c suffixes from the compatible strings too (Geert Uytterhoeven)
.../bindings/display/solomon,ssd1307fb.yaml | 44 +++++++++++++------
1 file changed, 31 insertions(+), 13 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
index ade61d502edd..7653b6c3fcb6 100644
--- a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
+++ b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
@@ -12,12 +12,22 @@ maintainers:
properties:
compatible:
- enum:
- - sinowealth,sh1106-i2c
- - solomon,ssd1305fb-i2c
- - solomon,ssd1306fb-i2c
- - solomon,ssd1307fb-i2c
- - solomon,ssd1309fb-i2c
+ oneOf:
+ # Deprecated compatible strings
+ - items:
+ - enum:
+ - solomon,ssd1305fb-i2c
+ - solomon,ssd1306fb-i2c
+ - solomon,ssd1307fb-i2c
+ - solomon,ssd1309fb-i2c
+ deprecated: true
+ - items:
+ - enum:
+ - sinowealth,sh1106
+ - solomon,ssd1305
+ - solomon,ssd1306
+ - solomon,ssd1307
+ - solomon,ssd1309
reg:
maxItems: 1
@@ -136,7 +146,7 @@ allOf:
properties:
compatible:
contains:
- const: sinowealth,sh1106-i2c
+ const: sinowealth,sh1106
then:
properties:
solomon,dclk-div:
@@ -148,7 +158,9 @@ allOf:
properties:
compatible:
contains:
- const: solomon,ssd1305fb-i2c
+ enum:
+ - solomon,ssd1305-i2c
+ - solomon,ssd1305
then:
properties:
solomon,dclk-div:
@@ -160,7 +172,9 @@ allOf:
properties:
compatible:
contains:
- const: solomon,ssd1306fb-i2c
+ enum:
+ - solomon,ssd1306-i2c
+ - solomon,ssd1306
then:
properties:
solomon,dclk-div:
@@ -172,7 +186,9 @@ allOf:
properties:
compatible:
contains:
- const: solomon,ssd1307fb-i2c
+ enum:
+ - solomon,ssd1307-i2c
+ - solomon,ssd1307
then:
properties:
solomon,dclk-div:
@@ -186,7 +202,9 @@ allOf:
properties:
compatible:
contains:
- const: solomon,ssd1309fb-i2c
+ enum:
+ - solomon,ssd1309-i2c
+ - solomon,ssd1309
then:
properties:
solomon,dclk-div:
@@ -203,14 +221,14 @@ examples:
#size-cells = <0>;
ssd1307: oled@3c {
- compatible = "solomon,ssd1307fb-i2c";
+ compatible = "solomon,ssd1307";
reg = <0x3c>;
pwms = <&pwm 4 3000>;
reset-gpios = <&gpio2 7>;
};
ssd1306: oled@3d {
- compatible = "solomon,ssd1306fb-i2c";
+ compatible = "solomon,ssd1306";
reg = <0x3c>;
pwms = <&pwm 4 3000>;
reset-gpios = <&gpio2 7>;
--
2.35.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH v3 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers
2022-04-12 16:27 [PATCH v3 0/5] drm/solomon: Add SSD130x OLED displays SPI support Javier Martinez Canillas
2022-04-12 16:27 ` [PATCH v3 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings Javier Martinez Canillas
@ 2022-04-12 16:27 ` Javier Martinez Canillas
2022-04-13 8:04 ` Geert Uytterhoeven
1 sibling, 1 reply; 6+ messages in thread
From: Javier Martinez Canillas @ 2022-04-12 16:27 UTC (permalink / raw)
To: linux-kernel
Cc: Geert Uytterhoeven, Neil Armstrong, Rob Herring, Andy Shevchenko,
dri-devel, Mark Brown, Chen-Yu Tsai, Javier Martinez Canillas,
Geert Uytterhoeven, Daniel Vetter, David Airlie,
Krzysztof Kozlowski, Maxime Ripard, Rob Herring, devicetree
The Solomon SSD130x OLED displays can either have an I2C or SPI interface,
add to the schema the properties and examples for OLED devices under SPI.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Acked-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Changes in v3:
- Add a comment to the properties required for SPI (Geert Uytterhoeven)
Changes in v2:
- Don't add compatible strings with an "-spi" suffix (Geert Uytterhoeven)
.../bindings/display/solomon,ssd1307fb.yaml | 38 ++++++++++++++++++-
1 file changed, 36 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
index 7653b6c3fcb6..7d7de92df86f 100644
--- a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
+++ b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
@@ -38,9 +38,16 @@ properties:
reset-gpios:
maxItems: 1
+ # Only required for SPI
+ dc-gpios:
+ maxItems: 1
+
vbat-supply:
description: The supply for VBAT
+ # Only required for SPI
+ spi-max-frequency: true
+
solomon,height:
$ref: /schemas/types.yaml#/definitions/uint32
default: 16
@@ -220,14 +227,14 @@ examples:
#address-cells = <1>;
#size-cells = <0>;
- ssd1307: oled@3c {
+ ssd1307_i2c: oled@3c {
compatible = "solomon,ssd1307";
reg = <0x3c>;
pwms = <&pwm 4 3000>;
reset-gpios = <&gpio2 7>;
};
- ssd1306: oled@3d {
+ ssd1306_i2c: oled@3d {
compatible = "solomon,ssd1306";
reg = <0x3c>;
pwms = <&pwm 4 3000>;
@@ -238,3 +245,30 @@ examples:
solomon,lookup-table = /bits/ 8 <0x3f 0x3f 0x3f 0x3f>;
};
};
+ - |
+ spi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ ssd1307_spi: oled@0 {
+ compatible = "solomon,ssd1307";
+ reg = <0x0>;
+ pwms = <&pwm 4 3000>;
+ reset-gpios = <&gpio2 7>;
+ dc-gpios = <&gpio2 8>;
+ spi-max-frequency = <10000000>;
+ };
+
+ ssd1306_spi: oled@1 {
+ compatible = "solomon,ssd1306";
+ reg = <0x1>;
+ pwms = <&pwm 4 3000>;
+ reset-gpios = <&gpio2 7>;
+ dc-gpios = <&gpio2 8>;
+ spi-max-frequency = <10000000>;
+ solomon,com-lrremap;
+ solomon,com-invdir;
+ solomon,com-offset = <32>;
+ solomon,lookup-table = /bits/ 8 <0x3f 0x3f 0x3f 0x3f>;
+ };
+ };
--
2.35.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v3 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers
2022-04-12 16:27 ` [PATCH v3 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers Javier Martinez Canillas
@ 2022-04-13 8:04 ` Geert Uytterhoeven
2022-04-13 9:44 ` Javier Martinez Canillas
0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2022-04-13 8:04 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: Linux Kernel Mailing List, Neil Armstrong, Rob Herring,
Andy Shevchenko, DRI Development, Mark Brown, Chen-Yu Tsai,
Geert Uytterhoeven, Daniel Vetter, David Airlie,
Krzysztof Kozlowski, Maxime Ripard, Rob Herring,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
Hi Javier,
On Tue, Apr 12, 2022 at 6:27 PM Javier Martinez Canillas
<javierm@redhat.com> wrote:
> The Solomon SSD130x OLED displays can either have an I2C or SPI interface,
> add to the schema the properties and examples for OLED devices under SPI.
>
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> Acked-by: Mark Brown <broonie@kernel.org>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>
> Changes in v3:
> - Add a comment to the properties required for SPI (Geert Uytterhoeven)
Thanks for the update!
> --- a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
> +++ b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
> @@ -38,9 +38,16 @@ properties:
> reset-gpios:
> maxItems: 1
>
> + # Only required for SPI
> + dc-gpios:
> + maxItems: 1
Actually I meant to also add a description, like for vbat-supply below,
to explain the meaning of "dc".
> +
> vbat-supply:
> description: The supply for VBAT
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers
2022-04-13 8:04 ` Geert Uytterhoeven
@ 2022-04-13 9:44 ` Javier Martinez Canillas
2022-04-13 10:38 ` Geert Uytterhoeven
0 siblings, 1 reply; 6+ messages in thread
From: Javier Martinez Canillas @ 2022-04-13 9:44 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Linux Kernel Mailing List, Neil Armstrong, Rob Herring,
Andy Shevchenko, DRI Development, Mark Brown, Chen-Yu Tsai,
Geert Uytterhoeven, Daniel Vetter, David Airlie,
Krzysztof Kozlowski, Maxime Ripard, Rob Herring,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
Hello Geert,
On 4/13/22 10:04, Geert Uytterhoeven wrote:
> Hi Javier,
>
> On Tue, Apr 12, 2022 at 6:27 PM Javier Martinez Canillas
> <javierm@redhat.com> wrote:
>> The Solomon SSD130x OLED displays can either have an I2C or SPI interface,
>> add to the schema the properties and examples for OLED devices under SPI.
>>
>> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
>> Acked-by: Mark Brown <broonie@kernel.org>
>> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> ---
>>
>> Changes in v3:
>> - Add a comment to the properties required for SPI (Geert Uytterhoeven)
>
> Thanks for the update!
>
>> --- a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
>> +++ b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
>> @@ -38,9 +38,16 @@ properties:
>> reset-gpios:
>> maxItems: 1
>>
>> + # Only required for SPI
>> + dc-gpios:
>> + maxItems: 1
>
> Actually I meant to also add a description, like for vbat-supply below,
> to explain the meaning of "dc".
>
Ahh, sorry for misunderstanding you! Something like the following looks good ?
# Only required for SPI
dc-gpios:
description:
GPIO connected to the controller's D/C# (Data/Command) pin,
that is needed for 4-wire SPI to tell the controller if the
data sent is for a command register or the display data RAM
maxItems: 1
If you agree with that, then can squash before pushing or add it to a v4
if another revision is needed.
--
Best regards,
Javier Martinez Canillas
Linux Engineering
Red Hat
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers
2022-04-13 9:44 ` Javier Martinez Canillas
@ 2022-04-13 10:38 ` Geert Uytterhoeven
0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2022-04-13 10:38 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: Linux Kernel Mailing List, Neil Armstrong, Rob Herring,
Andy Shevchenko, DRI Development, Mark Brown, Chen-Yu Tsai,
Geert Uytterhoeven, Daniel Vetter, David Airlie,
Krzysztof Kozlowski, Maxime Ripard, Rob Herring,
open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
Hi Javier,
On Wed, Apr 13, 2022 at 11:44 AM Javier Martinez Canillas
<javierm@redhat.com> wrote:
> On 4/13/22 10:04, Geert Uytterhoeven wrote:
> > On Tue, Apr 12, 2022 at 6:27 PM Javier Martinez Canillas
> > <javierm@redhat.com> wrote:
> >> The Solomon SSD130x OLED displays can either have an I2C or SPI interface,
> >> add to the schema the properties and examples for OLED devices under SPI.
> >>
> >> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
> >> Acked-by: Mark Brown <broonie@kernel.org>
> >> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
> >> ---
> >>
> >> Changes in v3:
> >> - Add a comment to the properties required for SPI (Geert Uytterhoeven)
> >
> > Thanks for the update!
> >
> >> --- a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
> >> +++ b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml
> >> @@ -38,9 +38,16 @@ properties:
> >> reset-gpios:
> >> maxItems: 1
> >>
> >> + # Only required for SPI
> >> + dc-gpios:
> >> + maxItems: 1
> >
> > Actually I meant to also add a description, like for vbat-supply below,
> > to explain the meaning of "dc".
> >
>
> Ahh, sorry for misunderstanding you! Something like the following looks good ?
>
> # Only required for SPI
> dc-gpios:
> description:
> GPIO connected to the controller's D/C# (Data/Command) pin,
> that is needed for 4-wire SPI to tell the controller if the
> data sent is for a command register or the display data RAM
> maxItems: 1
>
> If you agree with that, then can squash before pushing or add it to a v4
> if another revision is needed.
Thanks, LGTM.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-04-13 10:38 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-12 16:27 [PATCH v3 0/5] drm/solomon: Add SSD130x OLED displays SPI support Javier Martinez Canillas
2022-04-12 16:27 ` [PATCH v3 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings Javier Martinez Canillas
2022-04-12 16:27 ` [PATCH v3 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers Javier Martinez Canillas
2022-04-13 8:04 ` Geert Uytterhoeven
2022-04-13 9:44 ` Javier Martinez Canillas
2022-04-13 10:38 ` Geert Uytterhoeven
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).