From patchwork Fri Apr 29 10:59:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 8979981 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 030239F372 for ; Fri, 29 Apr 2016 11:02:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1B88920220 for ; Fri, 29 Apr 2016 11:02:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 29A8020212 for ; Fri, 29 Apr 2016 11:02:18 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aw6AW-0001k4-0v; Fri, 29 Apr 2016 11:01:08 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aw69x-0001EL-Uz for linux-arm-kernel@lists.infradead.org; Fri, 29 Apr 2016 11:00:34 +0000 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O6E00FFW6K9EJ80@mailout1.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 29 Apr 2016 12:00:09 +0100 (BST) X-AuditID: cbfec7f4-f796c6d000001486-95-57233eb953f6 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 21.65.05254.9BE33275; Fri, 29 Apr 2016 12:00:09 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O6E00M736K3GJ20@eusync4.samsung.com>; Fri, 29 Apr 2016 12:00:09 +0100 (BST) From: Krzysztof Kozlowski To: Kukjin Kim , Krzysztof Kozlowski , Chanwoo Choi , Liam Girdwood , Mark Brown , Greg Kroah-Hartman , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH 3/3] regulator: max77686: Configure enable time to properly handle regulator enable Date: Fri, 29 Apr 2016 12:59:51 +0200 Message-id: <1461927591-7864-4-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1461927591-7864-1-git-send-email-k.kozlowski@samsung.com> References: <1461927591-7864-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrHLMWRmVeSWpSXmKPExsVy+t/xa7o77ZTDDW4dlrfYOGM9q8XUh0/Y LK5/ec5qMf/IOVaL5sXr2SxOTX7GZPH6haFF/+PXzBbfrnQwWWx6fI3V4vKuOWwWM87vY7JY tKyV2WLdxlvsFmuP3GW3aFv9gdVBwGPnrLvsHptWdbJ57J+7ht1j85J6j3/H2D36tqxi9Pi8 Sc7j1NfP7AEcUVw2Kak5mWWpRfp2CVwZy75tZS34K1Bx/NcptgbGz7xdjJwcEgImEgdXXWOG sMUkLtxbzwZiCwksZZQ4dkuji5ELyG5kkui6cYURJMEmYCyxefkSNpCEiMB0ZondLw6ygDjM AgsYJb4sn80OUiUskCrR/vwu2FgWAVWJyWuWg8V5BdwkXp1YygqxTk7i5LHJYDangLvE/Vnf mSFWu0msO/KebQIj7wJGhlWMoqmlyQXFSem5hnrFibnFpXnpesn5uZsYIaH8ZQfj4mNWhxgF OBiVeHhn3FMKF2JNLCuuzD3EKMHBrCTCe9RWOVyINyWxsiq1KD++qDQntfgQozQHi5I479xd 70OEBNITS1KzU1MLUotgskwcnFINjOVeEk83GxT7r47eVcRqe8qvMzfadvtlqf/K6yfMdlx0 8OzhI1yrrZtz5/N+sgjSnlbHc03usWndj5RyPd20X9ZMUanBseJP6ypVDX+X1JiKRvisMDL+ telE7tG+CYvTf77Q8Eq6cdrR6pTGvSM3fv1fpJC+umPXCTb391NuHS17Mk9x6v3INiWW4oxE Qy3mouJEACLTRG5hAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160429_040034_169530_FF946587 X-CRM114-Status: GOOD ( 13.91 ) X-Spam-Score: -7.9 (-------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux.amoon@gmail.com, tjakobi@math.uni-bielefeld.de, Bartlomiej Zolnierkiewicz , hverkuil@xs4all.nl, m.szyprowski@samsung.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The enable time for buck regulators was not configured but actually is essential: consumers, like usb3503, doing hard reset (regulator off/on) should wait for the regulator to settle. Configure the enable time according to datasheet. Signed-off-by: Krzysztof Kozlowski --- drivers/regulator/max77686-regulator.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/regulator/max77686-regulator.c b/drivers/regulator/max77686-regulator.c index d1ab6a4da88f..ac4fa581e0a5 100644 --- a/drivers/regulator/max77686-regulator.c +++ b/drivers/regulator/max77686-regulator.c @@ -41,6 +41,8 @@ #define MAX77686_LDO_LOW_UVSTEP 25000 #define MAX77686_BUCK_MINUV 750000 #define MAX77686_BUCK_UVSTEP 50000 +#define MAX77686_BUCK_ENABLE_TIME 40 /* us */ +#define MAX77686_DVS_ENABLE_TIME 22 /* us */ #define MAX77686_RAMP_DELAY 100000 /* uV/us */ #define MAX77686_DVS_RAMP_DELAY 27500 /* uV/us */ #define MAX77686_DVS_MINUV 600000 @@ -422,6 +424,7 @@ static struct regulator_ops max77686_buck_dvs_ops = { .min_uV = MAX77686_BUCK_MINUV, \ .uV_step = MAX77686_BUCK_UVSTEP, \ .ramp_delay = MAX77686_RAMP_DELAY, \ + .enable_time = MAX77686_BUCK_ENABLE_TIME, \ .n_voltages = MAX77686_VSEL_MASK + 1, \ .vsel_reg = MAX77686_REG_BUCK5OUT + (num - 5) * 2, \ .vsel_mask = MAX77686_VSEL_MASK, \ @@ -439,6 +442,7 @@ static struct regulator_ops max77686_buck_dvs_ops = { .min_uV = MAX77686_BUCK_MINUV, \ .uV_step = MAX77686_BUCK_UVSTEP, \ .ramp_delay = MAX77686_RAMP_DELAY, \ + .enable_time = MAX77686_BUCK_ENABLE_TIME, \ .n_voltages = MAX77686_VSEL_MASK + 1, \ .vsel_reg = MAX77686_REG_BUCK1OUT, \ .vsel_mask = MAX77686_VSEL_MASK, \ @@ -456,6 +460,7 @@ static struct regulator_ops max77686_buck_dvs_ops = { .min_uV = MAX77686_DVS_MINUV, \ .uV_step = MAX77686_DVS_UVSTEP, \ .ramp_delay = MAX77686_DVS_RAMP_DELAY, \ + .enable_time = MAX77686_DVS_ENABLE_TIME, \ .n_voltages = MAX77686_DVS_VSEL_MASK + 1, \ .vsel_reg = MAX77686_REG_BUCK2DVS1 + (num - 2) * 10, \ .vsel_mask = MAX77686_DVS_VSEL_MASK, \