
Dear Tom,
In message 20140325200435.GV16360@bill-the-cat you wrote:
But as Wolfgang's v4 shows, it's also not hard to just call clrsetbits_le32 directly. Arguably the cases where mask==1 we should just call setbits_le32 but that's not a big deal.
We would have to call setbits_le32() or clrbits_le32() depending on the arguments...
I was already about to rewrite the code more in the style previously used, i. e. turn for example
134 clrsetbits_le32(reg, 1 << TRI_SHIFT(pin), 135 (tri == PMUX_TRI_TRISTATE) << TRI_SHIFT(pin));
back into
if (tri == PMUX_TRI_TRISTATE) setbits_le32(reg, 1 << TRI_SHIFT(pin)); else clrbits_le32(reg, 1 << TRI_SHIFT(pin));
but then I decided to keep the changes copmpared to the update_reg_mask_shift_val() version minimal.
If the if/then version should be preferred, I can easily redo that patch.
Best regards,
Wolfgang Denk