From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 510A3C47080 for ; Tue, 1 Jun 2021 15:52:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A7EC6136E for ; Tue, 1 Jun 2021 15:52:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234498AbhFAPyb (ORCPT ); Tue, 1 Jun 2021 11:54:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:39136 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234495AbhFAPyb (ORCPT ); Tue, 1 Jun 2021 11:54:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2BE3861396; Tue, 1 Jun 2021 15:52:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1622562769; bh=aGdPf/JG2Ma5dBKju6woR09ogotgTp0UyCyCSzPN8E0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vFmm4EuDgRez/N9yYR8a2d8GUezxEqiMSMBcLzq6HqBUE9zJLj6qL2dkHJZDPH8op iX1CqyIZdIMGpNoMJTIQcrkoOPYDGcPRizuPOtMu++Mpn3MXa7CrkR+xTl0SizVkxU vcY6KQYQK60IB4VYju/UO9J5u2YSUpE5eGtiUe/2X99jCl7DPrE7zmeZwH7xYGB08Y ATdnAOyRj0KSZSx3/W8vzdstQHOvZ/6t2RrP+qoC6yeHZl1IWU6uCqi65sHaC+ae/d ePaRWGOdqnfOrax69HoqQoU0WFH6K/UvnadhleC25UuxBaWYwIZ//PDxH7sk13RtRc u7POCe7b6WHgw== Date: Tue, 1 Jun 2021 16:52:39 +0100 From: Mark Brown To: ChiYuan Huang Cc: lgirdwood@gmail.com, Rob Herring , lkml , cy_huang , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" Subject: Re: [PATCH v4 2/2] regulator: rt6160: Add support for Richtek RT6160 Message-ID: <20210601155239.GD4089@sirena.org.uk> References: <1622008068-13474-1-git-send-email-u0084500@gmail.com> <1622008068-13474-2-git-send-email-u0084500@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="//IivP0gvsAy3Can" Content-Disposition: inline In-Reply-To: X-Cookie: Sic Transit Gloria Thursdi. User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org --//IivP0gvsAy3Can Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, May 27, 2021 at 11:14:17AM +0800, ChiYuan Huang wrote: > I review the regulator_set_ramp_delay_regmap API. > If seems I need to fill in the ramp_delay_table by the descend order. > But this chip ramp delay table is designed the ascending value reg bit > field [0 1 2 3] by > the ascending order [1000 2500 5000 10000] uV/uS > Even if I tried to filler in descending order, I also need a inverted operation. I see... that really should be supportable, and I'd have expected find_closest_bigger() to DTRT here, it's not obvious it's expecting ordering. > And I found the regulator_set_ramp_delay_regmap API has some logic error. > From the include/linux/regulator/driver.h, the set_ramp_delay function says to > set the less or equal one ramp delay value. > But your logic will get the larger or equal one from the descending > ramp delay table. The code is correct here, the documentation should be fixed - with a delay like this we should be erring on the side of delaying too long to be safe. --//IivP0gvsAy3Can Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmC2V8YACgkQJNaLcl1U h9CTrgf6ArqSe4D42r70JaahR7KYaMW6G6x9fIdM279DEUiisu2lF4pby14hFG9v xze19BNI8C7w7ziMCd3Q4gOF2h8jLljHv8tubSalY3W89MCX6AhfBfKzoc7aSWat lxjjLfCMWV6u5CJhPvSS8L2XMawDG6WkA98Kuvde52YGTxRnieHeJbLaHdIs3fr9 c2uHJRSRFvEkVhkhikwi4OhtFHoRjZVRlnTn03n1gqSc9d9gfZSOATutUZxQnvoe 6eneLvfQJwpX1UjhvJ1JPox28cXqzPwWgxKfBBoAd3hRSRwZSNMhwto9VsJ7TrRZ 9r1fBvnARN+gMU2hPNeHwQT6zO5p7A== =1NtJ -----END PGP SIGNATURE----- --//IivP0gvsAy3Can--