From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932707AbcFBLxh (ORCPT ); Thu, 2 Jun 2016 07:53:37 -0400 Received: from mail-wm0-f53.google.com ([74.125.82.53]:36433 "EHLO mail-wm0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932344AbcFBLxf (ORCPT ); Thu, 2 Jun 2016 07:53:35 -0400 Subject: Re: [RFC PATCH v1 1/3] regulator: helpers: consider constriants in list_voltage_linear_range To: Mark Brown References: <1464862996-3147-1-git-send-email-srinivas.kandagatla@linaro.org> <1464862996-3147-2-git-send-email-srinivas.kandagatla@linaro.org> <20160602110557.GH2282@sirena.org.uk> Cc: bjorn.andersson@linaro.org, linux-kernel@vger.kernel.org, Liam Girdwood , linux-arm-msm@vger.kernel.org From: Srinivas Kandagatla Message-ID: <57501E3C.3060308@linaro.org> Date: Thu, 2 Jun 2016 12:53:32 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <20160602110557.GH2282@sirena.org.uk> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/06/16 12:05, Mark Brown wrote: > On Thu, Jun 02, 2016 at 11:23:14AM +0100, Srinivas Kandagatla wrote: >> Regulator drivers can have linear range which is according to the >> regualtor hardware spec, however the board level device tree files >> can restrict this range by adding constriants. >> These constriants are not considered in the exsiting code, which >> gives false supported voltage range to the consumers. > > ... > >> For now I have added this support for regulator_list_voltage_linear_range() >> If it makes sense we can extend this to other list voltage helpers too. > > Why are you making this change? The obvious problem here is that drivers > should not be looking at constraints - it would be silly to duplicate > constraint enforcing code in individual drivers and would lead to > inconsistent performance of constraints. This is why we do this in the > core, in _regulator_list_voltage(), Yep, you are right, I should have looked into _regulator_list_voltage() in more carefully, it already has this check in place. --srini