diff mbox series

[2/5] dt-bindings: mfd: rk809: Add missing audio codec properties

Message ID 20240619-rk809-fixes-v1-2-fa93bc5313f4@collabora.com (mailing list archive)
State New, archived
Headers show
Series DT fixes for Rockchip RK809 audio codec support | expand

Commit Message

Cristian Ciocaltea June 19, 2024, 11:23 a.m. UTC
The RK809 MFD provides a RK817 compatible audio codec, supported by the
rk817_codec driver.

This has been already in use by several boards: rk3566-quartz64-b,
k3566-roc-pc, rk3568-evb1-v10, rk3568-lubancat-2, rk3568-odroid-m1,
rk3568-rock-3a.  However, dtbs_check fails for all of them:

  DTC_CHK arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dtb
  rk3568-rock-3a.dtb: pmic@20: '#sound-dai-cells', 'assigned-clock-parents', 'assigned-clocks', 'clock-names', 'clocks', 'codec' do not match any of the regexes: 'pinctrl-[0-9]+'
    from schema $id: http://devicetree.org/schemas/mfd/rockchip,rk809.yaml#

Document the missing audio codec properties as found on the
rockchip,rk817 schema.

Fixes: 6c38ca03406e ("dt-bindings: mfd: rk808: Convert bindings to yaml")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
---
 .../devicetree/bindings/mfd/rockchip,rk809.yaml    | 30 +++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

Comments

Jonas Karlman June 19, 2024, 12:20 p.m. UTC | #1
Hi Cristian,

On 2024-06-19 13:23, Cristian Ciocaltea wrote:
> The RK809 MFD provides a RK817 compatible audio codec, supported by the
> rk817_codec driver.
> 
> This has been already in use by several boards: rk3566-quartz64-b,
> k3566-roc-pc, rk3568-evb1-v10, rk3568-lubancat-2, rk3568-odroid-m1,
> rk3568-rock-3a.  However, dtbs_check fails for all of them:
> 
>   DTC_CHK arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dtb
>   rk3568-rock-3a.dtb: pmic@20: '#sound-dai-cells', 'assigned-clock-parents', 'assigned-clocks', 'clock-names', 'clocks', 'codec' do not match any of the regexes: 'pinctrl-[0-9]+'
>     from schema $id: http://devicetree.org/schemas/mfd/rockchip,rk809.yaml#
> 
> Document the missing audio codec properties as found on the
> rockchip,rk817 schema.

This is duplicate of "dt-bindings: mfd: rk809: Add audio codec properties"
part of "arm64: dts: rockchip: Add Radxa ROCK 3B" series.

https://lore.kernel.org/all/20240505134120.2828885-3-jonas@kwiboo.se/

A v2 of that series with fixes for reported issues is imminent.
How do you want me to preceded with such v2 series?

Regards,
Jonas

> 
> Fixes: 6c38ca03406e ("dt-bindings: mfd: rk808: Convert bindings to yaml")
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
>  .../devicetree/bindings/mfd/rockchip,rk809.yaml    | 30 +++++++++++++++++++++-
>  1 file changed, 29 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml b/Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml
> index a327d73f3c43..cadfb5f1c631 100644
> --- a/Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml
> +++ b/Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml
> @@ -12,7 +12,7 @@ maintainers:
>  
>  description: |
>    Rockchip RK809 series PMIC. This device consists of an i2c controlled MFD
> -  that includes regulators, an RTC, and power button.
> +  that includes regulators, an RTC, a power button and an audio codec.
>  
>  properties:
>    compatible:
> @@ -93,6 +93,34 @@ properties:
>          unevaluatedProperties: false
>      unevaluatedProperties: false
>  
> +  clocks:
> +    description:
> +      The input clock for the audio codec.
> +
> +  clock-names:
> +    description:
> +      The clock name for the codec clock.
> +    items:
> +      - const: mclk
> +
> +  '#sound-dai-cells':
> +    description:
> +      Needed for the interpretation of sound dais.
> +    const: 0
> +
> +  codec:
> +    description: |
> +      The child node for the codec to hold additional properties. If no
> +      additional properties are required for the codec, this node can be
> +      omitted.
> +    type: object
> +    additionalProperties: false
> +    properties:
> +      rockchip,mic-in-differential:
> +        type: boolean
> +        description:
> +          Describes if the microphone uses differential mode.
> +
>  allOf:
>    - if:
>        properties:
>
Cristian Ciocaltea June 19, 2024, 12:53 p.m. UTC | #2
Hi Jonas,

