From patchwork Tue Dec 11 15:17:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 10724005 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 DCDBD91E for ; Tue, 11 Dec 2018 15:18:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C87B8296B0 for ; Tue, 11 Dec 2018 15:18:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B9A142B2F1; Tue, 11 Dec 2018 15:18:16 +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=-4.4 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, 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 9F2EA29A4B for ; Tue, 11 Dec 2018 15:18:11 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=cbwZ65g12jzpzZklU6mGlqpaY9xtuEpcPzFLIQNHc4k=; b=uea3aU2HIR0mwO Op8YPmpyELRfLyIC/rT+EjhGFLzXJADCQd3ZBTUY4RbPkVWEVimuEvCxJyP0KB7hFQkoSwiMVA/gc xVpQv2xIqsdOYMBTuNjA0WCCUV5KJejNtwLz4f7LVOPz6U20b3WTOcEpiwTtsZFrmmJJpCaYPArCq OcpVvHkY47OTS2ehEi17IHl99mvmeig0NFIpOTRJNbKnViyUcROaXuSZuUlKqku9v5WL0rCRs+hTr T8aFxBOZAJitCDqJok5KVh10RJmMHIkFsLQZeSUibSt+3mNIEna866XiJBvpMIDdA0R6pUt+Q9FMc o5kfgMdw4zME3LGgq8Aw==; 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 1gWjnV-0003Fa-FG; Tue, 11 Dec 2018 15:18:09 +0000 Received: from plaes.org ([188.166.43.21]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWjnM-0002xE-4J for linux-arm-kernel@lists.infradead.org; Tue, 11 Dec 2018 15:18:07 +0000 Received: from localhost (unknown [213.204.46.240]) by plaes.org (Postfix) with ESMTPSA id 23183409A6; Tue, 11 Dec 2018 15:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1544541439; bh=DNxG4QIovujeB65kr1xY5el00nrx7k3udwttY/HTPZc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iRdN6gA1aWsbOokJIFQyHUIS1TkGG9rwoQkAT9AxOiwfNGZxD+GNOO9r9EYKKcglj a6YcN7n3EoZhvhY3T4ri6hweIduI05vtP6NdjFu8IzzlwvDazrbS2ZTCdLRtB2KDyt rWxj0aMzHvAB8kiuVXX0Aq8pdLZrbQiprfKWQ4WTpCLhGr7uvs4vvJFT6N+YdhWIX3 CtMF16x/bZfHY3aRQjNAEXP0NXdHdtFTvSqBCrXpmaAnrmCyBcPh8SKs7uLywgAaiC OzCNm7r23Ax2iKhsvOQv+b0wNolGX71xy7jrPAQHUP0PEUtUG312zQpsM6xqsf88xZ rWnUy5l8OIZPg== From: Priit Laes To: Lee Jones , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Liam Girdwood , Mark Brown , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Olliver Schinagl , linux-sunxi Subject: [PATCH v2 1/8] mfd: axp20x: name voltage ramping define properly Date: Tue, 11 Dec 2018 17:17:05 +0200 Message-Id: <01367c4f4f1e174fefbef9aac645f6792bda07e5.1544512919.git-series.plaes@plaes.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181211_071800_835702_51FE0FA6 X-CRM114-Status: UNSURE ( 9.43 ) 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: Priit Laes 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: Olliver Schinagl The current axp20x names the ramping register 'scal' which probably means scaling. Since the register really has nothing to do with scaling, but really is the voltage ramp we rename it appropriately. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes Acked-for-MFD-by: Lee Jones --- include/linux/mfd/axp20x.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h index 2302b62..a353cd2 100644 --- a/include/linux/mfd/axp20x.h +++ b/include/linux/mfd/axp20x.h @@ -35,7 +35,7 @@ enum axp20x_variants { #define AXP152_ALDO_OP_MODE 0x13 #define AXP152_LDO0_CTRL 0x15 #define AXP152_DCDC2_V_OUT 0x23 -#define AXP152_DCDC2_V_SCAL 0x25 +#define AXP152_DCDC2_V_RAMP 0x25 #define AXP152_DCDC1_V_OUT 0x26 #define AXP152_DCDC3_V_OUT 0x27 #define AXP152_ALDO12_V_OUT 0x28 @@ -53,7 +53,7 @@ enum axp20x_variants { #define AXP20X_USB_OTG_STATUS 0x02 #define AXP20X_PWR_OUT_CTRL 0x12 #define AXP20X_DCDC2_V_OUT 0x23 -#define AXP20X_DCDC2_LDO3_V_SCAL 0x25 +#define AXP20X_DCDC2_LDO3_V_RAMP 0x25 #define AXP20X_DCDC3_V_OUT 0x27 #define AXP20X_LDO24_V_OUT 0x28 #define AXP20X_LDO3_V_OUT 0x29 From patchwork Tue Dec 11 15:17:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 10724015 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 3A2A713AF for ; Tue, 11 Dec 2018 15:19:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 291952B2CA for ; Tue, 11 Dec 2018 15:19:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CB3F2B2D0; Tue, 11 Dec 2018 15:19:47 +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=-4.4 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, 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 AA1242B2CA for ; Tue, 11 Dec 2018 15:19:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=om42ew7joyZDgEwuiLPMG8ll0iioX2Mxg843dDMxZN4=; b=YKYidzbBTgN+I9 FNJ5Nd6o+ITfmFRV+JGuc+URXmQjfc3KjPutmdbB2wM3nd+MoHevcCyZCNon349wSqPOZGamPtZLf iT5/W72s4y9R7FoAUgFi1a1GA6YtWnwfF1JGcth5nhxT41cthTnCoWnOfhRvQQGk+fal+ufkPGPTC SjM8/++c1TYP8SJpA4oxbG9ovFhIIaxDxFHJ9FBjk0BbWxTlNvnSfgVU8zxmVS4MVD2fSPTxIj8ZQ hJoi6cAw17BQWfmMPM6G55wAJWCqHx7nSsaK23ShXU8d6NzA3007RRkTAYmv+VjKDWdrUZQ4Olz8B GXQJ+/q4AdrkC1YvzLTQ==; 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 1gWjoy-0004jP-46; Tue, 11 Dec 2018 15:19:40 +0000 Received: from plaes.org ([188.166.43.21]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWjnM-00032z-4I for linux-arm-kernel@lists.infradead.org; Tue, 11 Dec 2018 15:18:09 +0000 Received: from localhost (unknown [213.204.46.240]) by plaes.org (Postfix) with ESMTPSA id A98D040FC0; Tue, 11 Dec 2018 15:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1544541439; bh=f2mcC9Dpd0QYLyRmz8so1Ckg3Nv64+LbaTC/FIJ10Ik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NWlgdzMNAUxywqbY398RLRk6ZGte8XrA2GDFiKSVQ+OlncalS72BMXNqZ1JMhoylE ykWsElaZcjjHXQyDy6CozhpXERm51Cl8MaHuuEuEF9fBmusTVXjvlVWGk+EXqhc0+C lD1FypQHxjFEZN62SKDJ9l/Wfs9SrkwxAD6MxTRXr7+IVLv1NYqgrGhzizuZjO11Q+ cUujUGSYPbodgN664xwSfbNCTo5bGGa6AfVATcMLl2wicMdZCCEtqcLlw7EBK9UtiJ 2fBbvyRuKN3UNLnnyvQD3ys46UkpgGcPv+t5nXq7GrR1hKD9c6NLjf9d30epBkUHPA sD1L1IWXWhuYA== From: Priit Laes To: Lee Jones , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Liam Girdwood , Mark Brown , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Olliver Schinagl , linux-sunxi Subject: [PATCH v2 2/8] regulator: axp20x: add support for set_ramp_delay for AXP209 Date: Tue, 11 Dec 2018 17:17:06 +0200 Message-Id: <2bfe47f173fe72a30b0036dcdeebc2123962ff33.1544512919.git-series.plaes@plaes.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181211_071800_844144_BCA45002 X-CRM114-Status: GOOD ( 15.24 ) 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: Priit Laes 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: Olliver Schinagl The AXP209 supports ramping up voltages on several regulators such as DCDC2 and LDO3. This patch adds preliminary support for the regulator-ramp-delay property for these 2 regulators. Note that the voltage ramp only works when regulator is already enabled. E.g. when going from say 0.7 V to 3.6 V. When turning on the regulator, no voltage ramp is performed in hardware. What this means, is that if the bootloader brings up the voltage at 0.7 V, the ramp delay property is properly applied. If however, the bootloader leaves the power off, no ramp delay is applied when the power is enabled by the regulator framework. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes --- drivers/regulator/axp20x-regulator.c | 85 +++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+) diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c index 9a2db28..1d9fa62 100644 --- a/drivers/regulator/axp20x-regulator.c +++ b/drivers/regulator/axp20x-regulator.c @@ -51,6 +51,17 @@ #define AXP20X_PWR_OUT_DCDC2_MASK BIT_MASK(4) #define AXP20X_PWR_OUT_LDO3_MASK BIT_MASK(6) +#define AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_RATE_MASK BIT_MASK(0) +#define AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_RATE(x) \ + ((x) << 0) +#define AXP20X_DCDC2_LDO3_V_RAMP_LDO3_RATE_MASK BIT_MASK(1) +#define AXP20X_DCDC2_LDO3_V_RAMP_LDO3_RATE(x) \ + ((x) << 1) +#define AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN_MASK BIT_MASK(2) +#define AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN BIT(2) +#define AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN_MASK BIT_MASK(3) +#define AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN BIT(3) + #define AXP20X_LDO4_V_OUT_1250mV_START 0x0 #define AXP20X_LDO4_V_OUT_1250mV_STEPS 0 #define AXP20X_LDO4_V_OUT_1250mV_END \ @@ -346,6 +357,79 @@ .ops = &axp20x_ops_range, \ } +static const int axp209_dcdc2_ldo3_slew_rates[] = { + 1600, + 800, +}; + +static int axp20x_set_ramp_delay(struct regulator_dev *rdev, int ramp) +{ + struct axp20x_dev *axp20x = rdev_get_drvdata(rdev); + const struct regulator_desc *desc = rdev->desc; + u8 reg, mask, enable, cfg = 0xff; + const int *slew_rates; + int rate_count = 0; + + if (!rdev) + return -EINVAL; + + switch (axp20x->variant) { + case AXP209_ID: + if (desc->id == AXP20X_DCDC2) { + rate_count = ARRAY_SIZE(axp209_dcdc2_ldo3_slew_rates); + reg = AXP20X_DCDC2_LDO3_V_RAMP; + mask = AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_RATE_MASK | + AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN_MASK; + enable = (ramp > 0) ? + AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN : + !AXP20X_DCDC2_LDO3_V_RAMP_DCDC2_EN; + break; + } + + if (desc->id == AXP20X_LDO3) { + slew_rates = axp209_dcdc2_ldo3_slew_rates; + rate_count = ARRAY_SIZE(axp209_dcdc2_ldo3_slew_rates); + reg = AXP20X_DCDC2_LDO3_V_RAMP; + mask = AXP20X_DCDC2_LDO3_V_RAMP_LDO3_RATE_MASK | + AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN_MASK; + enable = (ramp > 0) ? + AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN : + !AXP20X_DCDC2_LDO3_V_RAMP_LDO3_EN; + break; + } + + if (rate_count > 0) + break; + + /* fall through */ + default: + /* Not supported for this regulator */ + return -ENOTSUPP; + } + + if (ramp == 0) { + cfg = enable; + } else { + int i; + + for (i = 0; i < rate_count; i++) { + if (ramp <= slew_rates[i]) + cfg = AXP20X_DCDC2_LDO3_V_RAMP_LDO3_RATE(i); + else + break; + } + + if (cfg == 0xff) { + dev_err(axp20x->dev, "unsupported ramp value %d", ramp); + return -EINVAL; + } + + cfg |= enable; + } + + return regmap_update_bits(axp20x->regmap, reg, mask, cfg); +} + static const struct regulator_ops axp20x_ops_fixed = { .list_voltage = regulator_list_voltage_linear, }; @@ -366,6 +450,7 @@ static const struct regulator_ops axp20x_ops = { .enable = regulator_enable_regmap, .disable = regulator_disable_regmap, .is_enabled = regulator_is_enabled_regmap, + .set_ramp_delay = axp20x_set_ramp_delay, }; static const struct regulator_ops axp20x_ops_sw = { From patchwork Tue Dec 11 15:17:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 10723995 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 DAD0A13AF for ; Tue, 11 Dec 2018 15:17:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C86CF296B0 for ; Tue, 11 Dec 2018 15:17:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB96D2B2F1; Tue, 11 Dec 2018 15:17:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.4 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, 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 5D40A296B0 for ; Tue, 11 Dec 2018 15:17:42 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=9N1VWBVIPNDWozi01zoJ6Jp8iprbo0/2/3xAKiGEXYk=; b=twgAV6Wo+NR/15 WzhKhErJt7s627KRshFEG/RAcm+hlOgfj5xYDozlUSNETC9S8rRfT3qpSRKobT9pywAfdYvGIz1uI QlH6tCkJXnuBfGNag5WwoethhNqUSJtwpnRurbw2xs78XEC2INwlLNSuQug4oaIuVoLEFTUofbK6z hKSnZ7huh11BCJODgnCh/sCajXdoo2ZcOgYzxROZ+z1HxWI2l1bOnIqcSKzBcWT/lxTLLLGhHSiPe jERIJPeBS+L95nuSnWCiHqVELwItgr6rjm1G2RIfRJEbMtLOVDMK5ID/iU+AwHGdt+Qg45iIK/Ehe 2W5GmZ/XZhCdpgNtjEFg==; 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 1gWjn1-0002kk-6K; Tue, 11 Dec 2018 15:17:39 +0000 Received: from plaes.org ([188.166.43.21]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWjmx-0002kS-CQ for linux-arm-kernel@lists.infradead.org; Tue, 11 Dec 2018 15:17:36 +0000 Received: from localhost (unknown [213.204.46.240]) by plaes.org (Postfix) with ESMTPSA id 4417641030; Tue, 11 Dec 2018 15:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1544541440; bh=WJHmPRGpzdjRM9E54gWuAmfTil1kkRXpmiRybmesfIc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BBGyKQJJTkZWy/KhWygCZi4ie5tSYgxViGAMmN3Kg8wkjf/dXw7Pm2xOURzsNWDru lZXlq/JcNiCuGI/mdMkM+kU8AvlmtkDhBpbsQekm3o5ARB+2x4V3iLY4zTn3KeinYq AL6SafQU5E+gnHqEd6AdufbmprlU/P8IdOgwmVn9h2bDZlIL65fGOncfTPsi5qIfMx frQX7xxO6fVOVaQOePeWone+OgYWAZdSdo/EEKFsSzX794INLs64u0HJH/27Ujz6WG d8+MUWMf9VPjSA+s44KjoJ+veCXwXmLMjVfexwV2NRwcPVrS44y0rtFULt9bEvH8Uy W7U+dCM+gqUgw== From: Priit Laes To: Lee Jones , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Liam Girdwood , Mark Brown , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Olliver Schinagl , linux-sunxi Subject: [PATCH v2 3/8] dt-bindings: mfd: axp20x: add support for regulator-ramp-delay for AXP209 Date: Tue, 11 Dec 2018 17:17:07 +0200 Message-Id: <78eafc64831c50005fe5d186c174440d48a865e3.1544512919.git-series.plaes@plaes.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181211_071735_628899_CD3A4A1E X-CRM114-Status: UNSURE ( 8.99 ) 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: Priit Laes 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: Olliver Schinagl The AXP209 supports ramping up voltages on several regulators such as DCDC2 and LDO3, therefore we can use the standard 'regulator-ramp-delay' property for those 2 regulators. Note that the voltage ramp only works when the regulator is already enabled. E.g. when going from say 0.7 V to 3.6 V. When turning on the regulator, no voltage ramp is performed in hardware. What this means, is that if the bootloader brings up the voltage at 0.7 V, the ramp delay property is properly applied. If however, the bootloader leaves the power off, no ramp delay is applied when the power is enabled by the regulator framework. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes Acked-for-MFD-by: Lee Jones --- Documentation/devicetree/bindings/mfd/axp20x.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt index 188f037..c626605 100644 --- a/Documentation/devicetree/bindings/mfd/axp20x.txt +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt @@ -32,6 +32,12 @@ Required properties: - interrupt-controller: The PMIC has its own internal IRQs - #interrupt-cells: Should be set to 1 +Supported common regulator properties, see ../regulator/regulator.txt for +more information: +- regulator-ramp-delay: sets the ramp up delay in uV/us + AXP20x/DCDC2: 1600, 800 + AXP20x/LDO3: 1600, 800 + Optional properties: - x-powers,dcdc-freq: defines the work frequency of DC-DC in KHz AXP152/20X: range: 750-1875, Default: 1.5 MHz From patchwork Tue Dec 11 15:17:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 10724009 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 0E9D617FE for ; Tue, 11 Dec 2018 15:18:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F17FF2990D for ; Tue, 11 Dec 2018 15:18:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E5CDF2A8BA; Tue, 11 Dec 2018 15:18:49 +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=-4.4 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, 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 C14872990D for ; Tue, 11 Dec 2018 15:18: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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=/Q4k79mvTmb1QBnXOzvyAIoAKyww2mHohFe1KDbUKts=; b=u6NPTOUtql0k28 ozeFvFRJPAjMo1/stdnFIVUUI/dnvXoXgL9x6yLro7uxDR+bPW9kNjVIvePs2AJfLWRQ1QA7/XW1H T9klkAiR3nDDczKRTP4PTSsD0N5MRhldl0Csoi5pE92EOpvxUm5VJPI3mAVuQbHAzejtV+Zjdmcgt klsWh4t7z8Kh3eYMQK3mTa8FRmBd3q5LaOfgt3lSNJ37Oxlx38ogn0ji8vJY5fLc4XR+upGzoXoVG QiMWFtimzfQhfelDkrg06Csmizfj0lvrhyGHT4GNB5Imo02F5NNZNg38P6K03Qu+bNDKKVqu8wKLw jSBIsKb6HfDo37ynbuSg==; 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 1gWjo0-0003o0-T8; Tue, 11 Dec 2018 15:18:40 +0000 Received: from plaes.org ([188.166.43.21]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWjnM-0002yE-4p for linux-arm-kernel@lists.infradead.org; Tue, 11 Dec 2018 15:18:08 +0000 Received: from localhost (unknown [213.204.46.240]) by plaes.org (Postfix) with ESMTPSA id CA52D41105; Tue, 11 Dec 2018 15:17:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1544541440; bh=kVazWeoBJTH1RfagB16nCXnVFLnAlX8uPnX2O4aNcZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GtcjlpRBTZ4y9PguNQWmWbzKsRcrLFg4ogxeJiGhrTmVi9OT57KO6Sxst26rWloxS 2ZnYCUB9NpAXabu5T06gr5rhoAH57n/X8VhZoRVgnfFqQ2YPlSV5fS3LcJ/rlj7KFO np0qfFuqgMG0mimMzu1HztPQ1OYAoV8npqyy6KFLG425RSp5RwlXzgG2HFsOwpMHzh adXXch8dvt+Q2RXw2i1aU8dawDQXeiXHBxQGytcvuVuTKszVxj4exj7x7MzyFI3zhX nu0yEUhWKHbvgFC4FCCydLoVx/Zns7cu8ZtDp6ivxsEMx+RUkU0D4q+5MwryAOj9+W XwDFdiS6m7tqg== From: Priit Laes To: Lee Jones , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Liam Girdwood , Mark Brown , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Olliver Schinagl , linux-sunxi Subject: [PATCH v2 4/8] regulator: axp20x: add software based soft_start for AXP209 LDO3 Date: Tue, 11 Dec 2018 17:17:08 +0200 Message-Id: X-Mailer: git-send-email 2.19.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181211_071800_847549_6F472350 X-CRM114-Status: GOOD ( 15.62 ) 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: Priit Laes 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: Olliver Schinagl In the past, there have been words on various lists that if LDO3 is disabled in u-boot, but enabled in the DTS, the axp209 driver would fail to continue/hang. Several enable/disable patches have been issues to devicetree's in both the kernel and u-boot to address this issue. What really happened however, was that the AXP209 shuts down without a notice and without setting an interrupt. This is caused when LDO3 gets overloaded, for example with large capacitors on the LDO3 output. Normally, we would expect that AXP209 would source 200 mA as per datasheet and set and trigger an interrupt when being overloaded. For some reason however, this does not happen. As a work-around, we use the soft-start constraint of the regulator node to first bring up the LDO3 to the lowest possible voltage and then enable the LDO. After that, we can set the requested voltage as usual. Combining this setting with the regulator-ramp-delay allows LDO3 to enable voltage slowly and staggered, potentially reducing overall inrush current. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes --- drivers/regulator/axp20x-regulator.c | 57 ++++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/drivers/regulator/axp20x-regulator.c b/drivers/regulator/axp20x-regulator.c index 1d9fa62..e8a895b 100644 --- a/drivers/regulator/axp20x-regulator.c +++ b/drivers/regulator/axp20x-regulator.c @@ -14,6 +14,7 @@ */ #include +#include #include #include #include @@ -23,6 +24,7 @@ #include #include #include +#include #include #define AXP20X_GPIO0_FUNC_MASK GENMASK(3, 0) @@ -430,6 +432,59 @@ static int axp20x_set_ramp_delay(struct regulator_dev *rdev, int ramp) return regmap_update_bits(axp20x->regmap, reg, mask, cfg); } +static int axp20x_regulator_enable_regmap(struct regulator_dev *rdev) +{ + struct axp20x_dev *axp20x = rdev_get_drvdata(rdev); + const struct regulator_desc *desc = rdev->desc; + + if (!rdev) + return -EINVAL; + + switch (axp20x->variant) { + case AXP209_ID: + if ((desc->id == AXP20X_LDO3) && + rdev->constraints && rdev->constraints->soft_start) { + int v_out; + int ret; + + /* + * On some boards, the LDO3 can be overloaded when + * turning on, causing the entire PMIC to shutdown + * without warning. Turning it on at the minimal voltage + * and then setting the voltage to the requested value + * works reliably. + */ + if (regulator_is_enabled_regmap(rdev)) + break; + + v_out = regulator_get_voltage_sel_regmap(rdev); + if (v_out < 0) + return v_out; + + if (v_out == 0) + break; + + ret = regulator_set_voltage_sel_regmap(rdev, 0x00); + /* + * A small pause is needed between + * setting the voltage and enabling the LDO to give the + * internal state machine time to process the request. + */ + usleep_range(1000, 5000); + ret |= regulator_enable_regmap(rdev); + ret |= regulator_set_voltage_sel_regmap(rdev, v_out); + + return ret; + } + break; + default: + /* No quirks */ + break; + } + + return regulator_enable_regmap(rdev); +}; + static const struct regulator_ops axp20x_ops_fixed = { .list_voltage = regulator_list_voltage_linear, }; @@ -447,7 +502,7 @@ static const struct regulator_ops axp20x_ops = { .set_voltage_sel = regulator_set_voltage_sel_regmap, .get_voltage_sel = regulator_get_voltage_sel_regmap, .list_voltage = regulator_list_voltage_linear, - .enable = regulator_enable_regmap, + .enable = axp20x_regulator_enable_regmap, .disable = regulator_disable_regmap, .is_enabled = regulator_is_enabled_regmap, .set_ramp_delay = axp20x_set_ramp_delay, From patchwork Tue Dec 11 15:17:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 10724017 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 CC08791E for ; Tue, 11 Dec 2018 15:19:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8D982B2CA for ; Tue, 11 Dec 2018 15:19:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AAA5A2B2D0; Tue, 11 Dec 2018 15:19: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=-4.4 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, 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 84DAA2B2CA for ; Tue, 11 Dec 2018 15:19: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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=sm+S3FNq+J/zqjjc9VBzn+2hJbQID64EEu03vXNx4ls=; b=Z8Qq01mx4GN5U2 z6rNMRnabFsV1zrOzQDTv0MzwMLd7xaWkLD4//FtsG5yYduEzEtCcQO+iH3WX2AE+0nFub/+SjqcG Znb4lO+VeuCt9cm5wW3In54c7kHt+kdMg9CKWkC4WWXYTSHxqe0OR22vnn4IusIX1uQstukXkjzDE /vhjmqE/Eh36vxkQG/UUezT7/Fmn/nnrsDTE26on/2dIarrdQjcnLeqIhh5jSMAKxMHkffEoq/pnt A23jQru6HNbxJcU5uP9dNjKohND6+l4JfNdHIWCCaqndDBklXQVKkmGcWZ810/33hFbJT4Kd+Czy2 x+GrQk2IFcJO6A8TEvgA==; 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 1gWjpA-0004tY-F8; Tue, 11 Dec 2018 15:19:52 +0000 Received: from plaes.org ([188.166.43.21]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWjne-0003EL-8D for linux-arm-kernel@lists.infradead.org; Tue, 11 Dec 2018 15:18:26 +0000 Received: from localhost (unknown [213.204.46.240]) by plaes.org (Postfix) with ESMTPSA id 5DE9541289; Tue, 11 Dec 2018 15:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1544541441; bh=snlyZLidIJEaCnhVA6nQ3LGjhvn8FydspTFdTImmP0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c7MgmDx9DJLinzSnvgYeehR6oxBBjhN6sfII3g77a3+YcmFKIc2+DW71ABMJ7XZBO BPyrnGgsqFnp9MLtW3O21DWnFNhpW9CvtFyJJfy5xuVGqkhRPYUlG0PhMPrcNEOtTd 77rquDIP6CxjtiV6wfRbaLYrGrBr0LBRjeXw4Z3q6Nf6EBb8eN7A8rZ8rQaw9q72Cl 6UlrmOkbXazg76Hmym3D5tz0VVWkX1pHHBGYyQ+bJbJo4OidLk6InKxMWM5Avcs1Um KBlNg7Pnb+sTv6a3QT+6baskHeCOqaJT5k4JrEDAFC19kwfr5Gnu1CrSOM/LWrdf0E R7dxb9fA+W2ig== From: Priit Laes To: Lee Jones , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Liam Girdwood , Mark Brown , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Olliver Schinagl , linux-sunxi Subject: [PATCH v2 5/8] dt-bindings: mfd: axp20x: Add software based soft_start for AXP209 LDO3 Date: Tue, 11 Dec 2018 17:17:09 +0200 Message-Id: <25e67fe9b5397aa5f11bdd7026e4ae6be51dd18b.1544512919.git-series.plaes@plaes.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181211_071819_064779_0A400320 X-CRM114-Status: GOOD ( 10.37 ) 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: Priit Laes 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: Olliver Schinagl In the past, there have been words on various lists that if LDO3 is disabled in u-boot, but enabled in the DTS, the axp209 driver would fail to continue/hang. Several enable/disable patches have been issues to devicetree's in both the kernel and u-boot to address this issue. What really happened however, was that the AXP209 shuts down without a notice and without setting an interrupt. This is caused when LDO3 gets overloaded, for example with large capacitors on the LDO3 output. Normally, we would expect that AXP209 would source 200 mA as per datasheet and set and trigger an interrupt when being overloaded. For some reason however, this does not happen. As a work-around, implement software-based 'regulator-soft-start' property for AXP209 LDO3 regulator, which is used to first bring up the LDO3 to the lowest possible voltage and then enable the LDO. After that, we can set the requested voltage as usual. Combining this setting with the regulator-ramp-delay allows LDO3 to come up slowly and staggered, potentially reducing overall inrush current. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes --- Documentation/devicetree/bindings/mfd/axp20x.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/axp20x.txt b/Documentation/devicetree/bindings/mfd/axp20x.txt index c626605..2af4ff9 100644 --- a/Documentation/devicetree/bindings/mfd/axp20x.txt +++ b/Documentation/devicetree/bindings/mfd/axp20x.txt @@ -37,6 +37,9 @@ more information: - regulator-ramp-delay: sets the ramp up delay in uV/us AXP20x/DCDC2: 1600, 800 AXP20x/LDO3: 1600, 800 +- regulator-soft-start: enable the output at the lowest possible voltage and + only then set the desired voltage + AXP20x/LDO3: software-based implementation Optional properties: - x-powers,dcdc-freq: defines the work frequency of DC-DC in KHz From patchwork Tue Dec 11 15:17:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 10724003 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 18FEF91E for ; Tue, 11 Dec 2018 15:17:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 06E0E296B0 for ; Tue, 11 Dec 2018 15:17:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF0502B2F1; Tue, 11 Dec 2018 15:17:54 +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=-4.4 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, 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 9D9BF296B0 for ; Tue, 11 Dec 2018 15:17:54 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=8Eq/2XQ6fbibIQLVYEY2YIH7X2oQoZ/ukikKMqQjWaE=; b=mDmTUOTf0zUTp/ GbU8W5kZq1li5c5ITmGclT8Kxyof4ogL0g2dItK8cfEamDWgyZQ45b1dL0oUWvU8jQTlfmYi13L/0 iID5VX6F0UDzqOqMkYdza5juIvVvz19V/9fcUKi/tbqg1P1zidG6kxRpbPtzSwF/rapY4nkP8KP3N /7lz7PJA3+4tKAtn4oow5J0deDyQfLlvk8uNRkI/kdZYsoKKdEDUMMcCFKYpzs29Jt8HhyAeG3VM/ WknHxuvNcCMQ6feuUYFXFKw76ebv9jRPwi3EdbNSREXKMsWFCw2Q2QAxlhBxl95x17SMquEjSMhp7 E389clhFvXbRWZi8zJDg==; 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 1gWjnD-0002yK-Rm; Tue, 11 Dec 2018 15:17:51 +0000 Received: from plaes.org ([188.166.43.21]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWjnA-0002kj-53 for linux-arm-kernel@lists.infradead.org; Tue, 11 Dec 2018 15:17:49 +0000 Received: from localhost (unknown [213.204.46.240]) by plaes.org (Postfix) with ESMTPSA id E114941803; Tue, 11 Dec 2018 15:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1544541442; bh=rL1R6deG8R4m86FOSDKOCU7rxrxi6SE5YJnbhqg7w48=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oHMqxd0F9qGE6lgVaPX/rL2H9UKd/k6bbS7ymcHjc1n7JVX3kqCHbGmzlW83zr657 dkrm6dF64Vlo4XbOQsiG36/hVic4zad+njeQUjQiAUGuvyJWPquVTrpZhZEICPQCAg 6aSKkGTjrhrlyUNT504HuGdfWQmyyCLZFchBlgJMPNf/Cw2TbqKelmNoeBOU3Ej8ZA PE3LSLfW5Ow/1p/1Txn6QpijEAUw5qnaMO2MFovGFwIfSeEsS2InhdRqGdIWpd6e4i wf7wsr3aIua+RmUic2vuC4sI3zDxG4ZKrMO8Qnj0oxawQ21LE9KmcewBRQwVjm0Lj+ IhqirIZyBLPlw== From: Priit Laes To: Lee Jones , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Liam Girdwood , Mark Brown , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Olliver Schinagl , linux-sunxi Subject: [PATCH v2 6/8] regulator: dts: enable soft-start and ramp delay for the OLinuXino Lime2 Date: Tue, 11 Dec 2018 17:17:10 +0200 Message-Id: X-Mailer: git-send-email 2.19.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181211_071748_429312_D8D44CA4 X-CRM114-Status: UNSURE ( 8.95 ) 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: Priit Laes 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: Olliver Schinagl The OLinuXino Lime2 has a big capacitor on its LDO3 output. It is actually too large, causing the PMIC to shutdown when toggling the LDO3. By enabling soft-start and ramp delay we increase the time for the capacitor to charge lowering the current drain on the power regulator. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes --- arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts index 55c9086..4e1c590 100644 --- a/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts +++ b/arch/arm/boot/dts/sun7i-a20-olinuxino-lime2.dts @@ -232,6 +232,8 @@ regulator-min-microvolt = <2800000>; regulator-max-microvolt = <2800000>; regulator-name = "vddio-csi0"; + regulator-soft-start; + regulator-ramp-delay = <1600>; }; ®_ldo4 { From patchwork Tue Dec 11 15:17:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 10724011 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 3C52691E for ; Tue, 11 Dec 2018 15:18:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B7CE2A8BA for ; Tue, 11 Dec 2018 15:18:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FD752A9CF; Tue, 11 Dec 2018 15:18: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=-4.4 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, 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 B74C02A8BA for ; Tue, 11 Dec 2018 15:18:57 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=MrxG+io30ITVMOnitcVYmrShr1A/yzQ0o4qAgXYVkXQ=; b=XNZI8cTiMfZh+1 GxERwXHJRScL/cnMiaPG3z+el8l+SzRfuxWbGb4c/oZWTl7WfPWF+TLugokQ1/eqRSfPo6AMNdkBI AGBNEPyRmnGpQx03dGZt9ZZhB5VzfJkvL1db3JA5zXUxvIg81PS/COZXUXmx5BBf+qUiHjjMU3lyw sh0ZLbtUCYMxS1zSnRgto2ey+6TNtb4gZ7wBR5B8KoNcJbsR1OPOACKs2qWaOVqrTY+mRsNXGT5Qb XGA4PmemwJoBSWgdOB+GCyKFsbitz3NLRgO7kjvcDojV4t1Bwf7g2+kEQRs2OVdJg7jAuiLUAyxBy IMrdE1MzmG2U8y89NC5g==; 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 1gWjoE-00046a-Ux; Tue, 11 Dec 2018 15:18:54 +0000 Received: from plaes.org ([188.166.43.21]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWjnM-0002xQ-4T for linux-arm-kernel@lists.infradead.org; Tue, 11 Dec 2018 15:18:11 +0000 Received: from localhost (unknown [213.204.46.240]) by plaes.org (Postfix) with ESMTPSA id 6DAB441A4E; Tue, 11 Dec 2018 15:17:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1544541442; bh=ByCwPrun3zomohIabXCqr8/YD09wa8MnYdpb1VM3gbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WJjikUPXjiZpwh4MmzOuGASuEzhle9mUab5gMvGtWV9YSGkmVXb+Emdr7gFJVeiqZ DEz2edKvggmJ+CPkAoz+xI+hpZArlDniQnsxZMvYZwH87iyUNkr/R9VR2eUsGr3KOD ilw0i9SAG8nJirW+tKbxbnaZ3h7xndNg5FtW3xUosjaJViZEXPRKZuYMZTeiE8ol0E 7o80wQIBOkPhQwYnDqhLwpX17vEtgsLSsj5ASjUD/PM7chIYqAlOyeLUDgVksCGsIL EMcjr5rtJgrX5tphIWKX5LASpMBpU2J//kDvIAPpkDJVyLYzHrmU798odELJSyWmKP l/N1IAixOZsEw== From: Priit Laes To: Lee Jones , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Liam Girdwood , Mark Brown , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Olliver Schinagl , linux-sunxi Subject: [PATCH v2 7/8] mfd: axp20x: Clean up included headers Date: Tue, 11 Dec 2018 17:17:11 +0200 Message-Id: <0cd6a4f334a84bfcbbdd805ccabe132611517ba3.1544512919.git-series.plaes@plaes.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181211_071800_868667_AD659E58 X-CRM114-Status: UNSURE ( 8.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: Priit Laes 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: Olliver Schinagl Add the bitops.h header as we need it, alphabetize header order. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes Acked-for-MFD-by: Lee Jones --- drivers/mfd/axp20x.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index dfc3cff..c3f3dbd 100644 --- a/drivers/mfd/axp20x.c +++ b/drivers/mfd/axp20x.c @@ -16,18 +16,19 @@ * published by the Free Software Foundation. */ -#include +#include +#include #include +#include #include #include +#include +#include #include +#include #include #include #include -#include -#include -#include -#include #define AXP20X_OFF 0x80 From patchwork Tue Dec 11 15:17:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 10724007 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 0AF2413AF for ; Tue, 11 Dec 2018 15:18:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC96D296B0 for ; Tue, 11 Dec 2018 15:18:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE9722B2F1; Tue, 11 Dec 2018 15:18: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=-4.4 required=2.0 tests=BAYES_00,DKIM_ADSP_ALL, 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 98906296B0 for ; Tue, 11 Dec 2018 15:18: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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=IeQNSs3PhOUVBy1hZzfxuBWXvFMOS5GYmuJPvEeH5Wk=; b=HrBAj0N7bAOZkt EQjpgJ9IvKocpFjLSV/suiY6ydkWMk60Nk+UOHVlmq7NQQDuzQiTuYC7t/DXSabcFucIvUcg0xwx4 EUvjLMEoYsGtMxgsDX4/zeuMrQS4nnkl6bXGgwQvi+8MTH1/EZvCmf33383QdEE1OTdWUP3TTucKM +yuMtUDAqytY32P13R4MoL4ITKMKQCLsV3KYm+sPuG+bBw7LhQZgZMgv17B+UxNXguNDTLtjUmUOT WFMog8O+nBmn5KpTxu2bHFpwgfwWkIJ0wGYf/ZSvhaKFzuimHfyoysazXI7PrjaDoPsY9Kc14GvvO hF4EX7vJ3W+9g9w2hY+w==; 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 1gWjnn-0003Yv-SI; Tue, 11 Dec 2018 15:18:27 +0000 Received: from plaes.org ([188.166.43.21]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWjnM-0002xT-4W for linux-arm-kernel@lists.infradead.org; Tue, 11 Dec 2018 15:18:07 +0000 Received: from localhost (unknown [213.204.46.240]) by plaes.org (Postfix) with ESMTPSA id 00BE441B8F; Tue, 11 Dec 2018 15:17:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1544541443; bh=vgPjZKkLtR2foKSb2/aM4T0Y7TjESGFmLL0vu1Bjlms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CaHBb7hCJbVH+DqnindqQM747x2bls2UN7WbkzPfj6ZN38GZE6BCZFxQTMEtomcAS Hosp2Ab90+O6cuVp854XjoJ+cQL1ndi8Re/u2o6Vw6mmzjf6Qn4hg81+J+kalCa0/5 FcTChwaoLQhM8PZQEI3HZ2I44kEzyCbMBw63f2aCivs/v2fIaRnpU5o01cqXwI6YPR 3aYOApy/Q64gQWiU+TUo58ZEFJykH0SpeRwoxsEPgdVrmAPDTuglUpW0K6C7AZvXo8 U2VuwDrnb7vIkzAA6VYiwFlHxwmcFLyT6b4mHtv7Zb5YJbhVSJTkuYn0vwk0PZ0PWS B3wpnbFQF/98A== From: Priit Laes To: Lee Jones , Rob Herring , Mark Rutland , Chen-Yu Tsai , Maxime Ripard , Liam Girdwood , Mark Brown , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Olliver Schinagl , linux-sunxi Subject: [PATCH v2 8/8] mfd: axp20x: use explicit bit defines Date: Tue, 11 Dec 2018 17:17:12 +0200 Message-Id: <2098c0aece09761bf975e72eaa75cba92a4e463d.1544512919.git-series.plaes@plaes.org> X-Mailer: git-send-email 2.19.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181211_071800_829059_A0643C97 X-CRM114-Status: UNSURE ( 9.70 ) 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: Priit Laes 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: Olliver Schinagl The AXP20X_OFF define is an actual specific bit, define it as such. Signed-off-by: Olliver Schinagl Signed-off-by: Priit Laes Acked-for-MFD-by: Lee Jones --- drivers/mfd/axp20x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index c3f3dbd..d183ed8 100644 --- a/drivers/mfd/axp20x.c +++ b/drivers/mfd/axp20x.c @@ -30,7 +30,7 @@ #include #include -#define AXP20X_OFF 0x80 +#define AXP20X_OFF BIT(7) #define AXP806_REG_ADDR_EXT_ADDR_MASTER_MODE 0 #define AXP806_REG_ADDR_EXT_ADDR_SLAVE_MODE BIT(4)