From patchwork Mon Dec 10 18:42: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: 10722191 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 AFD2A6C5 for ; Mon, 10 Dec 2018 18:42:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A03612B0AA for ; Mon, 10 Dec 2018 18:42:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E2A82B0EE; Mon, 10 Dec 2018 18:42: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 86C352B0EF for ; Mon, 10 Dec 2018 18:42: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=cbwZ65g12jzpzZklU6mGlqpaY9xtuEpcPzFLIQNHc4k=; b=HT1cYRpqgQcGwk F1OBt4l6Ix6KPFu5BkcqYR6w92t0asmdTvJHaM1Jny+wkipI+BbLO3NkePnCjYkKGrLAAfk+0mbbN 2Xr7oMCiq9vb70N6Mf0a6lbMTchH4O58UmJFWJs7dMURV3uTddm1HUqhCz6+NRlKuIxFLWy+AGK/F 1l2ROe8n9Z8GywKxGqJXegIhsBqnd8SG2AMCMvo25FHRS4M1or6fw7WRi/ctIvHt33eLz+Gn9OSLx bSPSF6vR9FqZ05qwXSvVq4jCCvq2X1Cpr2W+8qdrWW7q1m81J8kUXOzfTt2WDA+TVLVg5kfwMRQAQ sfN82RBoUSejvhEKq63A==; 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 1gWQVv-00033C-4K; Mon, 10 Dec 2018 18:42:43 +0000 Received: from plaes.org ([188.166.43.21]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWQVr-00030z-Lc for linux-arm-kernel@lists.infradead.org; Mon, 10 Dec 2018 18:42:41 +0000 Received: from localhost (unknown [213.204.46.240]) by plaes.org (Postfix) with ESMTPSA id 43DE44126E; Mon, 10 Dec 2018 18:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1544467345; bh=DNxG4QIovujeB65kr1xY5el00nrx7k3udwttY/HTPZc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VGaryfFNV8xozeb60Rm/7qOjwYb6gmCJWGq8Cd7nxq9t9XCpL+pNRT7bgqit37AYt OXwWFOVmIObrzD2+lDTY2dql8MHvW87roLS7tCbFsjbpgDF1cBnqvPlFkolVCVqaJC NBog6RXKOMt/Xt+60O1Tg4JYbkP9MkfoO7ft5YKDRREakbtwWbr2Pu/RmIw0LmL/Eh TDrW/h/j0Kymk51bt7orI5oJHpvsyH1m2ZDVWBr1BcfOrJ/CK7J7SLjJeEoAVx9NAO 7SalzfgTfPW56vrQFa598+kViB/L/HYnIWHw1tZBw/+tchFeXp3FQR/5GHz8MFVKAX RL1oB4IrRw3gg== 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 1/8] mfd: axp20x: name voltage ramping define properly Date: Mon, 10 Dec 2018 20:42:12 +0200 Message-Id: <01367c4f4f1e174fefbef9aac645f6792bda07e5.1544466940.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-20181210_104239_927068_343BEFA1 X-CRM114-Status: UNSURE ( 9.57 ) 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 Mon Dec 10 18:42:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 10722193 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 1D5F013BF for ; Mon, 10 Dec 2018 18:43:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D4E32B0AB for ; Mon, 10 Dec 2018 18:43:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B56A2B0EE; Mon, 10 Dec 2018 18:43:06 +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 977AB2B0E6 for ; Mon, 10 Dec 2018 18:43:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type: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=lAKoakfRjpk29A Pdb1Sdbm2rDqbJCB7dz4uGSeLmvLjHlIUNgojfXcQiUy+rHnSdDP074TtY0SPcbONI4eAPyPsWidc KFI21BJLRdTcN4LAz0L8H4+duZenkTFEPZyV1wQxh39KZKItFtw4G1vk6F94QOFxS8FoQQPgOnz8n IMHcdf+FV0FtV5u8DTdptUszlIVYFYRC106gHDX/fnvkiGsdlyAetBjuAHVPEF+e/D5o0LRwwDnSf kYbTozIgrQMcTmao0pw96QA8+smvCABfjED4YYnc4rj0RqaYfjnJOPu+ktI4bnSeINdMdHAzc5guM oGoUNCsshjSu0/ktePaQ==; 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 1gWQW6-0003Eo-7Q; Mon, 10 Dec 2018 18:42: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 1gWQVr-000310-Lk for linux-arm-kernel@lists.infradead.org; Mon, 10 Dec 2018 18:42:41 +0000 Received: from localhost (unknown [213.204.46.240]) by plaes.org (Postfix) with ESMTPSA id DA06C41289; Mon, 10 Dec 2018 18:42:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1544467346; bh=f2mcC9Dpd0QYLyRmz8so1Ckg3Nv64+LbaTC/FIJ10Ik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O0WRi/ydRMrVKhFvfrIp9rdhWemlVVSJizeZzDNYiH9lyZrQZiTltvzHazv628ABN ik2L4ipxvpqsfKM/qbJQ4CbD8bTRBZo9cWM3WNL4y7d/3dl54cr6sVi3idNrpzbbQs T7H1+TJiSgY7E4vI9oKsPFY8YwktCr81J5QHkbThIzhLh7v0FS3BNneH3+Nx5I1QaC 6PyyrBpTTy5dFGZT3jqn7S+sFel22dumtTbCGSLSEY+NPjgk0Jq3O9FZM4Lq/H9Cng 3O/KEY46u5lIuRWND//h5WUyFLRJ68BLGkiN3+vERefiOOU+t0F7boHxKgxF+W6AgA LEk5vNM2DmaBA== 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 2/8] regulator: axp20x: add support for set_ramp_delay for AXP209 Date: Mon, 10 Dec 2018 20:42:13 +0200 Message-Id: <2bfe47f173fe72a30b0036dcdeebc2123962ff33.1544466940.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-20181210_104239_995811_0E675A00 X-CRM114-Status: GOOD ( 15.32 ) 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 Mon Dec 10 18:42:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 10722195 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 AE5AC13BF for ; Mon, 10 Dec 2018 18:43:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DAEE2B0E6 for ; Mon, 10 Dec 2018 18:43:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C1D82B0EF; Mon, 10 Dec 2018 18:43:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-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 4817E2B10D for ; Mon, 10 Dec 2018 18:43:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type: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=crL7thuuijZ+Js m/auCcB3poVkCJeZWr3olXyCI3xeiFf2XVV0SmTb+aO877BPZ4PBnPZvryhlN/d/HACSK9IwavDiL HylkEY1a7ownem+w5UOhJGkr1P5sgvp7ql5+X9ZSLKmXWcU9RcF/swh8YRJKDpwRxiF6zFxY8S13k BSlKfpYfVxHywXhLVBCPYDSxi4U8J8nb4iantCn4JvGWbQ1cv0g47sRXU8iRy7fCgNMA9pctnYBX1 3FzUn45cUdXk7dawhCvriXyAeBCp/UYya2eEZyZPUE5WwBMcIbjEHKvFBfvs/kr97am3Nq5AXJWCH kEXnUF1UrQ8iCO/TWxEQ==; 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 1gWQWI-0003Ru-0E; Mon, 10 Dec 2018 18:43:06 +0000 Received: from plaes.org ([188.166.43.21]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWQVs-00031Q-1i for linux-arm-kernel@lists.infradead.org; Mon, 10 Dec 2018 18:42:42 +0000 Received: from localhost (unknown [213.204.46.240]) by plaes.org (Postfix) with ESMTPSA id 730F2418A8; Mon, 10 Dec 2018 18:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1544467346; bh=WJHmPRGpzdjRM9E54gWuAmfTil1kkRXpmiRybmesfIc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VrM8NZ6yzq2c2812K0TUVY3+m0ogRnsglxCeCOA4rUW5t2vx72RGUlJy9lO0pDpRo f85Rkc+rCLxkhXQLDiVZ9wmFqORHJqsalffvRj+oUJtK5MuybhOt2g/GN/TIB0LRtU fPjD4dT/YZKLHUEtnUEr7nyUy3dIg+H+TlDUDvtw7XlOnS3QA50IDnqkDqQqI3CegB FujHyNkqfaLjZVeLHOSVJVcUaPi7MB+Lx3+VtDhpZfaWff6Hecz9B4SfOnCTz+qmGD HRBSn8UR0HY+2mXlJnRpadqXggcqOFtmO5r6LVPzoHluP9Y896sLJrLziTR3gFfG5T 9QkhHHi3iL3FQ== 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 3/8] dt-bindings: mfd: axp20x: add support for regulator-ramp-delay for AXP209 Date: Mon, 10 Dec 2018 20:42:14 +0200 Message-Id: <78eafc64831c50005fe5d186c174440d48a865e3.1544466940.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-20181210_104240_244490_3B76A219 X-CRM114-Status: UNSURE ( 9.36 ) 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 Mon Dec 10 18:42:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 10722203 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 F31BC13BF for ; Mon, 10 Dec 2018 18:44:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E13042AC80 for ; Mon, 10 Dec 2018 18:44:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4EF22AC86; Mon, 10 Dec 2018 18:44:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-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 6A18C2AC80 for ; Mon, 10 Dec 2018 18:44:24 +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=V9kvUyXK/m96YW mbjEta441/4iTQu6571yywLl8SALhujTL19KPOSwSFy0868mrsN0zQubq1RYLOwKiQUC/2KZP3fsi g+MTpnj3hIhhle4K2GvyPNdFSr4sLQqyn0DKYECCLJZ+gcxX4ctMYvl3DrDHd4+gQgY6rRzHfc4K2 /UkP+CZy4FoNmWqUjQwtzMS88e1xkJwxfRBCusU+PbGY9kcySEgAlbAED1xRy+DUHIrw03vZMpwCV vsw4pDQ686zFbE4AjcyJrCp/YXFAb8XjVNbHi9s6d6VUrnYarf6vILkzD0cKDco7mtBC1sezgLkJi etyYyvqiYDcSvob2rXrA==; 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 1gWQXV-0004bx-2P; Mon, 10 Dec 2018 18:44:21 +0000 Received: from plaes.org ([188.166.43.21]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWQWI-0003NF-IM for linux-arm-kernel@lists.infradead.org; Mon, 10 Dec 2018 18:43:24 +0000 Received: from localhost (unknown [213.204.46.240]) by plaes.org (Postfix) with ESMTPSA id 085D9418DE; Mon, 10 Dec 2018 18:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1544467347; bh=kVazWeoBJTH1RfagB16nCXnVFLnAlX8uPnX2O4aNcZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TNhQU2+9kiHzHr2r0eh6QDKGwUgrDmxrva4AMNBAcOfaUCyc53Kc4MyL6DYlXAh+A QRpeLQ5jXhGAebKYSttBEOGHFI9WhVhYVw4mvulJLtXH7YaWP63OzFu3XuphamuXxw XXLvsVzoL7SzkVanAn4f6lehF2h9HgihvTiKBl51R+wLJERaKZwxUWuwcCoVGBboQX IvVKNEf/pou53ZKd34DtVR8hoMCNS09NeMJ/yvJXcVYygSVhfyIaqkced1ATpsv/jl IVvYs87x6UQxJ7drFbtCnMFPveYLrqg6I0n5PQTONtsCt+SBFG7x0+z4ap30+McPS5 4+ncvWx5W5GHw== 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 4/8] regulator: axp20x: add software based soft_start for AXP209 LDO3 Date: Mon, 10 Dec 2018 20:42:15 +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-20181210_104307_352923_32ABB696 X-CRM114-Status: GOOD ( 15.97 ) 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 Mon Dec 10 18:42:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 10722205 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 B4B8E13BF for ; Mon, 10 Dec 2018 18:45:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A241C2AC86 for ; Mon, 10 Dec 2018 18:45:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95BA22AC8C; Mon, 10 Dec 2018 18:45:00 +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 2CF792AC86 for ; Mon, 10 Dec 2018 18:45:00 +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=e6TUQobGDE7T1n 0IQiRq/ams6X6+k7sKnFQn04cM5rgZ2TZoEyj3q0G61zbtn15P8dAMTqLTRvRsUXLSZXn1Spu5MH9 MTe2/sJ+aGbeLl33N2G5joObzcjU7e7nxNEswddDdTEh38jVU0tw9NM2TLwot1JTp/B7azeWhkeVJ ddj6HHux5gAeTEvRRhaTCcmxQxpM2k2LMRo5Wy3K2vSXgCM2WnT8ST/PziirQAMMGjYbNgXo7M60+ CuaH90mOEHROMviHXPpMuKztz5KzaMOigHbWWP0SdZHrAG4peglgJSxYjOXPRmJRsw1CCBL33zn/f btKvh4j9AgK8wbJy28bg==; 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 1gWQY5-0004yb-D1; Mon, 10 Dec 2018 18:44:57 +0000 Received: from plaes.org ([188.166.43.21]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWQWY-0003cU-O2 for linux-arm-kernel@lists.infradead.org; Mon, 10 Dec 2018 18:43:35 +0000 Received: from localhost (unknown [213.204.46.240]) by plaes.org (Postfix) with ESMTPSA id 94FCA41911; Mon, 10 Dec 2018 18:42:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1544467347; bh=snlyZLidIJEaCnhVA6nQ3LGjhvn8FydspTFdTImmP0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SQz0IQv0kp3gM2C/gvHmVEeCq10zBLBUhrgzqkVmAFLNJYYuEgy2WCJXC5z86/37w HBu/YOxmKcktbgqsM59G28edueIEoA5rIv/olUx1lUsaovMgJiQRoAtAeNPzHu3pmY uYajVcooyH9AGKHaszB8Qn07e6zMTLNQk/UTipuF46Chs7fHsnV7+uhF1xWXEAfGWi Km1yXg4FH9AAYMdMOgUKafVaw+PotE0tutJoPhV4mzluftUncY84eGiDBVBjRnMvjR oMP4++DvG8kzsAq0Ik1wQISAlT5EKPeLZ8eQJLKiVkH8cTw5AsAKeyMK1+FufdXxKi Sd+NjNByjpwnA== 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 5/8] dt-bindings: mfd: axp20x: Add software based soft_start for AXP209 LDO3 Date: Mon, 10 Dec 2018 20:42:16 +0200 Message-Id: <25e67fe9b5397aa5f11bdd7026e4ae6be51dd18b.1544466940.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-20181210_104323_208147_CBADC0A1 X-CRM114-Status: GOOD ( 10.81 ) 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 Mon Dec 10 18:42:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 10722303 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 74A09159A for ; Mon, 10 Dec 2018 19:31:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62BF82AA80 for ; Mon, 10 Dec 2018 19:31:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 554222AAA3; Mon, 10 Dec 2018 19:31: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=-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 C96FE2AA80 for ; Mon, 10 Dec 2018 19:31:34 +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=uB7J5O+WoMwpHg D8Bv6GyR/P6lZQnj7qy8GT6MspHqxoZHnN6kcVngdpVjZ4T3v2jtEnTq1FTekT8EQF+8imS+LeB88 r9FugY6iHUftqPcIGcbl0jw+Gli3s74CIi42oC1nt91CAjqW7SD2SbpMhH8+Illi3L82WQUS6HvwW 9v2SrI2FcEX2tgxDDIwluPxGwhmc2D+xkYBza+esRRGHgBJRWZSEydSUXrrvER5DWuuaSPvwmO+dp qJWgqrHH+Jh8X612ZDabm84qfVSMXfQJVQEHr15kK/ky6CGy0d9PfgiNs9BEoBPqjQvDQTJip+uLB JZ1QUbJniw813YaJXOHQ==; 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 1gWRH6-00005t-2H; Mon, 10 Dec 2018 19:31:28 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWRH3-0008WA-UM for linux-arm-kernel@bombadil.infradead.org; Mon, 10 Dec 2018 19:31:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=R3vckfbKaGOFqre3VzpA++cmfXTh2HrU7ttVPE4Ted4=; b=cPLOobsCp1AWm2s2P6NI3rReAf OYXuPOJoUpK86I7QFUxkIbU5brC3XtGzoCiG12/NrV5r/2w8O0THreLXosEBc39Id/63R17EKOcka T3qoZ25wuqc1eP0NsaVMroJ2piZWDK6Pn07IpSbZ5W18G0VmSVSeA5lamVy0NhpsRB8MQtWTq87b1 uhlxb1HuEMDvJtEbb4yBwiHS5vZijdAzqaAEjSaNNAONNjSu6Bbhd9TKh6vVxw01dqvSSRJ5huLzc cMu/VBIFVrSV0vm3Lm303GIJKtDj5mMhX/o3rb98si9FxP0qBgVIz6Y94funHu4OuSCxDx5hyt6VQ rb6D+DRA==; Received: from plaes.org ([188.166.43.21]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWQWe-0006fe-56 for linux-arm-kernel@lists.infradead.org; Mon, 10 Dec 2018 18:43:29 +0000 Received: from localhost (unknown [213.204.46.240]) by plaes.org (Postfix) with ESMTPSA id 287604195C; Mon, 10 Dec 2018 18:42:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1544467348; bh=rL1R6deG8R4m86FOSDKOCU7rxrxi6SE5YJnbhqg7w48=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SyfUTFucZNxHfb6zdMH+nBz7AF5svNHDzNRiiTY4Sz9vRSBQlkK6da+gAnMUei6+B cllyP3Xlc1/FqQ48+2yGeUTubaVoVdaYtzN5pHc6tj0tBTxfMxpNjCnZ+C7OYihnSE 1MT30MRD2wWYTG6V2ZItqx89sUyQ09VTCSUub/CneifpKrNKeAfkVs7fRts3UbsmdQ Cn1cLj+vKMJVoaJrEh9sKz+68FFZqTnPrg/oq26QqG4p9Q+VNGCrMv/qaugKH0jajz aNPGZPw3QAoNsOwCg5z1UR64LBDTgvia75OP4haDR2ryy7fSWN4cQ1kqIO77dnb7Uo dM37smIMKCmhw== 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 6/8] regulator: dts: enable soft-start and ramp delay for the OLinuXino Lime2 Date: Mon, 10 Dec 2018 20:42:17 +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-20181210_134328_305026_A46A1B98 X-CRM114-Status: UNSURE ( 9.97 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 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 Mon Dec 10 18:42:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 10722199 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 2B4006C5 for ; Mon, 10 Dec 2018 18:44:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 192D128B49 for ; Mon, 10 Dec 2018 18:44:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0D25328B95; Mon, 10 Dec 2018 18:44:03 +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 A5AF928A07 for ; Mon, 10 Dec 2018 18:44:02 +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=e++TR+QsMMF71V LMxGLWSbNZehvoEEBb3ZVUai0WDO1IzP+LtgcgG1exwq2x6Y0hAR/TVQprHeT6LaI0hGjzptpC5uo H+gvliwiKcs4eua/PRl37SNll0YwjzTtO3+lJp6f7Z5yoi1iY08i0K3/cx/7ouww2Eagp98irFMJs sQWpBoTWuQ0KOt+nrcKn5eeIMInq41Bs2gFG21Mxu8u9lFOY6V+F8d6ujQK7i/lr4Tyn2HOKcF4YU UAEaZUglL2bYnrYxDzJtDYFb61tfGSnQ/EHKmEPPR8FU6ZTlCx9U4gTOvNfIWKuHrm64TuHyHg8eI BiAlRsJqd1lb0+scjI+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 1gWQX2-0004Bd-SV; Mon, 10 Dec 2018 18:43: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 1gWQW4-00033B-SR for linux-arm-kernel@lists.infradead.org; Mon, 10 Dec 2018 18:42:54 +0000 Received: from localhost (unknown [213.204.46.240]) by plaes.org (Postfix) with ESMTPSA id B150B419F3; Mon, 10 Dec 2018 18:42:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1544467348; bh=ByCwPrun3zomohIabXCqr8/YD09wa8MnYdpb1VM3gbA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JEopBUnN/ZqgyRVolAJn6Wehn7MfIypM86LoeRg0xiP5tj9DbnEPwyXc/Zw3yHZQy iobPYZHb9ljyMfGVyJ9rgAnFOK6/DUcCUWLEVorGfWx2r3mboNCl41cihN4XdtarHr fjcFmzhhxvgGS2W4my3WzusdE6hiNPudcBJbd5BfbU9tT1bwEze0pjgZ34oedpHXCI vPpxH06hyMoP4beVv3GwwMVMf824phQ6vsX74q3+4vDfF+XwM+1wXpEioP/ll0HVeO c/2iW9n/J8A77JRYmpOdcE2Xn3B97Rql5Y7T7Dq7au2k3Dn461hVLXj3y9FFvHcW7R F4B4/IA99t8Gw== 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 7/8] mfd: axp20x: Clean up included headers Date: Mon, 10 Dec 2018 20:42:18 +0200 Message-Id: <0cd6a4f334a84bfcbbdd805ccabe132611517ba3.1544466940.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-20181210_104253_184854_F8CDE432 X-CRM114-Status: UNSURE ( 8.76 ) 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 Mon Dec 10 18:42:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Priit Laes X-Patchwork-Id: 10722197 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 B276E6C5 for ; Mon, 10 Dec 2018 18:43:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D8B22882A for ; Mon, 10 Dec 2018 18:43:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C03F285DA; Mon, 10 Dec 2018 18:43:44 +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 2BD88285DA for ; Mon, 10 Dec 2018 18:43:44 +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=t1pifGtrsG1nyD eEcQH370TTBn9KK2PASxXymKsI6YWkcypn9kaFQRZYW6cbFuNoHVdCH/tTyJui9ZHpS1AMYV/8XxU DGI9aLlw1Wap7TCbDz/W5Dg+eG6kqSHV44qqVPLMxoxJ3r5J5462/hIPNtpoD+BPf6USnAWFmEyDy G/lTd7L6NZwMDixChL3/iDSyDvzoFM+UYbx6UYHXD3GCakhktgyfHP6ZoFy4zt5ykvFY9qnWVH84c DJ+NvT2vN0rJnIQ/HVEo3e2YIfmM40c1VY46FBIXTbL9khvZwTl7xz8F2OZEwQ+DXv1RLdqVwtnFR vkcDjssIopDGp+Nvc87g==; 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 1gWQWm-0003wd-3i; Mon, 10 Dec 2018 18:43:36 +0000 Received: from plaes.org ([188.166.43.21]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gWQW4-00033A-SQ for linux-arm-kernel@lists.infradead.org; Mon, 10 Dec 2018 18:42:54 +0000 Received: from localhost (unknown [213.204.46.240]) by plaes.org (Postfix) with ESMTPSA id 4325B41A4E; Mon, 10 Dec 2018 18:42:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1544467349; bh=vgPjZKkLtR2foKSb2/aM4T0Y7TjESGFmLL0vu1Bjlms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SSlONadqlrWBkWFxCwIDBGKMqR2fOnLh6DiMMPI1+GERy527ZbbyHi5k2tgL6EiQz g+zoaz1Vjz8OauAvYxz4zGpKR6vZD5bhYw3S9Mo7r/cwfnfQ9DEbzoPlntPpcwktPv WtvAOoW481at0T+dWPXQ9BQ1+cej9rGiDaYYeggIO8mkw2/gKU63lo+pYXRbyn+B1L g6MHz5a7PD/KcYJHTO9Zc79lTStwJnQ/tQci6Rcz5NBlRWg7Kt//IFsGEWBeAvGhKv LM79EGbxf2wAksGr7hk1DD3MZ+Km32PjhwJ7BrLnp29YEFUmJkFWPgYJOxo7lGXkLr 1j5s117nrDs/w== 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 8/8] mfd: axp20x: use explicit bit defines Date: Mon, 10 Dec 2018 20:42:19 +0200 Message-Id: <2098c0aece09761bf975e72eaa75cba92a4e463d.1544466940.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-20181210_104253_056172_281F600E X-CRM114-Status: UNSURE ( 9.84 ) 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)