From patchwork Sat Dec 8 17:36:10 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: 10719651 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 26702112E for ; Sat, 8 Dec 2018 17:38:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A4662B062 for ; Sat, 8 Dec 2018 17:38:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEFFF2B067; Sat, 8 Dec 2018 17:38:58 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 715602B062 for ; Sat, 8 Dec 2018 17:38:58 +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=T6aNQ4pVqHjqNysvff3LqlqFCoFiJXAxq5lID+1AHu8=; b=sPJ86kYiaZdaxneQMXezJZ8BHQ JZEa/X90ToEqeSspUIufwcc2BnRYCzrhgs71DA2EQSp1YMVOs99chSOeG8S5srm2IlRPqkiZd0N9Z FzITZ8IjfWlqQeJk3TB4fL/uZMd4aEkcmQHyQJqo7h0Eu49bPvIYlnHTUW9iMlDnMKI6JjeGKtPys crXzsYVVjoH7xWmIED+ZhZoZxxctMeNnU4PI5M7b5L2f8p9ktXVOm9S1o4KZ0SMxCZstGgCtcMSVj G3OixusuBnqoteYEd2CigIfgBhddWjslrd4sxYP9HULfbRQHJ/eZ3ydoU0C7ewb8h8kUK1RLNl1MQ QTiPHpxg==; 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 1gVgZ4-0005qa-G2; Sat, 08 Dec 2018 17:38:54 +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 1gVgYZ-0005Jz-1m for linux-arm-kernel@lists.infradead.org; Sat, 08 Dec 2018 17:38:24 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 0B20620926; Sat, 8 Dec 2018 18:38:08 +0100 (CET) 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=1544290687; x= 1546882688; bh=j3Vl2TNmgvtTSUry15fj4Q/WOZ4rGD+1mEVBj65G2EA=; b=t 4pZXgu8wlYWZF8/qL4FSx1TIP8Lr5sflpdLbhA28cazxnw7ImGo1oVTWoz2To+4C 1hMT336VKavUehec3fVShv4vGDL91/EWVfye2MC/dG1PrEnYaysyYeW8jap0xLJ9 5QpmHW19GwFM1PQA2lJcC4V55IbTdbw5V6Gf2e6BRL6V7cisXdvRHcj+XPYrMdQ0 7CtPgn6/bFRF72fK4vEeNvVSrqcUoGsRdY7LqoZw7OTzMJfHn79PGUAstaSBpAly B5UE24WgxVG2/13K0kZI0RExbwZs/eEAlBR5nu8vUQCtScfIng4S+XxmKeJ6eMge Cjrr4LxWvKAUrTMIg5GEgZfaDFicMvHDEK1bltNE3m/7DEWcSJqUFD7nvVuAEGZf Ji7WsKNJKsb0kKIiszJ6HK9MrzJOmFU3fBfcfmuHigkNu+TjDzsQu86Z9cne4HfP 9VbVnqnTKZ3MF/j/dAuaXTm0wol57/GFuzddC+ufSdlEUTjbZqJ0W3zbDfMHL+RO bc5qKBgYilDN7G7bhuGKuWBD+OwFHDgjVMJc4Mc6x1HG1Ape5h5Et0KVArZ2KI0k yxHkl5PMIapVQQ/Z+3H0kWhIsG3YHXOyVPeitT4BgSVCyT3KXN+UKgfMwM7fVVMy ycozXTdol+/Zx9SvTp8SzOi0aeWKLHn8dLRkYvHqng= 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 qfCflTAya_b1; Sat, 8 Dec 2018 18:38:07 +0100 (CET) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id ADA6A1F988; Sat, 8 Dec 2018 18:38:06 +0100 (CET) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Lee Jones Subject: [PATCH v7 1/9] dt-bindings: power: supply: axp20x: add AXP813 AC power DT binding Date: Sat, 8 Dec 2018 19:36:10 +0200 Message-Id: <20181208173618.31395-2-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181208173618.31395-1-oskari@lemmela.net> References: <20181208173618.31395-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181208_093823_268969_A6EF9FC6 X-CRM114-Status: UNSURE ( 9.24 ) 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, Quentin Schulz , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Oskari Lemmela , 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 Tested-by: Vasily Khoruzhick --- .../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 Dec 8 17:36:11 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: 10719655 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 1CF6A112E for ; Sat, 8 Dec 2018 17:39:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F37272B211 for ; Sat, 8 Dec 2018 17:39:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E7B392B20D; Sat, 8 Dec 2018 17:39:21 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 9A5CE2B20D for ; Sat, 8 Dec 2018 17:39:21 +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=tpiFJTtFJ5MVfybcB3+Ykna4sQJyb51wooBq78r2qdE=; b=sK7PvvtouliwXgfvHtYtbSiLw6 vuoiZDkJ4OppfnNSoaro1BJUkO2cZq57To0EyY3bXxWVdtEYrT9e/a4lbGZnwRcnF5Emp6+LbvsWp NpzcIbGqIaUwm5phAOTiQ084HoA/tlnF0wA/rjj9GprwGt3c4PhHu5pKE6RvXMVWgtfRSNjyizzya s3aYBQlVeQLrpOHhjo3Zk0hwvgr5WzNYhnHZyydLTyDDqqWuP9qV9D6XZ/TUKxoBpieSJUfganItK QXEaNOPmO0Pa/ZOtesBi2L8yczSGTWBtrIfzkiKWPgPIEeRF5e9C/fTTQByquj6EYP8J1NDUFp09W VwaFAShA==; 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 1gVgZS-0006AE-0d; Sat, 08 Dec 2018 17:39:18 +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 1gVgYZ-0005KB-2w for linux-arm-kernel@lists.infradead.org; Sat, 08 Dec 2018 17:38:24 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 9832F20929; Sat, 8 Dec 2018 18:38:08 +0100 (CET) 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=1544290687; x= 1546882688; bh=jXIX8izX1CAuHrKZL/jrJD5rwgJGf7wij/BFmTD06Lw=; b=V C56qkkyMJYe69QQFeBiWzvF2PiU0dc96IN4LSCOAlbqH58x6mYyhUYJ3XVT5EIOI /pL22kDKb7h2+tGxcBbaMJB9PtroCRjus5rxAhTyTcddmR7zS0o32J9GapTDHQwY OygE4IhXnKZGANbVR7MrirgmA+mbxQC+MQJT8q39+ZGy9MfCTpqbazm3jTJeFEPp 2+Q1mGvswMtrTMIDsjMfjT6na/VI5Q7XmvYfN5BPv2LEORGY7HcQSCWXzEacX9vp tQjH/KE4AbLVB4MUvKCLn+3NXhRNgeQ0ExJu5PFRXoGEXVowwyy9TpgsOaYhseCf gV5PTr+1dO+oBV75gWVI0z0cLWiuk4y/SPW04W6PpWqdtnBknEATMtXM3NAcLUv3 umeYfqfh6MehdLtGaSAbAVA982f/HmR1+M7mI4RmKBTjFq9686II6wSHXeh3IpKy HaJ6QdWkJNcme4LMDWOpZEn8oSzbjMt2EYCMw+usgUP63iNtPY94wkHzyv3zRRms 4xbV3sGpvehZ4IOkbZB4jjWN73L96Iip5t/AO+RaZM286PxWR6B9Wux/f4U3XQ+8 dP+G3PJeymchEhuh69EzKtE/IFGZx21mu3sLMDTiGXKGrZVUbMwuts7shrAm6n17 YS3IndTphn9aZwB3b/3fJfYvl0cjdrugz3z44pszrM= 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 IR-2xEhYvnHh; Sat, 8 Dec 2018 18:38:07 +0100 (CET) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 42E4B1FB8E; Sat, 8 Dec 2018 18:38:07 +0100 (CET) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Lee Jones Subject: [PATCH v7 2/9] ARM: dts: axp81x: add AC power supply subnode Date: Sat, 8 Dec 2018 19:36:11 +0200 Message-Id: <20181208173618.31395-3-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181208173618.31395-1-oskari@lemmela.net> References: <20181208173618.31395-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181208_093823_280136_5C754BCE X-CRM114-Status: UNSURE ( 9.42 ) 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, Quentin Schulz , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Oskari Lemmela , 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 Tested-by: Vasily Khoruzhick --- 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 Dec 8 17:36:12 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: 10719643 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 7760D13BF for ; Sat, 8 Dec 2018 17:38:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1973D2B037 for ; Sat, 8 Dec 2018 17:38:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0678F2B039; Sat, 8 Dec 2018 17:38:41 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 A53002B037 for ; Sat, 8 Dec 2018 17:38:40 +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=75sQVyWNcnRxm8G2SP1ZpDgArtCiciac57w913ssXpQ=; b=YdFehbaWfZixZYOOliSK08wM11 uBY3OH8mtu9rdFuMhAGpeHyWgo/08HF01MjDg0WeN16NiLJdtgT0Wb2q4hItk4HKDwPlijNY/LRe5 /cWbxaMIx8wH/9AD9AzuMevY3DKheTTwbYU7GdMuf3NmMRBrGB9/TVZxNMISE5AFZzmj5tzdN4Jyu aXlpkfh3MkkMF56ghg5xuZNZxH4ciR9sebQoeGl8oOxa/0vWEd8rQ45KRi5ndwnYRx/DsqGklc+CY rm3wCTEE3/JaPuvvRBBBSvxDPbVU8EVDYwNHEPOtrs9b+wGlCBYXs+w+ylUy6JRYDr+syCXpilfI2 jDh9qYzw==; 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 1gVgYm-0005YT-K3; Sat, 08 Dec 2018 17:38:36 +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 1gVgYX-0005KC-DT for linux-arm-kernel@lists.infradead.org; Sat, 08 Dec 2018 17:38:23 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 43D621F988; Sat, 8 Dec 2018 18:38:09 +0100 (CET) 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=1544290688; x= 1546882689; bh=QYpt9U4kN0fxfLWGOuGgh6WV6Aux5m8kaZEfxenP2QE=; b=q /u62eXUqo+65WEG/riC1UH9fT228GyddmsW4dCvPdK3M1SWkTAYuUoh+WkUWfR2E KMIL2AGWrGThV5SlhoQn/JNdoxXExim1u1jY73Lzs8kMDFc49TCqucVptjqPmyme WvgwpGaWomaRkUxwiejiy/WW+qPGdqe7p4GWiB7g7i9U1e2no1NZK7Z+q6GJpAmT yWsjhj/fEEra7VafQam8EJ6B+Ddn7Kat7VaLKb0SWy2Zs5riE/WkmsQ9LIMHdt2k BwShmI0J2m7L7ByCyhY9fRZJpChZXeEOXrwSdp6kAl+iiLFGXH1f14AhfMOTg2ND d8ksJ3UCA3ArJGo4Ip5NJz+vtoiyxELip2kfBWpTQHeEmNqC8rYB26eKEgOLb3lW jSr/1ge9Zi+dyblDIQGRWD2fsm7b6Son/YwG+z93QoRcP/vyddV8/l8Ywqkx2vw0 bpq1vQzUm04KeEmBNiZAeGRwpxT1rt2QZDRzRU/Yt2IWYTYN/HD+HtAdJ8dJJTji n9cIh3q3llgvF/l0HhsOjg8ssbS8ToubBfhXH9KU1N0CNhLEM619xRJFnjHvR+9t TOkUEvW6ialnwJM7WxvlYFu6+/E9M+61f1hTVTWfrevZxGEsPNJ3OaIVSIbCS7DX EmDa3Kb6PFApD0m/6lEi4yZ1nlpcJgc+to9uGbZggE= 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 Bfcy23ozd_Yt; Sat, 8 Dec 2018 18:38:08 +0100 (CET) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id CFF8B1F965; Sat, 8 Dec 2018 18:38:07 +0100 (CET) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Lee Jones Subject: [PATCH v7 3/9] arm64: dts: allwinner: axp803: add AC and battery power supplies Date: Sat, 8 Dec 2018 19:36:12 +0200 Message-Id: <20181208173618.31395-4-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181208173618.31395-1-oskari@lemmela.net> References: <20181208173618.31395-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181208_093821_749854_FD2B6B17 X-CRM114-Status: UNSURE ( 9.73 ) 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, Quentin Schulz , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Oskari Lemmela , 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 Parts of the AXP803 are compatible with their counterparts on the AXP813. Add DT nodes ADC, GPIO, AC and battery power supplies. Signed-off-by: Oskari Lemmela Reviewed-by: Quentin Schulz Reviewed-by: Chen-Yu Tsai Tested-by: Vasily Khoruzhick --- arch/arm64/boot/dts/allwinner/axp803.dtsi | 33 +++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/axp803.dtsi b/arch/arm64/boot/dts/allwinner/axp803.dtsi index e5eae8bafc42..c3a618e1279a 100644 --- a/arch/arm64/boot/dts/allwinner/axp803.dtsi +++ b/arch/arm64/boot/dts/allwinner/axp803.dtsi @@ -49,6 +49,39 @@ interrupt-controller; #interrupt-cells = <1>; + ac_power_supply: ac-power-supply { + compatible = "x-powers,axp803-ac-power-supply", + "x-powers,axp813-ac-power-supply"; + status = "disabled"; + }; + + axp_adc: adc { + compatible = "x-powers,axp803-adc", "x-powers,axp813-adc"; + #io-channel-cells = <1>; + }; + + axp_gpio: gpio { + compatible = "x-powers,axp803-gpio", "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,axp803-battery-power-supply", + "x-powers,axp813-battery-power-supply"; + status = "disabled"; + }; + regulators { /* Default work frequency for buck regulators */ x-powers,dcdc-freq = <3000>; From patchwork Sat Dec 8 17:36:13 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: 10719637 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 E89CA13BF for ; Sat, 8 Dec 2018 17:38:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C97022AB65 for ; Sat, 8 Dec 2018 17:38:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B94FD2AE27; Sat, 8 Dec 2018 17:38:28 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 1BCAA2AB65 for ; Sat, 8 Dec 2018 17:38:28 +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=nS858YbnElHE8uf5jkH4q6LYCUEavw5IbIT8QDSMYJE=; b=DWNIGcRVc6td6y2HTD7D1iwfpg nhVQNRVarewTAmu9GSp2P3N1XFPYcKjgIpkh4TIWA+o8zAaZSCB84W+p4ob+C0sAfORFbKVbImeyb IfRXpf4PEXS/UDS8HS2+2DL2lI1HS3U3fBGZzHHo/9NpQmqGoNcvSLAkEW3TihVqGxdkGcps1ubL/ dDU0/iVK/oVmcv7CCCRl7ru1Zp0pYkyHQM2Ii7KxyjtXMAu8nJxpuW8M/h6D9KjtjmlTLGCtEnj38 qYJwYsDYF6UhAW1jc3ruhRejBUHNeibMdBEGhPcv+xDVfV9owBsK2imY3S7mvLac1Yww1vi85mojL MKPoSkiA==; 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 1gVgYb-0005N2-3Q; Sat, 08 Dec 2018 17:38:25 +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 1gVgYX-0005KD-Bp for linux-arm-kernel@lists.infradead.org; Sat, 08 Dec 2018 17:38:23 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id A56342092C; Sat, 8 Dec 2018 18:38:09 +0100 (CET) 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=1544290688; x= 1546882689; bh=2Ufa8g2X6gl38LQeXSxK1nafFVhKZ/h1m5RVhJnwc00=; b=G J/rk24wTV3LF+sWsqF7w97R44D9BFo5crW2fQMcOzPhpgVaQqprcCeVRSycuUfoz MwS1unWimMKgfY2MwJvWkYPil9VENGJ3E65IBShtLoW+CuGBVzBHnU3RuwpwyfKw IhEGFMMeKE8jWn0Jz0fd4YJdfs8qG9Q+50TG4QT1zFAmEB5GOCUhpJHejjeqMAa9 tiUYvduH/wse0zUAVVOSsS0n5pnxqW9ynylENX+Zfai/4tzG1jRqyy1Lu5jUK2h8 ax8YF4MUIlxQ0XevLFKw+zEVn+BwBObVr0f8+RUJ+w349n3/ChCFQBwUa+Gol3yF nrlfbm3Wlrk6Uts4MamvCFjpsGAQ7H6C1boSq4l2Cr4q1foEP0c/RW8rFISvSsTF WAT7PJCSMdk2HOWqIwvgSN64NGQRZMPjN2dSWjv+6Lj4zhvQO5ZUS7DVVBsVmOEm R7IXmpmqDYmSwsslCiEk9lwWCHwnJJz8z8Cpv1S+gOLUy0psTQQVZuKuS5QfZCxX ffnDcxd4tTYSd5hdy9GgyDJoVIHMH78q2QnRBq4GtSncokQjEDRx841ws27BOngD oj/T55L9YNcsg2csYsBAbG1BDvJfynMYjnLQbqNJqAjHagTifBlb0yselWWeBSm8 4jgI8DvTpzxgs6n8gcQsgcMMhag4aTOvoUCRv69R4Q= 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 I1KkFdTi7BsM; Sat, 8 Dec 2018 18:38:08 +0100 (CET) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 6C71F1F96B; Sat, 8 Dec 2018 18:38:08 +0100 (CET) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Lee Jones Subject: [PATCH v7 4/9] arm64: dts: allwinner: a64: sopine-baseboard: enable power supplies Date: Sat, 8 Dec 2018 19:36:13 +0200 Message-Id: <20181208173618.31395-5-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181208173618.31395-1-oskari@lemmela.net> References: <20181208173618.31395-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181208_093821_547841_58027BE1 X-CRM114-Status: UNSURE ( 9.94 ) 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, Quentin Schulz , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Oskari Lemmela , 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 ACIN pins are routed from SOM to the DC jack on the baseboard. AXP803 charger pins BATSENSE, LOADSENSE, N_BATDRV, LX_CHG, VIN_CHG and IPSOUT are connected via PMOS driver to SOM VBAT pins. VBAT and AXP803 TS pins are routed to the baseboard 3-pin battery connector. Signed-off-by: Oskari Lemmela Reviewed-by: Quentin Schulz Reviewed-by: Chen-Yu Tsai --- .../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 53fcc9098df3..4695b0d407b6 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine-baseboard.dts @@ -80,6 +80,14 @@ }; }; +&ac_power_supply { + status = "okay"; +}; + +&battery_power_supply { + status = "okay"; +}; + &de { status = "okay"; }; From patchwork Sat Dec 8 17:36:14 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: 10719659 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 225A917D5 for ; Sat, 8 Dec 2018 17:39:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0336C2B211 for ; Sat, 8 Dec 2018 17:39:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB0112B217; Sat, 8 Dec 2018 17:39:57 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 E890B2B211 for ; Sat, 8 Dec 2018 17:39:56 +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=mLoTjZtH9vK4IzDIMpQp95wIDqdChSnB/+1bLaHi/Qo=; b=Nfo7AAjbKtqy8TLlVb6vekIEdc o+J+xffBqYwT9zTiQVdCHOCmeLgDW0KKvF1zzN1bEqW/X+K+HCtuNTto+2lXRQWqGO220q272xAQF YcB8UY9upDtCG5lO7gDQQP/ed891RB0/YlKvObNlHTAExyOrBPHcCHDpIr0RYsZVNnH5zbYk6Gxpt aFWJA0WrVZVvROCMb4/8n25iu/LDPRe0mhxRMZUY74z2YZH6GPy5eI61ieMXRaZW78VWgOiouYQXA xSZaAwwkF+EyamRclmymjy30NQySbTYFiEWG4tSzBjc2t6VLP9LcjuBeHe8iGMQAzZc9sTBH0Y5Fa imCPJwYg==; 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 1gVga1-0006e7-HX; Sat, 08 Dec 2018 17:39:53 +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 1gVgYk-0005Mp-DZ for linux-arm-kernel@lists.infradead.org; Sat, 08 Dec 2018 17:38:37 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 3275A1F96B; Sat, 8 Dec 2018 18:38:10 +0100 (CET) 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=1544290689; x= 1546882690; bh=YtsaaInLaSJV+mW4ZGJfvOx1QGYgTi0mgpQkgtrzmII=; b=O hxVa3wUBMLWd+dVgF2jYcYoWa7rmS5/ptazA8nQty5EKySZmcY7aBOWlGq30gSG/ 6N6SNu8mJVpyqboo9itD/SnrO/4XNTOl05zwL6ewugrsJa1mDXBmcQt3NFbhiStf WD56XAUtZzi1pdv5Y6uUElvwJ7R23gdTxNSCDfPVZOgJeGVw1He/VoBlRbvrUPaa RsCfm8b2vr2hub/swDj7KAFclRHZWLjpgJm+RgSyMwIAjOpZMBAyC7X5J8WntbDe Wk8cVBFhdY6T1LhW1VENjxnLBI0VH13J/ag7oz7UWu8zvj9gFupJO0rj3ctpoOD0 D2OaxqdDfY9j0ay7qvmtZQDTz2411ONMHN0ytV9LzXqDmPWtDBoDiKo21QpAOelb ElnJmcFPeWp73P5X8ow83kzG2AthkY2AmFTi4egyaWEECIP5Tm9uxGkQ4QwzIU9/ 2MQsDB3OGHHQyn4Z892hQZgSep2DdGys8M5v6Exr6nUtkmpwoUxR72FsI20CNm+O VwwnImF12RLUMSpRU49wwWEVxESwZ8J8cxqgV81mdHJsp7/MINGgw01hhDwevjso 8w8g2O/F5t4Gs2yLtQ0XQVvPSoVUiAuabe2F4eVLt/26Tc1SMp5JBHkBJ8LVwFSB G+7TehFqGsfaj+gkTxitYVHM/OQvMkn0+0bOdXwE8s= 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 QB1lwNE5Rws9; Sat, 8 Dec 2018 18:38:09 +0100 (CET) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 08A921FB8E; Sat, 8 Dec 2018 18:38:09 +0100 (CET) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Lee Jones Subject: [PATCH v7 5/9] arm64: dts: allwinner: a64: pinebook: enable power supplies Date: Sat, 8 Dec 2018 19:36:14 +0200 Message-Id: <20181208173618.31395-6-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181208173618.31395-1-oskari@lemmela.net> References: <20181208173618.31395-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181208_093835_180478_6205CFD6 X-CRM114-Status: UNSURE ( 9.71 ) 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, Quentin Schulz , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vasily Khoruzhick , Oskari Lemmela , 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 From: Vasily Khoruzhick Pinebook has ACIN connector and 10000 mAh battery. Signed-off-by: Vasily Khoruzhick Signed-off-by: Oskari Lemmela Reviewed-by: Chen-Yu Tsai --- arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts index 77fac84797e9..6a1402bf0362 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts @@ -148,6 +148,14 @@ #include "axp803.dtsi" +&ac_power_supply { + status = "okay"; +}; + +&battery_power_supply { + status = "okay"; +}; + ®_aldo1 { regulator-min-microvolt = <2800000>; regulator-max-microvolt = <2800000>; From patchwork Sat Dec 8 17:36:15 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: 10719663 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 01A9513BB for ; Sat, 8 Dec 2018 17:40:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D93B52B211 for ; Sat, 8 Dec 2018 17:40:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD2C32B217; Sat, 8 Dec 2018 17:40:29 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 3BB312B211 for ; Sat, 8 Dec 2018 17:40:29 +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=HRl9ZPRxiidJZib32tiWbAyb8cAWhOFMU/2/DvkWLFE=; b=p++GbMwCJkeEzv1i0K9hBu7kyZ EyszVqAu0ZWJ0xHB1XlgQCDjAAZvPZIzskz7Kv0ai4yikeTzgmzXSip1t3hutK0lNz0ZJS4NtZxr3 2HqhgzykrO+0L5jrp2QV1jtuGGWNwaTimPHIhzvi/omAekasXx8Q+9+ugnsJlfIfW6nF9HX4b3Jfu QaBeFzlI9sXCPJT2iH6MpvKAIoPv/kLwWERSSYt6A0DgMPSm+YlWjyDEzIL1g3FJWfYe+bZ3c4aBq KoIXiEY3o02gdmc04f4V8whXF0tfEn+bxlUnaktOQtW/dgmKH7NIbTHNOhAubMfmCWJixqTzoQGu6 kMKS8g6A==; 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 1gVgaY-0008ON-BS; Sat, 08 Dec 2018 17:40:26 +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 1gVgYk-0005Mq-DY for linux-arm-kernel@lists.infradead.org; Sat, 08 Dec 2018 17:38:42 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 19BE120B70; Sat, 8 Dec 2018 18:38:11 +0100 (CET) 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=1544290690; x= 1546882691; bh=McHTmJfwqv5vT4ak3tr5W+9VZ0cs/KhRnl4KNDz2q2E=; b=B jxMl0XNAyZ0DDKZ1ZBb/gJGUJMRT/yHv/F63A1KCvhOHp9hmBqz7cV1rjPu6JO23 Tm5Kppq8dGU55wWPQpvA51dFnRlMw4devTmHq0n+rBfuwecHWGChj6E/hZDUWSt/ SYHA+FVF2B2opru5KCahOmU0eYruvVeTrgd5PtQGLw1b8VX1Jh0QNpGQ0troCBtz HVk7dF5iQRBSPGWS3/3Z9xTmMAjDu7BOAYoptH4i+YlEHUuxOfP0KlEEIAgbNq/+ Vonpp93jzEhY/u7ChN3SwRflUuh+Os59jE/O7kyeCGKXYUGysr9O3RpqSnLWgv6h tkHEUSAuWgxtdA88k2zhfyjnjJeRbFZ8/EUvEBH4h0SIlRJJfRU8N22MWjqIPMGf +3ziJol1TS8Gs5SbzUn7dp/DRFqVN32qCScz68nMDYL3RiEqRHC41yzc1MeoRxAa h9moQDk+//5zQY0b/lf/3C404qjVTqwtLV09HjQK8ATAMd5qeg4mluAUxLnVvu/V F2w8QYSa7xCxY+4+kq49yqvFSsmKLDFvhj1L37r5Epz3JUBo8sEFaFKVx6QiOVG2 0iEXMqeT5ujj/EEf17vjrKF7wHvLWgRDkawfA9M3tAX+uOoujniyn9BTtlUcGgEK vMvrsdqtbTGRhX/yjOIBqvN9mm+OG3vxCpzmPM6AK8= 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 tfQMZucHYcu9; Sat, 8 Dec 2018 18:38:10 +0100 (CET) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id A42D82092A; Sat, 8 Dec 2018 18:38:09 +0100 (CET) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Lee Jones Subject: [PATCH v7 6/9] power: supply: add AC power supply driver for AXP813 Date: Sat, 8 Dec 2018 19:36:15 +0200 Message-Id: <20181208173618.31395-7-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181208173618.31395-1-oskari@lemmela.net> References: <20181208173618.31395-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181208_093835_225219_7AB4EE8D X-CRM114-Status: GOOD ( 14.88 ) 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, Quentin Schulz , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Oskari Lemmela , 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 Reviewed-by: Chen-Yu Tsai Acked-by: Lee Jones --- drivers/power/supply/axp20x_ac_power.c | 94 ++++++++++++++++++++++++++ include/linux/mfd/axp20x.h | 1 + 2 files changed, 95 insertions(+) diff --git a/drivers/power/supply/axp20x_ac_power.c b/drivers/power/supply/axp20x_ac_power.c index 0771f951b11f..59b4c8d3b961 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,57 @@ 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); + /* AXP813 datasheet defines values 11x as 4000mA */ + if (val->intval > 4000000) + val->intval = 4000000; + + 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 +170,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 +191,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 +215,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 +240,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 +325,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 Dec 8 17:36:16 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: 10719661 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 3EEAC17D5 for ; Sat, 8 Dec 2018 17:40:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1D54E2B211 for ; Sat, 8 Dec 2018 17:40:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AD4D2B217; Sat, 8 Dec 2018 17:40: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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 A93422B211 for ; Sat, 8 Dec 2018 17:40: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=rrs3d8TB4Cydo3PYt89hdp04GOqC0bRHk49vsy5ZGic=; b=O3CJ9SUqJQ9D9f/s+YUAaT6JZq WF77bhhqMBIVD9q0CVH8TOrux7iL4S2wqVmxAfe9i2d6eUTCwcHDx7PGZgOQnBaAMas0oX4zcGAqy afrzcoW3sKkJLBHe5WrPlzW/Fd6onVAfddUwR+KeAdikvmSuvqZKwpkrAqIC8U7JHyp4ZNNQJSr4Y KLlnAqD8jO7cERBgD2ngAL+g79shDacdPNIWauZV5J3MhbZB8cZxl8daNiaP9nBJCQLns5NBAq1uU Qg/Gj8UrZECWAZr04u/imN5DyDzlsk6RNH7jiFjh0Fb8eR0RZamvvp02NiEPIAuYuYOK2fGzFVdhd Ix3Zlx3w==; 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 1gVgaJ-0007Il-2I; Sat, 08 Dec 2018 17:40:11 +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 1gVgYk-0005Mu-F1 for linux-arm-kernel@lists.infradead.org; Sat, 08 Dec 2018 17:38:41 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 5CA3A2092A; Sat, 8 Dec 2018 18:38:11 +0100 (CET) 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=1544290690; x= 1546882691; bh=cfMh6AcbyeWrvCk50dMKmOhXsNrpnTzv4+nFyu7Nu5E=; b=Q o7mQIWzM7VSoUQwlHRNzg9qZ0ETnUWNQ7o0YWU9uzzei2Hd+PKKyY/N2MFuyXZwt aoJpyR91Wzb8Nh30mmq6LwzLBxh7nPTJEzFnAcEGdf/zzHMAbskKvuHq+eu5jtd4 159S37k3CCyLoD8/y0C01EvzmIhkmR2X3y+cJZJOYkX56rYwAve/8h/lbadw1BnR y/t/Imf1uDElx9XTc8zaYpaui3FQJlJGLNxGWLw5OwqUnBpnIEWXnTqoXspd8d8p lMeNHT0iPvR40exvmvDqRJoTOtbmvT48eYwg15Qy1te3lsqOuL9OU/zpGYQHIuMj f9FmsEkj11IUv+bkrNXTCly7P6Ans++alhMznvgsmWN7B6XoMCb5RZU8oO03UtIb KiGzh4xFnf4a4w/oOdU76p8MsX97Ui9m9s8O4icCjb+AT4R8/VMBn+UDzUbB8dOs VAckkgnUfCt/xzbpYzjbphnZkJzG9IImu8NGnH0IHAyVqwouVY8irdcCMQ8SbYwc 4hT/b0mvtLw+D9DYo+QYMXJJCMrqRIVYQTdLoNRuoR0R8X1GE66SNoHa1oHrXYuR 3pVSqt29+tn5l459FsRUAAZN1veFsQGPt2aYBM0SYCVGvGfvvvRmn95vWaD8TqVZ SQEoDdz/ybX8jgXlzjzEjng2WyKbkymYH7hynbG5u4= 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 8nE9SaZ1zfsz; Sat, 8 Dec 2018 18:38:10 +0100 (CET) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 3D7FC1F965; Sat, 8 Dec 2018 18:38:10 +0100 (CET) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Lee Jones Subject: [PATCH v7 7/9] mfd: axp20x: Add AC power supply cell for AXP813 Date: Sat, 8 Dec 2018 19:36:16 +0200 Message-Id: <20181208173618.31395-8-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181208173618.31395-1-oskari@lemmela.net> References: <20181208173618.31395-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181208_093835_665889_F2A4D69C X-CRM114-Status: GOOD ( 10.25 ) 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, Quentin Schulz , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Oskari Lemmela , 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 Tested-by: Vasily Khoruzhick --- 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, }, };