From patchwork Thu Nov 5 05:41:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Holland X-Patchwork-Id: 319565 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0312C388F9 for ; Thu, 5 Nov 2020 05:42:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5324D2151B for ; Thu, 5 Nov 2020 05:42:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731210AbgKEFlk (ORCPT ); Thu, 5 Nov 2020 00:41:40 -0500 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:36499 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730948AbgKEFlj (ORCPT ); Thu, 5 Nov 2020 00:41:39 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id F2C035C015B; Thu, 5 Nov 2020 00:41:37 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 05 Nov 2020 00:41:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=jkrVH4j2GkC3P 3IVwiaih9w84EK5SRrgiFWIljFK7tI=; b=RYCENO/XOI4Q+sFtnwc6lfCMxNl0m pkKrWCgSTXnNMQnfLwF6ow8+SAhpWGeW7Drhgvyy/RAvYRjuIrp59VCKHGg6Yxak qmMRToEMRBVQg2NZJv1N9U/DCmGTxok9B/ochYAM47f+wj3scfaX5KRwmOZHZWXy mvA3TX4WVAfn3kp28lfosuSx7MYUAH5ETJ6BUApleVfd3uisWC/PtpINLCnKgdIN QVqGZNNbR9tH+FV5/zTxs/No+3npLXeNVmocTEmG8RGE6JJpaT5mIXtkVC4nHv/M 0Z2u00gjNzWsrYxWaZmJLX06zu8O6dkSXxHSlz3wEGO9UYyeMZqMGfNPA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=jkrVH4j2GkC3P3IVwiaih9w84EK5SRrgiFWIljFK7tI=; b=WTaGYgil 9IuZds093SZ5P6gPC3582n1YZL+es2kb4IFZFk+bDYj8DTe+prTbiGnMaM5YUOxH TIv7yRmPp5mSCPXADn54ZrE3xU8ZYqi07MfTnfu1lXBNExiw+bEhosdCBRWntVa7 FHkXfqah8J2IT0NUodW9Xj5FEIEl9cedeReBztSoMiZuwqDR9FArC5yLgP1LP3+f nB7/dPP5N+H8+sqjX57/g21o6OiSSU8g+/6OjCQZID+xAKeL7xrs0QCvdQBA4kYB zxWyAt6Id8bhWmpkncNWm2NJCDl8ePCRc3n1lZdD2AiuyL2q4MV0ILLsIDyzbxCu 0ap/Wv35tJvRSQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddtiedgkeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpefhvffufffkofgjfhgggfestdekredtredt tdenucfhrhhomhepufgrmhhuvghlucfjohhllhgrnhguuceoshgrmhhuvghlsehshhholh hlrghnugdrohhrgheqnecuggftrfgrthhtvghrnhepudfhjeefvdfhgfefheetgffhieei gfefhefgvddvveefgeejheejvdfgjeehueeinecukfhppeejtddrudefhedrudegkedrud ehudenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpehs rghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: from titanium.stl.sholland.net (70-135-148-151.lightspeed.stlsmo.sbcglobal.net [70.135.148.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 3AE4732801D7; Thu, 5 Nov 2020 00:41:37 -0500 (EST) From: Samuel Holland To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , linux-arm-kernel@lists.infradead.org Cc: Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Samuel Holland , Luca Weiss Subject: [PATCH 3/6] arm64: dts: allwinner: pinephone: Add LED flash Date: Wed, 4 Nov 2020 23:41:32 -0600 Message-Id: <20201105054135.24860-4-samuel@sholland.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201105054135.24860-1-samuel@sholland.org> References: <20201105054135.24860-1-samuel@sholland.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org From: Luca Weiss All revisions of the PinePhone have an SGM3140 LED flash. The gpios were swapped on v1.0 of the board, but this was fixed in later revisions. Signed-off-by: Luca Weiss Signed-off-by: Samuel Holland --- .../boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts | 5 +++++ .../boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts | 5 +++++ .../boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts | 5 +++++ .../boot/dts/allwinner/sun50i-a64-pinephone.dtsi | 11 +++++++++++ 4 files changed, 26 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts index 0c42272106af..3d5a2ae9aa39 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.0.dts @@ -9,3 +9,8 @@ / { model = "Pine64 PinePhone Developer Batch (1.0)"; compatible = "pine64,pinephone-1.0", "allwinner,sun50i-a64"; }; + +&sgm3140 { + enable-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */ + flash-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */ +}; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts index 3e99a87e9ce5..c9b9f6e9ee8c 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.1.dts @@ -28,3 +28,8 @@ &backlight { num-interpolated-steps = <50>; default-brightness-level = <400>; }; + +&sgm3140 { + enable-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */ + flash-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */ +}; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts index a9f5b670c9b8..94e4f11e0215 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone-1.2.dts @@ -38,3 +38,8 @@ &lis3mdl { interrupt-parent = <&pio>; interrupts = <1 1 IRQ_TYPE_EDGE_RISING>; /* PB1 */ }; + +&sgm3140 { + enable-gpios = <&pio 3 24 GPIO_ACTIVE_HIGH>; /* PD24 */ + flash-gpios = <&pio 2 3 GPIO_ACTIVE_HIGH>; /* PC3 */ +}; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi index 57c89c3b71e9..e595a8262920 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi @@ -49,6 +49,17 @@ red { }; }; + sgm3140: led-controller { + compatible = "sgmicro,sgm3140"; + vin-supply = <®_dcdc1>; + + sgm3140_flash: led { + function = LED_FUNCTION_FLASH; + color = ; + flash-max-timeout-us = <250000>; + }; + }; + speaker_amp: audio-amplifier { compatible = "simple-audio-amplifier"; enable-gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */