i2c: designware: Use transfer timeout from ioctl I2C_TIMEOUT
Subsystems (3)
PATCH v3 1/1 i2c: designware: Use transfer timeout from ioctl I2C_TIMEOUT
This allows applications to set the transfer timeout in 10ms increments via ioctl I2C_TIMEOUT.
---
changelog v2:
* No code change, just change to a more suitable title
changelog v3:
* Move changelog out of commit log
drivers/i2c/busses/i2c-designware-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-designware-core.c +1 -1
@@ -663,7 +663,7 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)i2c_dw_xfer_init (dev);/* wait for tx to complete */ -if (!wait_for_completion_timeout (&dev->cmd_complete,HZ )) { +if (!wait_for_completion_timeout (&dev->cmd_complete, adap->timeout)) {dev_err (dev->dev,"controller timed out\n" );/* i2c_dw_init implicitly disables the adapter */ i2c_dw_init (dev);
Signature · 1 line
1.9.1
Quoted 19 lines · Weifeng Voon
This allows applications to set the transfer timeout in 10ms increments via ioctl
I2C_TIMEOUT.Signed-off-by Weifeng Voon <[email protected]>---
changelog v2:
* No code change, just change to a more suitable titlechangelog v3:
* Move changelog out of commit logdrivers/i2c/busses/i2c-designware-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/i2c/busses/i2c-designware-core.c +0
-0
drivers/i2c/busses/i2c-designware-core.c i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) · line 669
Quoted 8 lines
drivers/i2c/busses/i2c-designware-core.c +1
-1@@ -663,7 +663,7 @@ i2c_dw_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)i2c_dw_xfer_init (dev);/* wait for tx to complete */ -if (!wait_for_completion_timeout (&dev->cmd_complete,HZ )) { +if (!wait_for_completion_timeout (&dev->cmd_complete, adap->timeout)) {dev_err (dev->dev,"controller timed out\n" );/* i2c_dw_init implicitly disables the adapter */ i2c_dw_init (dev);
Quoted 4 lines · Weifeng Voon
This allows applications to set the transfer timeout in 10ms increments via ioctl
I2C_TIMEOUT.Signed-off-by Weifeng Voon <[email protected]>
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |
Wolfram Sang
AppliedQuoted 4 lines · Weifeng Voon
This allows applications to set the transfer timeout in 10ms increments via ioctl
I2C_TIMEOUT.Signed-off-by Weifeng Voon <[email protected]>
Applied to for-next, thanks!