[U-Boot] [PATCH 0/2] i2c: sh_i2c: bugfix: i2c probe command does now work

Hello, I found i2c probe command bug on kzm9g board and fixed it. I know it is the last minute to v2014.04, but I want these patches merged. Please review.
Tetsuyuki Kobayashi (2): i2c: sh_i2c: bugfix: i2c probe command does now work arm: kzm9g: Add CONFIG_SYS_GENERIC_BOARD
drivers/i2c/sh_i2c.c | 2 +- include/configs/kzm9g.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)

This is regression of commit 2035d77d i2c: sh_i2c: Update to new CONFIG_SYS_I2C framework.
Before commit 2035d77d, i2c probe command works properly on kzm9g board.
KZM-A9-GT# i2c probe Valid chip addresses: 0C 12 1D 32 39 3D 40 60
After commit 2035d77d, i2c probe command does not work.
KZM-A9-GT# i2c probe Valid chip addresses: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
sh_i2c_probe() calls sh_i2c_read(), but read length is 0. So acutally it does not read device at all. This patch changes read length to 1.
Signed-off-by: Tetsuyuki Kobayashi koba@kmckk.co.jp --- drivers/i2c/sh_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/sh_i2c.c b/drivers/i2c/sh_i2c.c index cc19100..264c2e6 100644 --- a/drivers/i2c/sh_i2c.c +++ b/drivers/i2c/sh_i2c.c @@ -269,7 +269,7 @@ static int sh_i2c_write(struct i2c_adapter *adap, uint8_t chip, uint addr, static int sh_i2c_probe(struct i2c_adapter *adap, u8 dev) { - return sh_i2c_read(adap, dev, 0, 0, NULL, 0); + return sh_i2c_read(adap, dev, 0, 0, NULL, 1); }
static unsigned int sh_i2c_set_bus_speed(struct i2c_adapter *adap,

I am sorry. The title was typo. "i2c: sh_i2c: bugfix: i2c probe command does not work"
(2014/04/14 11:21), Tetsuyuki Kobayashi wrote:
This is regression of commit 2035d77d i2c: sh_i2c: Update to new CONFIG_SYS_I2C framework.
Before commit 2035d77d, i2c probe command works properly on kzm9g board.
KZM-A9-GT# i2c probe Valid chip addresses: 0C 12 1D 32 39 3D 40 60
After commit 2035d77d, i2c probe command does not work.
KZM-A9-GT# i2c probe Valid chip addresses: 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
sh_i2c_probe() calls sh_i2c_read(), but read length is 0. So acutally it does not read device at all. This patch changes read length to 1.
Signed-off-by: Tetsuyuki Kobayashi koba@kmckk.co.jp
drivers/i2c/sh_i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/sh_i2c.c b/drivers/i2c/sh_i2c.c index cc19100..264c2e6 100644 --- a/drivers/i2c/sh_i2c.c +++ b/drivers/i2c/sh_i2c.c @@ -269,7 +269,7 @@ static int sh_i2c_write(struct i2c_adapter *adap, uint8_t chip, uint addr, static int sh_i2c_probe(struct i2c_adapter *adap, u8 dev) {
- return sh_i2c_read(adap, dev, 0, 0, NULL, 0);
return sh_i2c_read(adap, dev, 0, 0, NULL, 1); }
static unsigned int sh_i2c_set_bus_speed(struct i2c_adapter *adap,

Add CONFIG_SYS_GENERIC_BOARD to enable generic board for kzm9g. See doc/README.generic-board
Signed-off-by: Tetsuyuki Kobayashi koba@kmckk.co.jp --- include/configs/kzm9g.h | 1 + 1 file changed, 1 insertion(+)
diff --git a/include/configs/kzm9g.h b/include/configs/kzm9g.h index 4d11c7d..5a13ad1 100644 --- a/include/configs/kzm9g.h +++ b/include/configs/kzm9g.h @@ -15,6 +15,7 @@ #define CONFIG_KZM_A9_GT #define CONFIG_RMOBILE_BOARD_STRING "KMC KZM-A9-GT" #define CONFIG_MACH_TYPE MACH_TYPE_KZM9G +#define CONFIG_SYS_GENERIC_BOARD
#include <asm/arch/rmobile.h>
participants (1)
-
Tetsuyuki Kobayashi