2022-12-13 18:47:25

by Konrad Dybcio

[permalink] [raw]
Subject: [PATCH v2 1/6] dt-bindings: i2c: qcom,i2c-cci: Fall back to common compatibles

Almost every compatible string in the CCI driver is a duplicate. Adjust
the bindings to include a common (first-soc-implementing-vX) compatible
to remove the need to keep adding superfluous compatible strings.

Signed-off-by: Konrad Dybcio <[email protected]>
---
Changes in v2:
- make sure the actual patch contests are tested..
- resolve errors

.../devicetree/bindings/i2c/qcom,i2c-cci.yaml | 47 ++++++++++++-------
1 file changed, 30 insertions(+), 17 deletions(-)

diff --git a/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml b/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
index cf9f8fda595f..87e414f0c39c 100644
--- a/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
+++ b/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
@@ -12,14 +12,23 @@ maintainers:

properties:
compatible:
- enum:
- - qcom,msm8226-cci
- - qcom,msm8916-cci
- - qcom,msm8974-cci
- - qcom,msm8996-cci
- - qcom,sdm845-cci
- - qcom,sm8250-cci
- - qcom,sm8450-cci
+ oneOf:
+ - enum:
+ - qcom,msm8226-cci
+ - qcom,msm8974-cci
+ - qcom,msm8996-cci
+
+ - items:
+ - enum:
+ - qcom,msm8916-cci
+ - const: qcom,msm8226-cci # CCI v1
+
+ - items:
+ - enum:
+ - qcom,sdm845-cci
+ - qcom,sm8250-cci
+ - qcom,sm8450-cci
+ - const: qcom,msm8996-cci # CCI v2

"#address-cells":
const: 1
@@ -88,10 +97,12 @@ allOf:
- if:
properties:
compatible:
- contains:
- enum:
- - qcom,msm8226-cci
- - qcom,msm8974-cci
+ oneOf:
+ - contains:
+ enum:
+ - qcom,msm8974-cci
+
+ - const: qcom,msm8226-cci
then:
properties:
clocks:
@@ -105,10 +116,12 @@ allOf:
- if:
properties:
compatible:
- contains:
- enum:
- - qcom,msm8916-cci
- - qcom,msm8996-cci
+ oneOf:
+ - contains:
+ enum:
+ - qcom,msm8916-cci
+
+ - const: qcom,msm8996-cci
then:
properties:
clocks:
@@ -169,7 +182,7 @@ examples:

cci@ac4a000 {
reg = <0x0ac4a000 0x4000>;
- compatible = "qcom,sdm845-cci";
+ compatible = "qcom,sdm845-cci", "qcom,msm8996-cci";
#address-cells = <1>;
#size-cells = <0>;

--
2.39.0


2022-12-13 18:48:03

by Konrad Dybcio

[permalink] [raw]
Subject: [PATCH v2 5/6] arm64: dts: qcom: sm8450: Add fallback CCI compatible

Add a fallback CCI compatible, as required by bindings.

Signed-off-by: Konrad Dybcio <[email protected]>
---
Changes in v2:
- new patch

arch/arm64/boot/dts/qcom/sm8450.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8450.dtsi b/arch/arm64/boot/dts/qcom/sm8450.dtsi
index a8f8ffd728d7..a9ed8443ac02 100644
--- a/arch/arm64/boot/dts/qcom/sm8450.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8450.dtsi
@@ -2554,7 +2554,7 @@ IPCC_MPROC_SIGNAL_GLINK_QMP
};

