Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1886823imu; Fri, 23 Nov 2018 01:29:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/WNszo5z2ZK+8ug7F7Rw9lZ1lFjf/JpCvYQkr4zVLLFX0ASjQW5EowVPbFrsc3vGkc8GgRm X-Received: by 2002:a62:cdd:: with SMTP id 90mr809459pfm.219.1542965386634; Fri, 23 Nov 2018 01:29:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542965386; cv=none; d=google.com; s=arc-20160816; b=gPHb62X2ROU4WXu38GzTfvGPUF/lV7NRtW0IJAsHUnqsr66tqRmwwDX94GHZlIgAZ2 FerS8t6Pc36P7KMLTEMPAJ9C55QB3xE7a7FsUVL3WnvZAfJ/V+3RfCCAzYpuGhLEM0i+ 6cqrjKV3oal1GUpTp+TNJ9g83t9ttG9mAn8HkwlapmbXTfUcZHnCuogudNGp4HsYeTuP YZezDWHVgkRXA+ryUF30V16qLquMnBbTzre6nS+vM5cwWU7qHeYhhWk/MAYydCHbKHAm Sfl16EhBebVCZ9qPlvhJ76JbOM6wQjuOlLEH/fgAgdLcokxNEYsdAONEmCvhfYbihl9x 0HLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=qfLfGY8x8LFEXoQS1GXSQCGeWcITJIsA3Jtg/X6nyLY=; b=mf0258gsmW8sKAT1sGZv8BGt3mE2sUmdFCOpe7B5ZZi+Ike7B5q8O48Todl4jHusok tEt1uXaosZkUWXu+XKLgALD7+TWCYEFxtLyONqN9wHPkb6D1BfhwMyQWv5EoP4hmBiYs itv2sS6Msy3IsoU9rY3hIcvASbwITxHAAT9OHXCF+ugPASJpOtgzZdc6HdN7jeyG+i6w aU4U0XQu+IfnbQdEqmaRenXbk7zVCwkXuegSO0o25qIqFcPyz/WrWyes+2V6hOcgS+Mo jTzEKBT1aPlUivygZrFmTzUi9u1NGJu4w1f8EWldWlyQUFvlUK2C4oOgss3yR+nMU6ie UsrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t3si53433847pgo.585.2018.11.23.01.29.30; Fri, 23 Nov 2018 01:29:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394292AbeKVVDA (ORCPT + 99 others); Thu, 22 Nov 2018 16:03:00 -0500 Received: from mirror2.csie.ntu.edu.tw ([140.112.30.76]:48380 "EHLO wens.csie.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394235AbeKVVCi (ORCPT ); Thu, 22 Nov 2018 16:02:38 -0500 Received: by wens.csie.org (Postfix, from userid 1000) id 702F15FD90; Thu, 22 Nov 2018 18:23:46 +0800 (CST) From: Chen-Yu Tsai To: Mark Brown , Liam Girdwood , Rob Herring , Mark Rutland , Maxime Ripard Cc: Vasily Khoruzhick , devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Chen-Yu Tsai Subject: [PATCH v9 8/8] arm64: dts: allwinner: a64: enable sound on Pinebook Date: Thu, 22 Nov 2018 18:23:25 +0800 Message-Id: <20181122102325.29495-9-wens@csie.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181122102325.29495-1-wens@csie.org> References: <20181122102325.29495-1-wens@csie.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vasily Khoruzhick The Pinebook has a headphone jack tied to the HP headphone output of the SoC, and internal speakers connected to the LINEOUT of the SoC, through a standalone amplifier. This commit enables I2S, digital and analog parts of audio codec on Pinebook, along with a device node for the external amplifier. Signed-off-by: Vasily Khoruzhick [wens@csie.org: dropped headphone_amp; added headphone amp regulator supply; fixed speaker_amp node name and sound-name-prefix name] Signed-off-by: Chen-Yu Tsai --- .../dts/allwinner/sun50i-a64-pinebook.dts | 49 +++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts index ec537c529726..b6d0b926a2ff 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts @@ -74,6 +74,32 @@ compatible = "mmc-pwrseq-simple"; reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */ }; + + speaker_amp: audio-amplifier { + compatible = "simple-audio-amplifier"; + /* + * TODO This is actually a fixed regulator controlled by + * the GPIO line on the PMIC. This should be corrected + * once GPIO support is added for this PMIC. + */ + VCC-supply = <®_ldo_io0>; + enable-gpios = <&pio 7 7 GPIO_ACTIVE_HIGH>; /* PH7 */ + sound-name-prefix = "Speaker Amp"; + }; + +}; + +&codec { + hpvcc-supply = <®_eldo1>; + status = "okay"; +}; + +&codec_analog { + status = "okay"; +}; + +&dai { + status = "okay"; }; &ehci0 { @@ -277,6 +303,29 @@ vcc-hdmi-supply = <®_dldo1>; }; +&sound { + status = "okay"; + simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>; + simple-audio-card,widgets = "Microphone", "Internal Microphone Left", + "Microphone", "Internal Microphone Right", + "Headphone", "Headphone Jack", + "Speaker", "Internal Speaker"; + simple-audio-card,routing = + "Left DAC", "AIF1 Slot 0 Left", + "Right DAC", "AIF1 Slot 0 Right", + "Speaker Amp INL", "LINEOUT", + "Speaker Amp INR", "LINEOUT", + "Internal Speaker", "Speaker Amp OUTL", + "Internal Speaker", "Speaker Amp OUTR", + "Headphone Jack", "HP", + "AIF1 Slot 0 Left ADC", "Left ADC", + "AIF1 Slot 0 Right ADC", "Right ADC", + "Internal Microphone Left", "MBIAS", + "MIC1", "Internal Microphone Left", + "Internal Microphone Right", "HBIAS", + "MIC2", "Internal Microphone Right"; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pb_pins>; -- 2.19.1