From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Collins Subject: Re: [PATCH v8 2/2] regulator: add QCOM RPMh regulator driver Date: Thu, 12 Jul 2018 18:34:02 -0700 Message-ID: References: <35c4ea70cdf5caba560fb6f40e866ee8bc456d93.1529712888.git.collinsd@codeaurora.org> <20180702102853.GI18211@sirena.org.uk> <9bbfb628-018d-2d89-257b-9cc4e716cb46@codeaurora.org> <20180712165457.GI10369@sirena.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20180712165457.GI10369@sirena.org.uk> Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org To: Mark Brown Cc: lgirdwood@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, rnayak@codeaurora.org, sboyd@kernel.org, dianders@chromium.org, mka@chromium.org List-Id: linux-arm-msm@vger.kernel.org On 07/12/2018 09:54 AM, Mark Brown wrote: > On Mon, Jul 09, 2018 at 04:44:14PM -0700, David Collins wrote: >> On 07/02/2018 03:28 AM, Mark Brown wrote: >>> On Fri, Jun 22, 2018 at 05:46:14PM -0700, David Collins wrote: >>>> +static unsigned int rpmh_regulator_pmic4_ldo_of_map_mode(unsigned int mode) >>>> +{ >>>> + static const unsigned int of_mode_map[RPMH_REGULATOR_MODE_COUNT] = { >>>> + [RPMH_REGULATOR_MODE_RET] = REGULATOR_MODE_STANDBY, >>>> + [RPMH_REGULATOR_MODE_LPM] = REGULATOR_MODE_IDLE, >>>> + [RPMH_REGULATOR_MODE_AUTO] = REGULATOR_MODE_INVALID, >>>> + [RPMH_REGULATOR_MODE_HPM] = REGULATOR_MODE_FAST, >>>> + }; > >>> Same here, based on that it looks like auto mode is a good map for >>> normal. > >> LDO type regulators physically do not support AUTO mode. That is why I >> specified REGULATOR_MODE_INVALID in the mapping. > > The other question here is why this is even in the table if it's not > valid (I'm not seeing a need for the MODE_COUNT define)? I thought that having a table would be more concise and easier to follow. I can change this to a switch case statement. Take care, David -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project