Message ID | 20230626110909.38718-2-hal.feng@starfivetech.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp7404556vqr; Mon, 26 Jun 2023 04:21:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4FkPEqdK/1siOtSN6hwEc62JIKtf9jgq4YF7NBUXwrqySDm8Sn+JKMrth0JLRcsAeDIQd+ X-Received: by 2002:a17:902:d506:b0:1b6:6ddb:3a2b with SMTP id b6-20020a170902d50600b001b66ddb3a2bmr5452917plg.25.1687778502706; Mon, 26 Jun 2023 04:21:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687778502; cv=none; d=google.com; s=arc-20160816; b=oQgsYrKjnUU7gVaXdNSANo4qo8+OeJUirOFhWwXDkjqBLeK2DyPSIRRG4891wGpuIf HbBJDtc7xVfo3Gj0kaC/LS/taL4+szhU3G/jxInsH3BY8utMSFnWVWPIUAMg0y2LDVDO 99hd5S+qU3dZ5tIsenmrRZTleTHAemZEmR9wHYulVbYaMMGf1MrGR5jXg5RPtaj7L/aR wmrkiMTHsnj4BF9eNNuAgkIad1ldm5+spL5RhOQ1XQZOonbgeb965IcTkLFlkU64PHNH idptLtgLY8WU1KdLZ2VvDZBT8toIrrGEPlQG7yGNgjbgCqUZ8RcuAI1ZdKdFreD1ZkNK xvFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=jHboDrFX1gQLiPJAS0faQMjxuSsUo0RUBlTqhTJDdYQ=; fh=C9k7ewE3MFlelxbPIhf5lgILyVkFS4QkOgvXASRW4pM=; b=aQOxvUMAxjhkGtivx1dWkOn3CBTV3+nQnmjSuxZmMkFjWbDaI+3mbXx2IqBwL/y3N9 iXRJDoS2VFsdFKotgBwNhva7No51UNlHI7BDiGJETHK4FSK5f9Ix1Dy5XZ/c8CKbEyOI PLBotXHzAh6zZB1LmQRq+IfgsPRdrs2Q/UniXiHsbGoA4YJAXZA4lmOkg+BXpC2zExp3 NI4VVp4vIGIL+zm/5Xv1AEesWIy1WlqGhEHkNXvdcY5MYXbqKrBW0hteNDLOjLyumtBl h9D9JsxfUMaoeDs+LpLswVTfMFewfswl5q70WHI7lA4hNuxUcdkx3ne0Wq8G65wTrqd2 fo9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p18-20020a170902ebd200b001b66f1fcf0csi4799749plg.174.2023.06.26.04.21.30; Mon, 26 Jun 2023 04:21:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230336AbjFZLJ2 convert rfc822-to-8bit (ORCPT <rfc822;filip.gregor98@gmail.com> + 99 others); Mon, 26 Jun 2023 07:09:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230151AbjFZLJU (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 26 Jun 2023 07:09:20 -0400 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D98C3E1; Mon, 26 Jun 2023 04:09:18 -0700 (PDT) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 05EF924DE30; Mon, 26 Jun 2023 19:09:12 +0800 (CST) Received: from EXMBX172.cuchost.com (172.16.6.92) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 26 Jun 2023 19:09:12 +0800 Received: from ubuntu.localdomain (113.72.146.167) by EXMBX172.cuchost.com (172.16.6.92) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Mon, 26 Jun 2023 19:09:11 +0800 From: Hal Feng <hal.feng@starfivetech.com> To: Mark Brown <broonie@kernel.org>, Liam Girdwood <lgirdwood@gmail.com>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor@kernel.org>, "Walker Chen" <walker.chen@starfivetech.com>, Xingyu Wu <xingyu.wu@starfivetech.com>, Emil Renner Berthing <emil.renner.berthing@canonical.com>, Hal Feng <hal.feng@starfivetech.com> CC: <alsa-devel@alsa-project.org>, <devicetree@vger.kernel.org>, <linux-riscv@lists.infradead.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH v1 1/5] ASoC: dt-bindings: Add StarFive JH7110 dummy PWM-DAC transmitter Date: Mon, 26 Jun 2023 19:09:05 +0800 Message-ID: <20230626110909.38718-2-hal.feng@starfivetech.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230626110909.38718-1-hal.feng@starfivetech.com> References: <20230626110909.38718-1-hal.feng@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [113.72.146.167] X-ClientProxiedBy: EXCAS064.cuchost.com (172.16.6.24) To EXMBX172.cuchost.com (172.16.6.92) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1769764031542944079?= X-GMAIL-MSGID: =?utf-8?q?1769764031542944079?= |
Series |
Add PWM-DAC audio support for StarFive JH7110 RISC-V SoC
|
|
Commit Message
Hal Feng
June 26, 2023, 11:09 a.m. UTC
Add bindings for StarFive JH7110 dummy PWM-DAC transmitter.
Signed-off-by: Hal Feng <hal.feng@starfivetech.com>
---
.../sound/starfive,jh7110-pwmdac-dit.yaml | 38 +++++++++++++++++++
1 file changed, 38 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/starfive,jh7110-pwmdac-dit.yaml
Comments
On 26/06/2023 13:09, Hal Feng wrote: > Add bindings for StarFive JH7110 dummy PWM-DAC transmitter. > > Signed-off-by: Hal Feng <hal.feng@starfivetech.com> > --- > .../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 <hal.feng@starfivetech.com> > + > +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
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
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 <hal.feng@starfivetech.com> >> --- >> .../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 <hal.feng@starfivetech.com> >> + >> +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
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
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
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
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
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 <hal.feng@starfivetech.com> + +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>; + }; + +... +