From patchwork Sat Oct 6 21:18:31 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: 10629333 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 0A1AD112B for ; Sat, 6 Oct 2018 21:22:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F041828C1C for ; Sat, 6 Oct 2018 21:22:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E41AA28C2A; Sat, 6 Oct 2018 21:22:25 +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 70A6F28C1C for ; Sat, 6 Oct 2018 21:22:25 +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=jD+sU6BQfh+CCHT/HbAVakNiO7VJ2rJvNiusb451Qqo=; b=qS26ruPcuqkNQ48oh+q2qrq5a9 yfmzMIngi06s7RuJN85Rs5Pl1EC1mWWB9jrccX4vFnJytgu0D5MhbC0Yx8Ts0/KQRWN/x291ojof7 BYyM+KsAUZK4QPk+AofC0vX4iVMJsDLvSJmvZwqVsXMilr5u5bauq3HiPzRVQHpda0IuwN8k0tMOk vHI1pB2MYwS6c9wKGzw7Bib9grYU+TCxc/sI8wkeeJnFhFAAR/z6mQL75ccr+xSAPKDbq8kcNoXvs XtsU8D78vvzPBK7FS43WSTP+7kyFj5mi4HfgnCIPJ6fEopIFXFopKw+hx+liQYDkvSoYoogWShVEy QdaeiNSA==; 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 1g8u1j-0008TU-Ix; Sat, 06 Oct 2018 21:22:19 +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 1g8tzr-0006nG-Aa for linux-arm-kernel@lists.infradead.org; Sat, 06 Oct 2018 21:20:27 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 76E7220657; Sat, 6 Oct 2018 23:20:07 +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=1538860806; x= 1541452807; bh=7GDl1ndnwqGbv+2YOjStm1fcMbJsyDoNyj9lXt0BCQs=; b=g sumN2vn53XFB7eerOA3q4WXsrsiVbN+kpuLw9vfp6iotOl9UoHnQZdtJt7kKkDDG p5XbCbbqt01V3KBPa8NtyWJwiohP2kMs2Njj7JYxt1CCbrUe2OBs4DWHz7UgnBub KeX7m2YqQj6Wq7pZjDxq5ihTmtjOYZNfIN86KDmACqFosorgA24g4djwKhzLApDJ I9wiLv4KQmtbd0WaJtJuZ7xpdel3MBn1+c7ssA5so/RX53PhEMJGowqKSzBXG9og JULJkkSPdXv+qD5YedOdEqgGoxxqWZTRnimPQbcWP3pcbO42MgCD6gcxH5d3iCCW 0NedhJrJRJqWPZAmb3oDuqtOYK2KNmPqBj3grdbO28/YQyyCIp0mchn2CmX7YJRk kLeckB3b9hXUrY4xImMO4mBfVWwoJ+LSdQXHvZbU0owdD/x94qSOhaBb9d9hoWGt ZeiS3nPSnvRogqNmxgsDVKt7xA1DWhuuSia6SQC8zkdSnaG4GIJ81yPWrrrUFCfO FMl+YcnRxMW13hzTJbakzRj7A4yc1UjOA8x2jNPq5J25dmZqiEzvqs9giGFD5OAM 0c8PbJV/L92PSAUhJ2wYkPkEoxJtE3wqF/YC+2lejPBjNp9jb+PLVr7ASkVe418Q FuwYGCvIEaZzWBXjHlNkZYdAWBThe9Ru0Do4eWwGbg= 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 zoTz0Z-o9c_a; Sat, 6 Oct 2018 23:20:06 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 23AE61F99C; Sat, 6 Oct 2018 23:20:06 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v2 1/6] dt-bindings: power: supply: axp20x: add AXP813 AC power DT binding Date: Sun, 7 Oct 2018 00:18:31 +0300 Message-Id: <20181006211836.28253-2-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181006211836.28253-1-oskari@lemmela.net> References: <20181004193410.7265-1-oskari@lemmela.net> <20181006211836.28253-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181006_142023_543769_733DA709 X-CRM114-Status: UNSURE ( 9.60 ) 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 --- .../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 6 21:18:32 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: 10629335 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 C1CED112B for ; Sat, 6 Oct 2018 21:23:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A641128CD0 for ; Sat, 6 Oct 2018 21:23:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 977DB28CE2; Sat, 6 Oct 2018 21:23:08 +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 4087828CD0 for ; Sat, 6 Oct 2018 21:23:08 +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=ElZ/nhKy5EqI7OHs8rpcPtcn359OkGNbxGxdpSx09SY=; b=lNKjrNqA4+jf8nniSaezwIAKgz VzBL+OFhJJEhU7S0dpjZnRb/1vtIWA8E3oici0VoARs/JbqvWDIzfd2KXBdZYUZSZzjBkceaf1QKn 5eQlOf74eMWZP/iDusKOYrF0ld4csF4okVTjuL/GWvV67urJkrpItIMnRT3EAmrNuYmke2VIoBVI9 bXF1NsaqXogCv3dGfktENaZZE66JJ/jYouk8xOHeFbBhXcr+cKVKGf0XkrGWqSfIvlXaxyMt0IEgh hw7OiYmc5/ffWW1E6UsGrTy0gwU2XMJ9palWrMXLNxdYdCFdAQoC4lBygh2152IZkpLdvPoSzugk3 hMMfC1tg==; 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 1g8u2K-0000Hx-UR; Sat, 06 Oct 2018 21:22:56 +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 1g8tzr-0006n4-8z for linux-arm-kernel@lists.infradead.org; Sat, 06 Oct 2018 21:20:27 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id D279A1F99A; Sat, 6 Oct 2018 23:20:07 +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=1538860807; x= 1541452808; bh=KKVyyBS4oW4DfmHiU/gqRxlOHearp/uEX7HgGQY69JU=; b=b QkeMIOE+q5nfrVnH5EH7pS/hS39coFr30nf9FxwzWIqoWbp/jSgBecix+F5JrkdT xjXLq2Hy+CkS2C9mglX5MTsMHN2JAin277J6aPWCRq4NnHLUpBXXOvVPML0vQeK1 wDjSfX8WdbAdj9BxmxvgWOayfh3fqWQzgkEFUlrWINVemIg0AiuJeeOSbrJhE605 qEieFdj8vyl+X3zDuP6qTNaBz2JBadtA2j5nvYqcybKgomNq7IbQM5BJNEx7DLHT 4ckEX/EPr7ed3MKFwpqNR1cNCDqgPkDNnBtpZks8ymiNY+H+QKcj0LTOV26vRmaX ATCws1CbmYnFs7DvYcJONFLhTgSYuJfJTGxD6fOMKraxXHkYKfDB52Me49gzuHt/ bmtbU5vVvmTlgBSIPV0UXKnhOe6KFg+Gmi5foZDV0cVZwmOWMDyFG2OOUDKl6q38 6PZyxdpFT6u1l+ggZSpovu+0WsXBM7jS3L2jpdUSpMAQtT1VF0KYeng4NQhNFOfk YiZYzu5NB78eplaPUAJt+V6Ohy3dlefnl1yOKYO/FT3NO0bQdxGhpLzfbJ+PLfC4 NKsEYdYAoD3MnQWE65zwu8HMILGVFf8sAwUjD/FneOsursxJV+R8E/srrd0H2ms6 OBlaKCwPfuDHEECVJrLypExvBEghsahioBXgNgS6Ek= 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 v4DppIMPGo09; Sat, 6 Oct 2018 23:20:07 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id B185F1FBEE; Sat, 6 Oct 2018 23:20:06 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v2 2/6] ARM: dts: axp81x: add AC power supply subnode Date: Sun, 7 Oct 2018 00:18:32 +0300 Message-Id: <20181006211836.28253-3-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181006211836.28253-1-oskari@lemmela.net> References: <20181004193410.7265-1-oskari@lemmela.net> <20181006211836.28253-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181006_142023_486134_1859A8D9 X-CRM114-Status: UNSURE ( 9.97 ) 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 --- 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..67c17151b584 100644 --- a/arch/arm/boot/dts/axp81x.dtsi +++ b/arch/arm/boot/dts/axp81x.dtsi @@ -69,6 +69,11 @@ }; }; + ac_power_supply: ac-power-supply { + compatible = "x-powers,axp813-ac-power-supply"; + status = "disabled"; + }; + battery_power_supply: battery-power-supply { compatible = "x-powers,axp813-battery-power-supply"; status = "disabled"; From patchwork Sat Oct 6 21:18:33 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: 10629329 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 399CF112B for ; Sat, 6 Oct 2018 21:21:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 293F528C1C for ; Sat, 6 Oct 2018 21:21:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CEE928C2A; Sat, 6 Oct 2018 21:21: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=-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 AE8BA28C1C for ; Sat, 6 Oct 2018 21:21:20 +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=Op20QSML8utuQxbHdWKHrrQdlR9Tfic80X7hRuHcmsM=; b=JfRiV8o0gMmUgLROKjct18qjqv J5e6FHd/wTVvZLBKHsXXUDz6kB+BUrTUROb5e/Th85jHyEJV3QBEwzLWkonLMLrHSwWNaneGe8YII hjNhOJqV1cawTrO2o0kclX0r7CkM2Wg71niRvY3wnFw/hj4f22fR8Bes/KzdiTBymVHrgOmgFqIlV xRxyEKxDQqwVeo/c9jT0ELuTYF0rFStt6HHtbIS3ATQnHXvusg3VRokyHSn6Q4wRDNsqsQcy0gXtv eLGNUuvHCrtVpR+PLzcO4gGu4uWGWTHc/QXnY5fIvsbKv+st1fLgWE9iNqqaPArMopB6zxOKYVp0m H4413X9w==; 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 1g8u0W-0007xI-N1; Sat, 06 Oct 2018 21:21:04 +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 1g8tzr-0006ki-7c for linux-arm-kernel@lists.infradead.org; Sat, 06 Oct 2018 21:20:25 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 942601F99C; Sat, 6 Oct 2018 23:20:08 +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=1538860807; x= 1541452808; bh=W+ktF4hdPsTh260RGfj4QSBAZhAjSZBjQblCUDMIGJE=; b=M VJrHLV3wpkl4WJhcfFA31P6sGQKFpxlwSBwGLMqWFoqDQxQ3aquKVG39XGwpPjYD McLMr8MdvoYg9guvk4xogT7YrRmLUtNWOLngyepEKB9tdy61SNaGwDnVY4wygVVJ s3OIJWLD61mmHAt20oKdN6GO4O6JX5F0OSNGSQF9SOClEX1OYNZWQJHBnxeF5YPU oUO9R5bOiO/WeGtQg4lS9DVyuVGBPx6pK3WtNJ4JYfxdUQXToAKgzUzdzKf4bNJb AFO2MrM3ss/ym5ZvBI77pH3oO9S8OgkNsF8IjPZGsFfZg2jDHQ9haN2Pmih6kteN XOJ0nDwF92e/6gHWN5GEoj2gGyLDjkqNyWDz4mDJcew8Iqz9Y1v7pMjdcQ/Sjtdu MuiuuXJ8a5iPqcgAk0CFCvbqM/00fZ8xqhh5IKs99TL9qopGgQYiRDD+HyRIdqmk nmK7WJzQ9tdUVf/MPfZdnRPX0d+QpQraKKbEoD5Nqgto3vYMwKkyanD7Qw/iiNF9 0VHB7lOQ4nuoTJEFnxH8ptH8V0F4qLfp93w8Slh6eV0eDCnNeQDcgqL4rdbmEOJ9 vOb2gUwH8eNvUQDwro4d46Lpyi4jmLeyNxn/5n5Xo4ftmLkgmJn2W78QDvcjcR1O SXtnciSEDb9pXc+aqvnZgHzww3GEVQPiCYludrfZSM= 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 pB62PhBHXOSq; Sat, 6 Oct 2018 23:20:07 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 4B0C11FBED; Sat, 6 Oct 2018 23:20:07 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v2 3/6] arm64: dts: allwinner: axp803: add AC and battery power supplies Date: Sun, 7 Oct 2018 00:18:33 +0300 Message-Id: <20181006211836.28253-4-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181006211836.28253-1-oskari@lemmela.net> References: <20181004193410.7265-1-oskari@lemmela.net> <20181006211836.28253-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181006_142023_457836_9106826C X-CRM114-Status: GOOD ( 10.33 ) 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 --- 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..533987b2fe7a 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>; + 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"; + }; + }; + + ac_power_supply: ac-power-supply { + compatible = "x-powers,axp813-ac-power-supply"; + status = "disabled"; + }; + + 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 6 21:18:34 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: 10629331 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 2549915E8 for ; Sat, 6 Oct 2018 21:21:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 163DB28C1C for ; Sat, 6 Oct 2018 21:21:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 094FB28C2A; Sat, 6 Oct 2018 21:21: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=-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 9FE6F28C1C for ; Sat, 6 Oct 2018 21:21: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=kh+npimug9AeAe73cckkw1PUxA+5G8XIoQ4ub9h4h5A=; b=FDcqUtLvSh863QzPd1YuRKzdqi TVCpaJv2TJk11FB5jAD/QKJMefei6aZMPnVS8VOnnU0ZP/nqV/qsPlqmAAEvfSQEie/vDdx23YQJK giFbUqGUgs5KrEf1xOSzZNNtd1ivWxfxfBFBRy1IgCjBvuXNJ+xwVXtV17RgVysX+jv1ELx+PJYPj 55zjv1ezzvNpY0XQ5NNOhFEShLE6j95lDQWmBDVKeZpxCGQ4vNHUVj/tWBKzlzCCjQiN3A9IjVuSy NhqWYnGoIR5rVtQ1o/V+IIebq3SxBVn9dSjyjEO3lCj2CZExROAhMeOBZ+eCZ6A66PEKPnfIjcv6d a8HU7exw==; 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 1g8u19-0008EF-E1; Sat, 06 Oct 2018 21:21:43 +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 1g8tzr-0006mF-8J for linux-arm-kernel@lists.infradead.org; Sat, 06 Oct 2018 21:20:27 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 1FFC820791; Sat, 6 Oct 2018 23:20:09 +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=1538860808; x= 1541452809; bh=01vMnBcvhmgbenPNRiP6vEWBw0VXxpZO/dS2anQ0+Ys=; b=t xRZ7Z5AFFFwfc0VfiscPMLai6ANacodU3/j3LeJ6r+NGadQsL15UlvG3R730+Md5 lvoZk5/bLHujuquTR9Aw68LXHDwhvclaXMwKfx4kmgkZWrZthWh7RJXTu/Z73cle emhtLVNWNpW83+bi4nMudjCUanEWNtnuJE16sZfu2NnzNup7knBrz74IlskNfCjF u60hQDLOUQ6aHDuI2LU7N1dAtkAy8Nzc2Rt0Vuq8sgGZeYsxbpLswHpMhQUxcIwM PsDjzzTc6xJRh5HgMrorgrbTGzzHU4cc1nlbIOf8eg+NlepXJpr6ukgPVHgYmcZO N040i3NV+F47i5wbWDJHDhSV0DEaj/MV04qt9eGRYFlDBSZti0uXGX6odMXqUHfl /BDUAhJSuymQJBdDzAbBx3SxaNDJkltl5sHoTdrDSWDncSmkuLV9yKnjWxNaylTx gudbsTnkGTonAAVjehqem8dTct03Ij8pmopH0lr+DxUz9pWcWxcLS3sltfDpzMhP Sp/HMJpck4Ivlzb5RrQoDrgCxchA7WGdV/smmTs4OUoqKoLGIGnbDdLt0reK/f4v oEAZdKs+CQp4KgD2Vzh/vdT+O4IVYS3nPp3vbE7wJbplMU2giP9VcwBnb9Sh1Cgf beF/mPDufzJiENBwm2oTMn4MbqOicggQ9AGQ7u2S5U= 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 0BM6ASD2Voae; Sat, 6 Oct 2018 23:20:08 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id DB87B20790; Sat, 6 Oct 2018 23:20:07 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v2 4/6] arm64: dts: allwinner: a64: sopine: enable power supplies Date: Sun, 7 Oct 2018 00:18:34 +0300 Message-Id: <20181006211836.28253-5-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181006211836.28253-1-oskari@lemmela.net> References: <20181004193410.7265-1-oskari@lemmela.net> <20181006211836.28253-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181006_142023_463785_8ED0F5E0 X-CRM114-Status: UNSURE ( 9.64 ) 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 --- .../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 6 21:18:35 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: 10629337 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 E1741112B for ; Sat, 6 Oct 2018 21:23:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D2B5528CE4 for ; Sat, 6 Oct 2018 21:23:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C5EBD28CFA; Sat, 6 Oct 2018 21:23:48 +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 7087C28CE4 for ; Sat, 6 Oct 2018 21:23:48 +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=/b1torm0cyuiVcHTBNxUgkrR3gLaXH6Nk3V5u3j3+GM=; b=jQ8eS6uZvKs9P5VQC5fWRDE2R4 AMqBZjwimd8BHUkmqRLbmVgG1kol5+C5ViVLj5z9V1i4/0/av+djSprZ407NPz4/ZHSGPPJ4muuaW wBjbEmMTl70AreILHpQIJynXYDwGlNah8M3VOODKAxm+WXqMINmTGW8hsEgpurzQCHEbKO7sZrdZo wr7Z1SF/W5ODV0ylxVkVDysd7cm9qfxGggFrCg5K0DRVI46/BEOvfua6VH4xNu6HdqxddPJH8OYhP bA7OFQ6c1qn8r2sI/dAE3maeDtxdd5DnLwxwUI/+n1bpL3jGM362uNULtf3odIYIfalz5VZxj2HSn 9k6rVa/Q==; 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 1g8u2v-0000Y6-Fp; Sat, 06 Oct 2018 21:23:33 +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 1g8u04-0007hL-CZ for linux-arm-kernel@lists.infradead.org; Sat, 06 Oct 2018 21:20:46 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id CED9720790; Sat, 6 Oct 2018 23:20:09 +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=1538860809; x= 1541452810; bh=ruX3wZR0GTvecoOmNyFlvQ1sc+zejmHze/zVBbMEiUA=; b=Z +QbnGZyfyBMPI3gsGxPPDQL0+T8kdMYNwDE1mWjnDDD0PS4kJ8CVJxbNHSQtlTQd yXZ3qx06Z36tWOTHKMO76N0CAuzCQGRainReSSucpatylm1vazRgub8BdvEV39ja REL8y0+E0LpCa53/Iiqf4QfA8OW/KBzgE5/l8pTo2UQ02W1igpYLqDu4p7HPP3Ll 6+0ghn4XYxjnzgHjiyddseFqHYRu6GvFgOJlWxRNdT0BKyfJhS0tpzN/8fMw+sLg MlFAFDg8VZSXEXHmPc2dzrwe9f/1riNXWlRPmIIRmLwoIR5+aQxhyA0B/uzSNq22 bD53JMzuQM95pf9kN+KbFVvxyDJIN/8CwnqsHxfzuOU+8z0YxqoLtGWukg/hMcw3 y11L5TNTecGeoxPs9dhfVcGb+KLQaYo8ICSwjhvscSUQt18hhIgBh7m02+5FqPsQ diWTXqjRcsDeNm5AD/i+4sEfvPx8ct4sGvkdmZPL0JaX9/Mv40OO4b+hZhQ/yFGe GOs+d+9xehfcaGYBiHmNufz64N768MPVHqzSG+i0cjKgFAZcuKzidAMyZVt8COw7 BQ2zmi+6MuX3ofoF0vJOoYymHSUyLAJ99+4v/9M0NP+1BCMNgqUaQ2nv3aracH/V eBVY58KGRTlOE2ywRaMLIfH3I/84nOFEcMPkOrLrao= 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 T9ymSrKY-3T3; Sat, 6 Oct 2018 23:20:09 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 729211FBEE; Sat, 6 Oct 2018 23:20:08 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v2 5/6] mfd: axp20x: add support AXP803 AC and battery power supplies Date: Sun, 7 Oct 2018 00:18:35 +0300 Message-Id: <20181006211836.28253-6-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181006211836.28253-1-oskari@lemmela.net> References: <20181004193410.7265-1-oskari@lemmela.net> <20181006211836.28253-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181006_142036_769289_1337193F X-CRM114-Status: GOOD ( 12.53 ) 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 needed cells for AC and battery power supplies. AXP813 AC power supply cell added. Signed-off-by: Oskari Lemmela --- drivers/mfd/axp20x.c | 22 +++++++++++++++++++++- include/linux/mfd/axp20x.h | 1 + 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index 0be511dd93d0..215f0b009728 100644 --- a/drivers/mfd/axp20x.c +++ b/drivers/mfd/axp20x.c @@ -731,8 +731,23 @@ static const struct mfd_cell axp803_cells[] = { .name = "axp221-pek", .num_resources = ARRAY_SIZE(axp803_pek_resources), .resources = axp803_pek_resources, + }, { + .name = "axp20x-regulator" + }, { + .name = "axp20x-gpio", + .of_compatible = "x-powers,axp813-gpio", + }, { + .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, }, - { .name = "axp20x-regulator" }, }; static const struct mfd_cell axp806_self_working_cells[] = { @@ -778,6 +793,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, }, }; 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 6 21:18:36 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: 10629339 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 E2551112B for ; Sat, 6 Oct 2018 21:24:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3EAA28CE4 for ; Sat, 6 Oct 2018 21:24:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C796A28CFA; Sat, 6 Oct 2018 21:24:26 +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 5C23428CE4 for ; Sat, 6 Oct 2018 21:24:26 +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=lVbUUkZRpVIp4rNgMTnWSPkEbAryQJmAgvd/qYxtNg8=; b=hVeZ1+ugfWLtqmVRwxs2VkFNqn nofNGco0A5Din7laWEBT6Bz9bcv9eY+VSTgNnG6zgkNvKLdDpYEL81HTzijdU9kAzgyph8Ow4LRCd yTuQulZ3ZioB/ptgHAJMmB2p2FLBHM9j8ekqmvDh0oTF6a1iZ5MQrxLYy7JS5BAX+goW7eMAUfs5J 54BFc46v0UsNPuO7UwddGjPuGlQLaZ13H4JVDGF6D0z/d7oVWtgvR5nkuSb0X/duK/PcQfq8u15p3 HwqyuJYXgWeXYwlAOi8IV+IFn+fVQuiHXZOz3HJrrC2HWBJ3H3QLp/30swurZ/eQwEiFeXXgAQINf UGiwcmaQ==; 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 1g8u3b-0000sB-F3; Sat, 06 Oct 2018 21:24:15 +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 1g8u04-0007hM-DT for linux-arm-kernel@lists.infradead.org; Sat, 06 Oct 2018 21:20:49 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id D26DF1FBEE; Sat, 6 Oct 2018 23:20:14 +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=1538860809; x= 1541452810; bh=RnIBxgk7LylL0C4GXdUGxBfeJdUQou3JPTyo9vzLAz4=; b=H WcYcTZAI8D1xmaL66LKveQhxM1GGBCb+0VtDWZzjkl0BYk7fKMNBXb4iOTdIQXE5 cOsgsHV6ZzojEEPpTA+N+IphvRfO9FIU8GI60BWmr5YZ3MNmd7HRITFhjkTbQJhZ tRjlw+vtRtdsh1tWh03BHalkreTap/6l1Pqz9xOxS9wMzrgyef9m48RFAdTW1zl7 oKUIbO0FS6LonnpSpeZkBu6nPENA8h0dZeRZ39eyMq77XfAkYsc4pEwNYm18+An4 3HPgLnb5EpSafhU8NyLdqHIr7YwhZdPC06usreiZYGMWLsj5aAHnsf803Tkt8S5p 2EsTHfY55LjX1/FWCL4v9+2VcG+1PkouZ/QpLJse2yxzIGK7s5u6WJyTy+FjM9m8 0OhjL3ew1mncOGU/wTpQyafS5DCd7mwvwkdWGenNWGu9AWxIyd3hagiWinlgDyEO WHDHRS1tktAGhMBOo8XF+FSxUM2al4pV6QONEUVPU9aFBOLNZVSSPQeWFLblFLdj 8UBsdimiu8CSoVrNZUSWGTgW0a3lN+g/i7w9Uw4VyYssNl+rPeFBS000aSsR7Mn1 KjgixrtxkTQw3vfGVWhaK0xuzCCtKo3IKsriaQqFPRg6jHdvPL9idfRi5AGR3CHz 5HXJLF21KjUUkQXqNJAKl0nxWK3g1m6RiULeW9ruLU= 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 e1ZNZHzeL6pl; Sat, 6 Oct 2018 23:20:09 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 131521FBED; Sat, 6 Oct 2018 23:20:09 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v2 6/6] power: supply: add AC power supply driver for AXP813 Date: Sun, 7 Oct 2018 00:18:36 +0300 Message-Id: <20181006211836.28253-7-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181006211836.28253-1-oskari@lemmela.net> References: <20181004193410.7265-1-oskari@lemmela.net> <20181006211836.28253-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181006_142036_783507_B8416C91 X-CRM114-Status: GOOD ( 13.98 ) 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 ++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) diff --git a/drivers/power/supply/axp20x_ac_power.c b/drivers/power/supply/axp20x_ac_power.c index 0771f951b11f..92a92354f6f0 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 axp20x_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 = axp20x_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);