cci0: cci@ac15000 {
- compatible = "qcom,sm8450-cci";
+ compatible = "qcom,sm8450-cci", "qcom,msm8996-cci";
reg = <0 0xac15000 0 0x1000>;
interrupts = <GIC_SPI 460 IRQ_TYPE_EDGE_RISING>;
power-domains = <&camcc TITAN_TOP_GDSC>;
@@ -2593,7 +2593,7 @@ cci0_i2c1: i2c-bus@1 {
};

cci1: cci@ac16000 {
- compatible = "qcom,sm8450-cci";
+ compatible = "qcom,sm8450-cci", "qcom,msm8996-cci";
reg = <0 0xac16000 0 0x1000>;
interrupts = <GIC_SPI 271 IRQ_TYPE_EDGE_RISING>;
power-domains = <&camcc TITAN_TOP_GDSC>;
--
2.39.0

2022-12-13 18:48:57

by Konrad Dybcio

[permalink] [raw]
Subject: [PATCH v2 3/6] arm64: dts: qcom: sdm845: Add fallback CCI compatible

Add a fallback CCI compatible, as required by bindings.

Signed-off-by: Konrad Dybcio <[email protected]>
---
No changes in v2.

arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 9eecf1b4ebf9..154f5054a200 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -4386,7 +4386,7 @@ port@3 {
};

cci: cci@ac4a000 {
- compatible = "qcom,sdm845-cci";
+ compatible = "qcom,sdm845-cci", "qcom,msm8996-cci";
#address-cells = <1>;
#size-cells = <0>;

--
2.39.0

2022-12-13 18:50:29

by Konrad Dybcio

[permalink] [raw]
Subject: [PATCH v2 6/6] i2c: qcom-cci: Deprecate duplicated compatibles

Many compatibles have been introduced, pointing to the same config data.
Leave a note reminding future developers to not do that again.

Signed-off-by: Konrad Dybcio <[email protected]>
---
Changes in v2:
- new patch

drivers/i2c/busses/i2c-qcom-cci.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-qcom-cci.c b/drivers/i2c/busses/i2c-qcom-cci.c
index a4b97fe3c3a5..01358472680c 100644
--- a/drivers/i2c/busses/i2c-qcom-cci.c
+++ b/drivers/i2c/busses/i2c-qcom-cci.c
@@ -811,9 +811,15 @@ static const struct cci_data cci_v2_data = {

static const struct of_device_id cci_dt_match[] = {
{ .compatible = "qcom,msm8226-cci", .data = &cci_v1_data},
- { .compatible = "qcom,msm8916-cci", .data = &cci_v1_data},
{ .compatible = "qcom,msm8974-cci", .data = &cci_v1_5_data},
{ .compatible = "qcom,msm8996-cci", .data = &cci_v2_data},
+
+
+ /*
+ * Legacy compatibles kept for backwards compatibility.
+ * Do not add any new ones unless they introduce a new config
+ */
+ { .compatible = "qcom,msm8916-cci", .data = &cci_v1_data},
{ .compatible = "qcom,sdm845-cci", .data = &cci_v2_data},
{ .compatible = "qcom,sm8250-cci", .data = &cci_v2_data},
{ .compatible = "qcom,sm8450-cci", .data = &cci_v2_data},
--
2.39.0

2022-12-13 19:22:46

by Konrad Dybcio

[permalink] [raw]
Subject: [PATCH v2 2/6] arm64: dts: qcom: msm8916: Add fallback CCI compatible

Add a fallback CCI compatible, as required by bindings.

Signed-off-by: Konrad Dybcio <[email protected]>
---
No changes in v2.

arch/arm64/boot/dts/qcom/msm8916.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index 2ca8e977fc2a..4c0a0078adb5 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -1167,7 +1167,7 @@ ports {
};

cci: cci@1b0c000 {
- compatible = "qcom,msm8916-cci";
+ compatible = "qcom,msm8916-cci", "qcom,msm8226-cci";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x01b0c000 0x1000>;
--
2.39.0

2022-12-13 19:30:05

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 6/6] i2c: qcom-cci: Deprecate duplicated compatibles

On 13/12/2022 19:33, Konrad Dybcio wrote:
> Many compatibles have been introduced, pointing to the same config data.
> Leave a note reminding future developers to not do that again.
>
> Signed-off-by: Konrad Dybcio <[email protected]>
> ---
> Changes in v2:
> - new patch
>


Reviewed-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof

2022-12-13 19:30:30

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 1/6] dt-bindings: i2c: qcom,i2c-cci: Fall back to common compatibles

On 13/12/2022 19:33, Konrad Dybcio wrote:
> Almost every compatible string in the CCI driver is a duplicate. Adjust
> the bindings to include a common (first-soc-implementing-vX) compatible
> to remove the need to keep adding superfluous compatible strings.
>
> Signed-off-by: Konrad Dybcio <[email protected]>
> ---
> Changes in v2:
> - make sure the actual patch contests are tested..
> - resolve errors
>
> .../devicetree/bindings/i2c/qcom,i2c-cci.yaml | 47 ++++++++++++-------
> 1 file changed, 30 insertions(+), 17 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml b/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
> index cf9f8fda595f..87e414f0c39c 100644
> --- a/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
> +++ b/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
> @@ -12,14 +12,23 @@ maintainers:
>
> properties:
> compatible:
> - enum:
> - - qcom,msm8226-cci
> - - qcom,msm8916-cci
> - - qcom,msm8974-cci
> - - qcom,msm8996-cci
> - - qcom,sdm845-cci
> - - qcom,sm8250-cci
> - - qcom,sm8450-cci
> + oneOf:
> + - enum:
> + - qcom,msm8226-cci
> + - qcom,msm8974-cci
> + - qcom,msm8996-cci
> +
> + - items:
> + - enum:
> + - qcom,msm8916-cci
> + - const: qcom,msm8226-cci # CCI v1
> +
> + - items:
> + - enum:
> + - qcom,sdm845-cci
> + - qcom,sm8250-cci
> + - qcom,sm8450-cci
> + - const: qcom,msm8996-cci # CCI v2
>
> "#address-cells":
> const: 1
> @@ -88,10 +97,12 @@ allOf:
> - if:
> properties:
> compatible:
> - contains:
> - enum:
> - - qcom,msm8226-cci
> - - qcom,msm8974-cci
> + oneOf:
> + - contains:
> + enum:
> + - qcom,msm8974-cci
> +
> + - const: qcom,msm8226-cci

The old version is here also correct and simpler. I don't think you need
to change it this way.

> then:
> properties:
> clocks:
> @@ -105,10 +116,12 @@ allOf:
> - if:
> properties:
> compatible:
> - contains:
> - enum:
> - - qcom,msm8916-cci
> - - qcom,msm8996-cci
> + oneOf:
> + - contains:
> + enum:
> + - qcom,msm8916-cci
> +
> + - const: qcom,msm8996-cci

The same comment.

> then:
> properties:
> clocks:
> @@ -169,7 +182,7 @@ examples:
>
> cci@ac4a000 {
> reg = <0x0ac4a000 0x4000>;
> - compatible = "qcom,sdm845-cci";
> + compatible = "qcom,sdm845-cci", "qcom,msm8996-cci";
> #address-cells = <1>;
> #size-cells = <0>;
>

Best regards,
Krzysztof

2022-12-13 19:34:31

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v2 1/6] dt-bindings: i2c: qcom,i2c-cci: Fall back to common compatibles

On 13/12/2022 20:20, Konrad Dybcio wrote:
>
>>
>>> then:
>>> properties:
>>> clocks:
>>> @@ -105,10 +116,12 @@ allOf:
>>> - if:
>>> properties:
>>> compatible:
>>> - contains:
>>> - enum:
>>> - - qcom,msm8916-cci
>>> - - qcom,msm8996-cci
>>> + oneOf:
>>> + - contains:
>>> + enum:
>>> + - qcom,msm8916-cci
>>> +
>>> + - const: qcom,msm8996-cci
>>
>> The same comment.
> e.g. the 845 example contains 8996 but does not fall in this category,
> reverting this change causes errors.

Ah, I see, indeed. Looks reasonable:

Reviewed-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof

2022-12-13 19:46:07

by Konrad Dybcio

[permalink] [raw]
Subject: [PATCH v2 4/6] arm64: dts: qcom: sm8250: Add fallback CCI compatible

Add a fallback CCI compatible, as required by bindings.

Signed-off-by: Konrad Dybcio <[email protected]>
---
No changes in v2.

arch/arm64/boot/dts/qcom/sm8250.dtsi | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8250.dtsi b/arch/arm64/boot/dts/qcom/sm8250.dtsi
index 0c4ecdab1244..6d16857fed26 100644
--- a/arch/arm64/boot/dts/qcom/sm8250.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8250.dtsi
@@ -3723,7 +3723,7 @@ videocc: clock-controller@abf0000 {
};

cci0: cci@ac4f000 {
- compatible = "qcom,sm8250-cci";
+ compatible = "qcom,sm8250-cci", "qcom,msm8996-cci";
#address-cells = <1>;
#size-cells = <0>;

@@ -3764,7 +3764,7 @@ cci0_i2c1: i2c-bus@1 {
};

cci1: cci@ac50000 {
- compatible = "qcom,sm8250-cci";
+ compatible = "qcom,sm8250-cci", "qcom,msm8996-cci";
#address-cells = <1>;
#size-cells = <0>;

--
2.39.0

2022-12-13 20:17:21

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH v2 1/6] dt-bindings: i2c: qcom,i2c-cci: Fall back to common compatibles



On 13.12.2022 20:16, Krzysztof Kozlowski wrote:
> On 13/12/2022 19:33, Konrad Dybcio wrote:
>> Almost every compatible string in the CCI driver is a duplicate. Adjust
>> the bindings to include a common (first-soc-implementing-vX) compatible
>> to remove the need to keep adding superfluous compatible strings.
>>
>> Signed-off-by: Konrad Dybcio <[email protected]>
>> ---
>> Changes in v2:
>> - make sure the actual patch contests are tested..
>> - resolve errors
>>
>> .../devicetree/bindings/i2c/qcom,i2c-cci.yaml | 47 ++++++++++++-------
>> 1 file changed, 30 insertions(+), 17 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml b/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
>> index cf9f8fda595f..87e414f0c39c 100644
>> --- a/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
>> +++ b/Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
>> @@ -12,14 +12,23 @@ maintainers:
>>
>> properties:
>> compatible:
>> - enum:
>> - - qcom,msm8226-cci
>> - - qcom,msm8916-cci
>> - - qcom,msm8974-cci
>> - - qcom,msm8996-cci
>> - - qcom,sdm845-cci
>> - - qcom,sm8250-cci
>> - - qcom,sm8450-cci
>> + oneOf:
>> + - enum:
>> + - qcom,msm8226-cci
>> + - qcom,msm8974-cci
>> + - qcom,msm8996-cci
>> +
>> + - items:
>> + - enum:
>> + - qcom,msm8916-cci
>> + - const: qcom,msm8226-cci # CCI v1
>> +
>> + - items:
>> + - enum:
>> + - qcom,sdm845-cci
>> + - qcom,sm8250-cci
>> + - qcom,sm8450-cci
>> + - const: qcom,msm8996-cci # CCI v2
>>
>> "#address-cells":
>> const: 1
>> @@ -88,10 +97,12 @@ allOf:
>> - if:
>> properties:
>> compatible:
>> - contains:
>> - enum:
>> - - qcom,msm8226-cci
>> - - qcom,msm8974-cci
>> + oneOf:
>> + - contains:
>> + enum:
>> + - qcom,msm8974-cci
>> +
>> + - const: qcom,msm8226-cci
>
> The old version is here also correct and simpler. I don't think you need
> to change it this way.
>
>> then:
>> properties:
>> clocks:
>> @@ -105,10 +116,12 @@ allOf:
>> - if:
>> properties:
>> compatible:
>> - contains:
>> - enum:
>> - - qcom,msm8916-cci
>> - - qcom,msm8996-cci
>> + oneOf:
>> + - contains:
>> + enum:
>> + - qcom,msm8916-cci
>> +
>> + - const: qcom,msm8996-cci
>
> The same comment.
e.g. the 845 example contains 8996 but does not fall in this category,
reverting this change causes errors.

Konrad
>
>> then:
>> properties:
>> clocks:
>> @@ -169,7 +182,7 @@ examples:
>>
>> cci@ac4a000 {
>> reg = <0x0ac4a000 0x4000>;
>> - compatible = "qcom,sdm845-cci";
>> + compatible = "qcom,sdm845-cci", "qcom,msm8996-cci";
>> #address-cells = <1>;
>> #size-cells = <0>;
>>
>
> Best regards,
> Krzysztof
>

2023-01-09 12:17:16

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH v2 1/6] dt-bindings: i2c: qcom,i2c-cci: Fall back to common compatibles

On Tue, Dec 13, 2022 at 07:33:00PM +0100, Konrad Dybcio wrote:
> Almost every compatible string in the CCI driver is a duplicate. Adjust
> the bindings to include a common (first-soc-implementing-vX) compatible
> to remove the need to keep adding superfluous compatible strings.
>
> Signed-off-by: Konrad Dybcio <[email protected]>

Applied to for-next, thanks!


Attachments:
(No filename) (380.00 B)
signature.asc (849.00 B)
Download all attachments

2023-01-09 12:21:09

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH v2 6/6] i2c: qcom-cci: Deprecate duplicated compatibles

On Tue, Dec 13, 2022 at 07:33:05PM +0100, Konrad Dybcio wrote:
> Many compatibles have been introduced, pointing to the same config data.
> Leave a note reminding future developers to not do that again.
>
> Signed-off-by: Konrad Dybcio <[email protected]>

Applied to for-next, thanks!


Attachments:
(No filename) (303.00 B)
signature.asc (849.00 B)
Download all attachments

2023-01-11 05:21:57

by Bjorn Andersson

[permalink] [raw]
Subject: Re: (subset) [PATCH v2 1/6] dt-bindings: i2c: qcom,i2c-cci: Fall back to common compatibles

On Tue, 13 Dec 2022 19:33:00 +0100, Konrad Dybcio wrote:
> Almost every compatible string in the CCI driver is a duplicate. Adjust
> the bindings to include a common (first-soc-implementing-vX) compatible
> to remove the need to keep adding superfluous compatible strings.
>
>

Applied, thanks!

[2/6] arm64: dts: qcom: msm8916: Add fallback CCI compatible
commit: 6d88aafa6fdded2a76f60060ea50f7b8e98a2705
[3/6] arm64: dts: qcom: sdm845: Add fallback CCI compatible
commit: 84c611c5bca41f584a990a041daf31bf73ba9b99
[4/6] arm64: dts: qcom: sm8250: Add fallback CCI compatible
commit: dd45008b74e4ca28bbacf0d249dac821624a88b0
[5/6] arm64: dts: qcom: sm8450: Add fallback CCI compatible
commit: 71b7c2df3109ee62e875b16fcb5654e626bf7cc7

Best regards,
--
Bjorn Andersson <[email protected]>