From patchwork Mon Oct 8 18:19:02 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: 10631221 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 109FE15E8 for ; Mon, 8 Oct 2018 18:22:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 046D429984 for ; Mon, 8 Oct 2018 18:22:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ECD1A2998E; Mon, 8 Oct 2018 18: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 7C3E229984 for ; Mon, 8 Oct 2018 18: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=mbnjeScuQqlASn2S6/j0JoS1PV U2qfIalqaHQg94AP8fLh6AFJKrXZvZD+q6KLX8uHbVjTtGss50ZTIJ9lMuU2HjsqFbGFoMNY7D4JJ 7y4Q889d46YYNfNNihg/fYjs9ldykkR6hSCGv6/EE50Y7/1NGeMSKqucySpaBmQlmHW41FVrKG2Rj QXJoIel9Zg8/6WwC6SdpbnLXvcH7zj8hN2Pnn/KZ4xkTevzGEgtgjvkoyJA6hfL0/t89Q30Skj4FW zv9ZJwPQsWaPGEQncMdPftU+w6N3wM0RJXlvaxYEEJV1ZaEORZIbpiK+Z9FwCXK6hfzPDWd0LQaki MpE07ypw==; 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 1g9aAc-0003J0-QD; Mon, 08 Oct 2018 18:22:18 +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 1g9a8f-00011U-1B for linux-arm-kernel@lists.infradead.org; Mon, 08 Oct 2018 18:20:51 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 011832092C; Mon, 8 Oct 2018 20:20:01 +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=1539022800; x= 1541614801; bh=7GDl1ndnwqGbv+2YOjStm1fcMbJsyDoNyj9lXt0BCQs=; b=u VmsetXPlK4oeLH+1nV5R/cFsFnZThA9yFl4Z1kHnnip3BI91L/gbIZrEvR9nbxSD 2OmhQSYOylui8e3BhjE8AITcyODijxp6LXv5XXSsgTwS/SLBVlCq2+vHh8IqN+VB T/tzNWTifhQkLOGRdVifrZWmAJR0f8iyD0vJM+k7eRpSOzX0rShrZD0bNhRVtwr8 qAgQU4mgpEUPXf3sZ1RRjLLrGNOtBiPl88P8/88qtN+czEwegb0tuG8PHg9rZurL hlFBpfu3p9YUEbZs30DpScur17rdjHAh6IApatR2q2tJtzG7u8VYnyCzPqOaFwIB ZSMaoV1tUj2OBIlZFu5BA2npt9RSYsDRJNOE/pjkaLS/a3EqzWz4OrFRqJznIPRD xDNtRpj8+2YyZlX7tJk8lHs8bttlqXEYQ0ycwunaGzKa8XSek/ZDM0AWig2FzLrw gCKgYkgY5hZBU1yUB8UBdwAetxaSNtG88LxHnN5lTOjycvjg3alHxbQj5/cIXgjw SOrQcL/7c8qDk+I+DmlqvE73Af9yxZs/8QHWPvo4iA71g6voh8dO+qLkMtFnx9x+ /ITJ+ow8rPYJaG0hGhhn58XDIUnq1VFwv28oXbr2Wa77mODNTzUf4EIYhcAZsJz4 NFMSZopFYgFpg5LZAujPEBMnPf4U/l8vlkCcYIMK/Y= 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 0pncrSTZGO9n; Mon, 8 Oct 2018 20:20:00 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id A9ECC1F984; Mon, 8 Oct 2018 20:19:59 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v3 1/7] dt-bindings: power: supply: axp20x: add AXP813 AC power DT binding Date: Mon, 8 Oct 2018 21:19:02 +0300 Message-Id: <20181008181908.9456-2-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181008181908.9456-1-oskari@lemmela.net> References: <20181008181908.9456-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181008_112017_251692_B92B535A X-CRM114-Status: GOOD ( 10.03 ) 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 --- .../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 Mon Oct 8 18:19:03 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: 10631223 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 1AEE9933 for ; Mon, 8 Oct 2018 18:23:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0CF90299A1 for ; Mon, 8 Oct 2018 18:23:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 00C21299A7; Mon, 8 Oct 2018 18:23:04 +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 7C908299A1 for ; Mon, 8 Oct 2018 18:23:04 +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=cOGwO8Yc4bh2gyVkRT4fY0gbIv95lIFvqRomaoOAJi8=; b=Gv5o+LQ3inAiUk0CGI6OFJX0aY HKmpiYBTyNNBZ9Hg23A6glqp/Ly3b+FY4QMpmiBAJSUmsruY5NTlEq48lFPGskgIfVRNWvg/luXG5 qgh4mfA2QedDG0HlOfM6FThIqIwdv4U0wNZZgIkfNJ2Te7X81VrLMB4lkHUxQbYmEBUMIlQtwScfO MEpbYyBQ5cNDv1fMXKdel9Wlssb/2bnnOB+rjYaIEyNKBvoHw2IwXm81mPrkUk8OxSEeRvJoCLp4z 0x/Yn5LyBD+HR5+nIcxewo9nrHyyB5SfEUuYT2UnhuUini+B94QD+BGBxFG60+yacI5pBo5WAATHs ikUgJDEw==; 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 1g9aBH-0003a9-NS; Mon, 08 Oct 2018 18:22:59 +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 1g9a8f-00011z-1T for linux-arm-kernel@lists.infradead.org; Mon, 08 Oct 2018 18:20:57 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 970891F984; Mon, 8 Oct 2018 20:20:01 +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=1539022800; x= 1541614801; bh=bIA8961skFS3aGjLCRIVUiZowiuj4nBOB3flC/q58j8=; b=V GZmEsem+LvE3bXzzDAoHu1dtKSyMNDP8EXsG1p0ItkmZVbUqmezlAcfjmmgFpmtA pH9nyUH7fdqsteT/l471p4sTxmPE1/ezh4ujsweb86bIWaDqAlA6pOxXHEbmzb2x Q6wQdjqZ6SlLdoCzXzQK79C6TvypuNic7gnfL1e4xHOcx1zzNWpsNrIRLTytBOQg qKexRe0u0pLG/fXdvX5fn9lJ81tcbWB8vqSfUst3QXwBIqi8CWYRkKIBUfd0ZFFX /t7SLm0h9UyAGTiHrpVv4eERI2Rqh86wibrZvi67NFbg/UT45oUKWHc3cDNOQVOx 30+P/KpDWj3JYtbojAXBmHoI+eFyLrvGKPOZy6Op8CxAD4V/rdf76EvuSyb+of9k Rx3JdoydXu2e6bDoDYm7usgqXN5C6ciIrP9GpwfSd1NnCkAQDHxwBHyfwkcICwvz cYDEWCsi8bnucSYKSrARgDYW4a8mgoXH6CkU2o9Qny6g6mVvspzkKRcm9l4Grpaf IwluSRsGSkNhinvvIsnCQGuG3TzI0Lsf71nb1JMsTSIfF+9A5lqzHjPy2mi03v52 g/Vq3jncOZRT6mzbcACWJRgoMCzfbw85HmXD1L1uVvEGMRp+kByIuU6rSGw0l5aA /dunbExhGUXVXj5im0A+rSSD4OqhEuRSRWjTid7j7I= 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 tcArbIAGhriw; Mon, 8 Oct 2018 20:20:00 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 426C220929; Mon, 8 Oct 2018 20:20:00 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v3 2/7] ARM: dts: axp81x: add AC power supply subnode Date: Mon, 8 Oct 2018 21:19:03 +0300 Message-Id: <20181008181908.9456-3-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181008181908.9456-1-oskari@lemmela.net> References: <20181008181908.9456-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181008_112017_294865_AE318A28 X-CRM114-Status: GOOD ( 10.21 ) 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 --- 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 Mon Oct 8 18:19:04 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: 10631211 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 1B890933 for ; Mon, 8 Oct 2018 18:21:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0EF3E29931 for ; Mon, 8 Oct 2018 18:21:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0263829937; Mon, 8 Oct 2018 18:21:35 +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 9018C29931 for ; Mon, 8 Oct 2018 18:21:35 +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=fsPsQD/1MKduYgn0zNlElTiRLIqN7Ge/v13dV7bQkO0=; b=Wjb3+634yy1AkhpTlj5hefi3Do TFs+lt+zGhSglSiAZzpPT1lwG7hVq9l2XGdA4o7U2/E7vtvkgWDeEY1+sJEHmyY6hRFIgbSt+pBUk Nhd74fTPxfMnc8zxQeBlDtBXTW+K7+b5XGsWnTUWXB0NH+58LfI6tWxSC1EkAM9qp+cCx6vvTEKZN rlAPL0uEb3NdiZKsQTSDB4fxjCX2PH4GJdrxOEwLG+1cYSQI4kQgPNPxNcnPaFkap1hXkBr1Aj698 qeDbqQ1VlitpR2j6Mzz1RAtSL2KfmqjKpw1t+/AJlEA/vVzcZu6faxG442+EUoW+0Ytio51dq9bqm 74OUg/0g==; 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 1g9a9r-0002yc-4M; Mon, 08 Oct 2018 18:21:31 +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 1g9a8e-00012j-Nt for linux-arm-kernel@lists.infradead.org; Mon, 08 Oct 2018 18:20:51 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 3C33C20B70; Mon, 8 Oct 2018 20:20:02 +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=1539022801; x= 1541614802; bh=hEUYMo1Vz1NId4TzMsdN8D77MBMdDVkUeXmyqIkV8KM=; b=X w6GkDyQzP+EcZ69C3YCqCsKlhpKn3hGfJtPGiNrU13VAO1/lE/5HUsV/wQrWGYuA lsNAeCe5CgupCV/tbGqFQvIeWVB1XkFhmiAAMlnJjcwOWfwYu4lz/ThNCRgFQzKT taU70qsKo9qzsgD+Da3W4vY17a0mIVvT+Gw045lecAHizLAM9t5sjT5Zqpp7cNFL shXoN7pZlOhZ8AtvSDMt3sxs00WPrCtIkxIA6/pvJ3XUZz61zqGey+YEGdrydDFV +pvBqxD5yymgT50QXRuAJDcvtPAsgSErFmSEYW67apzS6sU9PltYDl+WEuO6mans X9g3pUDeO0/xXwB1eUivwxJH3Es8jOev1Q0k6xizHxXhpN55KbWDn2mwhAuSmx/2 jm19W+5hGzDIuomFJ4RUQXhzZXleQwGblJh8z3e1WpU2DfUFsJGBvvTmCaui+uzI eLt0k0QQDGrOO+H+Xc0EHJtTeNKwmWIpIyfbCl8HGahllpJHOgZBZ0QzlZpH41mu r3sa+JQ9Fidrr8BKDZbx367DKvkq7ktNtVMCILFnjCwHerbAcY7AAJTOK1N6XkYu TBNUX/rVfNS9egfZr4/RNwjnUyoc0eHmtgXkq/tXQ+ikb6dQ0If5WvCDxiWbQtvJ YFUylqnYTW4xALs8b8slXOe+Ws1VYnCiLP2w9faTbc= 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 JfW5OItQrX0l; Mon, 8 Oct 2018 20:20:01 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id D626220791; Mon, 8 Oct 2018 20:20:00 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v3 3/7] arm64: dts: allwinner: axp803: add AC and battery power supplies Date: Mon, 8 Oct 2018 21:19:04 +0300 Message-Id: <20181008181908.9456-4-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181008181908.9456-1-oskari@lemmela.net> References: <20181008181908.9456-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181008_112016_970208_640C6EA9 X-CRM114-Status: GOOD ( 10.67 ) 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 Mon Oct 8 18:19:05 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: 10631271 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 706CF14BD for ; Mon, 8 Oct 2018 18:31:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 636C729733 for ; Mon, 8 Oct 2018 18:31:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55E752977A; Mon, 8 Oct 2018 18:31:02 +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 EE21F29733 for ; Mon, 8 Oct 2018 18:31:01 +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=GktCzICPplNsMVsSHZHmqMLR1N VfBipEwnPE/CtEVGNzvoRauvlRsd/WMsG3oazpJoxeyPgT0F6NnuhXD5qFSgtfE3jBX5oEY+vx9+W XK2veNBPDzVEBCtIT8+xc/MEye540yY53Bb0niuTNTDuecXaiWD3an1bTgeYxP4tF7Il/+4nKsHRZ 80K7KiZhP2sjzEUZp6rCfpKFD4ugrL7llcSE4h61l+RGzYb8KjI1xht1z55FVBRXlzYjVudokxFiG KUhP0OjhCn7m6RqPDUMAOHlho0fhnvD4xuivNwvbmzg7E4zgYD+Q/juQrSXw/AIZ9dJplJa3DGYlr GEyLmH/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 1g9aJ0-0000Jg-NU; Mon, 08 Oct 2018 18:30:58 +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 1g9a8f-00013X-EY for linux-arm-kernel@lists.infradead.org; Mon, 08 Oct 2018 18:20:58 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id B142920FEB; Mon, 8 Oct 2018 20:20:02 +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=1539022801; x= 1541614802; bh=01vMnBcvhmgbenPNRiP6vEWBw0VXxpZO/dS2anQ0+Ys=; b=C ECeVLQf7vOQz0AjPo/izDx3TQ/SIsOqMfaV3T9prE88FQmZans4in9rWSe30yLXI 7RrzB64s25vd+pIG9s+qdSMFaNCuluXTm059ZMWsnhFdw+QTIok2sQhiRq//cqNU ZjnbY2SRI0El9lRUmo30q/Sr4MPWQ8oKyz+NfgD208XtM5Uc38hBqskZQNiKntkN NN1Uq5x6NAnxTlIZ6uaJ9jW9GjU/46oPQgo1Ml9gMYch9pShqDpIjOiZjf9xs5Aj t9Q+KK1jgVTC5AyBguT6FifiIs6D+xSONbzunfo0s7k1GdZJO/0CtPfwwTpwiuqt EDFWNAuTnQQ9BSVMXh2dhKsOY31sa8UEZxV15j7HX0YxeG9nwtuFZ5P0u80Pi3G/ pjIOqk/R3YcKjBhLXcpKtx1/Z6lV/emCdIQSEB8b9M91WqDWE1j/O7BjsmbLsqr/ puBtRL7YSp/GnPOi7goXubpptS3aLgxJj2eu4LkCXZ+OgNfYwyho10zRhhB601tC aCjZ+wNyRrfaSXlhrLssFthD1xZAeVYm8yNIFtlEg3HIBtwC8Ee3XM6wzwaPYoX0 YW0zibLTu3Ms2ah44h+PxHxCtjXaDpteygP9A7UgJ4k91jNZV49qVxs1GwkVFV5a sjqsMDdZUC2sfeO9jCw/MGjIQZJwbNwyorJ698VTso= 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 4ErXytZKCOSQ; Mon, 8 Oct 2018 20:20:01 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 6DEDA1F99B; Mon, 8 Oct 2018 20:20:01 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v3 4/7] arm64: dts: allwinner: a64: sopine: enable power supplies Date: Mon, 8 Oct 2018 21:19:05 +0300 Message-Id: <20181008181908.9456-5-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181008181908.9456-1-oskari@lemmela.net> References: <20181008181908.9456-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181008_112017_803108_C92C6B33 X-CRM114-Status: UNSURE ( 9.88 ) 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 Mon Oct 8 18:19:06 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: 10631275 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 1269514BD for ; Mon, 8 Oct 2018 18:32:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 061D529733 for ; Mon, 8 Oct 2018 18:32:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EEA182977A; Mon, 8 Oct 2018 18:31:59 +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 7759029733 for ; Mon, 8 Oct 2018 18:31:59 +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=CwI+Y1hX32bMzdErUqaXomjeI8 m0AkC5Ln6N7AizGs0XVTRACpmijUrqoqNDU1bsdj88I/uWWPiPpdkEryxFienbIHAf6RBi550MlBI Jf3Ug4wJpr0tpDMl/kbutdRaNyBKMhhcLSVimJkfIdcOVhcYIXOJoXIIg/rjxuWskGNBYzRf5DHo9 BKZNKtNKFiFdJrVAx5YUBVBb8x9SQ6bCeEVtgaXVegO/Fosujk1X1F/0wxMySXTlcH8KA36EGivfO vhu4fKKRqpPKeLtap9+8wFH7kCuI8ULPWnel6WPd+p26fq3kC/IobFBQyCLFnDW/ik3qTnqymacw0 swWcZhPw==; 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 1g9aJv-0000jn-Cz; Mon, 08 Oct 2018 18:31: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 1g9a9L-0002hs-Fm for linux-arm-kernel@lists.infradead.org; Mon, 08 Oct 2018 18:22:04 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 9870920FED; Mon, 8 Oct 2018 20:20:03 +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=1539022802; x= 1541614803; bh=m8uhR3p38SRaJ+jBsn68IC3GU1eRDxR95szIsgGCzJw=; b=U YYw9czs4GlcqNYz8OROOFAoX6SZRLUAuwbmE2UzjfVdylrrVoy7nnZ+SqIFiP3Hy OwBuodvVeNxAHAjOgtrRVZwaNFFpQ/XqcsSJNQ4ovkduflXdvcIwh70xpHMiOFnU zilElUYPL/YNtod5oizum82GshiWfookuv1Puifx7n8+NXGILstdLHY/LdZipSLs bUGtwR6Q+MLE1xFVBXUFoC3CNB7iP1W8K5G+I0U6UCO4TqLLSQptu0EnIT/oEWci jAsfbpJ4P7jkesQl1Enh7ac1K4SSNngU+qpYqy6E6Zass5Z19ql2Bf44pjxpa6j1 txRHW68NpRT6sXWyvH6OztsI1bKwf0a2T4W8YfJbyHu0oLegSApoBmoHw9xf3Co6 XXVbJqknaHqZXu1TsNY7CcT9pNy/QYF82axle12HhTEPOAB5hJdnqGtR6kNnpaPL PbyZd8LktogVrLzuFSOr2qQnez6S/TKJ5AplvLOVT1xDZvi0dvquFdnlz+KQo1B3 o4K/p74mR3z+Tzval2OfbNPJTz/JiPFqPIv4aqvogfxK5x9pU2CA8G327I48wiC/ 9oIhHMmnAK95EwhJS5fiNQ4Ui1IoVU5T6FCpADTnhXCTfeO7Rji8X4FpoH11XPlR pcTuVWy0fGaZcLcRJ7HSDuT4ZaE/Dwf87anEAJ4oK0= 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 2M61cE4KCNHi; Mon, 8 Oct 2018 20:20:02 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 0F60120929; Mon, 8 Oct 2018 20:20:02 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v3 5/7] power: supply: add AC power supply driver for AXP813 Date: Mon, 8 Oct 2018 21:19:06 +0300 Message-Id: <20181008181908.9456-6-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181008181908.9456-1-oskari@lemmela.net> References: <20181008181908.9456-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181008_112059_847589_67FD7EDE X-CRM114-Status: GOOD ( 15.05 ) 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 Mon Oct 8 18:19:07 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: 10631273 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 B288314BD for ; Mon, 8 Oct 2018 18:31:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3D2729733 for ; Mon, 8 Oct 2018 18:31:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95C922977A; Mon, 8 Oct 2018 18:31:37 +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 2281A29733 for ; Mon, 8 Oct 2018 18:31:37 +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=9JhRiqPFSbphUmYrA5scrm3m1eVhwGnSjq3SkCWxQKU=; b=b1jkocDCzJEEPzmGof4Lon5El8 S0jqcNOhTSq6HFpm8Vo0a432SXDNNNPSlxK6EAO5vGjx/km/xPjFQm10KTJIEQdLXeEsBmQL6pqsT oK5Chapk863yCEE4Tp93aRzQxhtzkG8S1+fSpJlqyaLzjbSqF+vBxmN5bNRGTVOYokjUNBJcxbEs5 Ph58UkWr9GkS/oAPOrfQbsHvetTdigJFRCI7uaq1c4hq6xyTcmW2qmE05XRL/QGijxWUB8zveDtZX tXboVpBnZHfIfMVB4gbBaKjP30/u6aSRdOaMf+jwWkzTGmLuYgV7yJrrNIT82CqlgczOqCC3AZ2j9 EIKberpw==; 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 1g9aJW-0000Y6-4N; Mon, 08 Oct 2018 18:31:30 +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 1g9a9L-0002hr-Fn for linux-arm-kernel@lists.infradead.org; Mon, 08 Oct 2018 18:21:56 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id DF82220929; Mon, 8 Oct 2018 20:20:03 +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=1539022803; x= 1541614804; bh=YCvEZvi8r+B/iR11hwrDoTbiAvklCpnY5FxCAbplmOc=; b=a krjTU7reNlwqct45noygM6LBUEXmeJCyKex9AbLXZXUX9fKQ5YGXgRyg9t9hykDb MnoNRpvz/91DJvh0uvdDC5ZRjAV6PclthoXGRYkZijLoZGbNGNPo/+w0pWJj0//+ X6YaKskECXU4hkvfa0g06h6LJozi68MO+MTqKhmlKxSzI3eqaL4uKVS3jKXPBVtZ p4kMr/rMrCpIKdcT9EpHonAzOqa8JjLvHuZMBmmwI8YI/NvNA1YVLWZPnB5egalp iJUDCmc+USecHOxx9wDbXeChxBwvyTgxPxYYP+XaAHlk4ozXI+Hc2cyAu6E462Nq ykSziBoWNnROowdh92EmfZbsm0dO0Tz4Fbj2B3E53EdRW/LjpC00NtxJhBZbIcDj tW3Coi08CEMDKTnTbLIWv/ngrTgWWNjJqz2MqnYDk0M+A+E+Dq3JGoWtHZvlxdGN rfQvszfomKIFEgQZxVw4Me47pE3GhTIBbVS8nGGaWa7Hvi4+Qpn7vxj2HJMbPwOx CkkACtwmysJXEiBwIcm/hJ/PNjt4PH995DiL5N2WSjZD6Ge/xXI9hk51sH/Bd2w4 cLNGBb9uBl/IlcMfG5uhNhITjMK5dmgCZSTc1t/9IpY7dpSpTYI8mbD/qOQXQcnF 3JN76pVNUEbSA1Wt5pGk6MfmSoqTeMK4wpV4+CWw5E= 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 noG7XLmO-Ius; Mon, 8 Oct 2018 20:20:03 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id A482C20791; Mon, 8 Oct 2018 20:20:02 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v3 6/7] mfd: axp20x: Add AC power supply cell for AXP813 Date: Mon, 8 Oct 2018 21:19:07 +0300 Message-Id: <20181008181908.9456-7-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181008181908.9456-1-oskari@lemmela.net> References: <20181008181908.9456-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181008_112059_727036_3409497C X-CRM114-Status: GOOD ( 10.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 As axp20x-ac-power-supply now supports AXP813, add a cell for it. Signed-off-by: Oskari Lemmela Reviewed-by: Quentin Schulz --- drivers/mfd/axp20x.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index 0be511dd93d0..1508d9113126 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 Mon Oct 8 18:19:08 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: 10631233 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 5181B17E3 for ; Mon, 8 Oct 2018 18:24:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 451E12994A for ; Mon, 8 Oct 2018 18:24:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 390A92995F; Mon, 8 Oct 2018 18:24:59 +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 DEFD82994A for ; Mon, 8 Oct 2018 18:24:53 +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=H0eLYGJTPWYqNfWDygpHhGfhzNu29OZQV7v0OwxoC2Y=; b=WzMR5n+/IMnlJU91THo4bzpT7J sBFcwon4NyZ4oIeNySOkLGNS/F75E6nr23wkyts7Fk0LVa5TUwGEZwhQwZVRcvCt/0jkv/yAf/MOo 63qqz5bGoXGxZdOaNQH1SrmXCaPeZw/wnqVs2Dp/SZO87GJkMYGa7MrXiN6saxJBHMB3L4extxW5p n47qnA24vc+OrTj8Gblt+rI0EWlstZ+Tor8lJtaP5C+FFnIYGBHsCwuTSaHQjwAiWdYXNkGQxDydp ffBr3uUe78C3L4a/JeqAri4tEPRlRlvZIazj/JH04IRZMHg4EJffkvwApQrYIAUYtABJx3Ua0nOVW ZLl8tnqg==; 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 1g9aD2-0004Pm-VR; Mon, 08 Oct 2018 18:24:49 +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 1g9a9O-0002iH-Hl for linux-arm-kernel@lists.infradead.org; Mon, 08 Oct 2018 18:22:14 +0000 Received: from localhost (localhost [127.0.0.1]) by mail1.kuutio.org (Postfix) with ESMTP id 9B38A1F99B; Mon, 8 Oct 2018 20:20:04 +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=1539022803; x= 1541614804; bh=y86LgGaC+PYu/TqO6XCmCJge6MTF+Ti6+RsXqNPgXjM=; b=o 1GqYlAPyry7DQZXltzPs4x2HB4M9/oC0FW7kfkTc4oVQ2WJoKQb7+u/iJEuPl0E2 QGqtTt5qP68ezU2HMK7cg2/PaX+kgYaiAb+H32zGAZxlSUGexXi42+xxf4Y12Hc9 0JVrRFleFQuEedu3jwkBGlMlLlYfze/UhmcRALEh2MgiMlkKvkaXEUZ5bTQIDjLR Ef8+9sUgGIL11hv5Kf41sO1Xh1CpcYbpOrnzxkdNYmfoRPQQZzniar0NHhDmgo2T BYf5TVFyrUXZqjxODuZ/l+vKvkNnIQSbUn07DnSzC/ZFZ6vfq6eZh9t4f/WdRM2I Nzg0z/ZDW33JUisOQdfC2cgLVDecbJVk+wmj2jPqcEaoehEptVpR4mfCoE7T/QCs xoFePlqqiJQCgsT/Ia1pJNGDRTBwHtjQMdVTWnHZ7ycVklptx0tkAvHjAd5NuKNi YGz39CywdG4w24z55NuGDvKMA7U8LkTvrJSyxtLukicVE7TjTCQZmxi1L7xwCxka cJ2aRS37KSO8Us8FjtLFDDly17dyAnxnF2qbA1NnFrldOTzIlt7KbsEaHrFksW3Z OT5ZZ9CRliHmjdENgisja+HfexYAMXzsA1iOarDw8CkMh8hy4k2tvx0Ll/2WpMUu giDrM6cGFYfUjLhgj/omSRvWEegDm6DhjHFj6ig3n0= 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 BSZIzbgzQSl9; Mon, 8 Oct 2018 20:20:03 +0200 (CEST) Received: from build.kuutio.org (unknown [IPv6:2001:998:13:e4::69]) by mail1.kuutio.org (Postfix) with ESMTPSA id 47A3720FEC; Mon, 8 Oct 2018 20:20:03 +0200 (CEST) From: Oskari Lemmela To: Sebastian Reichel , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH v3 7/7] mfd: axp20x: Add supported cells for AXP803 Date: Mon, 8 Oct 2018 21:19:08 +0300 Message-Id: <20181008181908.9456-8-oskari@lemmela.net> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181008181908.9456-1-oskari@lemmela.net> References: <20181008181908.9456-1-oskari@lemmela.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181008_112102_786109_CF011555 X-CRM114-Status: GOOD ( 11.85 ) 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 --- drivers/mfd/axp20x.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index 1508d9113126..4befe474b165 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[] = {