From patchwork Tue Apr 11 21:05:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Lechner X-Patchwork-Id: 9676087 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C12EE60234 for ; Tue, 11 Apr 2017 21:09:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC085284BC for ; Tue, 11 Apr 2017 21:09:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F0FD28550; Tue, 11 Apr 2017 21:09:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 35C9C284BC for ; Tue, 11 Apr 2017 21:09:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=wH9B2pUJwpe4a35K1Kgflq9cgYXRpjTL5JCMnnZvuxg=; b=Fg1c+WRD7PS6mhT2siYCvECl/I liTbT5mQgUF3RNdcugR94JE0UROKDAETpEqiNuAQjiFVjhBT9kRHSRekuclS564gskpNPT/FbJJYf NsduIZoaZtRlvgsjD5G9aNmEBD2vEizLYbzEBm4cAShkG71uMGQtYIKUZ4yKV67k5Iqn/mF+26hKL Aot1yhVIvvmDw4v6QdPGb56Omljh43Uc8FnB5beApDRQqtWQx6gi2xrrNvgPWVF/hwBIUVcD7cL3r xz5JAzNndr9hbqne2aB9NnT5cAjDOXoPEfi3suIWYMhdzE3lCP5WZt0zBvsNjt10qA0+ezaTWtIRs GJ8lIPHQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cy32p-0006Si-8C; Tue, 11 Apr 2017 21:09:47 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cy32m-0006SH-WB for linux-arm-kernel@bombadil.infradead.org; Tue, 11 Apr 2017 21:09:45 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Dh2cSE9lOEVsCtaWJiXFZb9kHNdPszEg3bltZ/R/JKw=; b=3eEQFRHctZxHAdQt/AktbXZzL 5/v8RHoDt/NtBh/UnqNoas0nU/S5Xq/HLdfkgtuF+W2Ul6hK+tTd8lDJvme7MNzBbnvNNCFs9300V kpuhGZ7yzWcksfWwmxirxiypzz+cRggeJfRhnbnoEnVo5HgNKGgbmTL0d0n5GV6J27YfkwadOJWtA OLErt+iCfCYALBPd45JQQEkWC1o6CYfGwQ1IzT06cVgEc0VFm7lxnBgDOYm93HoWL7/uorDxVBmQq dp/ccaon0Zs9/POXsilEme03K3ZgBrIqJaAtgq1qF0nsRgxrNVDqi8SLf8O2I7+ZSXA8IfAzErhea x+J5kfyhw==; Received: from vern.gendns.com ([206.190.152.46]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cy32l-0007Iz-Fx for linux-arm-kernel@lists.infradead.org; Tue, 11 Apr 2017 21:09:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lechnology.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject :Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Dh2cSE9lOEVsCtaWJiXFZb9kHNdPszEg3bltZ/R/JKw=; b=tAc6S0c+xyLVjd098zoGF+g2d s4gsDSzW+dV+gr5wLlI5g8Hf3LqM/1YqJK+bydTA7yZp+eYk9KvO8KzYcxxE4aKUiVffb8ELZQxVu o5fF3y8LgLiQNyDhuoNZgFlQOSyCuJ7BsHa7kN7LfmCtHvx3CCys6M4MNd726D618NMfHjlgZ3ikj w8eYyUuKNi4zha9z2HH8JqS9fr7PVwsjsz1U8Iqx4E52f/15ZcNPz6ARCcoca0pXGN70Co0YWQVDm oXO1+exdaZ9+M5i6htBd6jk/wD5EbFJM0Bbvl1hHfG2eFB8/vjBwTVNmQP6KG3aMtuGIwxRyHvd2C 7eCQ3OmeQ==; Received: from 108-198-5-147.lightspeed.okcbok.sbcglobal.net ([108.198.5.147]:58146 helo=freyr.lechnology.com) by vern.gendns.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-SHA256:128) (Exim 4.88) (envelope-from ) id 1cy2z9-0005wa-0K; Tue, 11 Apr 2017 17:05:59 -0400 From: David Lechner To: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 3/3] ARM: dts: da850: Add node for LEGO MINDSTORMS EV3 Battery Date: Tue, 11 Apr 2017 16:05:23 -0500 Message-Id: <1491944723-32174-4-git-send-email-david@lechnology.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1491944723-32174-1-git-send-email-david@lechnology.com> References: <1491944723-32174-1-git-send-email-david@lechnology.com> X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - vern.gendns.com X-AntiAbuse: Original Domain - lists.infradead.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lechnology.com X-Get-Message-Sender-Via: vern.gendns.com: authenticated_id: davidmain+lechnology.com/only user confirmed/virtual account not confirmed X-Authenticated-Sender: vern.gendns.com: davidmain@lechnology.com X-Source: X-Source-Args: X-Source-Dir: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170411_170943_595810_D5CCCB5E X-CRM114-Status: UNSURE ( 8.82 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, Kevin Hilman , Sekhar Nori , David Lechner , Sebastian Reichel MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This adds a new node to the LEGO MINDSTORMS EV3 device tree for the battery. Signed-off-by: David Lechner --- arch/arm/boot/dts/da850-lego-ev3.dts | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm/boot/dts/da850-lego-ev3.dts b/arch/arm/boot/dts/da850-lego-ev3.dts index c20580a..99cd561 100644 --- a/arch/arm/boot/dts/da850-lego-ev3.dts +++ b/arch/arm/boot/dts/da850-lego-ev3.dts @@ -172,6 +172,18 @@ gpio = <&gpio 111 GPIO_ACTIVE_HIGH>; enable-active-high; }; + + /* + * The EV3 can use 6-AA batteries or a rechargeable Li-ion battery pack. + */ + battery { + pinctrl-names = "default"; + pintctrl-0 = <&battery_pins>; + compatible = "lego,ev3-battery"; + io-channels = <&adc 4>, <&adc 3>; + io-channel-names = "voltage", "current"; + rechargeable-gpios = <&gpio 136 GPIO_ACTIVE_LOW>; + }; }; &pmx_core { @@ -235,6 +247,15 @@ 0x34 0x00000008 0x0000000f >; }; + + battery_pins: pinmux_battery_pins { + pinctrl-single,bits = < + /* GP0[6] */ + 0x04 0x00000080 0x000000f0 + /* GP8[8] */ + 0x4c 0x00000080 0x000000f0 + >; + }; }; &pinconf { @@ -349,6 +370,13 @@ &gpio { status = "okay"; + + /* Don't pull down battery voltage adc io channel */ + batt_volt_en { + gpio-hog; + gpios = <6 GPIO_ACTIVE_HIGH>; + output-low; + }; }; &usb_phy {