Skip to content

Commit 2ae5092

Browse files
marcanjannau
authored andcommitted
i2c: pasemi: Enable the unjam machine
The I2C bus can get stuck under some conditions (desync between controller and device). The pasemi controllers include an unjam feature that is enabled on reset, but was being disabled by the driver. Keep it enabled by explicitly setting the UJM bit in the CTL register. This should help recover the bus from certain conditions, which would otherwise remain stuck forever. Signed-off-by: Hector Martin <marcan@marcan.st>
1 parent a9a796c commit 2ae5092

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/i2c/busses/i2c-pasemi-core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#define CTL_EN BIT(11)
5050
#define CTL_MRR BIT(10)
5151
#define CTL_MTR BIT(9)
52+
#define CTL_UJM BIT(8)
5253
#define CTL_CLK_M GENMASK(7, 0)
5354

5455
#define TRANSFER_TIMEOUT_MS 100
@@ -72,7 +73,7 @@ static inline int reg_read(struct pasemi_smbus *smbus, int reg)
7273

7374
static void pasemi_reset(struct pasemi_smbus *smbus)
7475
{
75-
u32 val = (CTL_MTR | CTL_MRR | (smbus->clk_div & CTL_CLK_M));
76+
u32 val = (CTL_MTR | CTL_MRR | CTL_UJM | (smbus->clk_div & CTL_CLK_M));
7677

7778
if (smbus->hw_rev >= 6)
7879
val |= CTL_EN;

0 commit comments

Comments
 (0)