2023-06-26 11:14:33

by Hal Feng

[permalink] [raw]
Subject: [PATCH v1 1/5] ASoC: dt-bindings: Add StarFive JH7110 dummy PWM-DAC transmitter

Add bindings for StarFive JH7110 dummy PWM-DAC transmitter.

Signed-off-by: Hal Feng <[email protected]>
---
.../sound/starfive,jh7110-pwmdac-dit.yaml | 38 +++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/starfive,jh7110-pwmdac-dit.yaml

diff --git a/Documentation/devicetree/bindings/sound/starfive,jh7110-pwmdac-dit.yaml b/Documentation/devicetree/bindings/sound/starfive,jh7110-pwmdac-dit.yaml
new file mode 100644
index 000000000000..bc43e3b1e9d2
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/starfive,jh7110-pwmdac-dit.yaml
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/starfive,jh7110-pwmdac-dit.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: StarFive JH7110 Dummy PWM-DAC Transmitter
+
+maintainers:
+ - Hal Feng <[email protected]>
+
+allOf:
+ - $ref: dai-common.yaml#
+
+properties:
+ compatible:
+ const: starfive,jh7110-pwmdac-dit
+
+ "#sound-dai-cells":
+ const: 0
+
+ sound-name-prefix: true
+
+required:
+ - compatible
+ - "#sound-dai-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ pwmdac-dit {
+ compatible = "starfive,jh7110-pwmdac-dit";
+ #sound-dai-cells = <0>;
+ };
+
+...
+
--
2.38.1



2023-06-26 16:26:51

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v1 1/5] ASoC: dt-bindings: Add StarFive JH7110 dummy PWM-DAC transmitter

On 26/06/2023 13:09, Hal Feng wrote:
> Add bindings for StarFive JH7110 dummy PWM-DAC transmitter.
>
> Signed-off-by: Hal Feng <[email protected]>
> ---
> .../sound/starfive,jh7110-pwmdac-dit.yaml | 38 +++++++++++++++++++
> 1 file changed, 38 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/sound/starfive,jh7110-pwmdac-dit.yaml
>
> diff --git a/Documentation/devicetree/bindings/sound/starfive,jh7110-pwmdac-dit.yaml b/Documentation/devicetree/bindings/sound/starfive,jh7110-pwmdac-dit.yaml
> new file mode 100644
> index 000000000000..bc43e3b1e9d2
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/starfive,jh7110-pwmdac-dit.yaml
> @@ -0,0 +1,38 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/starfive,jh7110-pwmdac-dit.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: StarFive JH7110 Dummy PWM-DAC Transmitter
> +
> +maintainers:
> + - Hal Feng <[email protected]>
> +
> +allOf:
> + - $ref: dai-common.yaml#
> +
> +properties:
> + compatible:
> + const: starfive,jh7110-pwmdac-dit
> +
> + "#sound-dai-cells":
> + const: 0
> +
> + sound-name-prefix: true

Drop

> +
> +required:
> + - compatible
> + - "#sound-dai-cells"
> +
> +additionalProperties: false

Instead: unevaluatedProperties: false
> +
> +examples:
> + - |
> + pwmdac-dit {

pwmdac?

Best regards,
Krzysztof


2023-06-26 16:26:53

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v1 1/5] ASoC: dt-bindings: Add StarFive JH7110 dummy PWM-DAC transmitter

On 26/06/2023 13:09, Hal Feng wrote:
> Add bindings for StarFive JH7110 dummy PWM-DAC transmitter.

...

