From patchwork Tue Mar 21 21:56:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Ciocaltea X-Patchwork-Id: 73077 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2031433wrt; Tue, 21 Mar 2023 15:01:51 -0700 (PDT) X-Google-Smtp-Source: AK7set/PoFZSw5ormL+sfj6n+E1KVCprijG0J2a1Il7IJlGZaGHTiFSvqMXDk+vPvp4PBF0Zbg/S X-Received: by 2002:a17:90b:384b:b0:23f:7176:df32 with SMTP id nl11-20020a17090b384b00b0023f7176df32mr984600pjb.40.1679436111265; Tue, 21 Mar 2023 15:01:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679436111; cv=none; d=google.com; s=arc-20160816; b=tzPY4HBAIkK9dnVxr/AKqY/+jFun3smKdKyiC3Y18nZ253TPJbVmpug8mKT+PS1WEM gBerNGWt+3lmWbOwT4DupE72cIlv+ff+f4J7uwmbLnMiMdqgfrrpFjuBRowQKn5LXCIq yHhli6zPoDNi007xQEz9eAxcnY9+xytkduAL2OU7nKBDrTwPk2nz8zdYQk4j/w/qjmCB yai+2Hc6dwRKFpj+4mhOAJYPD6CTZBLYZ8hRX60UyWfUQAMrxZYgFj9/sxAtRvuz0mnS k+UWQIpdQ/CTdnuUIbYOcWAndXwLHFsbAgZBjo8oC31avcmlFR+ITLarOVYAakgYgFXo tWCQ== 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 :dkim-signature; bh=I0l9omavfKUZJkIXW4bfuOiM9onVJrB1edDzwku4dK8=; b=OPskEe1CaDX+8lZh8IAPm6E+X5LMG1mMJu5Wuvu8jvlISIzUAEPjww64FXVgw27hRD BtTSKyKBPkWAvpwwOyP3xUC51iqpiPM1bumAxg/96mUPykl+5PYzFLyqo3mtwj0GFaY5 XbRLBJtmWICj6XVlw3kTHcxnqVh+MiqSZVUtKd4p7/A63D58Sb3QH9hnMSmMrRX3fLJN +slnhpqXp4rgUp4MRtKxcDYoG131l8mLLxkMk57iWbU1aHSUTMgB9TKzWt6nQPrcXNs/ VD/O5mSm7DwZ38z0EfcfTj8xqH2o6OEX05cFYvxbzj7c6sJUiMWV79qPYZz4tl1eyJtW SKtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=byK0mMTE; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p190-20020a6342c7000000b0050bc7a713b1si13435162pga.245.2023.03.21.15.01.35; Tue, 21 Mar 2023 15:01:51 -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; dkim=pass header.i=@collabora.com header.s=mail header.b=byK0mMTE; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230179AbjCUV6l (ORCPT + 99 others); Tue, 21 Mar 2023 17:58:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230258AbjCUV6F (ORCPT ); Tue, 21 Mar 2023 17:58:05 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9671F59435; Tue, 21 Mar 2023 14:57:04 -0700 (PDT) Received: from localhost (unknown [188.24.179.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: cristicc) by madras.collabora.co.uk (Postfix) with ESMTPSA id 8B35566030F1; Tue, 21 Mar 2023 21:57:02 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1679435822; bh=GwkI7NvsahRI9WNBHxkf1so8O+1ehcR5/nTJjj5XqyE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=byK0mMTEq51+ezXCzHTz6KzNJ+w0ZC98Udl6/zMTpEEzpptMWt0laFhQVm9j1S0i3 8JR0X4E5elQRvtodxqrAT7dKFxnYdOYtF+t2dv9nbKN4xr/cN5pwY7abSPfc8sNtXo HZih93oHeVNx2y9TGHx3B9vBC+NC+5gqDrhKM6y2zVJg4FmGyoPn7joqmw+/WO28q4 CtuTsX9UXuzPF/btdDE0fR7pQQq/vj7dVglw8NsrcI5G8hFwOh0Jis770zceqqOqpP UJgYfRxWfYcZO6psUdBNBir+QOL4SDEwiTeP2lvM3z+GBTkQ2DIP9zz5dpYXeIcc+i QMKLnbo2dhhiA== From: Cristian Ciocaltea To: Greg Kroah-Hartman , Rob Herring , Krzysztof Kozlowski , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Heiko Stuebner , Conor Dooley , Paul Walmsley , Palmer Dabbelt , Albert Ou , Nicolas Frattaroli Cc: linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-rockchip@lists.infradead.org, linux-riscv@lists.infradead.org, kernel@collabora.com Subject: [PATCH v2 10/10] arm64: dts: rockchip: rk3588-rock-5b: Add analog audio Date: Tue, 21 Mar 2023 23:56:24 +0200 Message-Id: <20230321215624.78383-11-cristian.ciocaltea@collabora.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230321215624.78383-1-cristian.ciocaltea@collabora.com> References: <20230321215624.78383-1-cristian.ciocaltea@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761016399809432593?= X-GMAIL-MSGID: =?utf-8?q?1761016399809432593?= Add the necessary DT nodes for the Rock 5B board to enable the analog audio support provided by the Everest Semi ES8316 codec. Signed-off-by: Cristian Ciocaltea --- .../boot/dts/rockchip/rk3588-rock-5b.dts | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts index 95805cb0adfa..945eac304766 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts +++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts @@ -2,6 +2,7 @@ /dts-v1/; +#include #include "rk3588.dtsi" / { @@ -25,6 +26,59 @@ vcc5v0_sys: vcc5v0-sys-regulator { regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; }; + + sound { + compatible = "audio-graph-card"; + label = "Analog"; + + widgets = "Microphone", "Mic Jack", + "Headphone", "Headphones"; + + routing = "MIC2", "Mic Jack", + "Headphones", "HPOL", + "Headphones", "HPOR"; + + dais = <&i2s0_8ch_p0>; + hp-det-gpio = <&gpio1 RK_PD5 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&hp_detect>; + }; +}; + +&i2c7 { + status = "okay"; + + es8316: es8316@11 { + compatible = "everest,es8316"; + reg = <0x11>; + clocks = <&cru I2S0_8CH_MCLKOUT>; + clock-names = "mclk"; + #sound-dai-cells = <0>; + + port { + es8316_p0_0: endpoint { + remote-endpoint = <&i2s0_8ch_p0_0>; + }; + }; + }; +}; + +&i2s0_8ch { + pinctrl-names = "default"; + pinctrl-0 = <&i2s0_lrck + &i2s0_mclk + &i2s0_sclk + &i2s0_sdi0 + &i2s0_sdo0>; + status = "okay"; + + i2s0_8ch_p0: port { + i2s0_8ch_p0_0: endpoint { + dai-format = "i2s"; + mclk-fs = <256>; + remote-endpoint = <&es8316_p0_0>; + }; + }; }; &sdhci { @@ -42,3 +96,11 @@ &uart2 { pinctrl-0 = <&uart2m0_xfer>; status = "okay"; }; + +&pinctrl { + sound { + hp_detect: hp-detect { + rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; +};