.. | .. |
---|
40 | 40 | |
---|
41 | 41 | #include "c_can.h" |
---|
42 | 42 | |
---|
43 | | -#define DCAN_RAM_INIT_BIT (1 << 3) |
---|
| 43 | +#define DCAN_RAM_INIT_BIT BIT(3) |
---|
| 44 | + |
---|
44 | 45 | static DEFINE_SPINLOCK(raminit_lock); |
---|
45 | | -/* |
---|
46 | | - * 16-bit c_can registers can be arranged differently in the memory |
---|
| 46 | + |
---|
| 47 | +/* 16-bit c_can registers can be arranged differently in the memory |
---|
47 | 48 | * architecture of different implementations. For example: 16-bit |
---|
48 | 49 | * registers can be aligned to a 16-bit boundary or 32-bit boundary etc. |
---|
49 | 50 | * Handle the same by providing a common read/write interface. |
---|
.. | .. |
---|
55 | 56 | } |
---|
56 | 57 | |
---|
57 | 58 | static void c_can_plat_write_reg_aligned_to_16bit(const struct c_can_priv *priv, |
---|
58 | | - enum reg index, u16 val) |
---|
| 59 | + enum reg index, u16 val) |
---|
59 | 60 | { |
---|
60 | 61 | writew(val, priv->base + priv->regs[index]); |
---|
61 | 62 | } |
---|
.. | .. |
---|
67 | 68 | } |
---|
68 | 69 | |
---|
69 | 70 | static void c_can_plat_write_reg_aligned_to_32bit(const struct c_can_priv *priv, |
---|
70 | | - enum reg index, u16 val) |
---|
| 71 | + enum reg index, u16 val) |
---|
71 | 72 | { |
---|
72 | 73 | writew(val, priv->base + 2 * priv->regs[index]); |
---|
73 | 74 | } |
---|
.. | .. |
---|
145 | 146 | u32 val; |
---|
146 | 147 | |
---|
147 | 148 | val = priv->read_reg(priv, index); |
---|
148 | | - val |= ((u32) priv->read_reg(priv, index + 1)) << 16; |
---|
| 149 | + val |= ((u32)priv->read_reg(priv, index + 1)) << 16; |
---|
149 | 150 | |
---|
150 | 151 | return val; |
---|
151 | 152 | } |
---|
152 | 153 | |
---|
153 | | -static void c_can_plat_write_reg32(const struct c_can_priv *priv, enum reg index, |
---|
154 | | - u32 val) |
---|
| 154 | +static void c_can_plat_write_reg32(const struct c_can_priv *priv, |
---|
| 155 | + enum reg index, u32 val) |
---|
155 | 156 | { |
---|
156 | 157 | priv->write_reg(priv, index + 1, val >> 16); |
---|
157 | 158 | priv->write_reg(priv, index, val); |
---|
.. | .. |
---|
162 | 163 | return readl(priv->base + priv->regs[index]); |
---|
163 | 164 | } |
---|
164 | 165 | |
---|
165 | | -static void d_can_plat_write_reg32(const struct c_can_priv *priv, enum reg index, |
---|
166 | | - u32 val) |
---|
| 166 | +static void d_can_plat_write_reg32(const struct c_can_priv *priv, |
---|
| 167 | + enum reg index, u32 val) |
---|
167 | 168 | { |
---|
168 | 169 | writel(val, priv->base + priv->regs[index]); |
---|
169 | 170 | } |
---|