On 6/19/24 3:20 PM, Jonas Karlman wrote:
> Hi Cristian,
> 
> On 2024-06-19 13:23, Cristian Ciocaltea wrote:
>> The RK809 MFD provides a RK817 compatible audio codec, supported by the
>> rk817_codec driver.
>>
>> This has been already in use by several boards: rk3566-quartz64-b,
>> k3566-roc-pc, rk3568-evb1-v10, rk3568-lubancat-2, rk3568-odroid-m1,
>> rk3568-rock-3a.  However, dtbs_check fails for all of them:
>>
>>   DTC_CHK arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dtb
>>   rk3568-rock-3a.dtb: pmic@20: '#sound-dai-cells', 'assigned-clock-parents', 'assigned-clocks', 'clock-names', 'clocks', 'codec' do not match any of the regexes: 'pinctrl-[0-9]+'
>>     from schema $id: http://devicetree.org/schemas/mfd/rockchip,rk809.yaml#
>>
>> Document the missing audio codec properties as found on the
>> rockchip,rk817 schema.
> 
> This is duplicate of "dt-bindings: mfd: rk809: Add audio codec properties"
> part of "arm64: dts: rockchip: Add Radxa ROCK 3B" series.
> 
> https://lore.kernel.org/all/20240505134120.2828885-3-jonas@kwiboo.se/
> 
> A v2 of that series with fixes for reported issues is imminent.
> How do you want me to preceded with such v2 series?

Oh, it seems both of us made the same mistake and wrongly assumed the
rockchip,rk817 schema is good enough to be used as a reference. :-)

Since both rockchip,rk817 and rockchip,rk809 files share most of the
content, I also think this might be a good opportunity to get them
merged into a single schema.

I can do this in v2, unless you prefer to handle it as part of your series.

Thanks,
Cristian
Jonas Karlman June 19, 2024, 3:05 p.m. UTC | #3
Hi Cristian,

On 2024-06-19 14:53, Cristian Ciocaltea wrote:
> Hi Jonas,
> 
> On 6/19/24 3:20 PM, Jonas Karlman wrote:
>> Hi Cristian,
>>
>> On 2024-06-19 13:23, Cristian Ciocaltea wrote:
>>> The RK809 MFD provides a RK817 compatible audio codec, supported by the
>>> rk817_codec driver.
>>>
>>> This has been already in use by several boards: rk3566-quartz64-b,
>>> k3566-roc-pc, rk3568-evb1-v10, rk3568-lubancat-2, rk3568-odroid-m1,
>>> rk3568-rock-3a.  However, dtbs_check fails for all of them:
>>>
>>>   DTC_CHK arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dtb
>>>   rk3568-rock-3a.dtb: pmic@20: '#sound-dai-cells', 'assigned-clock-parents', 'assigned-clocks', 'clock-names', 'clocks', 'codec' do not match any of the regexes: 'pinctrl-[0-9]+'
>>>     from schema $id: http://devicetree.org/schemas/mfd/rockchip,rk809.yaml#
>>>
>>> Document the missing audio codec properties as found on the
>>> rockchip,rk817 schema.
>>
>> This is duplicate of "dt-bindings: mfd: rk809: Add audio codec properties"
>> part of "arm64: dts: rockchip: Add Radxa ROCK 3B" series.
>>
>> https://lore.kernel.org/all/20240505134120.2828885-3-jonas@kwiboo.se/
>>
>> A v2 of that series with fixes for reported issues is imminent.
>> How do you want me to preceded with such v2 series?
> 
> Oh, it seems both of us made the same mistake and wrongly assumed the
> rockchip,rk817 schema is good enough to be used as a reference. :-)

Hehe, yeah :-)

> 
> Since both rockchip,rk817 and rockchip,rk809 files share most of the
> content, I also think this might be a good opportunity to get them
> merged into a single schema.
> 
> I can do this in v2, unless you prefer to handle it as part of your series.

I was planning on sending the following, merging the schemas may also be
an option.

https://github.com/Kwiboo/linux-rockchip/compare/619509e6c853...next-20240618-rock-3b-orangepi-3b/

Main purpose of my series was to add ROCK 3B and also Orange Pi 3B,
fixing rockchip,rk809 binding is just a prerequisite.

If you want to merge the bindings, please do :-), I can wait a few more
days to send out a ROCK 3B + Orange Pi 3B v2 series.

