Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5753569rwr; Tue, 9 May 2023 06:03:27 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ45beleMVCfZu9fvitmJN169IQS3d8QBcEmTE2Q7dP+ShZSWY1Uwu3AZtlimBHAQxCYX+7t X-Received: by 2002:a54:408d:0:b0:38e:8f6:a673 with SMTP id i13-20020a54408d000000b0038e08f6a673mr1389628oii.11.1683637406727; Tue, 09 May 2023 06:03:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683637406; cv=none; d=google.com; s=arc-20160816; b=jS34yZG6LOF1AyVBzbBm65uPC2Co5I8N5vi/rFbv0X/mkFpmAv0K1jMR93yH3lfyUE WDKqGU4ML9MbirUvPzh/e5FlH+e6xPL20ns5jcoDD3nPn7v+G2jEkzjep0HVgsHOKTbB ikgpzAcvkwaZpGL+roymg6tSDhT3Pxo4/wy8SDnz+2f4FYXHyYcJs1QgIPAcqiBbKCrr GmuEIMVaGpAzDXJW2AB0VoYCzH5XtDxnVTu4cQ0jiT9HWSWEA3F4D0nKRiwixd0Hlagh MroqC9tGKZkVFRjjtSRKVo/sP4raPfOdrWlw4sxw2Np1/udCgOyUehDDnxIByo6jeUpn 7P2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=vxWtbY5en7eB44hlLgeMGoKzjkSlI6j9wO5YA1kNkFA=; b=C/SMWOGQ1eFAuec1JFBUpW7R28lK5XsILuCJ1zkgHUKiiOwaQpO/xoV3HviA7P3OKw Zs9k6CBo+kqCicXt5nbNwT2Sw1BFhsi/f+JqgAP4H6NNfPl8G2T0itw3HzyzL68VdtaH tPu4jouNKrLSxwper91/keqxNHNFlZgZi7VoNVnZSJ9EkSgatirRvvQNqdUuAVxD02OQ qkRoj416zGluAr1AryjAk72J26Cn1Kvl/U7edeB8WRHbggILPT23wOmFb1MliWUVkAmr tOeG44eWEliB2CwuMMkbGGO++T3L8Wx8P5sDkiRRS/76J3bKdikqxgEm87EeT1Rki8bd q9VA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p4-20020a544604000000b00383c706bd34si1382416oip.262.2023.05.09.06.03.13; Tue, 09 May 2023 06:03:26 -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 S235188AbjEIMxL (ORCPT + 99 others); Tue, 9 May 2023 08:53:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230060AbjEIMxI (ORCPT ); Tue, 9 May 2023 08:53:08 -0400 Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 327F8EA; Tue, 9 May 2023 05:53:03 -0700 (PDT) Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 50AA524E1F0; Tue, 9 May 2023 20:52:50 +0800 (CST) Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 9 May 2023 20:52:50 +0800 Received: from [192.168.125.124] (183.27.98.219) by EXMBX168.cuchost.com (172.16.6.78) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 9 May 2023 20:52:49 +0800 Message-ID: Date: Tue, 9 May 2023 20:52:48 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Subject: Re: [PATCH v3 3/3] riscv: dts: starfive: add tdm node and sound card Content-Language: en-US To: Mark Brown , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Emil Renner Berthing CC: , , , References: <20230506090116.9206-1-walker.chen@starfivetech.com> <20230506090116.9206-4-walker.chen@starfivetech.com> From: Walker Chen In-Reply-To: <20230506090116.9206-4-walker.chen@starfivetech.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [183.27.98.219] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX168.cuchost.com (172.16.6.78) X-YovoleRuleAgent: yovoleflag X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,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: X-Mailing-List: linux-kernel@vger.kernel.org Hi Conor/Emil, DT overlay is used to describe combinations of VF2 and hat. Do you have any comments on this patch ? Thanks! Best regards, Walker On 2023/5/6 17:01, Walker Chen wrote: > Add the tdm controller node and sound card for the StarFive JH7110 SoC. > > Signed-off-by: Walker Chen > --- > arch/riscv/boot/dts/starfive/Makefile | 3 + > .../jh7110-starfive-visionfive-2-wm8960.dtso | 70 +++++++++++++++++++ > .../jh7110-starfive-visionfive-2.dtsi | 40 +++++++++++ > arch/riscv/boot/dts/starfive/jh7110.dtsi | 21 ++++++ > 4 files changed, 134 insertions(+) > create mode 100644 arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2-wm8960.dtso > > diff --git a/arch/riscv/boot/dts/starfive/Makefile b/arch/riscv/boot/dts/starfive/Makefile > index 170956846d49..644cc29b5be3 100644 > --- a/arch/riscv/boot/dts/starfive/Makefile > +++ b/arch/riscv/boot/dts/starfive/Makefile > @@ -4,3 +4,6 @@ dtb-$(CONFIG_ARCH_STARFIVE) += jh7100-starfive-visionfive-v1.dtb > > dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.2a.dtb > dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-v1.3b.dtb > + > +jh7110-starfive-visionfive-2-wm8960-dtbs := jh7110-starfive-visionfive-2-v1.3b.dtb jh7110-starfive-visionfive-2-wm8960.dtbo > +dtb-$(CONFIG_ARCH_STARFIVE) += jh7110-starfive-visionfive-2-wm8960.dtb > diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2-wm8960.dtso b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2-wm8960.dtso > new file mode 100644 > index 000000000000..67897f000883 > --- /dev/null > +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2-wm8960.dtso > @@ -0,0 +1,70 @@ > +// SPDX-License-Identifier: GPL-2.0 OR MIT > +/* > + * Copyright (C) 2023 StarFive Technology Co., Ltd. > + * Author: Walker Chen > + * > + * Requires ReSpeaker 2-Mics Pi HAT plugged in 40-pin GPIO header. > + */ > + > +/dts-v1/; > +/plugin/; > + > +&{/} { > + compatible = "starfive,visionfive-2-v1.3b", "starfive,jh7110"; > + > + wm8960_mclk: wm8960-mclk { > + compatible = "fixed-clock"; > + clock-output-names = "wm8960_mclk"; > + #clock-cells = <0>; > + clock-frequency = <24576000>; > + }; > + > + sound { > + compatible = "simple-audio-card"; > + > + #address-cells = <1>; > + #size-cells = <0>; > + > + simple-audio-card,name = "Starfive-TDM-Sound-Card"; > + simple-audio-card,widgets = "Microphone", "Mic Jack", > + "Line", "Line In", > + "Line", "Line Out", > + "Speaker", "Speaker", > + "Headphone", "Headphone Jack"; > + simple-audio-card,routing = "Headphone Jack", "HP_L", > + "Headphone Jack", "HP_R", > + "Speaker", "SPK_LP", > + "Speaker", "SPK_LN", > + "LINPUT1", "Mic Jack", > + "LINPUT3", "Mic Jack", > + "RINPUT1", "Mic Jack", > + "RINPUT2", "Mic Jack"; > + > + simple-audio-card,dai-link@0 { > + reg = <0>; > + format = "dsp_a"; > + bitclock-master = <&dailink_master>; > + frame-master = <&dailink_master>; > + > + cpu { > + sound-dai = <&tdm>; > + }; > + dailink_master: codec { > + sound-dai = <&wm8960>; > + clocks = <&wm8960_mclk>; > + }; > + }; > + }; > +}; > + > +&i2c0 { > + #address-cells = <1>; > + #size-cells = <0>; > + > + wm8960: codec@1a { > + compatible = "wlf,wm8960"; > + reg = <0x1a>; > + wlf,shared-lrclk; > + #sound-dai-cells = <0>; > + }; > +}; > diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi > index 1155b97b593d..19b5954ee72d 100644 > --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi > +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi > @@ -214,6 +214,40 @@ > slew-rate = <0>; > }; > }; > + > + tdm0_pins: tdm0-pins { > + tdm0-pins-tx { > + pinmux = + GPOEN_ENABLE, > + GPI_NONE)>; > + bias-pull-up; > + drive-strength = <2>; > + input-disable; > + input-schmitt-disable; > + slew-rate = <0>; > + }; > + > + tdm0-pins-rx { > + pinmux = + GPOEN_DISABLE, > + GPI_SYS_TDM_RXD)>; > + input-enable; > + }; > + > + tdm0-pins-sync { > + pinmux = + GPOEN_DISABLE, > + GPI_SYS_TDM_SYNC)>; > + input-enable; > + }; > + > + tdm0-pins-pcmclk { > + pinmux = + GPOEN_DISABLE, > + GPI_SYS_TDM_CLK)>; > + input-enable; > + }; > + }; > }; > > &uart0 { > @@ -221,3 +255,9 @@ > pinctrl-0 = <&uart0_pins>; > status = "okay"; > }; > + > +&tdm { > + pinctrl-names = "default"; > + pinctrl-0 = <&tdm0_pins>; > + status = "okay"; > +}; > diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi > index 866313570a7e..cfda6fb0d91b 100644 > --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi > +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi > @@ -366,6 +366,27 @@ > status = "disabled"; > }; > > + tdm: tdm@10090000 { > + compatible = "starfive,jh7110-tdm"; > + reg = <0x0 0x10090000 0x0 0x1000>; > + clocks = <&syscrg JH7110_SYSCLK_TDM_AHB>, > + <&syscrg JH7110_SYSCLK_TDM_APB>, > + <&syscrg JH7110_SYSCLK_TDM_INTERNAL>, > + <&syscrg JH7110_SYSCLK_TDM_TDM>, > + <&syscrg JH7110_SYSCLK_MCLK_INNER>, > + <&tdm_ext>; > + clock-names = "tdm_ahb", "tdm_apb", > + "tdm_internal", "tdm", > + "mclk_inner", "tdm_ext"; > + resets = <&syscrg JH7110_SYSRST_TDM_AHB>, > + <&syscrg JH7110_SYSRST_TDM_APB>, > + <&syscrg JH7110_SYSRST_TDM_CORE>; > + dmas = <&dma 20>, <&dma 21>; > + dma-names = "rx","tx"; > + #sound-dai-cells = <0>; > + status = "disabled"; > + }; > + > stgcrg: clock-controller@10230000 { > compatible = "starfive,jh7110-stgcrg"; > reg = <0x0 0x10230000 0x0 0x10000>;