i2c: i2c-au1550: relax bus timings a bit
PATCH 1/1 i2c: i2c-au1550: relax bus timings a bit
The i2c-au1550 driver has to program various setup and hold times for the sda/scl signals by hand. The current values seem to be working best when the driver is supplied with 50MHz, however on the DB1300 board 48MHz is the closest we can get to it, and the timings are a bit too tight for that, leading to the last bit of a transmission sometimes being swallowed. This manifests itself in wrong readings of the ne1619 sensor and inability to configure the wm8731 i2s codec.
With the relaxed timings, both the sensor and the i2s codec can now be accessed more reliably over a wider range of I2C block input frequencies.
Verified on DB1200, DB1300 and DB1550 boards.
--- drivers/i2c/busses/i2c-au1550.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/i2c/busses/i2c-au1550.c +4 -4
@@ -284,10 +284,10 @@ static void i2c_au1550_setup(struct i2c_au1550_data *priv)/* Set the protocol timer values. See Table 71 in the * Au1550 Data Book for standard timing values. */ -WR (priv,PSC_SMBTMR ,PSC_SMBTMR_SET_TH (0 ) |PSC_SMBTMR_SET_PS (15 ) | \ -PSC_SMBTMR_SET_PU (15 ) |PSC_SMBTMR_SET_SH (15 ) | \ -PSC_SMBTMR_SET_SU (15 ) |PSC_SMBTMR_SET_CL (15 ) | \ -PSC_SMBTMR_SET_CH (15 )); +WR (priv,PSC_SMBTMR ,PSC_SMBTMR_SET_TH (0 ) |PSC_SMBTMR_SET_PS (20 ) | \ +PSC_SMBTMR_SET_PU (20 ) |PSC_SMBTMR_SET_SH (20 ) | \ +PSC_SMBTMR_SET_SU (20 ) |PSC_SMBTMR_SET_CL (20 ) | \ +PSC_SMBTMR_SET_CH (20 )); cfg |=PSC_SMBCFG_DE_ENABLE ;WR (priv,PSC_SMBCFG , cfg);
Signature · 1 line
2.5.1
Wolfram Sang
AppliedQuoted 8 lines · Manuel Lauss
The i2c-au1550 driver has to program various setup and hold times for the sda/scl signals by hand. The current values seem to be working best when the driver is supplied with 50MHz, however on the DB1300 board 48MHz is the closest we can get to it, and the timings are a bit too tight for that, leading to the last bit of a transmission sometimes being swallowed. This manifests itself in wrong readings of the ne1619 sensor and inability to configure the wm8731 i2s codec.
Quoted 7 lines
With the relaxed timings, both the sensor and the i2s codec can now be accessed more reliably over a wider range of I2C block input frequencies.
Verified on DB1200, DB1300 and DB1550 boards.
Signed-off-by Manuel Lauss <[email protected]>
Applied to for-next, thanks!
Since you have access to these platforms, there is a pending devm conversion patchneeding some testing:
http://patchwork.ozlabs.org/patch/482140/
Are you maybe interested in checking that one?
Manuel Lauss
Tested-byQuoted 6 lines · Wolfram Sang
Since you have access to these platforms, there is a pending devm conversion patchneeding some testing:
http://patchwork.ozlabs.org/patch/482140/
Are you maybe interested in checking that one?
Sure, I've run-tested it now on the DB1300 board, no problems.
Thanks!
Manuel