From patchwork Sat Oct 13 08:08:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Oskari_Lemmel=C3=A4?= X-Patchwork-Id: 10640033 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 20E17925 for ; Sat, 13 Oct 2018 08:13:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DF3428F2F for ; Sat, 13 Oct 2018 08:13:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F176B2B1D6; Sat, 13 Oct 2018 08:13:46 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 81EC628F2F for ; Sat, 13 Oct 2018 08:13:46 +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=AowzZ8nn/pFGCPsdfQjI3Lwvk/U+j06lsdGV9LR/QLs=; b=Ls/W/VmNqnYUmnvxNahSBD04TH PoJQazWfEs18rUv1g5Kx/1fb6AAAr5EHDyFmHWcJcx32V1kcLxtY2oMtnS8nf0OOzfrdeXQTKp8Bq 2wYjY7xku6FI4yiFLclltDik0ChS1MaWLfbs1XgjNK4hNXQmKnz21wQRAnF0dO4onoAmBBpuK5g+w RpyCbEIeIPHSVNMXgFFVqK98sP2kng5um1U9wcHBDZMk80J557BckZftJcNLJ1rNw7TPNtFcHsFdm /oO713d/EWhy4WMb6ZeLAB5HJgDVg4Jwodpr8V45zBYjV/H9/LmlWQ3fLoRcVTJNL2k4fVZQkM0rw TLZ3dKuw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBF3G-00029J-TS; Sat, 13 Oct 2018 08:13:34 +0000 Received: from mail1.kuutio.org ([2001:41d0:401:3100::431a]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBEzr-0007lf-GD for linux-arm-kernel@lists.infradead.org; Sat, 13 Oct 2018 08:10:17 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id BF69F20FEB; Sat, 13 Oct 2018 10:09:37 +0200 (CEST) Authentication-Results: mail1.kuutio.org (amavisd-new); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=lemmela.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lemmela.net; h= references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received; s=dkim; t=1539418172; x= 1542010173; bh=yUoz/J22jZ3O8qivvjzvadJN4Zms13Ygz3EIGWpJgm0=; b=u +KohG31FEjv8GbVQwIGL3lnpw1mWVfXXBvfqkskS5YhzUBkohleqMrcM5AHLLLEQ TvPpt/7Np5/Lh82xPTzGSGsnQc2+edrLA/8LgMnYESe1w7EHmkH5GVWgU3p/60fv 3ncGRmrFtbMcu7R35lT9x20YdRrJeV04RNsz8RQ2f2CP9FLRFQfd/1pBrKgYV/94 3xNOjl8BBGR4/VrBOdBcBjGoR/4vCcA/zqTXXvMScfK4GrL1JxBv6AgzTmqKzrVu WZ+YpkGXOQIvo+szNR1jSNFbxe9C4vYICWl1luGq9w4kQsVvbhKOpd+Wv0dfL9by b708/7/1grq/TsA6Co4I1jtqTnSnbV5Zuw/kg9OYwI2xnCeSapWg3mSNosoCSm1+ Ux8LPQhjnY8OmPti+Tmn0UsiI6DfXo8YfRioSW4hDGW/aoSoCFfatnXRG2VFKUju iUKGrvQbi4Wfxa7rwegcFvzOSmcjiRQSVErRdpLeWZAw8WaWWHLOpJlWMoXlG14y mGWv4LWGHyc9NcZyKHziaVJnNXZRE7MWFf2wfk71NL2etDyZThewJmviJt1RWhzm pC8lcjbL0k0izl24hZVJi2c9f081ZLEn6acXkSXFHYCVe6ANgD6Ik+jsgwQ4iERu AR/GkvA7mVPCsDrZpyJgtJvKayMpqLATY8uJcNsOCU= X-Virus-Scanned: amavisd-new at kuutio.org Received: from mail1.kuutio.org ([127.0.0.1]) by localhost (mail1.kuutio.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id WBYLi7M9y53V; Sat, 13 Oct 2018 10:09:32 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id BA0F11FBA4; Sat, 13 Oct 2018 10:09:31 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v4 1/7] dt-bindings: power: supply: axp20x: add AXP813 AC power DT binding Date: Sat, 13 Oct 2018 11:08:42 +0300 Message-Id: <20181013080848.29894-2-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181013080848.29894-1-oskari@lemmela.net> References: <20181013080848.29894-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181013_011003_721325_DE18087A X-CRM114-Status: UNSURE ( 9.20 ) 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: devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Quentin Schulz , Oskari Lemmela , Lee Jones , linux-arm-kernel@lists.infradead.org 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 The AXP803/AXP813 AC power supply can limit input current and voltage. Signed-off-by: Oskari Lemmela Reviewed-by: Rob Herring Reviewed-by: Quentin Schulz Reviewed-by: Chen-Yu Tsai Reviewed-by: Sebastian Reichel --- .../devicetree/bindings/power/supply/axp20x_ac_power.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/power/supply/axp20x_ac_power.txt b/Documentation/devicetree/bindings/power/supply/axp20x_ac_power.txt index 826e8a879121..7a1fb532abe5 100644 --- a/Documentation/devicetree/bindings/power/supply/axp20x_ac_power.txt +++ b/Documentation/devicetree/bindings/power/supply/axp20x_ac_power.txt @@ -4,6 +4,7 @@ Required Properties: - compatible: One of: "x-powers,axp202-ac-power-supply" "x-powers,axp221-ac-power-supply" + "x-powers,axp813-ac-power-supply" This node is a subnode of the axp20x PMIC. @@ -13,6 +14,8 @@ reading ADC channels from the AXP20X ADC. The AXP22X is only able to tell if an AC power supply is present and usable. +AXP813/AXP803 are able to limit current and supply voltage + Example: &axp209 { From patchwork Sat Oct 13 08:08:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Oskari_Lemmel=C3=A4?= X-Patchwork-Id: 10640019 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 366963CF1 for ; Sat, 13 Oct 2018 08:10:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 281762B1C3 for ; Sat, 13 Oct 2018 08:10:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C2302B201; Sat, 13 Oct 2018 08:10:13 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 7AD192B1D6 for ; Sat, 13 Oct 2018 08:10:12 +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=oR3H7q2IpysAU/SFjyJyEALAWw6QygBCksXyk3tWWMU=; b=Y0teTwXzKOnBxHCIoWlJys7D0N Z6sZKzYZM0g/D1pSAAAPRZGOmnXyCb+VKArP52F4odB+dNTQO6gNnLRlM2e2UOPswo3yTAfA07uEd CXl3hPwcGsD5rT26rrRiASLG7T8HL2nYFGpb2oaAWG1Paqk/brqUxtUhgdwCvrq7LowQ2OM89DLOu EuZwn7n/BMO3y36kxaF0vdsTqtmN+qhHW86Q+zXeWzr6UE3LyhtIcy/wbdXBjBNxpxf/eIlZGFB8i z42wlBKA4aU3iSd27Tqm8dDwRfArgYnPiKm511l+fjE/mQIxgNkh9KUGeyle1fhpxxESuvFxJb7pH 8mY2qr8Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBEzj-0007m8-V7; Sat, 13 Oct 2018 08:09:55 +0000 Received: from mail1.kuutio.org ([2001:41d0:401:3100::431a]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBEze-0007hv-69 for linux-arm-kernel@lists.infradead.org; Sat, 13 Oct 2018 08:09:52 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 6A1C120929; Sat, 13 Oct 2018 10:09:33 +0200 (CEST) Authentication-Results: mail1.kuutio.org (amavisd-new); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=lemmela.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lemmela.net; h= references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received; s=dkim; t=1539418172; x= 1542010173; bh=zCS+BIMBUR1lR0ncFh1yMgxvx+0n0f4MUIcP6T3qxcs=; b=B FzLtwUf8klMqUIdH3DLGrgCPTF44UgTGb5UdM1yOwu4ObCIcPFVHDHtA+Y4NapUd mLNY2GAIvkbcwRd58nurXoXluXmV2FUNTwmc0KiXTgKV9xR0al/I07pHkGLJBG+w vtLAiJvDX04C1JlmgiCBkCVH2lVC2JIvwHZy8wv5tH2kiMQo4x82A9BHcUYxsucq BkHuH1tM/8CEU0FKzdIt0P0w0J8b0QmFH7m/QJhkdINXzRLzg/tmi59TcFg5D5UM B6MYq10pKo6DflRSFyn22HYvPg0G0qD4Ln3LPMpw8EsbrIvCDyYb/+KiXjNqkl31 I1o2XlNM3MbVWhgh/yeqtq5pjrWlbZelQq5bL5gVgA/XePdNN3msunHI8BlamxD/ 3WhDERLq3a+T1DECuEECT2B2eCrkKDCEYozwuFhMRMEOjYML8/O1QEzKcawgUhGb lS9msTWJyqVXewqwvmkv+U1LitRlG1Hf43cWR5dyYFjC2VvgaZxRVOurweiW0rBl 47XldLGLN83ok7+s44lyPk1hbE/wjbzq9YgwJcPYfEjQdy9I7o0lGvN81jt8RnKp KSlzx7ICdkvooNiaFLzaG1bIysGtj691bcHLBstx4F57+bgdNFdypLI8CVH4CgAM sJ5F0QUHTcsyp5+I99Qup17Yx6d9ASQIT6EoTixulg= X-Virus-Scanned: amavisd-new at kuutio.org Received: from mail1.kuutio.org ([127.0.0.1]) by localhost (mail1.kuutio.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id WbFWjAgolOLk; Sat, 13 Oct 2018 10:09:32 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 59310202F8; Sat, 13 Oct 2018 10:09:32 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v4 2/7] ARM: dts: axp81x: add AC power supply subnode Date: Sat, 13 Oct 2018 11:08:43 +0300 Message-Id: <20181013080848.29894-3-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181013080848.29894-1-oskari@lemmela.net> References: <20181013080848.29894-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181013_010950_379383_1A4C6F0C X-CRM114-Status: UNSURE ( 9.50 ) 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: devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Quentin Schulz , Oskari Lemmela , Lee Jones , linux-arm-kernel@lists.infradead.org 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 Add AC power supply subnode for AXP81X PMIC. Signed-off-by: Oskari Lemmela Reviewed-by: Quentin Schulz Reviewed-by: Chen-Yu Tsai --- arch/arm/boot/dts/axp81x.dtsi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/arm/boot/dts/axp81x.dtsi b/arch/arm/boot/dts/axp81x.dtsi index 043c717dcef1..bd83962d3627 100644 --- a/arch/arm/boot/dts/axp81x.dtsi +++ b/arch/arm/boot/dts/axp81x.dtsi @@ -48,6 +48,11 @@ interrupt-controller; #interrupt-cells = <1>; + ac_power_supply: ac-power-supply { + compatible = "x-powers,axp813-ac-power-supply"; + status = "disabled"; + }; + axp_adc: adc { compatible = "x-powers,axp813-adc"; #io-channel-cells = <1>; From patchwork Sat Oct 13 08:08:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Oskari_Lemmel=C3=A4?= X-Patchwork-Id: 10640027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 281D914E2 for ; Sat, 13 Oct 2018 08:11:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1504F2B1C3 for ; Sat, 13 Oct 2018 08:11:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 077802B201; Sat, 13 Oct 2018 08:11:42 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 906EA2B1C3 for ; Sat, 13 Oct 2018 08:11:41 +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=2Ncxrc6pjqJ0gEgQT/uBif1JBg0D3qOLSPa2yvtWdw8=; b=Nkmzr/GAOsio8yhtPq/P8EGuhz D37/ESm4m1fmINRzBenogYj5XvYpE3ARm+9zqvYy6Km8P803oEbAfDZGUrJ/EhuMogQQVRAd/yebQ RnqL3RdGwdeNUY5+yyKzq2VVDMmngRShDpy/vBOjQZBOjjQ+sSPev6M3VC7fhMjh/zzho8wAGw/q3 gkuZ5yWY/R5vIQsuF+7ggxtLBBfB1t+YwtuLQDfHJ93jEkYbwx/z2hWqrOhdD2wSjyutSWx09nTHn eeYuR32MuKXdZMQz/iOUeWAoI/X8HVxCXavuq9JEywU7M4No/TGbcj7hy5/ZT3/g1e5QuWpOOlA92 fNTYQOpQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBF1F-0001E2-NQ; Sat, 13 Oct 2018 08:11:29 +0000 Received: from mail1.kuutio.org ([92.222.216.83]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBEze-0007hy-MV for linux-arm-kernel@lists.infradead.org; Sat, 13 Oct 2018 08:09:54 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 194432092C; Sat, 13 Oct 2018 10:09:34 +0200 (CEST) Authentication-Results: mail1.kuutio.org (amavisd-new); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=lemmela.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lemmela.net; h= references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received; s=dkim; t=1539418173; x= 1542010174; bh=n0Xmd7FY193JX3x7QDQasOjJ464JZkigDA3BIx9ytj0=; b=b rIVdavjE+NwgO0XgleVrIdL6uRCKzklO457+aXJX5z9C9e/sOKuIgcvy5iO7JGLN nQpNU695tZ6l1TkV0qwik1SbOKXDOQzsTsWKN07scpZMbEfPWet0lWl2vKdnY16E mRqx4cvP6bLjhVh5rkLqnnuIfG1W2lqPRmy0LKenGe279Js9GjA9+Ef7t5SBBx+L 1WCyw321PvXzHl+kRM0Jet+h+b7Vdov0BgK4mo/QTqHwH2ArLJuJ3vl80F+wkBhz n7J5H++IqQK4aRzAAqzyHwY6Yq+e4CD/DpBZ1iEU1bMa/xsgCfQPm6PB16S1J2kR xuenvId1Gl9Zm/ipvP5RpT7GBOqvly1ElPzzLgmQyJVh+gTNIXYRHEM60jUnsLzN uEwOKL/et+FmZnfKpE9w4iba+/HjfDbnkkXmvu5yL0Rb9sxdZleJU6IWKsZHH4WR eJuzvb6OpOTB+Euete9+dQyqNOv0uCk5k7HTrubwX/xCVoC7I9VbOQ0SbfyiS9SP V7NQgP1BLAVfUQBHPAlAnaTgM6WIJCB7/xQYvhnbgf+6DNxF80CJuV0plUd85pDZ ccqNO7D922Mq7nJjHIO7J1opWMj7Nl/DOXRm5J8gg+8VVI97PZmrA2W54CdTxGbp G8kBYxBN1heDvEz6EVo7/fxIC/HxbhAC05LAai3n2Q= X-Virus-Scanned: amavisd-new at kuutio.org Received: from mail1.kuutio.org ([127.0.0.1]) by localhost (mail1.kuutio.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id S9_uVqHw9KHL; Sat, 13 Oct 2018 10:09:33 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id E3C1E1F99C; Sat, 13 Oct 2018 10:09:32 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v4 3/7] arm64: dts: allwinner: axp803: add AC and battery power supplies Date: Sat, 13 Oct 2018 11:08:44 +0300 Message-Id: <20181013080848.29894-4-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181013080848.29894-1-oskari@lemmela.net> References: <20181013080848.29894-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181013_010950_926914_4014F966 X-CRM114-Status: UNSURE ( 9.96 ) 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: devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Quentin Schulz , Oskari Lemmela , Lee Jones , linux-arm-kernel@lists.infradead.org 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 AXP803 is compatible with AXP813. Add DT nodes ADC, GPIO, AC and battery power supplies. Signed-off-by: Oskari Lemmela Reviewed-by: Quentin Schulz --- arch/arm64/boot/dts/allwinner/axp803.dtsi | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/axp803.dtsi b/arch/arm64/boot/dts/allwinner/axp803.dtsi index e5eae8bafc42..128177178615 100644 --- a/arch/arm64/boot/dts/allwinner/axp803.dtsi +++ b/arch/arm64/boot/dts/allwinner/axp803.dtsi @@ -49,6 +49,37 @@ interrupt-controller; #interrupt-cells = <1>; + ac_power_supply: ac-power-supply { + compatible = "x-powers,axp813-ac-power-supply"; + status = "disabled"; + }; + + axp_adc: adc { + compatible = "x-powers,axp813-adc"; + #io-channel-cells = <1>; + }; + + axp_gpio: gpio { + compatible = "x-powers,axp813-gpio"; + gpio-controller; + #gpio-cells = <2>; + + gpio0_ldo: gpio0-ldo { + pins = "GPIO0"; + function = "ldo"; + }; + + gpio1_ldo: gpio1-ldo { + pins = "GPIO1"; + function = "ldo"; + }; + }; + + battery_power_supply: battery-power-supply { + compatible = "x-powers,axp813-battery-power-supply"; + status = "disabled"; + }; + regulators { /* Default work frequency for buck regulators */ x-powers,dcdc-freq = <3000>; From patchwork Sat Oct 13 08:08:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Oskari_Lemmel=C3=A4?= X-Patchwork-Id: 10640029 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6AA82925 for ; Sat, 13 Oct 2018 08:12:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C1BB2B1C3 for ; Sat, 13 Oct 2018 08:12:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 500962B201; Sat, 13 Oct 2018 08:12:24 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 09BD82B1C3 for ; Sat, 13 Oct 2018 08:12:23 +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=JuGff5TV7S5AQCQLA1CSVutRc4Qw1Tepf7DnK1NUHoI=; b=knGJa1omUnoM6peB3mrZlYfUmJ 46Vlxo5eJYuCnAw1EE//itYUbF5mXr89pJz5g1X87Rh8fWNyor+pTliYBOpl62hbyc8Mgjl+85dw+ kIWvF8TadZj54myoW+5YO7aoLyKzJQljg5TeX/CbMyNfxOoTNvmCWGUHCjQK0fQlpr2WqMjYHwz/Z 7/lBjTUW2taxmBm4+bxV2WfK6gNaSCuEcoH/HmY20WOdSOhqjvvcHi26+0JnLIMcb15BE9PM1sWw7 ZGsvMHfTf+pO4xLcJPM1k4xh1XD7xL7s4akLXjjxg3hcCEAkdDDqxC8LJI7n7F+HGJOoyOaT9rJ3Z 5lZhHI0g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBF1u-0001ZG-E5; Sat, 13 Oct 2018 08:12:10 +0000 Received: from mail1.kuutio.org ([2001:41d0:401:3100::431a]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBEze-0007hz-I4 for linux-arm-kernel@lists.infradead.org; Sat, 13 Oct 2018 08:09:54 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id BDEA820B70; Sat, 13 Oct 2018 10:09:34 +0200 (CEST) Authentication-Results: mail1.kuutio.org (amavisd-new); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=lemmela.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lemmela.net; h= references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received; s=dkim; t=1539418174; x= 1542010175; bh=9AOQZD8CZEsYHFILfRVx3iqqbKmnzj1G7gNg4TQ9414=; b=P TkLAXcdt/+0aknn+uSKZESPZf+QhYSTonhco+NI2OTyeDuRd5a+B+hVyIw4iIrMg i7LGKfkSNpAdK2CqjiWb4wWdlbQsrRaD/CSqHIRqB95QH+bWrSbAcWykNgV8vKn1 GBFnHd4B4ICY1s3VrCVpbYuS7xMBn+crbu0WsnzloKjrf6xZJtwEsA0WsB/9Vf67 jiqE955LMp8FQG5TXU/7Q+XgbTwhYatzhWFgVQjxtvhOBfi9X3JRp3WLgakVZRNl oqJ7+SCWZq9EtwPHCUv4ciVunQwK7Rn2IVlEeIWYsRa50haWWgqXWYh4ezI4V1aq wTz9k/Kw7manZ/HmB+RjpeZCwzohN8q+OjgT0Fi3JOXerSakSB2MAoeW71Acw4+F 4dr9J3O2Ewh/o55S4K8rpSLXNo5bXCr0MSNEGtg8Z4i/xi6jNyKxP6rkKhcOSoSF dosqKuzUoWI2voQWJSA/Wic2XqL13onM7ibuF1UrjXvs8uYff5BTKb/3dVOi+reH 6g2xNcQMf9+Ja1zRXKKxkL33Ny8ldnwWmUIzNYohgGeVhcFWWDccSw9H7rv8p2xH 8/9fmKKF5kQ4If8sLjpviTIkOH//lHKnYkLDBxrzBf/DAvf5x1GT6SuQxuqRbmc4 RnOBTkRAxgBL2IPvUhEgj4auSF0fiPbITFo99YGU14= X-Virus-Scanned: amavisd-new at kuutio.org Received: from mail1.kuutio.org ([127.0.0.1]) by localhost (mail1.kuutio.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id BV-HmirljvKh; Sat, 13 Oct 2018 10:09:34 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 79CF3202F8; Sat, 13 Oct 2018 10:09:33 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v4 4/7] arm64: dts: allwinner: a64: sopine: enable power supplies Date: Sat, 13 Oct 2018 11:08:45 +0300 Message-Id: <20181013080848.29894-5-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181013080848.29894-1-oskari@lemmela.net> References: <20181013080848.29894-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181013_010950_738337_D3A375B1 X-CRM114-Status: UNSURE ( 9.27 ) 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: devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Quentin Schulz , Oskari Lemmela , Lee Jones , linux-arm-kernel@lists.infradead.org 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 Sopine baseboard have ACIN and battery connectors. Signed-off-by: Oskari Lemmela Reviewed-by: Quentin Schulz --- .../boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts index c21f2331add6..335cf2263d19 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts @@ -69,6 +69,14 @@ }; }; +&ac_power_supply { + status = "okay"; +}; + +&battery_power_supply { + status = "okay"; +}; + &ehci0 { status = "okay"; }; From patchwork Sat Oct 13 08:08:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Oskari_Lemmel=C3=A4?= X-Patchwork-Id: 10640031 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0736D925 for ; Sat, 13 Oct 2018 08:13:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA96D2B1C3 for ; Sat, 13 Oct 2018 08:13:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D9F272B201; Sat, 13 Oct 2018 08:13:05 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 6342A2B1C3 for ; Sat, 13 Oct 2018 08:13:05 +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=IDU3ACd1a1GV7tXCRIpcyel7291u7Ek6qsdAc6LOvvk=; b=eqrei1ZNhZdCIOgjMJOz9xtPhb 5/JIXXk9zY7xbO9m1d28RcnTwgxNV2HLGYdXPz3IL5/PPjD1WraJmkfOJzH4duUgh4JlfW/WuK3hL /l7GvRApvjXAeRfMBM6iEELvrIW5A+YTSTeWaMnzURDa1VZWgvbglwJCzvU0vdXe2jnY+SBKmFV17 oHxsYeRG1F6nlBuuLTdpYdVnDzhm7TSRcABxK+6F750kK4usl0v+uQWHe/wCwsYJ5v9f77JnPGwn1 1bgiH0CvrUYrR40URl83tkO39YPQgT25/wCRCjzKHltl2iEQXm1lEaRlj8dE2337jsRMrq++RA7bf FQwFPJ1A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBF2X-0001or-Jf; Sat, 13 Oct 2018 08:12:49 +0000 Received: from mail1.kuutio.org ([2001:41d0:401:3100::431a]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBEze-0007iE-Gb for linux-arm-kernel@lists.infradead.org; Sat, 13 Oct 2018 08:09:54 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id A8F0F1F99C; Sat, 13 Oct 2018 10:09:35 +0200 (CEST) Authentication-Results: mail1.kuutio.org (amavisd-new); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=lemmela.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lemmela.net; h= references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received; s=dkim; t=1539418174; x= 1542010175; bh=m8uhR3p38SRaJ+jBsn68IC3GU1eRDxR95szIsgGCzJw=; b=d r9ahzTdOtPSL+pjEf0oOqQgidgFFgFCkvGVgIQfP4jzl5oFzoMjiPlMllSYhUpGR MvXDXFInH5BWrNzyEmDJN7m10G0KT7AMk58TPsTm3OjSOkx2HpyV0euLhkaMa9Ea BPSKmD8ot84faLr7Qd2ArAj5ThD8uF5lQqyeReJad+cbFfYpr/tgm5I7H2OK9y+4 Ir+H3S1Qxc/a+TaN2SkydOLFX3Uq5IgZebbEfQMRBQr9aTdOxOItu6YuCBrwHz8z grRBlXs88O2OfmrDnBJi3u9fTrK+HPO5YpvYima4uDKBMS/VfDZYsx36ddVWuB1U kfK9wxQ+r1BhOKVHSJ0klKapY01DgC2ubwKI6twNsDB2yVIMe4d4IszYv5gSOTbY cbyc2QwTbuf7TSvckE0qEkjf5WSDSjy2MK7NefasurCwAScGAdsd+5u71Nq5boDJ gaXCePY7CJRmHyDhXxanj8DupYUxnWjaUvatCk0CDLGrBwlEmFt06MgB8mSyl0RH 62msUFu+krjOrp6xQUCu4tbwvuEihDhvD+WjG7rcUOP7kF5FYmcsPbWRn4KswNYP Gm9VI9Hg/hwOvmzAt1v4yIl7wMeX25eWRMPpNmekqdog+rkVcmLHnAt9ZgPuTc6/ x5Cu01eDYvMjk+NbWttJQmHYpr733vPe0krq8AqF7k= X-Virus-Scanned: amavisd-new at kuutio.org Received: from mail1.kuutio.org ([127.0.0.1]) by localhost (mail1.kuutio.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id QFGoSONMh1eR; Sat, 13 Oct 2018 10:09:34 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 0CEB21F99A; Sat, 13 Oct 2018 10:09:34 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v4 5/7] power: supply: add AC power supply driver for AXP813 Date: Sat, 13 Oct 2018 11:08:46 +0300 Message-Id: <20181013080848.29894-6-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181013080848.29894-1-oskari@lemmela.net> References: <20181013080848.29894-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181013_010950_840114_09256D60 X-CRM114-Status: GOOD ( 14.63 ) 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: devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Quentin Schulz , Oskari Lemmela , Lee Jones , linux-arm-kernel@lists.infradead.org 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 AXP813 and AXP803 PMICs can control input current and minimum voltage. Both of these values are configurable. Signed-off-by: Oskari Lemmela Reviewed-by: Quentin Schulz --- drivers/power/supply/axp20x_ac_power.c | 92 ++++++++++++++++++++++++++ include/linux/mfd/axp20x.h | 1 + 2 files changed, 93 insertions(+) diff --git a/drivers/power/supply/axp20x_ac_power.c b/drivers/power/supply/axp20x_ac_power.c index 0771f951b11f..059a97d6e14c 100644 --- a/drivers/power/supply/axp20x_ac_power.c +++ b/drivers/power/supply/axp20x_ac_power.c @@ -27,6 +27,16 @@ #define AXP20X_PWR_STATUS_ACIN_PRESENT BIT(7) #define AXP20X_PWR_STATUS_ACIN_AVAIL BIT(6) +#define AXP813_VHOLD_MASK GENMASK(5, 3) +#define AXP813_VHOLD_UV_TO_BIT(x) ((((x) / 100000) - 40) << 3) +#define AXP813_VHOLD_REG_TO_UV(x) \ + (((((x) & AXP813_VHOLD_MASK) >> 3) + 40) * 100000) + +#define AXP813_CURR_LIMIT_MASK GENMASK(2, 0) +#define AXP813_CURR_LIMIT_UA_TO_BIT(x) (((x) / 500000) - 3) +#define AXP813_CURR_LIMIT_REG_TO_UA(x) \ + ((((x) & AXP813_CURR_LIMIT_MASK) + 3) * 500000) + #define DRVNAME "axp20x-ac-power-supply" struct axp20x_ac_power { @@ -102,6 +112,55 @@ static int axp20x_ac_power_get_property(struct power_supply *psy, return 0; + case POWER_SUPPLY_PROP_VOLTAGE_MIN: + ret = regmap_read(power->regmap, AXP813_ACIN_PATH_CTRL, ®); + if (ret) + return ret; + + val->intval = AXP813_VHOLD_REG_TO_UV(reg); + + return 0; + + case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT: + ret = regmap_read(power->regmap, AXP813_ACIN_PATH_CTRL, ®); + if (ret) + return ret; + + val->intval = AXP813_CURR_LIMIT_REG_TO_UA(reg); + + return 0; + + default: + return -EINVAL; + } + + return -EINVAL; +} + +static int axp813_ac_power_set_property(struct power_supply *psy, + enum power_supply_property psp, + const union power_supply_propval *val) +{ + struct axp20x_ac_power *power = power_supply_get_drvdata(psy); + + switch (psp) { + case POWER_SUPPLY_PROP_VOLTAGE_MIN: + if (val->intval < 4000000 || val->intval > 4700000) + return -EINVAL; + + return regmap_update_bits(power->regmap, AXP813_ACIN_PATH_CTRL, + AXP813_VHOLD_MASK, + AXP813_VHOLD_UV_TO_BIT(val->intval)); + + case POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT: + if (val->intval < 1500000 || val->intval > 4000000) + return -EINVAL; + + return regmap_update_bits(power->regmap, AXP813_ACIN_PATH_CTRL, + AXP813_CURR_LIMIT_MASK, + AXP813_CURR_LIMIT_UA_TO_BIT + (val->intval)); + default: return -EINVAL; } @@ -109,6 +168,13 @@ static int axp20x_ac_power_get_property(struct power_supply *psy, return -EINVAL; } +static int axp813_ac_power_prop_writeable(struct power_supply *psy, + enum power_supply_property psp) +{ + return psp == POWER_SUPPLY_PROP_VOLTAGE_MIN || + psp == POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT; +} + static enum power_supply_property axp20x_ac_power_properties[] = { POWER_SUPPLY_PROP_HEALTH, POWER_SUPPLY_PROP_PRESENT, @@ -123,6 +189,14 @@ static enum power_supply_property axp22x_ac_power_properties[] = { POWER_SUPPLY_PROP_ONLINE, }; +static enum power_supply_property axp813_ac_power_properties[] = { + POWER_SUPPLY_PROP_HEALTH, + POWER_SUPPLY_PROP_PRESENT, + POWER_SUPPLY_PROP_ONLINE, + POWER_SUPPLY_PROP_VOLTAGE_MIN, + POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT, +}; + static const struct power_supply_desc axp20x_ac_power_desc = { .name = "axp20x-ac", .type = POWER_SUPPLY_TYPE_MAINS, @@ -139,6 +213,16 @@ static const struct power_supply_desc axp22x_ac_power_desc = { .get_property = axp20x_ac_power_get_property, }; +static const struct power_supply_desc axp813_ac_power_desc = { + .name = "axp813-ac", + .type = POWER_SUPPLY_TYPE_MAINS, + .properties = axp813_ac_power_properties, + .num_properties = ARRAY_SIZE(axp813_ac_power_properties), + .property_is_writeable = axp813_ac_power_prop_writeable, + .get_property = axp20x_ac_power_get_property, + .set_property = axp813_ac_power_set_property, +}; + struct axp_data { const struct power_supply_desc *power_desc; bool acin_adc; @@ -154,6 +238,11 @@ static const struct axp_data axp22x_data = { .acin_adc = false, }; +static const struct axp_data axp813_data = { + .power_desc = &axp813_ac_power_desc, + .acin_adc = false, +}; + static int axp20x_ac_power_probe(struct platform_device *pdev) { struct axp20x_dev *axp20x = dev_get_drvdata(pdev->dev.parent); @@ -234,6 +323,9 @@ static const struct of_device_id axp20x_ac_power_match[] = { }, { .compatible = "x-powers,axp221-ac-power-supply", .data = &axp22x_data, + }, { + .compatible = "x-powers,axp813-ac-power-supply", + .data = &axp813_data, }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, axp20x_ac_power_match); diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h index 517e60eecbcb..2302b620d238 100644 --- a/include/linux/mfd/axp20x.h +++ b/include/linux/mfd/axp20x.h @@ -266,6 +266,7 @@ enum axp20x_variants { #define AXP288_RT_BATT_V_H 0xa0 #define AXP288_RT_BATT_V_L 0xa1 +#define AXP813_ACIN_PATH_CTRL 0x3a #define AXP813_ADC_RATE 0x85 /* Fuel Gauge */ From patchwork Sat Oct 13 08:08:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Oskari_Lemmel=C3=A4?= X-Patchwork-Id: 10640035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B843D925 for ; Sat, 13 Oct 2018 08:14:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A873D28F2F for ; Sat, 13 Oct 2018 08:14:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C4D62B1D6; Sat, 13 Oct 2018 08:14:13 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 3D33828F2F for ; Sat, 13 Oct 2018 08:14:13 +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=EykIY6bGMcY0dRFWjecg4ThRZ0L3PPrheeaL0Dvj+gQ=; b=adVkSO0iN+IogCnZTzXLk4u+FY 5OIjqnhNjeJOGPdKJSs8aVWiNpRQK4pHP25QIpnE/WB/2cIMqrTF4OQLjsZvrcf5kzhuSpl3ZIOvn 6xorjYeFFc5x4KyhdJfZZHV/O0vy5QZ1TgJJJUWskMiIPOyTtlm51DVhgaNyU8buQIL4Zpt0xQLwL rdrcgmJLASUAs11zxc266HR4ra92Bf8z7F8tjxD0ZknW/ru7uNYfkx0+nt2gVwvSRn1NJciPZnPED TNbEjirhtBfpcqXREO8fZR004a8T6yJ4bsYZqemY0XR9m2QWODIeQQ3m26ggGE+z9ZbsCp0Oa3L1c QgN5XqHg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBF3o-0002TD-Al; Sat, 13 Oct 2018 08:14:08 +0000 Received: from mail1.kuutio.org ([2001:41d0:401:3100::431a]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBEzr-0007lZ-GC for linux-arm-kernel@lists.infradead.org; Sat, 13 Oct 2018 08:10:17 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 5BB4D1F99A; Sat, 13 Oct 2018 10:09:36 +0200 (CEST) Authentication-Results: mail1.kuutio.org (amavisd-new); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=lemmela.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lemmela.net; h= references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received; s=dkim; t=1539418175; x= 1542010176; bh=RDLMb/zCp3FWggHEX2Z0jTQ4Z/KHaPoFVBQtwQaF15s=; b=b wNzomrJ5xPpdsSODYm02IylMPMhrrBXXQo7mNWbB5gsdaVNmGZwFruW6BMQt0swL x+e1toU5R2Xd5HIHWFHdnu6v1Yf9KRJIE6sXqOvoVGg135CP9aQc1lG5jnulnQBh OJWgXRJc2cfrZZCwJcqhdMNl9toXxgqyQQ99EhgMLtDOHHSlxB4L5yEXQjKsE1DQ RTQeg9ON35FfW8IpptIR/R/seVR4kg74ofsMOjxjzIpq1UUqtq3KoX/gZy+Unzev LJq1DLLsn91O0KzLnzXyGLeMCo74rZKNxAxuLfWSTT8oh8GYO13mvCGxBciJ/JHs kpoS87+8aUrrsLaVoVpZ6tjgwthvPBijkNabv1EFbiHoeNSaC9sZkEiXzUutV93A gFZyFq84ewMvWyd+ntd8MQ0wlzdfF8FYFhZjp/Y4H4rEaS0brRrB57AX1Xgpt7VC 71wPAXzSozaykqgdVo/Ob9eOJi9ats8FSNHw5Y9F1UNR5ZCbkTkRUHwXPW3jNT5m haLGJSCtxdOYsviMIvPFXD0qmsCBV/gSL1B0QKGD7s6SqtncBoiDN4+6vmFfIymG YyzCgKymJt3YukWsgxCwPmsk8qEpb7PRozp+0XbIQNgJBE6SBCi4Y9B0hJatcHeZ lySxT/DQas9QL0+TjT6x23iAWSYzUO3ywNJYrb1sdU= X-Virus-Scanned: amavisd-new at kuutio.org Received: from mail1.kuutio.org ([127.0.0.1]) by localhost (mail1.kuutio.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id s92H13R-iaDY; Sat, 13 Oct 2018 10:09:35 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 974F52092A; Sat, 13 Oct 2018 10:09:34 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v4 6/7] mfd: axp20x: Add AC power supply cell for AXP813 Date: Sat, 13 Oct 2018 11:08:47 +0300 Message-Id: <20181013080848.29894-7-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181013080848.29894-1-oskari@lemmela.net> References: <20181013080848.29894-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181013_011003_743976_69CB0F66 X-CRM114-Status: GOOD ( 10.31 ) 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: devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Quentin Schulz , Oskari Lemmela , Lee Jones , linux-arm-kernel@lists.infradead.org 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 As axp20x-ac-power-supply now supports AXP813, add a cell for it. Signed-off-by: Oskari Lemmela Reviewed-by: Quentin Schulz Reviewed-by: Chen-Yu Tsai --- drivers/mfd/axp20x.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index 0be511dd93d0..dfc3cff1d08b 100644 --- a/drivers/mfd/axp20x.c +++ b/drivers/mfd/axp20x.c @@ -778,6 +778,11 @@ static const struct mfd_cell axp813_cells[] = { }, { .name = "axp20x-battery-power-supply", .of_compatible = "x-powers,axp813-battery-power-supply", + }, { + .name = "axp20x-ac-power-supply", + .of_compatible = "x-powers,axp813-ac-power-supply", + .num_resources = ARRAY_SIZE(axp20x_ac_power_supply_resources), + .resources = axp20x_ac_power_supply_resources, }, }; From patchwork Sat Oct 13 08:08:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Oskari_Lemmel=C3=A4?= X-Patchwork-Id: 10640037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8E9AD14E2 for ; Sat, 13 Oct 2018 08:14:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C84E28F2F for ; Sat, 13 Oct 2018 08:14:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A8202B1D6; Sat, 13 Oct 2018 08:14:56 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 001A928F2F for ; Sat, 13 Oct 2018 08:14:55 +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=uuVVZb5K9yHiTamspGN8kkD2kB6ZypmhYq5gjWyWUrg=; b=fuz8VLocTaeXUkpr10gLx+83zO /vlCpPFB7Q1tsmxERbW9sFAfyV/gOc8EOum5mZBvjIuyvg5f/eN27znovSd6RNlwYVGD89R2tabbV GWvP8qohgF2wDjbbgtpJ2A6Egsg+iUaQ7m/NgJv/hkVZQzZ1zM7uOWPxOhy7SZbMzQKFsNmKVNWPg 5SDsAT0geBSCj7PqGCbD1YUrjNRNLFVx7ti8Kpu6xsJJ8aEToTZl1G+8VexAzmNhBgdbhFkQnLnXy VaUURiNtGkdVoUGwXroa054n0SpR3ejyAVro9gaZxUfBbvv2k05xzMo2FRxZ9MrPD7BoYCpQe8fey PAlW9blQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBF4P-0002iX-0Z; Sat, 13 Oct 2018 08:14:45 +0000 Received: from mail1.kuutio.org ([92.222.216.83]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gBEzr-0007la-Fi for linux-arm-kernel@lists.infradead.org; Sat, 13 Oct 2018 08:10:31 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id F24882092A; Sat, 13 Oct 2018 10:09:36 +0200 (CEST) Authentication-Results: mail1.kuutio.org (amavisd-new); dkim=pass (4096-bit key) reason="pass (just generated, assumed good)" header.d=lemmela.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lemmela.net; h= references:in-reply-to:x-mailer:message-id:date:date:subject :subject:from:from:received:received; s=dkim; t=1539418176; x= 1542010177; bh=hFIzlqPfogdACLNOPs3fOziaLQqmcreIg9gvUuXfZM8=; b=C J+/YpmC3PWF7gvtXWW53855gHZ5mSErB9ImCzsfm0YbDjunylsMDTkVag1QpzS9I WtNv75sNpZo4m6OMT7zzFzKGLtax+61eclGhoPMTzPoE7g+DO8J4KumkDlSjJWEd DfDvCcjsPvDYeR+mhFgXsu+CHke59ZwN5vVqZL7j5PiXMPw6Gg3gyVxXSFIVFDxt VSVSnuHTH5/T7Sl365QfebqOvsAbtMOXWMRd3hkKU3BwoluKIYGL8r1VOQ7yQmKk jynC0+fTzEfLjJy2wZdJdlDfAeo8W5kuK5P+We3lVIvXaI6PUA5QuBExP76lIwQ5 MQ7WbzKAiwSGG7YdLJ117mo88MoBRpdW7182CIXFy+fr/9sG1m1NCeLkP6NyyhTk iSYwc/RiK0CHs0uL2KjdQwqr2ZcvWMkjLn47QrSpKMfeYnHNvOxOTuZUpEZ2l4Ym XSweLBj15C8mDuWXM5t8ArdTGK9i6jYx7TydzujNIYLe6W5w6/VFxTNC9P2VaZIF E9GfXrrx2Pu0F6zGThMY5DL1gsIsgiht/CapqdSjRmZqd537SqYeq1+6rIq7PacS JNSPIyiksBf9MqX1BWZwWqgjA19bLIytePWvblyNpEhuJebJ6MnfVJ+Y7Y3q6Vn5 kAMa29pFLJVobkY3iIInOTVTnPq3eRQ3fQgan6l3Go= X-Virus-Scanned: amavisd-new at kuutio.org Received: from mail1.kuutio.org ([127.0.0.1]) by localhost (mail1.kuutio.org [127.0.0.1]) (amavisd-new, port 10024) with LMTP id F34jGULZJGg4; Sat, 13 Oct 2018 10:09:36 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 35CB7202F8; Sat, 13 Oct 2018 10:09:35 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v4 7/7] mfd: axp20x: Add supported cells for AXP803 Date: Sat, 13 Oct 2018 11:08:48 +0300 Message-Id: <20181013080848.29894-8-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181013080848.29894-1-oskari@lemmela.net> References: <20181013080848.29894-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181013_011003_758648_021F57E6 X-CRM114-Status: GOOD ( 10.68 ) 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: devicetree@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Quentin Schulz , Oskari Lemmela , Lee Jones , linux-arm-kernel@lists.infradead.org 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 AXP803 is compatible with AXP813. Adding cells for GPIO, ADC, AC and battery power supplies. Signed-off-by: Oskari Lemmela Reviewed-by: Chen-Yu Tsai --- drivers/mfd/axp20x.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index dfc3cff1d08b..e415b967d38c 100644 --- a/drivers/mfd/axp20x.c +++ b/drivers/mfd/axp20x.c @@ -728,11 +728,26 @@ static const struct mfd_cell axp288_cells[] = { static const struct mfd_cell axp803_cells[] = { { + .name = "axp20x-gpio", + .of_compatible = "x-powers,axp813-gpio", + }, { .name = "axp221-pek", .num_resources = ARRAY_SIZE(axp803_pek_resources), .resources = axp803_pek_resources, }, { .name = "axp20x-regulator" }, + { + .name = "axp813-adc", + .of_compatible = "x-powers,axp813-adc", + }, { + .name = "axp20x-battery-power-supply", + .of_compatible = "x-powers,axp813-battery-power-supply", + }, { + .name = "axp20x-ac-power-supply", + .of_compatible = "x-powers,axp813-ac-power-supply", + .num_resources = ARRAY_SIZE(axp20x_ac_power_supply_resources), + .resources = axp20x_ac_power_supply_resources, + }, }; static const struct mfd_cell axp806_self_working_cells[] = {