Please also include the vcc8/9 fix if you send a v2.

Regards,
Jonas

> 
> Thanks,
> Cristian
Krzysztof Kozlowski June 21, 2024, 10:16 a.m. UTC | #4
On 19/06/2024 13:23, Cristian Ciocaltea wrote:
> The RK809 MFD provides a RK817 compatible audio codec, supported by the
> rk817_codec driver.
> 
> This has been already in use by several boards: rk3566-quartz64-b,
> k3566-roc-pc, rk3568-evb1-v10, rk3568-lubancat-2, rk3568-odroid-m1,
> rk3568-rock-3a.  However, dtbs_check fails for all of them:
> 
>   DTC_CHK arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dtb
>   rk3568-rock-3a.dtb: pmic@20: '#sound-dai-cells', 'assigned-clock-parents', 'assigned-clocks', 'clock-names', 'clocks', 'codec' do not match any of the regexes: 'pinctrl-[0-9]+'
>     from schema $id: http://devicetree.org/schemas/mfd/rockchip,rk809.yaml#
> 
> Document the missing audio codec properties as found on the
> rockchip,rk817 schema.
> 
> Fixes: 6c38ca03406e ("dt-bindings: mfd: rk808: Convert bindings to yaml")
> Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
> ---
>  .../devicetree/bindings/mfd/rockchip,rk809.yaml    | 30 +++++++++++++++++++++-
>  1 file changed, 29 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml b/Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml
> index a327d73f3c43..cadfb5f1c631 100644
> --- a/Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml
> +++ b/Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml
> @@ -12,7 +12,7 @@ maintainers:
>  
>  description: |
>    Rockchip RK809 series PMIC. This device consists of an i2c controlled MFD
> -  that includes regulators, an RTC, and power button.
> +  that includes regulators, an RTC, a power button and an audio codec.
>  
>  properties:
>    compatible:
> @@ -93,6 +93,34 @@ properties:
>          unevaluatedProperties: false
>      unevaluatedProperties: false
>  
> +  clocks:
> +    description:
> +      The input clock for the audio codec.

Instead, maxItems. Or items with description.

> +
> +  clock-names:
> +    description:
> +      The clock name for the codec clock.

Drop description.

> +    items:
> +      - const: mclk
> +
> +  '#sound-dai-cells':
> +    description:
> +      Needed for the interpretation of sound dais.

Description looks redundant, drop.

> +    const: 0
> +
> +  codec:
> +    description: |

Do not need '|' unless you need to preserve formatting.

> +      The child node for the codec to hold additional properties. If no
> +      additional properties are required for the codec, this node can be
> +      omitted.

Useless description. Say something hardware relevant, not about DTS syntax.

> +    type: object
> +    additionalProperties: false
> +    properties:
> +      rockchip,mic-in-differential:
> +        type: boolean
> +        description:
> +          Describes if the microphone uses differential mode.

No resources? Then it goes to parent.

> +
>  allOf:

Add $ref to dai-common.yaml.

>    - if:
>        properties:
> 

Best regards,
Krzysztof
Krzysztof Kozlowski June 21, 2024, 10:18 a.m. UTC | #5
On 21/06/2024 12:16, Krzysztof Kozlowski wrote:
>> +    type: object
>> +    additionalProperties: false
>> +    properties:
>> +      rockchip,mic-in-differential:
>> +        type: boolean
>> +        description:
>> +          Describes if the microphone uses differential mode.
> 
> No resources? Then it goes to parent.

Ah, I missed explanation in commit msg, this was already since few
years. It's fine.


Best regards,
Krzysztof
Cristian Ciocaltea June 21, 2024, 10:41 a.m. UTC | #6
Hi Krzysztof,

On 6/21/24 1:18 PM, Krzysztof Kozlowski wrote:
> On 21/06/2024 12:16, Krzysztof Kozlowski wrote:
>>> +    type: object
>>> +    additionalProperties: false
>>> +    properties:
>>> +      rockchip,mic-in-differential:
>>> +        type: boolean
>>> +        description:
>>> +          Describes if the microphone uses differential mode.
>>
>> No resources? Then it goes to parent.
> 
> Ah, I missed explanation in commit msg, this was already since few
> years. It's fine.

I mentioned in one of the previous messages that both rockchip,rk817 and
rockchip,rk809 files share most of the content, and I'd like to take
this opportunity to merge them into a single schema.

