* [PATCH v2 0/5] drm/solomon: Add SSD130x OLED displays SPI support
@ 2022-04-11 21:12 Javier Martinez Canillas
  2022-04-11 21:12 ` [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings Javier Martinez Canillas
  2022-04-11 21:12 ` [PATCH v2 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers Javier Martinez Canillas
  0 siblings, 2 replies; 13+ messages in thread
From: Javier Martinez Canillas @ 2022-04-11 21:12 UTC (permalink / raw)
  To: linux-kernel
  Cc: Rob Herring, dri-devel, Neil Armstrong, Geert Uytterhoeven,
	Mark Brown, Andy Shevchenko, 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 through a SPI.
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 v2 that addresses the issues pointed out in v1.
Best regards,
Javier
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).
- Drop ssd13x_variant_to_info() and just use the array index (Neil Armstrong).
- 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   |  74 +++++--
 drivers/gpu/drm/solomon/Kconfig               |   9 +
 drivers/gpu/drm/solomon/Makefile              |   1 +
 drivers/gpu/drm/solomon/ssd130x-i2c.c         |  64 +++---
 drivers/gpu/drm/solomon/ssd130x-spi.c         | 184 ++++++++++++++++++
 drivers/gpu/drm/solomon/ssd130x.c             |  45 ++++-
 drivers/gpu/drm/solomon/ssd130x.h             |  12 ++
 7 files changed, 332 insertions(+), 57 deletions(-)
 create mode 100644 drivers/gpu/drm/solomon/ssd130x-spi.c
