Skip to contentSkip to conversation

dt-bindings: i2c: mux: ltc4306: Add dt-bindings for I2C multiplexer/switch

PATCH In review [email protected] 3 participants 5 messages Apr 11, 2017 – Apr 13, 2017

Subsystems (5)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH v5 1/2 dt-bindings: i2c: mux: ltc4306: Add dt-bindings for I2C multiplexer/switch

From: Michael Hennerich <[email protected]>

This patch adds support for the Analog Devices / Linear Technology LTC4306 and LTC4305 4/2 Channel I2C Bus Multiplexer/Switches. The LTC4306 optionally provides two general purpose input/output pins (GPIOs) that can be configured as logic inputs, opendrain outputs or push-pull outputs via the generic GPIOLIB framework.

---
 .../devicetree/bindings/i2c/i2c-mux-ltc4306.txt    | 61 ++++++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt
Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt new file +61 -0
new file mode 100644
index 0000000..1e98c6b
@@ -0,0 +1,61 @@
+* Linear Technology / Analog Devices I2C bus switch
+
+Required Properties:
+
+  - compatible: Must contain one of the following.
+    "lltc,ltc4305", "lltc,ltc4306"
+  - reg: The I2C address of the device.
+
+  The following required properties are defined externally:
+
+  - Standard I2C mux properties. See i2c-mux.txt in this directory.
+  - I2C child bus nodes. See i2c-mux.txt in this directory.
+
+Optional Properties:
+
+  - enable-gpios: Reference to the GPIO connected to the enable input.
+  - i2c-mux-idle-disconnect: Boolean; if defined, forces mux to disconnect all
+    children in idle state. This is necessary for example, if there are several
+    multiplexers on the bus and the devices behind them use same I2C addresses.
+  - gpio-controller: Marks the device node as a GPIO Controller.
+  - #gpio-cells: Should be two.  The first cell is the pin number and
+	the second cell is used to specify flags.
+	See ../gpio/gpio.txt for more information.
+  - ltc,downstream-accelerators-enable: Enables the rise time accelerators
+	on the downstream port.
+  - ltc,upstream-accelerators-enable: Enables the rise time accelerators
+	on the upstream port.
+
+Example:
+
+	ltc4306: i2c-mux@4a {
+		compatible = "lltc,ltc4306";
+		#address-cells = <1>;
+		#size-cells = <0>;
+		reg = <0x4a>;
+
+		gpio-controller;
+		#gpio-cells = <2>;
+
+		i2c@0 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0>;
+
+			eeprom@50 {
+				compatible = "at,24c02";
+				reg = <0x50>;
+			};
+		};
+
+		i2c@1 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <1>;
+
+			eeprom@50 {
+				compatible = "at,24c02";
+				reg = <0x50>;
+			};
+		};
+	};
Signature · 1 line
2.7.4
author maintainer
#1 lore raw

PATCH v5 2/2 i2c: mux: ltc4306: LTC4306 and LTC4305 I2C multiplexer/switch

From: Michael Hennerich <[email protected]>

This patch adds support for the Analog Devices / Linear Technology LTC4306 and LTC4305 4/2 Channel I2C Bus Multiplexer/Switches. The LTC4306 optionally provides two general purpose input/output pins (GPIOs) that can be configured as logic inputs, opendrain outputs or push-pull outputs via the generic GPIOLIB framework.

---

Changes since v1:

- Sort makefile entries
- Sort driver includes
- Use proper defines
- Miscellaneous coding style fixups
- Rename mux select callback
- Revise i2c-mux-idle-disconnect handling
- Add ENABLE GPIO handling on error and device removal.
- Remove surplus of_match_device call.

Changes since v2:

- Stop double error reporting (i2c_mux_add_adapter)
- Change subject
- Split dt bindings to separate patch

Changes since v3:

- Change subject and add spaces
- Convert to I2C_MUX_LOCKED
- Convert to regmap
- Remove local register cache
- Restore previous ENABLE GPIO handling
- Initially pulse ENABLE low
- Eliminate i2c client struct in driver state structure
- Simplify error return path
- Misc minor cleanups

Changes since v4:

- Remove redundant includes
- Use regmap cache type REGCACHE_FLAT
- gpio_get restore double negates on return
- Implement gpio_get_direction
- Use unified device property interface
- mux_alloc exact number of channels
- Reword kconfig help text

---
 MAINTAINERS                         |   8 +
 drivers/i2c/muxes/Kconfig           |  11 ++
 drivers/i2c/muxes/Makefile          |   1 +
 drivers/i2c/muxes/i2c-mux-ltc4306.c | 322 ++++++++++++++++++++++++++++++++++++
 4 files changed, 342 insertions(+)
 create mode 100644 drivers/i2c/muxes/i2c-mux-ltc4306.c
MAINTAINERS +8 -0
index c776906..9a27a19 100644
@@ -7698,6 +7698,14 @@ S:	Maintained
 F:	Documentation/hwmon/ltc4261
 F:	drivers/hwmon/ltc4261.c
 
+LTC4306 I2C MULTIPLEXER DRIVER
+M:	Michael Hennerich <[email protected]>
+W:	http://ez.analog.com/community/linux-device-drivers
+L:	[email protected]
+S:	Supported
+F:	drivers/i2c/muxes/i2c-mux-ltc4306.c
+F:	Documentation/devicetree/bindings/i2c/i2c-mux-ltc4306.txt
+
 LTP (Linux Test Project)
 M:	Mike Frysinger <[email protected]>
 M:	Cyril Hrubis <[email protected]>
