summaryrefslogtreecommitdiffstats
path: root/drivers/i2c/muxes
Commit message (Collapse)AuthorAgeFilesLines
* i2c: mux: Add dt support to i2c-mux-gpio driverMaxime Ripard2012-11-161-31/+114
| | | | | | | | | | | | | Allow the i2c-mux-gpio to be used by a device tree enabled device. The bindings are inspired by the one found in the i2c-mux-pinctrl driver. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Stephen Warren <swarren@nvidia.com> Acked-by: Peter Korsgaard <peter.korsgaard@barco.com> [wsa: fixed some whitespace] Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
* i2c-mux-gpio: Add support for dynamically allocated GPIO pinsJean Delvare2012-10-051-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | | The code instantiating an i2c-mux-gpio platform device doesn't necessarily know in advance the GPIO pin numbers it wants to use. If pins are on a GPIO device which gets its base GPIO number assigned dynamically at run-time, the values can't be hard-coded. In that case, let the caller tell i2c-mux-gpio the name of the GPIO chip and the (relative) GPIO pin numbers to use. At probe time, the i2c-mux-gpio driver will look for the chip and apply the proper offset to turn relative GPIO pin numbers to absolute GPIO pin numbers. The same could be (and was so far) done on the caller's end, however doing it in i2c-mux-gpio has two benefits: * It avoids duplicating the code on every caller's side (about 30 lines of code.) * It allows for deferred probing for the muxed part of the I2C bus only. If finding the GPIO chip is the caller's responsibility, then deferred probing (if the GPIO chip isn't there yet) will not only affect the mux and the I2C bus segments behind it, but also the I2C bus trunk. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Peter Korsgaard <peter.korsgaard@barco.com>
* i2c-mux-gpio: Use devm_kzalloc instead of kzallocMaxime Ripard2012-10-051-9/+5
| | | | | | | | | Use the devm_kzalloc managed function to stripdown the error and remove code. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c-mux: Add support for device auto-detectionJean Delvare2012-10-054-7/+11
| | | | | | | | | | | | | | | | | Let I2C bus segments behind multiplexers have a class. This allows for device auto-detection on these segments. As long as parent segments don't share the same class, it should be fine. I implemented support in drivers i2c-mux-gpio and i2c-mux-pca954x. I left i2c-mux-pca9541 and i2c-mux-pinctrl alone for the moment as I don't know if this feature makes sense for the use cases of these drivers. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Peter Korsgaard <peter.korsgaard@barco.com> Cc: David Daney <david.daney@cavium.com> Cc: Michael Lawnick <ml.lawnick@gmx.de> Cc: Rodolfo Giometti <giometti@linux.it>
* i2c: Update Guenter Roeck's e-mail addressGuenter Roeck2012-07-241-1/+1
| | | | | | | My old e-mail address won't be valid for much longer. Time to update it. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: Add generic I2C multiplexer using pinctrl APIStephen Warren2012-06-043-0/+292
| | | | | | | | | | | | | | | | | | | | | | | | This is useful for SoCs whose I2C module's signals can be routed to different sets of pins at run-time, using the pinctrl API. +-----+ +-----+ | dev | | dev | +------------------------+ +-----+ +-----+ | SoC | | | | /----|------+--------+ | +---+ +------+ | child bus A, on first set of pins | |I2C|---|Pinmux| | | +---+ +------+ | child bus B, on second set of pins | \----|------+--------+--------+ | | | | | +------------------------+ +-----+ +-----+ +-----+ | dev | | dev | | dev | +-----+ +-----+ +-----+ Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
* i2c: Rename last mux driver to standard patternJean Delvare2012-05-123-24/+23
| | | | | | | | | | | | | Update the MAINTAINERS entry and all other references accordingly. Based on an original patch by Wolfram Sang. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Peter Korsgaard <peter.korsgaard@barco.com> [wsa: fixed merge conflict due to rework in i2c_add_mux_adapter()] Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
* i2c: muxes: rename first set of drivers to a standard patternWolfram Sang2012-05-124-4/+4
| | | | | | | | | | | Apply a naming pattern like in the rest of the subsystem to a first set of mux drivers. Those drivers are the low-hanging fruit; we want to pick them to motivate upcoming drivers to follow the new pattern. The missing GPIO driver will be converted in a later patch. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com> (pca9541) Acked-by: Jean Delvare <khali@linux-fr.org>
* i2c: Add a struct device * parameter to i2c_add_mux_adapter()David Daney2012-05-123-3/+5
| | | | | | | | | | | And adjust all callers. The new device parameter is used in the next patch to initialize the mux's of_node so that its children may be automatically populated. Signed-off-by: David Daney <david.daney@cavium.com> Tested-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
* i2c: Convert drivers/i2c/muxes/* to use module_i2c_driver()Axel Lin2012-03-262-24/+2
| | | | | | | | | | | | This patch converts the drivers in drivers/i2c/muxes/* to use the module_i2c_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Michael Lawnick <ml.lawnick@gmx.de> Cc: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c/gpio-i2cmux: Convert to use module_platform_driver()Axel Lin2012-01-121-12/+1
| | | | | | | | | Convert gpio-i2cmux to use the module_platform_driver() macro which makes the code smaller and a bit simpler. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Peter Korsgaard <peter.korsgaard@barco.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c/pca954x: Initialize the mux to disconnected statePetri Gynther2011-06-291-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | pca954x power-on default is channel 0 connected. If multiple pca954x muxes are connected to the same physical I2C bus, the parent bus will see channel 0 devices behind both muxes by default. This is bad. Scenario: -- pca954x @ 0x70 -- ch 0 (I2C-bus-101) -- EEPROM @ 0x50 | I2C-bus-1 --- | -- pca954x @ 0x71 -- ch 0 (I2C-bus-111) -- EEPROM @ 0x50 1. Load I2C bus driver: creates I2C-bus-1 2. Load pca954x driver: creates virtual I2C-bus-101 and I2C-bus-111 3. Load eeprom driver 4. Try to read EEPROM @ 0x50 on I2C-bus-101. The transaction will also bleed onto I2C-bus-111 because pca954x @ 0x71 channel 0 is connected by default. Fix: Initialize pca954x to disconnected state in pca954x_probe() Signed-off-by: Petri Gynther <pgynther@google.com> Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: stable@kernel.org
* i2c: Add generic I2C multiplexer using GPIO APIPeter Korsgaard2011-01-103-0/+197
| | | | | | | | | | | | | | | | | | | | | | | Add an i2c mux driver providing access to i2c bus segments using a hardware MUX sitting on a master bus and controlled through gpio pins. E.G. something like: ---------- ---------- Bus segment 1 - - - - - | | SCL/SDA | |-------------- | | | |------------| | | | | | Bus segment 2 | | | Linux | GPIO 1..N | MUX |--------------- Devices | |------------| | | | | | | | Bus segment M | | | |---------------| | ---------- ---------- - - - - - SCL/SDA of the master I2C bus is multiplexed to bus segment 1..M according to the settings of the GPIO pins 1..N. Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c/pca954x: Remove __devinit and __devexit from probe and remove functionsGuenter Roeck2010-10-241-4/+4
| | | | | | | | | The underlying I2C adapter may or may not be present when this driver gets initialized, and may disappear later, so there is no safe time at which the probe and remove functions can be discarded. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c/mux: Driver for PCA9541 I2C Master SelectorGuenter Roeck2010-10-243-0/+422
| | | | | | | | | | This patch adds support for PCA9541, an I2C Bus Master Selector. The driver is modeled as single channel I2C Multiplexer to be able to utilize the I2C multiplexer framework. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Tom Grennan <tom.grennan@ericsson.com> Acked-by: Jean Delvare <khali@linux-fr.org>
* i2c: Change to new flag variablematt mooney2010-10-241-3/+1
| | | | | | | Replace EXTRA_CFLAGS with ccflags-y. Signed-off-by: matt mooney <mfm@muteddisk.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
* i2c: I2C bus multiplexer driver pca954xMichael Lawnick2010-08-113-0/+327
I2C driver for PCA954x I2C multiplexer series. Signed-off-by: Michael Lawnick <ml.lawnick@gmx.de> Acked-by: Rodolfo Giometti <giometti@linux.it> Signed-off-by: Jean Delvare <khali@linux-fr.org>
OpenPOWER on IntegriCloud