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