Thread (15 messages) 15 messages, 5 authors, 2026-02-04

Re: [PATCH v19 2/6] pwm: driver for qualcomm ipq6018 pwm block

From: Uwe Kleine-König <ukleinek@kernel.org>
Date: 2026-01-19 16:41:26
Also in: linux-arm-msm, linux-pwm, lkml

Hello,

On Mon, Dec 08, 2025 at 07:40:21PM +0400, George Moussalem wrote:
On 11/28/25 15:32, Konrad Dybcio wrote:
quoted
On 11/28/25 11:29 AM, George Moussalem via B4 Relay wrote:
quoted
+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

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help