drivers/i2c/muxes/Kconfig +11 -0
index 10b3d17..1e160fc 100644
@@ -30,6 +30,17 @@ config I2C_MUX_GPIO
 	  This driver can also be built as a module.  If so, the module
 	  will be called i2c-mux-gpio.
 
+config I2C_MUX_LTC4306
+	tristate "LTC LTC4306/5 I2C multiplexer"
+	select GPIOLIB
+	select REGMAP_I2C
+	help
+	  If you say yes here you get support for the Analog Devices
+	  LTC4306 or LTC4305 I2C mux/switch devices.
+
+	  This driver can also be built as a module.  If so, the module
+	  will be called i2c-mux-ltc4306.
+
 config I2C_MUX_PCA9541
 	tristate "NXP PCA9541 I2C Master Selector"
 	help
drivers/i2c/muxes/Makefile +1 -0
index 9948fa4..ff7618c 100644
@@ -6,6 +6,7 @@ obj-$(CONFIG_I2C_ARB_GPIO_CHALLENGE)	+= i2c-arb-gpio-challenge.o
 obj-$(CONFIG_I2C_DEMUX_PINCTRL)		+= i2c-demux-pinctrl.o
 
 obj-$(CONFIG_I2C_MUX_GPIO)	+= i2c-mux-gpio.o
+obj-$(CONFIG_I2C_MUX_LTC4306)	+= i2c-mux-ltc4306.o
 obj-$(CONFIG_I2C_MUX_MLXCPLD)	+= i2c-mux-mlxcpld.o
 obj-$(CONFIG_I2C_MUX_PCA9541)	+= i2c-mux-pca9541.o
 obj-$(CONFIG_I2C_MUX_PCA954x)	+= i2c-mux-pca954x.o
drivers/i2c/muxes/i2c-mux-ltc4306.c new file +322 -0

322 lines not on this page · raw message

Signature · 1 line
2.7.4
Reviewed-by on v5 2/2
#2 lore raw

Re: [PATCH v5 2/2] i2c: mux: ltc4306: LTC4306 and LTC4305 I2C multiplexer/switch

Quoted 9 lines · On Tue, Apr 11, 2017 at 2:16 PM, <[email protected]> wrote:

From: Michael Hennerich <[email protected]>

This patch adds support for the Analog Devices / Linear Technology LTC4306 and LTC4305 4/2 Channel I2C Bus Multiplexer/Switches. The LTC4306 optionally provides two general purpose input/output pins (GPIOs) that can be configured as logic inputs, opendrain outputs or push-pull outputs via the generic GPIOLIB framework.

(...)

Quoted 1 line

Changes since v4:

Please go ahead and merge to the i2c tree if you like.

Yours,
Linus Walleij

#3 lore raw

Re: [PATCH v5 2/2] i2c: mux: ltc4306: LTC4306 and LTC4305 I2C multiplexer/switch

Quoted 9 lines · Linus Walleij
Quoted 7 lines · On Tue, Apr 11, 2017 at 2:16 PM, <[email protected]> wrote:

From: Michael Hennerich <[email protected]>

This patch adds support for the Analog Devices / Linear Technology LTC4306 and LTC4305 4/2 Channel I2C Bus Multiplexer/Switches. The LTC4306 optionally provides two general purpose input/output pins (GPIOs) that can be configured as logic inputs, opendrain outputs or push-pull outputs via the generic GPIOLIB framework.

Great, thanks for your contribution Michael! Both patches pushed to the for-next branch of the i2c-mux tree.

Quoted 7 lines
Quoted 1 line

(...)

Quoted 1 line

Changes since v4:

Please go ahead and merge to the i2c tree if you like.

Yup, thanks for the review! (But not merged directly to the i2c tree, although they will get there eventually...)

Cheers,
peda

author maintainer
#4 lore raw

Re: [PATCH v5 2/2] i2c: mux: ltc4306: LTC4306 and LTC4305 I2C multiplexer/switch

Quoted 20 lines · Peter Rosin
Quoted 9 lines · Linus Walleij
Quoted 7 lines · On Tue, Apr 11, 2017 at 2:16 PM, <[email protected]> wrote:

From: Michael Hennerich <[email protected]>

This patch adds support for the Analog Devices / Linear Technology LTC4306 and LTC4305 4/2 Channel I2C Bus Multiplexer/Switches. The LTC4306 optionally provides two general purpose input/output pins (GPIOs) that can be configured as logic inputs, opendrain outputs or push-pull outputs via the generic GPIOLIB framework.

Great, thanks for your contribution Michael! Both patches pushed to the for-next branch of the i2c-mux tree.

Quoted 6 lines
Quoted 1 line

(...)

Quoted 1 line

Changes since v4:

Quoted 9 lines
Quoted 1 line

Please go ahead and merge to the i2c tree if you like.

Yup, thanks for the review! (But not merged directly to the i2c tree, although they will get there eventually...)

Cheers,
peda

Peter and Linus,

Thanks for your precious time - really appreciated!

Signature · 7 lines
Greetings,
Michael

--
Analog Devices GmbH      Otl-Aicher Strasse 60-64      80807 München
Sitz der Gesellschaft München, Registergericht München HRB 40368,
Geschäftsführer: Peter Kolberg, Ali Raza Husain, Eileen Wynne