Re: [PATCH 2/3] pwm: sophgo-sg2042: add support for CV1800B
From: Chen Wang
Date: Mon Nov 30 2026 - 18:57:36 EST
On 11/30/2026 8:57 PM, Hiago De Franco wrote:
Hi Chen,[......]
On Mon, Nov 30, 2026 at 01:30:55PM +0800, Chen Wang wrote:
On 11/17/2026 8:57 PM, Hiago De Franco wrote:
In this case I was not entirely sure and got confused with the names. I/**`pwm_sg2044_get_outputen` is only called in pwm_cv1800b_xxx, why not name it
* struct sg2042_pwm_ddata - private driver data
* @base: base address of mapped PWM registers
@@ -155,6 +168,14 @@ static void pwm_sg2044_set_outputen(struct sg2042_pwm_ddata *ddata, struct pwm_d
writel(pwmstart, ddata->base + SG2044_PWM_PWMSTART);
}
+static bool pwm_sg2044_get_outputen(struct sg2042_pwm_ddata *ddata,
+ struct pwm_device *pwm)
+{
+ u32 pwmstart = readl(ddata->base + SG2044_PWM_PWMSTART);
+
+ return !!(pwmstart & BIT(pwm->hwpwm));
+}
+
as pwm_cv1800b_get_outputen and put it together wtih pwm_cv1800b_xxx
functions?
agree with you, but pwm_sg2044_set_outputen already exists and
pwm_sg2044_get_outputen is just the a get function for
SG2044_PWM_PWMSTART. So for this specific case I believe keeping it as
pwm_sg2044_get_outputen would be more accurate, what do you think?
Agreed; please maintain the original naming convention.
[......]
Thanks,
Chen