Skip to contentSkip to conversation

drivers/i2c/busses: adding ch341a USB adapter

PATCH New Angelo Compagnucci 1 participant 1 message Jun 7, 2016 I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drivers/i2c/busses: adding ch341a USB adapter

This patch adds support for ch341a USB to I2C bridge, it's based on a reverse engineering of the official gui client and several code examples.

Tested with several eeprom models (24c32, 24c08), rtc (ds1307), adc (mcp3422).

---
Changes v1->v2:

* Better delay in writing function
* Corrected i2c supported speeds (verified also
with an oscilloscope)

 drivers/i2c/busses/Kconfig      |  10 ++
 drivers/i2c/busses/Makefile     |   1 +
 drivers/i2c/busses/i2c-ch341a.c | 388 ++++++++++++++++++++++++++++++++++++++++
 3 files changed, 399 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-ch341a.c
drivers/i2c/busses/Kconfig +10 -0
index f167021..2a168c2 100644
@@ -997,6 +997,16 @@ config I2C_RCAR
 
 comment "External I2C/SMBus adapter drivers"
 
+config I2C_CH341A
+        tristate "Winchiphead CH341A USB adapter"
+        depends on USB
+        help
+          If you say yes to this option, support will be included for
+          Winchiphead CH341A, a USB to I2C interface.
+
+          This driver can also be built as a module.  If so, the module
+          will be called i2c-ch341a.
+
 config I2C_DIOLAN_U2C
 	tristate "Diolan U2C-12 USB adapter"
 	depends on USB
drivers/i2c/busses/Makefile +1 -0
index 37f2819..16805b7 100644
@@ -98,6 +98,7 @@ obj-$(CONFIG_I2C_XLP9XX)	+= i2c-xlp9xx.o
 obj-$(CONFIG_I2C_RCAR)		+= i2c-rcar.o
 
 # External I2C/SMBus adapter drivers
+obj-$(CONFIG_I2C_CH341A)	+= i2c-ch341a.o
 obj-$(CONFIG_I2C_DIOLAN_U2C)	+= i2c-diolan-u2c.o
 obj-$(CONFIG_I2C_DLN2)		+= i2c-dln2.o
 obj-$(CONFIG_I2C_PARPORT)	+= i2c-parport.o
drivers/i2c/busses/i2c-ch341a.c new file +388 -0

388 lines not on this page · raw message

Signature · 1 line
1.9.1