From patchwork Wed Oct 27 14:37:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 12587495 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F1B5C433F5 for ; Wed, 27 Oct 2021 14:38:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D578160F56 for ; Wed, 27 Oct 2021 14:38:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D578160F56 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=+e/BoWlHXOvktt/xf4OCmf/byT2tqsFASj0fSVmhl10=; b=PNQqvlx94SOvoM seBMBvAALiN6FJNTzuMw/unUiewq5idLM/AeiEI38wOG0z5i80sowK1Q7QylABPwNiNhpUWphWgmi IikFfdhJ19gcAgM0HQ79qz2mfPCbfoIfStToWeThmolUTouajvot42j9mnvYGnXNXjUiS98UKAi25 teklwQeKv63HYrqko+4LwFmI9hv+OY8vXytv46WukoTqj1wlhH+d3uhiKTSO9xIQWLwYgRK4CaQHY g4XzkimKtRIGmNGX5l6kAO1tym0bnf8W4tM8lNQk7BxRwPI6yTEblN0rtSRdSYPi4fmc8ZmcdV/qZ oGGwbiAbjIHDyrkVSEmQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfk3j-0058kS-HQ; Wed, 27 Oct 2021 14:37:43 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfk3f-0058il-Js; Wed, 27 Oct 2021 14:37:41 +0000 Received: by mail-wr1-x42f.google.com with SMTP id e4so4548501wrc.7; Wed, 27 Oct 2021 07:37:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TGWbt0DaQKCswEBt0ArwqQnvqc41g6JU5zhKYrPiWaQ=; b=pDTwVgBFo87UyDGWShmU8Dtev0ZcRzpYvlQV7kt71SdaMb+m9heGBhDyFk+2SBwRU3 DwfKkUXyW/mCm399z0UXEV8CmFcsM8Hy9CmvXzQDispnVGrO7MVgyy2TR6N3D2Vx5LpQ puLeSWTY65hXS8VRkPCtnK6iqDKBwGEBghH9fvn5AAvK9OM0ODR7PK+Xaj2y9Wolb62H Q92o7tCS67mWgTPJlp8krqQhrxXBXqIVyh8735JbAq8G2Usb8CNup0wXntvUgfJFI4aS LGWimyCP1Uc+kdMGOHCAqLC6It7D1b+yCKiS1R/y+M+JZx1SdMYBXETyo/muHZ6XVFtU iu1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TGWbt0DaQKCswEBt0ArwqQnvqc41g6JU5zhKYrPiWaQ=; b=jJOuznXtli5Q4BYWIopgd16tS6Nb0jfKf/PVacrReYaLN8dol4AQrSkJmVp1G5mxjJ iVnFnRTJA5G9sQ5Y2F9PNVgzWqBOoa2nvcPhDXiNYET+X6S5zgSwRvW1M4pm3wuUvRWh MLhgXf0u92Y8cDTXct1rlkPXsaYJ43IwZWzGOm5TbeuTMJvYsFk6avpoUWrqQX3Io8kV OVjrprIqZ62DhEVeJX2SVR5oICzm23wxun3KWJ52F0DsLYZYNZHg+21N/692XWeEWvri t/U439NqX+ZT6AtvL8dQs2SrckqClcLktwt+WV+SWEqiBc1NXb5oTLNYBwt9X43bytHv JsPA== X-Gm-Message-State: AOAM531fCvrjhikyJQdQUgYdkVrYmvKWXcbbl/AZrxx0a8Ma05qCnBGN oIhD+2aqhHRu6HgbSV4L4w== X-Google-Smtp-Source: ABdhPJwbUhkqT+wluf90XToU2xknGoyv3gvSKRYquezS11x9eVlIvfNpBcu0LsM7zKblTtfbIPXdkA== X-Received: by 2002:adf:f50f:: with SMTP id q15mr42084157wro.324.1635345457284; Wed, 27 Oct 2021 07:37:37 -0700 (PDT) Received: from alex-ThinkPad-E480.. ([2a02:810b:f40:4200:8072:4c96:3e48:9ebf]) by smtp.googlemail.com with ESMTPSA id p21sm25866wmc.11.2021.10.27.07.37.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Oct 2021 07:37:37 -0700 (PDT) From: Alex Bee To: Heiko Stuebner , Rob Herring Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH 1/2] arm64: dts: rockchip: fix audio-supply for Rock Pi 4 Date: Wed, 27 Oct 2021 16:37:25 +0200 Message-Id: <20211027143726.165809-1-knaerzche@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211027_073739_684308_71C72073 X-CRM114-Status: GOOD ( 13.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As stated in the schematics [1] and [2] P5 the APIO5 domain is supplied by RK808-D Buck4, which in our case vcc1v8_codec - i.e. a 1.8 V regulator. Currently only white noise comes from the ES8316's output, which - for whatever reason - came up only after the the correct switch from i2s0_8ch_bus to i2s0_2ch_bus for i2s0's pinctrl was done. Fix this by setting the correct regulator for audio-supply. [1] https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi4_v13_sch_20181112.pdf [2] https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi_4c_v12_sch_20200620.pdf Fixes: 1b5715c602fd ("arm64: dts: rockchip: add ROCK Pi 4 DTS support") Signed-off-by: Alex Bee --- arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi index 98136c88fa49..6a434be62819 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi @@ -502,7 +502,7 @@ &io_domains { status = "okay"; bt656-supply = <&vcc_3v0>; - audio-supply = <&vcc_3v0>; + audio-supply = <&vcc1v8_codec>; sdmmc-supply = <&vcc_sdio>; gpio1830-supply = <&vcc_3v0>; }; From patchwork Wed Oct 27 14:37:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 12587497 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44CB9C433EF for ; Wed, 27 Oct 2021 14:39:05 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0E61560F56 for ; Wed, 27 Oct 2021 14:39:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0E61560F56 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UZA0Mp5C1LTdU/oAHg+s+8QRNJHuwH3PeMthFQ013uA=; b=sJX1YkpX6BdvnZ o6/16dqPFT7gjcOsO/YWFjMvdmP230r1mjkRBUTPL56cv1y/ESzLrqyUUUL5c9MxWQAV7vfQDwUKf MD2zMqm01bD7AwXmB6cc8pu+W93WLyzuFW/3FfuYPsh3+eUyiXhaZ8nwR8bYfAEHvi3YNzUxH+jKT 2yJSxTpGPxE+UranY59gOL9jKL55b6ggCWxNct8FH406l05M3mZ72DSmJUzQF1K6NjMbkG8/irNb+ PRers2ru1Ffp9Z2t+NZoq9rxvI2Z5zpFO50bFnUWhyh3XJWqXcXJ3cxDmLa3/qJ3xKlzdP5039cWF c5joMYrprqjyshSF25sA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfk3v-0058o1-SR; Wed, 27 Oct 2021 14:37:56 +0000 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfk3l-0058kn-1s; Wed, 27 Oct 2021 14:37:46 +0000 Received: by mail-wr1-x435.google.com with SMTP id s14so1657724wrb.3; Wed, 27 Oct 2021 07:37:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ECYBC4YNujNcfruFWFj5cKTQLy3jB52lzNAq73G9ODI=; b=WbLTG5z/2bX7mQkpZ20I/XHwbLEHWBZUHGye6qS7zMYsl85xenrtP3igf3w8vmbGZl yQ5DU8T0FcbKh2bL3uIZLPTsW2SbJsPu3F178yLzQEmUGO+g45XfTcFynvFwhqv9OO2v qixGGNpRkpGDhuYKCWDSIhJs9gXuKu5t4Pr8R9WmR0Y83mG3mvzsDl5hR0wIX4fOsEjr C87J+9EtyqwDvQ+UrWdlecbtUKDEpQYtmt658iRhoulvUo7mNVWF1lB9VqoSnkJkSizk YAwyYnNWsfrN24nbuGy4eoD9lLzWTbLFfD5dRiVnjQs4hW4A9NduSaDbXIDWbd27+gpt OKvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ECYBC4YNujNcfruFWFj5cKTQLy3jB52lzNAq73G9ODI=; b=NX0FMtOYpHzjEUpHwDfd5kHCOkiOKB5ikOAhftyyVhegn3OP7kbaoyc0V9XUv4bhSd nX1zXIlrNQ3Bec/MdaqwRclrugmC4CqPROajtEty0VBJKy+Mf4y0vqfYwDx2uPnNdJWv qk678YQWeDTtusqkEQIZJeQOSNBwg1Oe7tmTu3DnUfupALp0PWr261gxY7Ywy+Ew74no h6R07ydlixssAUgpnfpQWO+76BaEIlXqzUeSyHKidIgJX681KV7WCQhU9mowyO5N9v0Y iEUmT/bn44BIP2UwlZGJLlIYCplldmFxGlif9Vkknm2cfhoWZJH/dpBfLoPYuwz8oxmz PYgQ== X-Gm-Message-State: AOAM533C/lYnGE7EJ7ccnjMX4JOV822iSGWSH+O+59xij0xH9T/43qZ2 JjTtyq6UMHRuiTUnE+50OQ== X-Google-Smtp-Source: ABdhPJxM2xWFRcYqepvLXxjzgmiMicba79H5c9p5JTK4rrrGKSDr9cU4H9ZbipquZRtbuWCNQuZc6A== X-Received: by 2002:a05:6000:2a2:: with SMTP id l2mr34083026wry.109.1635345462964; Wed, 27 Oct 2021 07:37:42 -0700 (PDT) Received: from alex-ThinkPad-E480.. ([2a02:810b:f40:4200:8072:4c96:3e48:9ebf]) by smtp.googlemail.com with ESMTPSA id p21sm25866wmc.11.2021.10.27.07.37.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Oct 2021 07:37:42 -0700 (PDT) From: Alex Bee To: Heiko Stuebner , Rob Herring Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee Subject: [PATCH 2/2] arm64: dts: rockchip: add interrupt and headphone-detection for Rock Pi4's audio codec Date: Wed, 27 Oct 2021 16:37:26 +0200 Message-Id: <20211027143726.165809-2-knaerzche@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211027143726.165809-1-knaerzche@gmail.com> References: <20211027143726.165809-1-knaerzche@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211027_073745_127735_FF22461C X-CRM114-Status: GOOD ( 13.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org As schematics at [1] and [2] show C- and plus-revisions have interrupt and headphone detection lines of ES8316 codec connected. Add them to the respective device trees. [1] https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi_4c_v12_sch_20200620.pdf [2] https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi4b_plus_v16_sch_20200628.pdf Signed-off-by: Alex Bee --- arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi | 12 +++++++++++- .../boot/dts/rockchip/rk3399-rock-pi-4a-plus.dts | 11 +++++++++++ .../boot/dts/rockchip/rk3399-rock-pi-4b-plus.dts | 11 +++++++++++ arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4c.dts | 11 +++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi index 6a434be62819..92acf6ea299b 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi @@ -36,7 +36,7 @@ sdio_pwrseq: sdio-pwrseq { reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; }; - sound { + sound: sound { compatible = "audio-graph-card"; label = "Analog"; dais = <&i2s0_p0>; @@ -543,6 +543,16 @@ bt_wake_l: bt-wake-l { }; }; + es8316 { + hp_detect: hp-detect { + rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + hp_int: hp-int { + rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; + pcie { pcie_pwr_en: pcie-pwr-en { rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4a-plus.dts b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4a-plus.dts index 281a04b2f5e9..f5a68d8d072d 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4a-plus.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4a-plus.dts @@ -12,3 +12,14 @@ / { model = "Radxa ROCK Pi 4A+"; compatible = "radxa,rockpi4a-plus", "radxa,rockpi4", "rockchip,rk3399"; }; + +&es8316 { + pinctrl-0 = <&hp_detect &hp_int>; + pinctrl-names = "default"; + interrupt-parent = <&gpio1>; + interrupts = ; +}; + +&sound { + hp-det-gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>; +}; diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4b-plus.dts b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4b-plus.dts index dfad13d2ab24..81bea953c891 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4b-plus.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4b-plus.dts @@ -17,6 +17,13 @@ aliases { }; }; +&es8316 { + pinctrl-0 = <&hp_detect &hp_int>; + pinctrl-names = "default"; + interrupt-parent = <&gpio1>; + interrupts = ; +}; + &sdio0 { status = "okay"; @@ -31,6 +38,10 @@ brcmf: wifi@1 { }; }; +&sound { + hp-det-gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>; +}; + &uart0 { status = "okay"; diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4c.dts b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4c.dts index 99169bcd51c0..0ad7b6e22f70 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4c.dts +++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4c.dts @@ -17,6 +17,13 @@ aliases { }; }; +&es8316 { + pinctrl-0 = <&hp_detect &hp_int>; + pinctrl-names = "default"; + interrupt-parent = <&gpio1>; + interrupts = ; +}; + &sdio0 { status = "okay"; @@ -31,6 +38,10 @@ brcmf: wifi@1 { }; }; +&sound { + hp-det-gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>; +}; + &uart0 { status = "okay";