Hello,
> In order to be easier to review (and bisect if needed), could you
> split that patch into one to convert to the regmap API, without any
> change but to replace the sun4i_pwm_readl/sun4i_pwm_writel calls by
> their regmap equivalent, and then convert to the regmap fields the
> registers that need to?
Looks reasonable, will be done shortly.
>> +#define SUN4I_REGMAP_FIELDS(chan) {\
>> + [FIELD_PRESCALER] = \
>> + REG_FIELD(PWM_CTRL_REG, \
>> + BIT_CH(PWM_PRESCAL_LSB, chan), \
>> + BIT_CH(PWM_PRESCAL_MSB, chan)), \
>> + [FIELD_POLARITY] = \
>> + REG_FIELD(PWM_CTRL_REG, \
>> + BIT_CH(PWM_ACT_STATE_BIT, chan), \
>> + BIT_CH(PWM_ACT_STATE_BIT, chan)), \
>> + [FIELD_CLK_GATING] = \
>> + REG_FIELD(PWM_CTRL_REG, \
>> + BIT_CH(PWM_CLK_GATING_BIT, chan), \
>> + BIT_CH(PWM_CLK_GATING_BIT, chan)), \
>> + [FIELD_READY] = \
>> + REG_FIELD(PWM_CTRL_REG, \
>> + PWM_RDY_BIT(chan), \
>> + PWM_RDY_BIT(chan)), \
>> +}
>> +
>
> This is not correct, unfortunately. If someone calls that macro with
> chan++ or chan--, it will be modified four times instead of one as the
> caller would expect.
Ok, i will refactor that.
I think you should know about existence of unsafe macros (like MIN
MAX or ABS) into existing linux kernel tree, this macros can be easily
refactored into the inline functions. Please tell me your point of view
on that things.
Thanks,
Siarhei.
--
You received this message because you are subscribed to the Google Groups
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.