2022-04-12 07:49:32

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings

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 <[email protected]>
Acked-by: Mark Brown <[email protected]>
---

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


2022-04-12 20:10:24

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings

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
> <[email protected]> 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

2022-04-12 20:41:34

by Chen-Yu Tsai

[permalink] [raw]
Subject: Re: [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings

On Tue, Apr 12, 2022 at 5:12 AM Javier Martinez Canillas
<[email protected]> 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 <[email protected]>
> Acked-by: Mark Brown <[email protected]>
> ---
>
> 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

2022-04-12 22:25:33

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings

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

2022-04-12 23:51:30

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings

On Mon, Apr 11, 2022 at 11:12 PM Javier Martinez Canillas
<[email protected]> 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 <[email protected]>
> Acked-by: Mark Brown <[email protected]>

Reviewed-by: Geert Uytterhoeven <[email protected]>

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

2022-04-12 23:54:22

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH v2 1/5] dt-bindings: display: ssd1307fb: Deprecate "-i2c" compatible strings

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 <[email protected]>
> Acked-by: Mark Brown <[email protected]>
> ---
>
> 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