From: Fenglin Wu <quic_fenglinw@quicinc.com>
To: Konrad Dybcio <konrad.dybcio@linaro.org>, <kernel@quicinc.com>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <andersson@kernel.org>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: <linux-arm-msm@vger.kernel.org>, <linux-input@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>
Subject: Re: [PATCH v8 1/3] input: pm8xxx-vibrator: refactor to support new SPMI vibrator
Date: Wed, 3 Apr 2024 13:29:46 +0800 [thread overview]
Message-ID: <db301b10-6312-4d47-ba4a-9c462e5cbea0@quicinc.com> (raw)
In-Reply-To: <21641459-d7c0-412d-8244-6f2f2c458551@linaro.org>
On 4/2/2024 11:21 PM, Konrad Dybcio wrote:
> On 1.04.2024 10:38 AM, Fenglin Wu via B4 Relay wrote:
>> From: Fenglin Wu <quic_fenglinw@quicinc.com>
>>
>> Currently, vibrator control register addresses are hard coded,
>> including the base address and offsets, it's not flexible to
>> support new SPMI vibrator module which is usually included in
>> different PMICs with different base address. Refactor it by using
>> the base address defined in devicetree.
>>
>> Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
>> ---
>
> [...]
>
>> if (regs->enable_mask)
>> - rc = regmap_update_bits(vib->regmap, regs->enable_addr,
>> + rc = regmap_update_bits(vib->regmap, vib->enable_addr,
>> regs->enable_mask, on ? ~0 : 0);
>
> The idiomatic way across the kernel seems to be writing the mask value
> instead of ~0 (which also saves like 2 cpu instructions)
>
>
> Not sure about how ssbi addressing works, but except for that lgtm
>
Agree.
SSBI driver doesn't provide reg_update_bits function call so similar
mathematics is done on the value before writing to the register, I can
update it to use enable_mask directly in next version.
> Konrad
next prev parent reply other threads:[~2024-04-03 5:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-01 8:38 [PATCH v8 0/3] Add support for vibrator in multiple PMICs Fenglin Wu via B4 Relay
2024-04-01 8:38 ` [PATCH v8 1/3] input: pm8xxx-vibrator: refactor to support new SPMI vibrator Fenglin Wu via B4 Relay
2024-04-02 15:21 ` Konrad Dybcio
2024-04-03 5:29 ` Fenglin Wu [this message]
2024-04-01 8:38 ` [PATCH v8 2/3] dt-bindings: input: qcom,pm8xxx-vib: add new SPMI vibrator module Fenglin Wu via B4 Relay
2024-04-01 8:38 ` [PATCH v8 3/3] input: pm8xxx-vibrator: add new SPMI vibrator support Fenglin Wu via B4 Relay
2024-04-10 18:10 ` Konrad Dybcio
2024-04-11 6:41 ` Fenglin Wu
2024-04-11 6:58 ` Fenglin Wu
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=db301b10-6312-4d47-ba4a-9c462e5cbea0@quicinc.com \
--to=quic_fenglinw@quicinc.com \
--cc=agross@kernel.org \
--cc=andersson@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.baryshkov@linaro.org \
--cc=dmitry.torokhov@gmail.com \
--cc=kernel@quicinc.com \
--cc=konrad.dybcio@linaro.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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
all inboxes | Powered by JetHome®