-- 
2.35.1
^ permalink raw reply	[flat|nested] 13+ messages in thread* [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings 2022-04-11 21:12 [PATCH v2 0/5] drm/solomon: Add SSD130x OLED displays SPI support Javier Martinez Canillas @ 2022-04-11 21:12 ` Javier Martinez Canillas 2022-04-12 7:13 ` Geert Uytterhoeven ` (2 more replies) 2022-04-11 21:12 ` [PATCH v2 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers Javier Martinez Canillas 1 sibling, 3 replies; 13+ messages in thread From: Javier Martinez Canillas @ 2022-04-11 21:12 UTC (permalink / raw) To: linux-kernel Cc: Rob Herring, dri-devel, Neil Armstrong, Geert Uytterhoeven, Mark Brown, Andy Shevchenko, Chen-Yu Tsai, Javier Martinez Canillas, 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. Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> Acked-by: Mark Brown <broonie@kernel.org> --- Changes in v2: - Drop the -i2c suffixes from the compatible strings too (Geert Uytterhoeven). .../bindings/display/solomon,ssd1307fb.yaml | 37 ++++++++++++------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml index ade61d502edd..6b9d0c72739a 100644 --- a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml +++ b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml @@ -12,12 +12,23 @@ 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: + - sinowealth,sh1106-i2c + - 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 +147,7 @@ allOf: properties: compatible: contains: - const: sinowealth,sh1106-i2c + const: sinowealth,sh1106 then: properties: solomon,dclk-div: @@ -148,7 +159,7 @@ allOf: properties: compatible: contains: - const: solomon,ssd1305fb-i2c + const: solomon,ssd1305 then: properties: solomon,dclk-div: @@ -160,7 +171,7 @@ allOf: properties: compatible: contains: - const: solomon,ssd1306fb-i2c + const: solomon,ssd1306 then: properties: solomon,dclk-div: @@ -172,7 +183,7 @@ allOf: properties: compatible: contains: - const: solomon,ssd1307fb-i2c + const: solomon,ssd1307 then: properties: solomon,dclk-div: @@ -186,7 +197,7 @@ allOf: properties: compatible: contains: - const: solomon,ssd1309fb-i2c + const: solomon,ssd1309 then: properties: solomon,dclk-div: @@ -203,14 +214,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] 13+ messages in thread
* Re: [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings 2022-04-11 21:12 ` [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings Javier Martinez Canillas @ 2022-04-12 7:13 ` Geert Uytterhoeven 2022-04-12 11:28 ` Maxime Ripard 2022-04-12 12:07 ` Chen-Yu Tsai 2 siblings, 0 replies; 13+ messages in thread From: Geert Uytterhoeven @ 2022-04-12 7:13 UTC (permalink / raw) To: Javier Martinez Canillas Cc: Linux Kernel Mailing List, Rob Herring, DRI Development, Neil Armstrong, Mark Brown, Andy Shevchenko, Chen-Yu Tsai, Daniel Vetter, David Airlie, Krzysztof Kozlowski, Maxime Ripard, Rob Herring, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS On Mon, Apr 11, 2022 at 11:12 PM Javier Martinez Canillas <javierm@redhat.com> wrote: > 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. > > Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> > Acked-by: Mark Brown <broonie@kernel.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> 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] 13+ messages in thread
* Re: [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings 2022-04-11 21:12 ` [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings Javier Martinez Canillas 2022-04-12 7:13 ` Geert Uytterhoeven @ 2022-04-12 11:28 ` Maxime Ripard 2022-04-12 12:48 ` Javier Martinez Canillas 2022-04-12 12:07 ` Chen-Yu Tsai 2 siblings, 1 reply; 13+ messages in thread From: Maxime Ripard @ 2022-04-12 11:28 UTC (permalink / raw) To: Javier Martinez Canillas Cc: linux-kernel, Rob Herring, dri-devel, Neil Armstrong, Geert Uytterhoeven, Mark Brown, Andy Shevchenko, Chen-Yu Tsai, Daniel Vetter, David Airlie, Krzysztof Kozlowski, Rob Herring, devicetree On Mon, Apr 11, 2022 at 11:12:39PM +0200, Javier Martinez Canillas wrote: > 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. > > Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> > Acked-by: Mark Brown <broonie@kernel.org> > --- > > Changes in v2: > - Drop the -i2c suffixes from the compatible strings too (Geert Uytterhoeven). > > .../bindings/display/solomon,ssd1307fb.yaml | 37 ++++++++++++------- > 1 file changed, 24 insertions(+), 13 deletions(-) > > diff --git a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml > index ade61d502edd..6b9d0c72739a 100644 > --- a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml > +++ b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml > @@ -12,12 +12,23 @@ 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: > + - sinowealth,sh1106-i2c > + - 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 +147,7 @@ allOf: > properties: > compatible: > contains: > - const: sinowealth,sh1106-i2c > + const: sinowealth,sh1106 I think we should have both in the condition here, but it looks good otherwise. Maxime ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings 2022-04-12 11:28 ` Maxime Ripard @ 2022-04-12 12:48 ` Javier Martinez Canillas 0 siblings, 0 replies; 13+ messages in thread From: Javier Martinez Canillas @ 2022-04-12 12:48 UTC (permalink / raw) To: Maxime Ripard Cc: linux-kernel, Rob Herring, dri-devel, Neil Armstrong, Geert Uytterhoeven, Mark Brown, Andy Shevchenko, Chen-Yu Tsai, Daniel Vetter, David Airlie, Krzysztof Kozlowski, Rob Herring, devicetree Hello Maxime, On 4/12/22 13:28, Maxime Ripard wrote: > On Mon, Apr 11, 2022 at 11:12:39PM +0200, Javier Martinez Canillas wrote: [snip] >> >> reg: >> maxItems: 1 >> @@ -136,7 +147,7 @@ allOf: >> properties: >> compatible: >> contains: >> - const: sinowealth,sh1106-i2c >> + const: sinowealth,sh1106 > > I think we should have both in the condition here, but it looks good > otherwise. > Right, we want to keep enforcing for the deprecated compatible strings. > Maxime > -- Best regards, Javier Martinez Canillas Linux Engineering Red Hat ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings 2022-04-11 21:12 ` [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings Javier Martinez Canillas 2022-04-12 7:13 ` Geert Uytterhoeven 2022-04-12 11:28 ` Maxime Ripard @ 2022-04-12 12:07 ` Chen-Yu Tsai 2022-04-12 12:49 ` Javier Martinez Canillas 2 siblings, 1 reply; 13+ messages in thread From: Chen-Yu Tsai @ 2022-04-12 12:07 UTC (permalink / raw) To: Javier Martinez Canillas Cc: linux-kernel, Rob Herring, dri-devel, Neil Armstrong, Geert Uytterhoeven, Mark Brown, Andy Shevchenko, Daniel Vetter, David Airlie, Krzysztof Kozlowski, Maxime Ripard, Rob Herring, devicetree On Tue, Apr 12, 2022 at 5:12 AM Javier Martinez Canillas <javierm@redhat.com> wrote: > > 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. > > Signed-off-by: Javier Martinez Canillas <javierm@redhat.com> > Acked-by: Mark Brown <broonie@kernel.org> > --- > > Changes in v2: > - Drop the -i2c suffixes from the compatible strings too (Geert Uytterhoeven). > > .../bindings/display/solomon,ssd1307fb.yaml | 37 ++++++++++++------- > 1 file changed, 24 insertions(+), 13 deletions(-) > > diff --git a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml > index ade61d502edd..6b9d0c72739a 100644 > --- a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml > +++ b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml > @@ -12,12 +12,23 @@ 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: > + - sinowealth,sh1106-i2c I think you can just drop this one, since it was just merged and isn't part of any release yet. It's not even in -rc. ChenYu ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings 2022-04-12 12:07 ` Chen-Yu Tsai @ 2022-04-12 12:49 ` Javier Martinez Canillas 0 siblings, 0 replies; 13+ messages in thread From: Javier Martinez Canillas @ 2022-04-12 12:49 UTC (permalink / raw) To: wens Cc: Neil Armstrong, David Airlie, linux-kernel, dri-devel, Rob Herring, devicetree, Mark Brown, Geert Uytterhoeven, Krzysztof Kozlowski, Andy Shevchenko Hello Chen-Yu, On 4/12/22 14:07, Chen-Yu Tsai wrote: > On Tue, Apr 12, 2022 at 5:12 AM Javier Martinez Canillas > <javierm@redhat.com> wrote: [snip] > > I think you can just drop this one, since it was just merged and isn't > part of any release yet. It's not even in -rc. > I believe you are correct and we could just drop that one. > ChenYu > -- Best regards, Javier Martinez Canillas Linux Engineering Red Hat ^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v2 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers 2022-04-11 21:12 [PATCH v2 0/5] drm/solomon: Add SSD130x OLED displays SPI support Javier Martinez Canillas 2022-04-11 21:12 ` [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings Javier Martinez Canillas @ 2022-04-11 21:12 ` Javier Martinez Canillas 2022-04-12 7:16 ` Geert Uytterhoeven 1 sibling, 1 reply; 13+ messages in thread From: Javier Martinez Canillas @ 2022-04-11 21:12 UTC (permalink / raw) To: linux-kernel Cc: Rob Herring, dri-devel, Neil Armstrong, Geert Uytterhoeven, Mark Brown, Andy Shevchenko, Chen-Yu Tsai, Javier Martinez Canillas, 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> --- Changes in v2: - Don't add compatible strings with an "-spi" suffix (Geert Uytterhoeven). .../bindings/display/solomon,ssd1307fb.yaml | 37 ++++++++++++++++++- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml index 6b9d0c72739a..b58d2d7bd8c1 100644 --- a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml +++ b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml @@ -39,9 +39,14 @@ properties: reset-gpios: maxItems: 1 + dc-gpios: + maxItems: 1 + vbat-supply: description: The supply for VBAT + spi-max-frequency: true + solomon,height: $ref: /schemas/types.yaml#/definitions/uint32 default: 16 @@ -160,6 +165,7 @@ allOf: compatible: contains: const: solomon,ssd1305 + then: properties: solomon,dclk-div: @@ -213,14 +219,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>; @@ -231,3 +237,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] 13+ messages in thread
* Re: [PATCH v2 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers 2022-04-11 21:12 ` [PATCH v2 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers Javier Martinez Canillas @ 2022-04-12 7:16 ` Geert Uytterhoeven 2022-04-12 8:01 ` Javier Martinez Canillas 0 siblings, 1 reply; 13+ messages in thread From: Geert Uytterhoeven @ 2022-04-12 7:16 UTC (permalink / raw) To: Javier Martinez Canillas Cc: Linux Kernel Mailing List, Rob Herring, DRI Development, Neil Armstrong, Mark Brown, Andy Shevchenko, Chen-Yu Tsai, Daniel Vetter, David Airlie, Krzysztof Kozlowski, Maxime Ripard, Rob Herring, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS Hi Javier, On Mon, Apr 11, 2022 at 11:12 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> > --- > > Changes in v2: > - Don't add compatible strings with an "-spi" suffix (Geert Uytterhoeven). Thanks for the update! > --- a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml > +++ b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml > @@ -39,9 +39,14 @@ properties: > reset-gpios: > maxItems: 1 > > + dc-gpios: > + maxItems: 1 > + Perhaps add a description, and clarify this is for SPI only? Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> 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] 13+ messages in thread
* Re: [PATCH v2 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers 2022-04-12 7:16 ` Geert Uytterhoeven @ 2022-04-12 8:01 ` Javier Martinez Canillas 2022-04-12 8:07 ` Geert Uytterhoeven 0 siblings, 1 reply; 13+ messages in thread From: Javier Martinez Canillas @ 2022-04-12 8:01 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Linux Kernel Mailing List, Rob Herring, DRI Development, Neil Armstrong, Mark Brown, Andy Shevchenko, Chen-Yu Tsai, Daniel Vetter, David Airlie, Krzysztof Kozlowski, Maxime Ripard, Rob Herring, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS Hello Geert, On 4/12/22 09:16, Geert Uytterhoeven wrote: > Hi Javier, > > On Mon, Apr 11, 2022 at 11:12 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> >> --- >> >> Changes in v2: >> - Don't add compatible strings with an "-spi" suffix (Geert Uytterhoeven). > > Thanks for the update! > You are welcome and thanks for your prompt review and feedback! >> --- a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml >> +++ b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml >> @@ -39,9 +39,14 @@ properties: >> reset-gpios: >> maxItems: 1 >> >> + dc-gpios: >> + maxItems: 1 >> + > > Perhaps add a description, and clarify this is for SPI only? > I wondered how to make it required for SPI but couldn't find another binding that did the same and I'm not that familiar with DT schemas to figure it out. Before, when I had compatible strings just for SPI I could do the following: - if: properties: compatible: contains: enum: - sinowealth,sh1106-spi - solomon,ssd1305-spi - solomon,ssd1306-spi - solomon,ssd1307-spi - solomon,ssd1309-spi then: required: - spi-max-frequency - dc-gpios but now that we are using the same compatible strings for I2C and SPI, the compatible string can't be used anymore as an indication to make required. Do you have any hints here on how I should enforce this in the schema ? Or if you think that a comment is enough, then I will add it in v3. > Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> > Thanks! -- Best regards, Javier Martinez Canillas Linux Engineering Red Hat ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers 2022-04-12 8:01 ` Javier Martinez Canillas @ 2022-04-12 8:07 ` Geert Uytterhoeven 2022-04-12 8:12 ` Javier Martinez Canillas 0 siblings, 1 reply; 13+ messages in thread From: Geert Uytterhoeven @ 2022-04-12 8:07 UTC (permalink / raw) To: Javier Martinez Canillas Cc: Linux Kernel Mailing List, Rob Herring, DRI Development, Neil Armstrong, Mark Brown, Andy Shevchenko, Chen-Yu Tsai, 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 10:01 AM Javier Martinez Canillas <javierm@redhat.com> wrote: > On 4/12/22 09:16, Geert Uytterhoeven wrote: > > On Mon, Apr 11, 2022 at 11:12 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> > >> --- a/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml > >> +++ b/Documentation/devicetree/bindings/display/solomon,ssd1307fb.yaml > >> @@ -39,9 +39,14 @@ properties: > >> reset-gpios: > >> maxItems: 1 > >> > >> + dc-gpios: > >> + maxItems: 1 > >> + > > > > Perhaps add a description, and clarify this is for SPI only? > > I wondered how to make it required for SPI but couldn't find another binding > that did the same and I'm not that familiar with DT schemas to figure it out. > > Before, when I had compatible strings just for SPI I could do the following: > > - if: > properties: > compatible: > contains: > enum: > - sinowealth,sh1106-spi > - solomon,ssd1305-spi > - solomon,ssd1306-spi > - solomon,ssd1307-spi > - solomon,ssd1309-spi > then: > required: > - spi-max-frequency > - dc-gpios > > but now that we are using the same compatible strings for I2C and SPI, the > compatible string can't be used anymore as an indication to make required. > > Do you have any hints here on how I should enforce this in the schema ? > > Or if you think that a comment is enough, then I will add it in v3. I don't know how to make it required for SPI, if possible at all. 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] 13+ messages in thread
* Re: [PATCH v2 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers 2022-04-12 8:07 ` Geert Uytterhoeven @ 2022-04-12 8:12 ` Javier Martinez Canillas 2022-04-12 18:16 ` Rob Herring 0 siblings, 1 reply; 13+ messages in thread From: Javier Martinez Canillas @ 2022-04-12 8:12 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Linux Kernel Mailing List, Rob Herring, DRI Development, Neil Armstrong, Mark Brown, Andy Shevchenko, Chen-Yu Tsai, Daniel Vetter, David Airlie, Krzysztof Kozlowski, Maxime Ripard, Rob Herring, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS On 4/12/22 10:07, Geert Uytterhoeven wrote: > Hi Javier, [snip] >> >> Do you have any hints here on how I should enforce this in the schema ? >> >> Or if you think that a comment is enough, then I will add it in v3. > > I don't know how to make it required for SPI, if possible at all. > I see. Let's go with a comment then and we can later enforce it, if someone knows if is possible / how to do it. -- Best regards, Javier Martinez Canillas Linux Engineering Red Hat ^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v2 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers 2022-04-12 8:12 ` Javier Martinez Canillas @ 2022-04-12 18:16 ` Rob Herring 0 siblings, 0 replies; 13+ messages in thread From: Rob Herring @ 2022-04-12 18:16 UTC (permalink / raw) To: Javier Martinez Canillas Cc: Geert Uytterhoeven, Linux Kernel Mailing List, DRI Development, Neil Armstrong, Mark Brown, Andy Shevchenko, Chen-Yu Tsai, Daniel Vetter, David Airlie, Krzysztof Kozlowski, Maxime Ripard, open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS On Tue, Apr 12, 2022 at 10:12:32AM +0200, Javier Martinez Canillas wrote: > On 4/12/22 10:07, Geert Uytterhoeven wrote: > > Hi Javier, > > [snip] > > >> > >> Do you have any hints here on how I should enforce this in the schema ? > >> > >> Or if you think that a comment is enough, then I will add it in v3. > > > > I don't know how to make it required for SPI, if possible at all. > > > > I see. Let's go with a comment then and we can later enforce it, if someone > knows if is possible / how to do it. It's not possible unless we annotate child nodes with something from the parent. '$nodename' is the one and only example of that. Really, this falls below the bar of what I'm concerned about checking. Ask me again when the conversions are all done (only ~2K to go :( ). Rob ^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2022-04-12 18:17 UTC | newest] Thread overview: 13+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-04-11 21:12 [PATCH v2 0/5] drm/solomon: Add SSD130x OLED displays SPI support Javier Martinez Canillas 2022-04-11 21:12 ` [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings Javier Martinez Canillas 2022-04-12 7:13 ` Geert Uytterhoeven 2022-04-12 11:28 ` Maxime Ripard 2022-04-12 12:48 ` Javier Martinez Canillas 2022-04-12 12:07 ` Chen-Yu Tsai 2022-04-12 12:49 ` Javier Martinez Canillas 2022-04-11 21:12 ` [PATCH v2 2/5] dt-bindings: display: ssd1307fb: Extend schema for SPI controllers Javier Martinez Canillas 2022-04-12 7:16 ` Geert Uytterhoeven 2022-04-12 8:01 ` Javier Martinez Canillas 2022-04-12 8:07 ` Geert Uytterhoeven 2022-04-12 8:12 ` Javier Martinez Canillas 2022-04-12 18:16 ` Rob Herring
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).