Skip to content

Commit ea9f842

Browse files
warp5twwsakernel
authored andcommitted
i2c: npcm: Correct register access width
The SMBnCTL3 register is 8-bit wide and the 32-bit access was always incorrect, but simply didn't cause a visible error on the 32-bit machine. On the 64-bit machine, the kernel message reports that ESR value is 0x96000021. Checking Arm Architecture Reference Manual Armv8 suggests that it's the alignment fault. SMBnCTL3's address is 0xE. Fixes: 56a1485 ("i2c: npcm7xx: Add Nuvoton NPCM I2C controller driver") Signed-off-by: Tyrone Ting <[email protected]> Reviewed-by: Jonathan Neuschäfer <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 0bf58eb commit ea9f842

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/i2c/busses/i2c-npcm7xx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,14 +360,14 @@ static int npcm_i2c_get_SCL(struct i2c_adapter *_adap)
360360
{
361361
struct npcm_i2c *bus = container_of(_adap, struct npcm_i2c, adap);
362362

363-
return !!(I2CCTL3_SCL_LVL & ioread32(bus->reg + NPCM_I2CCTL3));
363+
return !!(I2CCTL3_SCL_LVL & ioread8(bus->reg + NPCM_I2CCTL3));
364364
}
365365

366366
static int npcm_i2c_get_SDA(struct i2c_adapter *_adap)
367367
{
368368
struct npcm_i2c *bus = container_of(_adap, struct npcm_i2c, adap);
369369

370-
return !!(I2CCTL3_SDA_LVL & ioread32(bus->reg + NPCM_I2CCTL3));
370+
return !!(I2CCTL3_SDA_LVL & ioread8(bus->reg + NPCM_I2CCTL3));
371371
}
372372

373373
static inline u16 npcm_i2c_get_index(struct npcm_i2c *bus)

0 commit comments

Comments
 (0)