mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
To: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Cc: Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	Subbaraman Narayanamurthy
	<subbaraman.narayanamurthy@oss.qualcomm.com>,
	David Collins <david.collins@oss.qualcomm.com>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, kernel@oss.qualcomm.com
Subject: Re: [PATCH 2/2] spmi: spmi-pmic-arb: add support for PMIC arbiter v8.5
Date: Thu, 2 Apr 2026 12:18:56 +0800	[thread overview]
Message-ID: <c5d1578d-729d-4c09-b761-c67e6d3be745@oss.qualcomm.com> (raw)
In-Reply-To: <mxawruvb2p6svks3y4rab7feyn4dhkwe6dosjyc6yt2ozdaual@bvvof6rzm3jo>


On 4/1/2026 7:22 PM, Dmitry Baryshkov wrote:
> On Wed, Apr 01, 2026 at 02:41:24AM -0700, Fenglin Wu wrote:
>> PMIC arbiter v8.5 is an extension of PMIC arbiter v8 that updated
>> the definition of the channel status register bit fields. Add support
>> to handle this difference.
>>
>> Signed-off-by: Fenglin Wu <fenglin.wu@oss.qualcomm.com>
>> ---
>>   drivers/spmi/spmi-pmic-arb.c | 69 ++++++++++++++++++++++++++++++++++++++------
>>   1 file changed, 60 insertions(+), 9 deletions(-)
>>
>> diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c
>> index 69f8d456324a..deeaa39bb647 100644
>> --- a/drivers/spmi/spmi-pmic-arb.c
>> +++ b/drivers/spmi/spmi-pmic-arb.c
>> @@ -28,6 +28,7 @@
>>   #define PMIC_ARB_VERSION_V5_MIN		0x50000000
>>   #define PMIC_ARB_VERSION_V7_MIN		0x70000000
>>   #define PMIC_ARB_VERSION_V8_MIN		0x80000000
>> +#define PMIC_ARB_VERSION_V8P5_MIN	0x80050000
>>   #define PMIC_ARB_INT_EN			0x0004
>>   
>>   #define PMIC_ARB_FEATURES		0x0004
>> @@ -63,11 +64,34 @@
>>   #define SPMI_OWNERSHIP_PERIPH2OWNER(X)	((X) & 0x7)
>>   
>>   /* Channel Status fields */
>> -enum pmic_arb_chnl_status {
>> -	PMIC_ARB_STATUS_DONE	= BIT(0),
>> -	PMIC_ARB_STATUS_FAILURE	= BIT(1),
>> -	PMIC_ARB_STATUS_DENIED	= BIT(2),
>> -	PMIC_ARB_STATUS_DROPPED	= BIT(3),
>> +struct pmic_arb_chnl_status_mask {
>> +	u8	done;
>> +	u8	failure;
>> +	u8	crc;
>> +	u8	parity;
>> +	u8	nack;
>> +	u8	denied;
>> +	u8	dropped;
>> +};
>> +
>> +static const struct pmic_arb_chnl_status_mask chnl_status_mask = {
>> +	.done		= BIT(0),
>> +	.failure	= BIT(1),
>> +	.crc		= 0,
>> +	.parity		= 0,
>> +	.nack		= 0,
>> +	.denied		= BIT(2),
>> +	.dropped	= BIT(3),
>> +};
>> +
>> +static const struct pmic_arb_chnl_status_mask chnl_status_mask_v8p5 = {
>> +	.done		= BIT(0),
>> +	.failure	= BIT(1),
>> +	.crc		= BIT(2),
>> +	.parity		= BIT(3),
>> +	.nack		= BIT(4),
>> +	.denied		= BIT(5),
>> +	.dropped	= BIT(6),
> Would it be better to extract generation-specific callback to decode the
> error rather than defining the list of masks?

Are you proposing to add a callback in pmic_arb_ver_ops, like 
'*check_chnl_status', and create separate implementations for PMIC 
arbiter versions before and after v8.5?

This approach would add more extensive code changes with some code 
duplication, especially for handling common error bits shared across all 
versions—even if they only print error messages and return an error 
code. Is that a concern?

Fenglin

  reply	other threads:[~2026-04-02  4:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-01  9:41 [PATCH 0/2] spmi: pmic-arb: Add spmi-pmic-arb support for Hawi SoC Fenglin Wu
2026-04-01  9:41 ` [PATCH 1/2] dt-bindings: spmi: glymur-spmi-pmic-arb: Add compatible for Hawi Fenglin Wu
2026-04-01 10:05   ` Konrad Dybcio
2026-04-02  8:37   ` Krzysztof Kozlowski
2026-04-02  8:37   ` Krzysztof Kozlowski
2026-04-01  9:41 ` [PATCH 2/2] spmi: spmi-pmic-arb: add support for PMIC arbiter v8.5 Fenglin Wu
2026-04-01 10:03   ` Konrad Dybcio
2026-04-01 11:22   ` Dmitry Baryshkov
2026-04-02  4:18     ` Fenglin Wu [this message]
2026-04-17  5:24       ` Fenglin Wu
2026-04-17 23:29         ` Dmitry Baryshkov

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=c5d1578d-729d-4c09-b761-c67e6d3be745@oss.qualcomm.com \
    --to=fenglin.wu@oss.qualcomm.com \
    --cc=conor+dt@kernel.org \
    --cc=david.collins@oss.qualcomm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.baryshkov@oss.qualcomm.com \
    --cc=kernel@oss.qualcomm.com \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=subbaraman.narayanamurthy@oss.qualcomm.com \
    /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®