[PATCH v9 6/6] pwm: airoha: Add support for EN7581 SoC

Uwe Kleine-König u.kleine-koenig at baylibre.com
Thu Oct 31 03:53:07 PDT 2024


Hello Benjamin,

On Wed, Oct 30, 2024 at 11:14:41AM +0100, Benjamin Larsson wrote:
> On 2024-10-30 08:32, Uwe Kleine-König wrote:
> > > +	/* Configure frequency divisor */
> > > +	mask = WAVE_GEN_CYCLE_MASK(index % 4);
> > > +	val = (period << __ffs(mask)) & mask;
> > FIELD_PREP please.
> 
> Per my understanding FIELD_PREP only work on compile time constants.

Then please create an alternative macro with the same semantic that also
works when the mask isn't known at compile time instead of open coding
the same concept several times.

Best regards
Uwe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mediatek/attachments/20241031/adc3b034/attachment.sig>


More information about the Linux-mediatek mailing list