On Tue, Jun 12, 2018 at 8:40 AM, Songjun Wu <songjun.wu@xxxxxxxxxxxxxxx> wrote:It will be split to four patches, coding style, new registers, readl()/writel() and asc_update_bits.
Previous implementation uses platform-dependent functionsThis patch consists 2 or even 3 ones:
ltq_w32()/ltq_r32() to access registers. Those functions are not
available for other SoC which uses the same IP.
Change to OS provided readl()/writel() and readb()/writeb(), so
that different SoCs can use the same driver.
- whitespace shuffling (indentation fixes, blank lines), I dunno if
it's needed at all
- some new registers / bits
- actual switch to readl() / writel()
Please, split.
It will be changed to asc_update_bits.+#define asc_w32_mask(clear, set, reg) \This would be better as a static inline helper, and name is completely
+ ({ typeof(reg) reg_ = (reg); \
+ writel((readl(reg_) & ~(clear)) | (set), reg_); })
misleading, it doesn't mask the register bits, it _updates_ them.