i2c/busses: Add support for Diolan U2C-12 USB-I2C adapter
Subsystems (3)
PATCH v4 1/1 i2c/busses: Add support for Diolan U2C-12 USB-I2C adapter
This patch adds support for the Diolan U2C-12 USB-I2C adapter. It also updates MAINTAINERS to list the author as maintainer.
---
v4 changes:
- Moved buffer to beginning of device data structure to improve cache alignment
- Increased maximum SYNC timeout to 20ms (from 10ms)
- Return -ENXIO only if the response to the address phase of a command is NACK. Otherwise return -EIO if a device (or the controller) responds with NACK.
- Add driver documentation
v3 changes:
- Round frequency configuration down (instead of rounding to closest value)
- Simplify diolan_usb_transfer() a bit
- Introduce diolan_write_cmd() to check if a write is needed and execute it if so.
- diolan_fw_version() and diolan_get_serial() no longer return errors.
- Change "Out of memory" error message to "no memory for device state".
- Display error message if diolan_init() fails.
- Merged patches into a single patch.
v2 changes:
- Moved receive and transmit buffers to allocated driver memory
- diolan_usb_transfer() no longer requires buffer and length arguments
- Pass "struct i2c_diolan_u2c *" instead of "struct i2c_adapter *" to many of the internal usb access functions.
- Introduced diolan_usb_cmd(), diolan_usb_cmd_data(), and diolan_usb_cmd_data2() as front-end functions for actual commands.
- Function prefix is now diolan_ for all functions.
- Removed diolan_scan().
- Fixed race conditions in diolan_u2c_probe().
- Use i2c_{set,get}_adapdata instead of misusing adapter.algo_data.
- Driver name is now i2c-diolan-u2c (instead of i2c-u2c-usb).
- Added support for "frequency" module parameter to set i2c clock frequency
- Enabled I2C clock stretching support
- Support sending multiple commands in single usb transfer
- Several other minor changes to address review comments.
Documentation/i2c/busses/i2c-diolan-u2c | 26 ++ MAINTAINERS | 6 + drivers/i2c/busses/Kconfig | 10 + drivers/i2c/busses/Makefile | 1 + drivers/i2c/busses/i2c-diolan-u2c.c | 535 +++++++++++++++++++++++++++++++ 5 files changed, 578 insertions(+), 0 deletions(-) create mode 100644 Documentation/i2c/busses/i2c-diolan-u2c create mode 100644 drivers/i2c/busses/i2c-diolan-u2c.c
Documentation/i2c/busses/i2c-diolan-u2c new file +26 -0
@@ -0,0 +1,26 @@ +Kernel driver i2c-diolan-u2c + +Supported adapters: + * Diolan U2C-12 I2C-USB adapter + Documentation: + http://www.diolan.com/i2c/u2c12.html + +Author: Guenter Roeck <guenter.roeck-IzeFyvvaP7pWk0Htik3J/[email protected]> + +Description +----------- + +This is the driver for the Diolan U2C-12 USB-I2C adapter. + +The Diolan U2C-12 I2C-USB Adapter provides a low cost solution to connect +a computer to I2C slave devices using a USB interface. It also supports +connectivity to SPI devices. + +This driver only supports the I2C interface of U2C-12. The driver does not use +interrupts. + + +Module parameters +----------------- + +* frequency: I2C bus frequency
MAINTAINERS +6 -0
@@ -2089,6 +2089,12 @@ F: Documentation/serial/digiepca.txt F: drivers/char/epca* F: drivers/char/digi* +DIOLAN U2C-12 I2C DRIVER +M: Guenter Roeck <guenter.roeck-IzeFyvvaP7pWk0Htik3J/[email protected]> +L: [email protected] +S: Maintained +F: drivers/i2c/busses/i2c-diolan-u2c.c + DIRECTORY NOTIFICATION (DNOTIFY) M: Eric Paris <[email protected]> S: Maintained
drivers/i2c/busses/Kconfig +10 -0
@@ -648,6 +648,16 @@ config I2C_EG20T comment "External I2C/SMBus adapter drivers" +config I2C_DIOLAN_U2C + tristate "Diolan U2C-12 USB adapter" + depends on USB + help + If you say yes to this option, support will be included for Diolan + U2C-12, a USB to I2C interface. + + This driver can also be built as a module. If so, the module + will be called i2c-diolan-u2c. + config I2C_PARPORT tristate "Parallel port adapter" depends on PARPORT
drivers/i2c/busses/Makefile +1 -0
@@ -64,6 +64,7 @@ obj-$(CONFIG_I2C_XILINX) += i2c-xiic.o obj-$(CONFIG_I2C_EG20T) += i2c-eg20t.o # External I2C/SMBus adapter drivers +obj-$(CONFIG_I2C_DIOLAN_U2C) += i2c-diolan-u2c.o obj-$(CONFIG_I2C_PARPORT) += i2c-parport.o obj-$(CONFIG_I2C_PARPORT_LIGHT) += i2c-parport-light.o obj-$(CONFIG_I2C_TAOS_EVM) += i2c-taos-evm.o
drivers/i2c/busses/i2c-diolan-u2c.c new file +535 -0
535 lines not on this page · raw message
Signature · 1 line
1.7.3.1
Looks fine, will add it to new -next tree before the weekend.
Signature · 3 lines
Ben Dooks, [email protected], http://www.fluff.org/ben/ Large Hadron Colada: A large Pina Colada that makes the universe disappear.
Quoted 2 lines · Ben Dooks
Looks fine, will add it to new -next tree before the weekend.
Thanks!
Guenter