> +required:
> + - compatible
> + - "#sound-dai-cells"
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + pwmdac-dit {
> + compatible = "starfive,jh7110-pwmdac-dit";
> + #sound-dai-cells = <0>;

BTW, I don't see any resources here. Neither in the driver. I think you
just added this for driver, not for a real hardware.

Best regards,
Krzysztof


2023-06-30 02:15:24

by Hal Feng

[permalink] [raw]
Subject: Re: [PATCH v1 1/5] ASoC: dt-bindings: Add StarFive JH7110 dummy PWM-DAC transmitter

On Mon, 26 Jun 2023 17:34:56 +0200, Krzysztof Kozlowski wrote:
> On 26/06/2023 13:09, Hal Feng wrote:
>> Add bindings for StarFive JH7110 dummy PWM-DAC transmitter.
>
> ...
>
>> +required:
>> + - compatible
>> + - "#sound-dai-cells"
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> + - |
>> + pwmdac-dit {
>> + compatible = "starfive,jh7110-pwmdac-dit";
>> + #sound-dai-cells = <0>;
>
> BTW, I don't see any resources here. Neither in the driver. I think you
> just added this for driver, not for a real hardware.

Yes, this is a dummy PWM-DAC transmitter as described in the title. The
StarFive JH7110 PWM-DAC module doesn't need a hardware codec, but a
dummy codec is needed for the driver.

For a similar implementation, you can refer to
sound/soc/codecs/spdif_transmitter.c

Best regards,
Hal

2023-06-30 02:17:27

by Hal Feng

[permalink] [raw]
Subject: Re: [PATCH v1 1/5] ASoC: dt-bindings: Add StarFive JH7110 dummy PWM-DAC transmitter

On Mon, 26 Jun 2023 17:32:04 +0200, Krzysztof Kozlowski wrote:
> On 26/06/2023 13:09, Hal Feng wrote:
>> Add bindings for StarFive JH7110 dummy PWM-DAC transmitter.
>>
>> Signed-off-by: Hal Feng <[email protected]>
>> ---
>> .../sound/starfive,jh7110-pwmdac-dit.yaml | 38 +++++++++++++++++++
>> 1 file changed, 38 insertions(+)
>> create mode 100644 Documentation/devicetree/bindings/sound/starfive,jh7110-pwmdac-dit.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/sound/starfive,jh7110-pwmdac-dit.yaml b/Documentation/devicetree/bindings/sound/starfive,jh7110-pwmdac-dit.yaml
>> new file mode 100644
>> index 000000000000..bc43e3b1e9d2
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/sound/starfive,jh7110-pwmdac-dit.yaml
>> @@ -0,0 +1,38 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/sound/starfive,jh7110-pwmdac-dit.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: StarFive JH7110 Dummy PWM-DAC Transmitter
>> +
>> +maintainers:
>> + - Hal Feng <[email protected]>
>> +
>> +allOf:
>> + - $ref: dai-common.yaml#
>> +
>> +properties:
>> + compatible:
>> + const: starfive,jh7110-pwmdac-dit
>> +
>> + "#sound-dai-cells":
>> + const: 0
>> +
>> + sound-name-prefix: true
>
> Drop

Will fix it.

>
>> +
>> +required:
>> + - compatible
>> + - "#sound-dai-cells"
>> +
>> +additionalProperties: false
>
> Instead: unevaluatedProperties: false

Will fix. Thanks.

>> +
>> +examples:
>> + - |
>> + pwmdac-dit {
>
> pwmdac?

No. For a similar implementation, you can refer to "spdif-dit" in

arch/arm64/boot/dts/rockchip/rk3328-rock64.dts

Best regards,
Hal

2023-07-01 08:40:53

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH v1 1/5] ASoC: dt-bindings: Add StarFive JH7110 dummy PWM-DAC transmitter

On 30/06/2023 03:57, Hal Feng wrote:
> On Mon, 26 Jun 2023 17:34:56 +0200, Krzysztof Kozlowski wrote:
>> On 26/06/2023 13:09, Hal Feng wrote:
>>> Add bindings for StarFive JH7110 dummy PWM-DAC transmitter.
>>
>> ...
>>
>>> +required:
>>> + - compatible
>>> + - "#sound-dai-cells"
>>> +
>>> +additionalProperties: false
>>> +
>>> +examples:
>>> + - |
>>> + pwmdac-dit {
>>> + compatible = "starfive,jh7110-pwmdac-dit";
>>> + #sound-dai-cells = <0>;
>>
>> BTW, I don't see any resources here. Neither in the driver. I think you
>> just added this for driver, not for a real hardware.
>
> Yes, this is a dummy PWM-DAC transmitter as described in the title. The
> StarFive JH7110 PWM-DAC module doesn't need a hardware codec, but a
> dummy codec is needed for the driver.

Bindings are no for drivers, therefore with such reasoning the answer
is: drop entire binding. If you think otherwise, please give me some
more details about the hardware.

Best regards,
Krzysztof


2023-07-10 04:07:45

by Hal Feng

[permalink] [raw]
Subject: Re: [PATCH v1 1/5] ASoC: dt-bindings: Add StarFive JH7110 dummy PWM-DAC transmitter

On Sat, 1 Jul 2023 10:17:51 +0200, Krzysztof Kozlowski wrote:
> On 30/06/2023 03:57, Hal Feng wrote:
>> On Mon, 26 Jun 2023 17:34:56 +0200, Krzysztof Kozlowski wrote:
>>> On 26/06/2023 13:09, Hal Feng wrote:
>>>> Add bindings for StarFive JH7110 dummy PWM-DAC transmitter.
>>>
>>> ...
>>>
>>>> +required:
>>>> + - compatible
>>>> + - "#sound-dai-cells"
>>>> +
>>>> +additionalProperties: false
>>>> +
>>>> +examples:
>>>> + - |
>>>> + pwmdac-dit {
>>>> + compatible = "starfive,jh7110-pwmdac-dit";
>>>> + #sound-dai-cells = <0>;
>>>
>>> BTW, I don't see any resources here. Neither in the driver. I think you
>>> just added this for driver, not for a real hardware.
>>
>> Yes, this is a dummy PWM-DAC transmitter as described in the title. The
>> StarFive JH7110 PWM-DAC module doesn't need a hardware codec, but a
>> dummy codec is needed for the driver.
>
> Bindings are no for drivers, therefore with such reasoning the answer
> is: drop entire binding. If you think otherwise, please give me some
> more details about the hardware.

I agreed. I will drop this binding and the compatible in patch 2. Thanks.

Best regards,
Hal

2023-07-25 08:42:39

by Hal Feng

[permalink] [raw]
Subject: Re: [PATCH v1 1/5] ASoC: dt-bindings: Add StarFive JH7110 dummy PWM-DAC transmitter

On Mon, 10 Jul 2023 11:22:50 +0800, Hal Feng wrote:
> On Sat, 1 Jul 2023 10:17:51 +0200, Krzysztof Kozlowski wrote:
>> On 30/06/2023 03:57, Hal Feng wrote:
>>> On Mon, 26 Jun 2023 17:34:56 +0200, Krzysztof Kozlowski wrote:
>>>> On 26/06/2023 13:09, Hal Feng wrote:
>>>>> Add bindings for StarFive JH7110 dummy PWM-DAC transmitter.
>>>>
>>>> ...
>>>>
>>>>> +required:
>>>>> + - compatible
>>>>> + - "#sound-dai-cells"
>>>>> +
>>>>> +additionalProperties: false
>>>>> +
>>>>> +examples:
>>>>> + - |
>>>>> + pwmdac-dit {
>>>>> + compatible = "starfive,jh7110-pwmdac-dit";
>>>>> + #sound-dai-cells = <0>;
>>>>
>>>> BTW, I don't see any resources here. Neither in the driver. I think you
>>>> just added this for driver, not for a real hardware.
>>>
>>> Yes, this is a dummy PWM-DAC transmitter as described in the title. The
>>> StarFive JH7110 PWM-DAC module doesn't need a hardware codec, but a
>>> dummy codec is needed for the driver.
>>
>> Bindings are no for drivers, therefore with such reasoning the answer
>> is: drop entire binding. If you think otherwise, please give me some
>> more details about the hardware.
>
> I agreed. I will drop this binding and the compatible in patch 2. Thanks.

Hi, Krzysztof,

Could I use the dummy spdif codec [1][2] which is already upstream? The dummy
spdif codec is really compatible with the one which JH7110 PWM-DAC needed.
They are mostly similar.

[1] Documentation/devicetree/bindings/sound/linux,spdif-dit.yaml
[2] sound/soc/codecs/spdif_transmitter.c

In that way, patch 1 & 2 can be dropped and patch 5 will be modified as follows.

+ pwmdac_dit: pwmdac-dit {
+ compatible = "linux,spdif-dit";
+ #sound-dai-cells = <0>;
+ };
+
+ sound {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "StarFive-PWMDAC-Sound-Card";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ simple-audio-card,dai-link@0 {
+ reg = <0>;
+ format = "left_j";
+ bitclock-master = <&sndcpu0>;
+ frame-master = <&sndcpu0>;
+
+ sndcpu0: cpu {
+ sound-dai = <&pwmdac>;
+ };
+
+ codec {
+ sound-dai = <&pwmdac_dit>;
+ };
+ };
+ };

Best regards,
Hal