Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit d738e17e341675931d4a0deeaa412d23cf4f2a74
- Author: Ryan Lim <[email protected]>
- Date: Mon Apr 25 18:51:10 2016 -0700
- SW-4909: i2c: Remove status check in the watchdog timeout callback
- When I2C bus is not available (i.e. the bus signals are not pulled
- up in the case for the stand alone GPB module), the I2C driver
- watchdog correctly times out. But the problem was that the watchdog
- timeout callback was incorrectly assuming the driver status could not
- be in the IDLE state. This commit removes the driver status check and
- instead prints out the current driver status.
- Testing Done: 1) Tested white-camera and white-audio functionality.
- 2) Ran I2C test script on a GPB module with bridged PHY
- daughter board attached.
- 3) Detected the GPB module correctly w/o any daughter
- board attached (addressed SW-4909)
- 4) Ran i2cdetect with GPB module with bridged PHY
- daughter board attached. It found address 0x50
- of I2C EEPROM on /dev/i2c-0
- 5) Ran i2cdect with GPI module w/o any daughter board
- attached. It did not find any I2C address on /dev/i2c-0.
- Change-Id: I883d945b8d3320fc31022c29d1beaf480caf2f2b
- Signed-off-by: Ryan Lim <[email protected]>
- ---
- nuttx/arch/arm/src/tsb/tsb_i2c.c | 14 ++++----------
- nuttx/arch/arm/src/tsb/tsb_i2c.h | 2 +-
- 2 files changed, 5 insertions(+), 11 deletions(-)
- diff --git a/nuttx/arch/arm/src/tsb/tsb_i2c.c b/nuttx/arch/arm/src/tsb/tsb_i2c.c
- index ff5b5cdcac19..4116e33e0b70 100644
- --- a/nuttx/arch/arm/src/tsb/tsb_i2c.c
- +++ b/nuttx/arch/arm/src/tsb/tsb_i2c.c
- @@ -392,18 +392,12 @@ static void tsb_i2c_read(struct tsb_i2c_info *info)
- static void tsb_i2c_timeout(int argc, uint32_t arg, ...)
- {
- struct tsb_i2c_info *info = (struct tsb_i2c_info*)arg;
- -
- - lldbg("\n");
- -
- irqstate_t flags = irqsave();
- - if (info->status != TSB_I2C_STATUS_IDLE)
- - {
- - lldbg("finished\n");
- - /* Mark the transfer as finished */
- - info->status = TSB_I2C_STATUS_TIMEOUT;
- - sem_post(&info->wait);
- - }
- + lldbg("\n%s: timeout. status was %d\n", __func__, info->status);
- + /* Mark the transfer as finished */
- + info->status = TSB_I2C_STATUS_TIMEOUT;
- + sem_post(&info->wait);
- irqrestore(flags);
- }
- diff --git a/nuttx/arch/arm/src/tsb/tsb_i2c.h b/nuttx/arch/arm/src/tsb/tsb_i2c.h
- index 36d11a94fc9e..c6e56df509cd 100644
- --- a/nuttx/arch/arm/src/tsb/tsb_i2c.h
- +++ b/nuttx/arch/arm/src/tsb/tsb_i2c.h
- @@ -92,7 +92,7 @@
- #define TSB_I2C_STATUS_IDLE 0x0
- #define TSB_I2C_STATUS_WRITE_IN_PROGRESS 0x1
- #define TSB_I2C_STATUS_READ_IN_PROGRESS 0x2
- -#define TSB_I2C_STATUS_TIMEOUT 0x3
- +#define TSB_I2C_STATUS_TIMEOUT 0x4
- /* hardware abort codes from the TSB_I2C_TX_ABRT_SOURCE register */
- #define ABRT_7B_ADDR_NOACK 0
Add Comment
Please, Sign In to add comment