Skip to contentSkip to conversation

i2c: add support for Cypress CYUSBS234 USB-I2C adapter

PATCH Superseded Muthu Mani 1 participant 1 message Nov 28, 2014

Subsystems (2)

v4 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Muthu Mani

author
#0 lore raw

PATCH v4 2/3 i2c: add support for Cypress CYUSBS234 USB-I2C adapter

Adds support for USB-I2C interface of Cypress Semiconductor CYUSBS234 USB-Serial Bridge controller.

The read/write operation is setup using vendor command through control endpoint and actual data transfer happens through bulk in/out endpoints.

Details about the device can be found at:
http://www.cypress.com/?rID=84126

---
Changes since v3:
* corrected typo

Changes since v2:
* Retrieved the i2c transfer status using interrupt in endpoint
* Used kstrtol instead of manually parsing and scnprintf instead of sprintf
* Given i2c adapter device for dev_xxx
* cleaned up the code

Changes since v1:
* allocated memory on heap for usb transfer data
* Used DEVICE_ATTR_xx and friends and attribute groups
* Added the device files under i2c-adapter rather than platform device

 drivers/i2c/busses/Kconfig         |  12 +
 drivers/i2c/busses/Makefile        |   1 +
 drivers/i2c/busses/i2c-cyusbs23x.c | 584 +++++++++++++++++++++++++++++++++++++
 3 files changed, 597 insertions(+)
 create mode 100644 drivers/i2c/busses/i2c-cyusbs23x.c
drivers/i2c/busses/Kconfig +12 -0
index 917c358..533bdda 100644
@@ -871,6 +871,18 @@ config I2C_RCAR
 
 comment "External I2C/SMBus adapter drivers"
 
+config I2C_CYUSBS23X
+       tristate "CYUSBS23x I2C adapter"
+       depends on MFD_CYUSBS23X && USB
+       help
+         Say yes if you would like to access Cypress CYUSBS23x I2C device.
+
+         This driver enables the I2C interface of CYUSBS23x USB Serial Bridge
+         controller.
+
+         This driver can also be built as a module. If so, the module will be
+         called i2c-cyusbs23x.
+
 config I2C_DIOLAN_U2C
        tristate "Diolan U2C-12 USB adapter"
        depends on USB
drivers/i2c/busses/Makefile +1 -0
index 78d56c5..3199908 100644
@@ -86,6 +86,7 @@ obj-$(CONFIG_I2C_XLR)         += i2c-xlr.o
 obj-$(CONFIG_I2C_RCAR)         += i2c-rcar.o
 
 # External I2C/SMBus adapter drivers
+obj-$(CONFIG_I2C_CYUSBS23X)    += i2c-cyusbs23x.o
 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
drivers/i2c/busses/i2c-cyusbs23x.c new file +584 -0

584 lines not on this page · raw message

--
1.8.3.2

This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message.