aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/i2c-mux.h
diff options
context:
space:
mode:
authorPeter Rosin <peda@axentia.se>2016-07-09 21:53:42 +0200
committerPeter Rosin <peda@axentia.se>2016-08-25 22:11:02 +0200
commitb2d57b56047b99f2992fc958d7ac5ead283e9088 (patch)
treeb5df552ab814d3c1fb852a941b361b767cf14015 /include/linux/i2c-mux.h
parentdt-bindings: i2c: add bindings for nxp,pca9541 (diff)
downloadwireguard-linux-b2d57b56047b99f2992fc958d7ac5ead283e9088.tar.xz
wireguard-linux-b2d57b56047b99f2992fc958d7ac5ead283e9088.zip
i2c: mux: add support for 'i2c-mux', 'i2c-arb' and 'i2c-gate' DT subnodes
Backwards compatibility is preserved; the subnodes are in practice optional. However, the mux core needs to know what subnode it should examine, so add a couple of new flags for i2c_mux_alloc for this purpose. The rule is that if the mux core finds a 'reg' property in the appropriate subnode, e.g. if 'reg' exists in the 'i2c-mux' subnode, then the mux core will assume that this is an old style entry and not an i2c-mux subnode (correspondingly for arbitrators and gates with 'i2c-arb' and 'i2c-gate'). Reviewed-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Peter Rosin <peda@axentia.se>
Diffstat (limited to 'include/linux/i2c-mux.h')
-rw-r--r--include/linux/i2c-mux.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/i2c-mux.h b/include/linux/i2c-mux.h
index d4c1d12f900d..bd74d5706f3b 100644
--- a/include/linux/i2c-mux.h
+++ b/include/linux/i2c-mux.h
@@ -32,7 +32,9 @@
struct i2c_mux_core {
struct i2c_adapter *parent;
struct device *dev;
- bool mux_locked;
+ unsigned int mux_locked:1;
+ unsigned int arbitrator:1;
+ unsigned int gate:1;
void *priv;
@@ -51,7 +53,9 @@ struct i2c_mux_core *i2c_mux_alloc(struct i2c_adapter *parent,
int (*deselect)(struct i2c_mux_core *, u32));
/* flags for i2c_mux_alloc */
-#define I2C_MUX_LOCKED BIT(0)
+#define I2C_MUX_LOCKED BIT(0)
+#define I2C_MUX_ARBITRATOR BIT(1)
+#define I2C_MUX_GATE BIT(2)
static inline void *i2c_mux_priv(struct i2c_mux_core *muxc)
{