If there are no objections, I'm ready to send v2 with this change.

Thanks for reviewing!

Cristian
Cristian Ciocaltea June 21, 2024, 10:03 p.m. UTC | #7
On 6/19/24 6:05 PM, Jonas Karlman wrote:
> Hi Cristian,
> 
> On 2024-06-19 14:53, Cristian Ciocaltea wrote:
>> Hi Jonas,
>>
>> On 6/19/24 3:20 PM, Jonas Karlman wrote:
>>> Hi Cristian,
>>>
>>> On 2024-06-19 13:23, Cristian Ciocaltea wrote:
>>>> The RK809 MFD provides a RK817 compatible audio codec, supported by the
>>>> rk817_codec driver.
>>>>
>>>> This has been already in use by several boards: rk3566-quartz64-b,
>>>> k3566-roc-pc, rk3568-evb1-v10, rk3568-lubancat-2, rk3568-odroid-m1,
>>>> rk3568-rock-3a.  However, dtbs_check fails for all of them:
>>>>
>>>>   DTC_CHK arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dtb
>>>>   rk3568-rock-3a.dtb: pmic@20: '#sound-dai-cells', 'assigned-clock-parents', 'assigned-clocks', 'clock-names', 'clocks', 'codec' do not match any of the regexes: 'pinctrl-[0-9]+'
>>>>     from schema $id: http://devicetree.org/schemas/mfd/rockchip,rk809.yaml#
>>>>
>>>> Document the missing audio codec properties as found on the
>>>> rockchip,rk817 schema.
>>>
>>> This is duplicate of "dt-bindings: mfd: rk809: Add audio codec properties"
>>> part of "arm64: dts: rockchip: Add Radxa ROCK 3B" series.
>>>
>>> https://lore.kernel.org/all/20240505134120.2828885-3-jonas@kwiboo.se/
>>>
>>> A v2 of that series with fixes for reported issues is imminent.
>>> How do you want me to preceded with such v2 series?
>>
>> Oh, it seems both of us made the same mistake and wrongly assumed the
>> rockchip,rk817 schema is good enough to be used as a reference. :-)
> 
> Hehe, yeah :-)
> 
>>
>> Since both rockchip,rk817 and rockchip,rk809 files share most of the
>> content, I also think this might be a good opportunity to get them
>> merged into a single schema.
>>
>> I can do this in v2, unless you prefer to handle it as part of your series.
> 
> I was planning on sending the following, merging the schemas may also be
> an option.
> 
> https://github.com/Kwiboo/linux-rockchip/compare/619509e6c853...next-20240618-rock-3b-orangepi-3b/
> 
> Main purpose of my series was to add ROCK 3B and also Orange Pi 3B,
> fixing rockchip,rk809 binding is just a prerequisite.
> 
> If you want to merge the bindings, please do :-), I can wait a few more
> days to send out a ROCK 3B + Orange Pi 3B v2 series.
> 
> Please also include the vcc8/9 fix if you send a v2.

Thanks for the pointers, got this finally merged in v2:

https://lore.kernel.org/lkml/20240622-rk809-fixes-v2-0-c0db420d3639@collabora.com/

Regards,
Cristian
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml b/Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml
index a327d73f3c43..cadfb5f1c631 100644
--- a/Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml
+++ b/Documentation/devicetree/bindings/mfd/rockchip,rk809.yaml
@@ -12,7 +12,7 @@  maintainers:
 
 description: |
   Rockchip RK809 series PMIC. This device consists of an i2c controlled MFD
-  that includes regulators, an RTC, and power button.
+  that includes regulators, an RTC, a power button and an audio codec.
 
 properties:
   compatible:
@@ -93,6 +93,34 @@  properties:
         unevaluatedProperties: false
     unevaluatedProperties: false
 
+  clocks:
+    description:
+      The input clock for the audio codec.
+
+  clock-names:
+    description:
+      The clock name for the codec clock.
+    items:
+      - const: mclk
+
+  '#sound-dai-cells':
+    description:
+      Needed for the interpretation of sound dais.
+    const: 0
+
+  codec:
+    description: |
+      The child node for the codec to hold additional properties. If no
+      additional properties are required for the codec, this node can be
+      omitted.
+    type: object
+    additionalProperties: false
+    properties:
+      rockchip,mic-in-differential:
+        type: boolean
+        description:
+          Describes if the microphone uses differential mode.
+
 allOf:
   - if:
       properties: