[PATCH v5 3/3] pwm: sophgo: add driver for SG2044

Longbin Li looong.bin at gmail.com
Fri May 30 02:48:27 PDT 2025


On Fri, May 30, 2025 at 09:50:25AM +0200, Uwe Kleine-König wrote:
> Hello,
> 
> On Wed, May 28, 2025 at 06:11:38PM +0800, Longbin Li wrote:
> > Add PWM controller for SG2044 on base of SG2042.
> > 
> > Signed-off-by: Longbin Li <looong.bin at gmail.com>
> > Reviewed-by: Chen Wang <unicorn_wang at outlook.com>
> > Tested-by: Chen Wang <unicorn_wang at outlook.com>
> 
> Nitpick: Make your S-o-b line the last line. This way you document that
> it was you who added the tags for Chen Wang.
>

Thank for remind.
 
> > [...]
> > +static int pwm_sg2044_apply(struct pwm_chip *chip, struct pwm_device *pwm,
> > +			    const struct pwm_state *state)
> > +{
> > +	struct sg2042_pwm_ddata *ddata = pwmchip_get_drvdata(chip);
> > +
> > +	pwm_sg2044_set_polarity(ddata, pwm, state);
> > +
> > +	pwm_sg2042_set_dutycycle(chip, pwm, state);
> > +
> > +	/*
> > +	 * re-enable PWMSTART to refresh the register period
> > +	 */
> > +	 pwm_sg2044_set_outputen(ddata, pwm, false);
> 
> I'm astonished that checkpatch doesn't spot the wrong indention here.
> 

I re-ran the checkpatch but no error. Maybe there is something wrong
in checkpatch.

> > +
> > +	if (!state->enabled)
> > +		return 0;
> > +
> > +	pwm_sg2044_set_outputdir(ddata, pwm, true);
> > +	pwm_sg2044_set_outputen(ddata, pwm, true);
> > +
> > +	return 0;
> > +}
> > +
> >  static const struct sg2042_chip_data sg2042_chip_data = {
> >  	.ops = {
> >  		.apply = pwm_sg2042_apply,
> > @@ -142,11 +215,22 @@ static const struct sg2042_chip_data sg2042_chip_data = {
> >  	}
> >  };
> > 
> > +static const struct sg2042_chip_data sg2044_chip_data = {
> > +	.ops = {
> > +		.apply = pwm_sg2044_apply,
> > +		.get_state = pwm_sg2042_get_state,
> > +	}
> 
> Missing , after }.
> 
> If you're ok, I'll pick up this version and fixup the two code changes
> and the order of the tags in the commit log.
> 
> Best regards
> Uwe

Thanks, it's ok to go.

Best regards,
Longbin



More information about the linux-riscv mailing list