From patchwork Wed May 25 01:43:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Judy Hsiao X-Patchwork-Id: 12860653 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D13FC433FE for ; Wed, 25 May 2022 01:43:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243340AbiEYBng (ORCPT ); Tue, 24 May 2022 21:43:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243345AbiEYBne (ORCPT ); Tue, 24 May 2022 21:43:34 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8D8973793 for ; Tue, 24 May 2022 18:43:32 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id q4so17321057plr.11 for ; Tue, 24 May 2022 18:43:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FeyuM5PEy+naOY4DskRrFwmQfbdcw403l2O3MJ4Mt1k=; b=NDvh2OFK7zyMJV/7uLL5VNuiw8Vo0ovf3dXvIOh/qz3iA+545z49bNJ4t/MPXtuFXg U5K3mLw7lx75m8wOwIqN7HV7uFgsG7rkWz6Ij7rp0cVfxf6QYibmtXOR7Hpcfvph4LQ0 Afb4GaWfjs6oqZDzkqX2Bz0e+6U0LqQUhpZ3Y= 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=FeyuM5PEy+naOY4DskRrFwmQfbdcw403l2O3MJ4Mt1k=; b=04nyiFrKKZ4ZJc9uI3DWlwabceZvpTKQ03SgkNFNQun4wNYyMFMxZC8lSg8wgQbcrd +31jjsMsKjWpvZqPZ7Ugc8+wsrgwwCtRNymHouzcbTWApknpX73QoPH2QoKza78jCBb/ 3EawSDHG7vml1uAXLioYF+NsZd4yKCTKi2R5iYSff4pLFxw3X0poI5/EeH4AJy7aIa9L AUh2b06Xlo4CUp9GP/UhBJelYuOrcRzDvLoRw/VDIFkeLLola28pRMJFhnjKykHGXJdB BoxhQzwmflv2NISyDc2WcDKot3zdzsud4NztnxJSfcNNwpvwseUY6lcAGTjQp6ntGrZC mr1Q== X-Gm-Message-State: AOAM530HSj9o6OrFviEquTzTMpWdzBDpnhP7avZD+ZAkMzoMNxa/mHJd DdvTC9V5gW5CgDw61t4fPqsZWQ== X-Google-Smtp-Source: ABdhPJyvgrfsQrvZr1kmXNY8g2GlnFYT64r8KFQYfZUCrzCAV5D+A7PYOd5041GBLtPU0GEGKBVGYg== X-Received: by 2002:a17:902:e747:b0:161:a2d3:d8f3 with SMTP id p7-20020a170902e74700b00161a2d3d8f3mr29772732plf.17.1653443012404; Tue, 24 May 2022 18:43:32 -0700 (PDT) Received: from judyhsiao0319.c.googlers.com.com (164.135.233.35.bc.googleusercontent.com. [35.233.135.164]) by smtp.gmail.com with ESMTPSA id n11-20020a1709026a8b00b0015e8d4eb2bcsm7877317plk.262.2022.05.24.18.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 May 2022 18:43:32 -0700 (PDT) From: Judy Hsiao To: Andy Gross Cc: Bjorn Andersson , Rob Herring , Srini Kandagatla , dianders@chromium.org, mka@chromium.org, cychiang@google.com, judyhsiao@google.com, tzungbi@chromium.org, swboyd@chromium.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Judy Hsiao Subject: [v3 2/3] arm64: dts: qcom: sc7280: Add sc7280-herobrine-audio-rt5682.dtsi Date: Wed, 25 May 2022 01:43:07 +0000 Message-Id: <20220525014308.1853576-3-judyhsiao@chromium.org> X-Mailer: git-send-email 2.36.1.124.g0e6072fb45-goog In-Reply-To: <20220525014308.1853576-1-judyhsiao@chromium.org> References: <20220525014308.1853576-1-judyhsiao@chromium.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Audio dtsi for sc7280 boards that using rt5682 headset codec: 1. Add dt nodes for sound card which use I2S playback and record through rt5682s and I2S playback through max98357a. 2. Enable lpass cpu node and add pin control and dai-links. Signed-off-by: Judy Hsiao Reviewed-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson --- .../qcom/sc7280-herobrine-audio-rt5682.dtsi | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 arch/arm64/boot/dts/qcom/sc7280-herobrine-audio-rt5682.dtsi diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-audio-rt5682.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine-audio-rt5682.dtsi new file mode 100644 index 000000000000..ec8f2e555a14 --- /dev/null +++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine-audio-rt5682.dtsi @@ -0,0 +1,121 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * + * This file defines the common audio settings for the child boards using rt5682 codec. + * + * Copyright 2022 Google LLC. + */ + +/ { + /* BOARD-SPECIFIC TOP LEVEL NODES */ + sound: sound { + compatible = "google,sc7280-herobrine"; + model = "sc7280-rt5682-max98360a-1mic"; + + status = "okay"; + audio-routing = + "Headphone Jack", "HPOL", + "Headphone Jack", "HPOR"; + + #address-cells = <1>; + #size-cells = <0>; + + dai-link@0 { + link-name = "MAX98360"; + reg = <0>; + + cpu { + sound-dai = <&lpass_cpu MI2S_SECONDARY>; + }; + + codec { + sound-dai = <&max98360a>; + }; + }; + + dai-link@1 { + link-name = "ALC5682"; + reg = <1>; + + cpu { + sound-dai = <&lpass_cpu MI2S_PRIMARY>; + }; + + codec { + sound-dai = <&alc5682 0 /* aif1 */>; + }; + }; + }; +}; + +hp_i2c: &i2c2 { + status = "okay"; + clock-frequency = <400000>; + + alc5682: codec@1a { + compatible = "realtek,rt5682s"; + reg = <0x1a>; + pinctrl-names = "default"; + pinctrl-0 = <&hp_irq>; + + #sound-dai-cells = <1>; + + interrupt-parent = <&tlmm>; + interrupts = <101 IRQ_TYPE_EDGE_BOTH>; + + AVDD-supply = <&pp1800_alc5682>; + MICVDD-supply = <&pp3300_codec>; + + realtek,dmic1-data-pin = <1>; + realtek,dmic1-clk-pin = <2>; + realtek,jd-src = <1>; + realtek,dmic-clk-rate-hz = <2048000>; + }; +}; + +&lpass_cpu { + status = "okay"; + + pinctrl-names = "default"; + pinctrl-0 = <&mi2s0_data0 &mi2s0_data1 &mi2s0_mclk &mi2s0_sclk &mi2s0_ws + &mi2s1_data0 &mi2s1_sclk &mi2s1_ws>; + + #address-cells = <1>; + #size-cells = <0>; + + dai-link@0 { + reg = ; + qcom,playback-sd-lines = <1>; + qcom,capture-sd-lines = <0>; + }; + + dai-link@1 { + reg = ; + qcom,playback-sd-lines = <0>; + }; +}; + +&mi2s0_data0 { + drive-strength = <6>; + bias-disable; +}; + +&mi2s0_data1 { + drive-strength = <6>; + bias-disable; +}; + +&mi2s0_mclk { + drive-strength = <6>; + bias-disable; +}; + +&mi2s0_sclk { + drive-strength = <6>; + bias-disable; +}; + +&mi2s0_ws { + drive-strength = <6>; + bias-disable; +};