i2c-imx: change log level for No ACK
Subsystems (2)
PATCH 1/3 i2c-imx: change log level for No ACK
Signed-off-by Eric Bénard <[email protected]>
--- drivers/i2c/i2c-imx.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/i2c/i2c-imx.c +1 -1
@@ -214,7 +214,7 @@ static int i2c_imx_acked(struct i2c_adapter *adapter)break ;if (is_timeout (start,MSECOND )) { -dev_err (adapter->dev,"<%s> No ACK\n" , __func__); +dev_dbg (adapter->dev,"<%s> No ACK\n" , __func__);return -EIO ; } }
Signature · 7 lines
1.6.3.3 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 2/3 commands: add i2c commands
theses commands allow low level access to i2c bus and can be useful to setup an i2c device without having to add code, compile and flash barebox.
Signed-off-by Eric Bénard <[email protected]>
--- commands/Kconfig | 8 ++ commands/Makefile | 1 + commands/i2c.c | 218 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 227 insertions(+), 0 deletions(-) create mode 100644 commands/i2c.c
commands/Kconfig +8 -0
@@ -314,4 +314,12 @@ config CMD_UNLZO Say yes here to get the unlzo command. lzo is a fast compression algorithm by Markus Franz Xaver Johannes Oberhumer. +config CMD_I2C + bool + depends on I2C + prompt "i2c commands" + help + include i2c_probe, i2c_read and i2c_write commands to communicate + on i2c bus. + endmenu
commands/Makefile +1 -0
@@ -48,3 +48,4 @@ obj-$(CONFIG_CMD_BMP) += bmp.o obj-$(CONFIG_USB_GADGET_DFU) += dfu.o obj-$(CONFIG_CMD_GPIO) += gpio.o obj-$(CONFIG_CMD_UNLZO) += unlzo.o +obj-$(CONFIG_CMD_I2C) += i2c.o
commands/i2c.c new file +218 -0
218 lines not on this page · raw message
Signature · 7 lines
1.6.3.3 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
PATCH 3/3 i2c: implement i2c_get_adapter()
From: Sascha Hauer <[email protected]>
Signed-off-by Sascha Hauer <[email protected]>
--- drivers/i2c/i2c.c | 24 +++++++++++++++++++++++- include/i2c/i2c.h | 1 + 2 files changed, 24 insertions(+), 1 deletions(-)
drivers/i2c/i2c.c +23 -1
@@ -39,7 +39,7 @@ struct boardinfo { };static LIST_HEAD (board_list); - +static LIST_HEAD (adapter_list);/** * i2c_transfer - execute a single or combined I2C message
@@ -327,6 +327,23 @@ static void scan_boardinfo(struct i2c_adapter *adapter) }/** +* +* i2c_get_adapter - get an i2c adapter from its busnum +* +* @param busnum the desired bus number +* +*/ +struct i2c_adapter *i2c_get_adapter (int busnum) +{ +struct i2c_adapter *adap; + +list_for_each_entry (adap, &adapter_list, list) +if (adap->nr == busnum) +return adap; +return NULL ; +} + +/** * i2c_register_master - register I2C master controller * * @param master initialized master, originally from i2c_alloc_master()
@@ -345,6 +362,11 @@ static void scan_boardinfo(struct i2c_adapter *adapter)*/ int i2c_add_numbered_adapter (struct i2c_adapter *adapter) { +if (i2c_get_adapter (adapter->nr)) +return -EBUSY ; + +list_add_tail (&adapter_list, &adapter->list); +/* populate children from any i2c device tables */ scan_boardinfo (adapter);
include/i2c/i2c.h +1 -0
@@ -66,6 +66,7 @@ struct i2c_adapter {struct device_d *dev;/* ptr to device */ int nr;/* bus number */ int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs,int num); +struct list_head list; };
Signature · 7 lines
1.6.3.3 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Re: [PATCH 2/3] commands: add i2c commands
In reply to Eric BénardQuoted 5 lines · Eric Bénard
theses commands allow low level access to i2c bus and can be useful to setup an i2c device without having to add code, compile and flash barebox.
Signed-off-by Eric Bénard<[email protected]>
forget it, v3 will be the right one !
Eric
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox