Re: [PATCH v19 2/6] pwm: driver for qualcomm ipq6018 pwm block
From: Uwe Kleine-König
Date: Mon Jan 19 2026 - 11:41:26 EST
Hello,
On Mon, Dec 08, 2025 at 07:40:21PM +0400, George Moussalem wrote:
> On 11/28/25 15:32, Konrad Dybcio wrote:
> > On 11/28/25 11:29 AM, George Moussalem via B4 Relay wrote:
> >> +static unsigned int ipq_pwm_reg_read(struct pwm_device *pwm, unsigned int reg)
> >> +{
> >> + struct ipq_pwm_chip *ipq_chip = ipq_pwm_from_chip(pwm->chip);
> >> + unsigned int off = 8 * pwm->hwpwm + reg;
> >
> > This magic 8 could be #defined as IPQ6018_PWM_CONTROLLER_STRIDE or so
>
> good suggestion, will add it should another iteration be required.
I don't consider that an advantage. If I see a register dump and want to
interpret it, I think
8 * pwm->hwpwm + reg
is much more helpful than
IPQ_PWM_CONTROLLER_STRIDE * pwm->hwpwm + reg
where I have to check the value of the define. Yes, then the 8 appears
twice (i.e. in reg_read and reg_write), but IMHO that's ok.
Best regards
Uwe
Attachment:
signature.asc
Description: PGP signature