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: 8979931 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 116F2BF29F for ; Fri, 29 Apr 2016 11:01:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3049720218 for ; Fri, 29 Apr 2016 11:01:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 39BFF201E4 for ; Fri, 29 Apr 2016 11:01:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753194AbcD2LAy (ORCPT ); Fri, 29 Apr 2016 07:00:54 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:32695 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753055AbcD2LAT (ORCPT ); Fri, 29 Apr 2016 07:00:19 -0400 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>; 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 Cc: linux.amoon@gmail.com, tjakobi@math.uni-bielefeld.de, m.szyprowski@samsung.com, hverkuil@xs4all.nl, Bartlomiej Zolnierkiewicz 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 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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, \