Skip to contentSkip to conversation

add pca9543 driver

PATCH In review Oskar Schirmer 2 participants 4 messages Mar 26, 2009 – Mar 27, 2009 I2C subsystem host drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 add pca9543 driver

support pca9543 i2c bus switch chip

---
 drivers/i2c/chips/Kconfig   |    3 +
 drivers/i2c/chips/Makefile  |    1 +
 drivers/i2c/chips/pca9543.c |  188 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 192 insertions(+), 0 deletions(-)
 create mode 100644 drivers/i2c/chips/pca9543.c
drivers/i2c/chips/Kconfig +3 -0
index c80312c..acfc46f 100644
@@ -64,6 +64,9 @@ config SENSORS_PCA9539
 	  This driver is deprecated and will be dropped soon. Use
 	  drivers/gpio/pca953x.c instead.
 
+config PCA9543
+	tristate "Philips PCA9543 i2c bus switch"
+
 config SENSORS_PCF8591
 	tristate "Philips PCF8591"
 	depends on EXPERIMENTAL
drivers/i2c/chips/Makefile +1 -0
index d142f23..c7a7fe2 100644
@@ -13,6 +13,7 @@
 obj-$(CONFIG_DS1682)		+= ds1682.o
 obj-$(CONFIG_SENSORS_MAX6875)	+= max6875.o
 obj-$(CONFIG_SENSORS_PCA9539)	+= pca9539.o
+obj-$(CONFIG_PCA9543)		+= pca9543.o
 obj-$(CONFIG_SENSORS_PCF8574)	+= pcf8574.o
 obj-$(CONFIG_PCF8575)		+= pcf8575.o
 obj-$(CONFIG_SENSORS_PCF8591)	+= pcf8591.o
drivers/i2c/chips/pca9543.c new file +188 -0

188 lines not on this page · raw message

Signature · 1 line
1.6.2.107.ge47ee
#1 lore raw
Quoted 6 lines · Oskar Schirmer

support pca9543 i2c bus switch chip

---
 drivers/i2c/chips/Kconfig   |    3 +
 drivers/i2c/chips/Makefile  |    1 +

Please read the header of these two files carefully again.

Quoted 4 lines
 drivers/i2c/chips/pca9543.c |  188 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 192 insertions(+), 0 deletions(-)
 create mode 100644 drivers/i2c/chips/pca9543.c

(...)

Signature · 1 line
Jean Delvare
#2 lore raw

"

Quoted 9 lines · Jean Delvare
Quoted 6 lines · Oskar Schirmer

support pca9543 i2c bus switch chip

---
 drivers/i2c/chips/Kconfig   |    3 +
 drivers/i2c/chips/Makefile  |    1 +

Please read the header of these two files carefully again.

Ok, I see. But how to have PCA9543 supported then? The PCA9543 is an I2C bus switch/mux, so following the headers it might be placed in drivers/<functionality>, where <functionality> is "i2c bus mux", thus drivers/i2c.

As this is obviously not the solution, we might try to do the bus muxing manually from userland, as soon as the system is up. This wont work either, as the video drivers need the i2c bus switch programmed before the video stuff can be initialized, thus during bootup.

Next, the drivers proposed by Rodolfo Giometti
( http://article.gmane.org/gmane.linux.drivers.i2c/2996/ ) might add the functionality needed. As far as I can see from Documentation/feature-removal-schedule.txt, prerequisites for it to be accepted are given with 2.6.30, is the driver by Rodolfo still in the queue, i.e. being merged for 2.6.30 now?

Oskar

#3 lore raw
Quoted 9 lines · Oskar Schirmer
Quoted 8 lines · Jean Delvare
Quoted 6 lines · Oskar Schirmer

support pca9543 i2c bus switch chip

---
 drivers/i2c/chips/Kconfig   |    3 +
 drivers/i2c/chips/Makefile  |    1 +
Quoted 6 lines
Quoted 1 line

Please read the header of these two files carefully again.

Ok, I see. But how to have PCA9543 supported then? The PCA9543 is an I2C bus switch/mux, so following the headers it might be placed in drivers/<functionality>, where <functionality> is "i2c bus mux", thus drivers/i2c.

We could consider creating drivers/i2c/muxes or similar for I2C multiplexer drivers, especially if we start supporting many of them.

Quoted 2 lines

As this is obviously not the solution, we might try to do the bus muxing manually from userland, as soon as the system is up.

"From userland" is exactly what your driver is doing, and this is clearly not acceptable. You can't do userland switching and let the kernel instantiate devices, as you found out yourself, which means that such multiplexed buses would only support userland-created devices (that is, i2c-dev.) This is way too limited to spend time on it.

Quoted 7 lines

This wont work either, as the video drivers need the i2c bus switch programmed before the video stuff can be initialized, thus during bootup.

Next, the drivers proposed by Rodolfo Giometti
( http://article.gmane.org/gmane.linux.drivers.i2c/2996/ ) might add the functionality needed.

It's not that they "might", rather they are _exactly_ what you need.

Quoted 4 lines

As far as I can see from Documentation/feature-removal-schedule.txt, prerequisites for it to be accepted are given with 2.6.30, is the driver by Rodolfo still in the queue, i.e. being merged for 2.6.30 now?

Unfortunately not, I'm still working on the prerequisite in question and I _hope_ to have that done in 2.6.30, but Rodolfo's work won't make it in time. Which does not mean you shouldn't look at it, see how it works for you, and report to Rodolfo. The more people help him cleanup and improve his code, the easier and faster it will be when the time finally comes to merge it.

Signature · 1 line
Jean Delvare