From: Jeffrey Hugo <jhugo@codeaurora.org>
To: Mark Brown <broonie@kernel.org>
Cc: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>,
lgirdwood@gmail.com, agross@kernel.org, david.brown@linaro.org,
bjorn.andersson@linaro.org, jcrouse@codeaurora.org,
robh+dt@kernel.org, mark.rutland@arm.com,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org,
Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>
Subject: Re: [PATCH 2/3] regulator: qcom_spmi: Add support for PM8005
Date: Wed, 22 May 2019 08:16:38 -0600 [thread overview]
Message-ID: <4e5bdf77-3141-bff6-e5b9-a81a5c73b4e4@codeaurora.org> (raw)
In-Reply-To: <20190522110107.GB8582@sirena.org.uk>
On 5/22/2019 5:01 AM, Mark Brown wrote:
> On Tue, May 21, 2019 at 05:16:06PM -0600, Jeffrey Hugo wrote:
>> On 5/21/2019 12:50 PM, Mark Brown wrote:
>
>>>> +static int spmi_regulator_common_list_voltage(struct regulator_dev *rdev,
>>>> + unsigned selector);
>>>> +
>>>> +static int spmi_regulator_common2_set_voltage(struct regulator_dev *rdev,
>>>> + unsigned selector)
>
>>> Eeew, can we not have better names?
>
>> I'm open to suggestions. Apparently there are two register common register
>> schemes - the old one and the new one. PMIC designs after some random point
>> in time are all the new register scheme per the documentation I see.
>
>> As far as I an aware, the FT426 design is the first design to be added to
>> this driver to make use of the new scheme, but I expect more to be supported
>> in future, thus I'm reluctant to make these ft426 specific in the name.
>
> If there's a completely new register map why are these even in the same
> driver?
Its not completely new, its a derivative of the old scheme. Of the 104
registers, approximately 5 have been modified, therefore the new scheme
is 95% compatible with the old one. Duplicating a 1883 line driver to
handle a change in 5% of the register space seems less than ideal.
Particularly considering your previous comments seem to indicate that
you feel its pretty trivial to handle the quirks associated with the
changes in this driver.
>
>>>> + if (reg == SPMI_COMMON2_MODE_HPM_MASK)
>>>> + return REGULATOR_MODE_NORMAL;
>>>> +
>>>> + if (reg == SPMI_COMMON2_MODE_AUTO_MASK)
>>>> + return REGULATOR_MODE_FAST;
>>>> +
>>>> + return REGULATOR_MODE_IDLE;
>>>> +}
>
>>> This looks like you want to write a switch statement.
>
>> It follows the existing style in the driver, but sure I can make this a
>> switch.
>
> Please fix the rest of the driver as well then.
>
--
Jeffrey Hugo
Qualcomm Datacenter Technologies as an affiliate of Qualcomm
Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the
Code Aurora Forum, a Linux Foundation Collaborative Project.
next prev parent reply other threads:[~2019-05-22 14:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-21 16:49 [PATCH 0/3] PM8005 regulator support for msm8998 GPU Jeffrey Hugo
2019-05-21 16:52 ` [PATCH 1/3] dt-bindings: qcom_spmi: Document PM8005 regulators Jeffrey Hugo
2019-05-21 17:26 ` Bjorn Andersson
2019-05-21 16:53 ` [PATCH 2/3] regulator: qcom_spmi: Add support for PM8005 Jeffrey Hugo
2019-05-21 18:50 ` Mark Brown
2019-05-21 23:16 ` Jeffrey Hugo
2019-05-22 11:01 ` Mark Brown
2019-05-22 14:16 ` Jeffrey Hugo [this message]
2019-05-22 14:28 ` Mark Brown
2019-05-22 14:58 ` Jeffrey Hugo
2019-05-21 19:09 ` Bjorn Andersson
2019-05-21 16:53 ` [PATCH 3/3] arm64: dts: msm8998-mtp: Add pm8005_s1 regulator Jeffrey Hugo
2019-05-21 18:16 ` Bjorn Andersson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4e5bdf77-3141-bff6-e5b9-a81a5c73b4e4@codeaurora.org \
--to=jhugo@codeaurora.org \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=broonie@kernel.org \
--cc=david.brown@linaro.org \
--cc=devicetree@vger.kernel.org \
--cc=jcrouse@codeaurora.org \
--cc=jeffrey.l.hugo@gmail.com \
--cc=jorge.ramirez-ortiz@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox