diff options
| author | Peter Rosin <peda@axentia.se> | 2016-03-02 09:14:22 -0500 |
|---|---|---|
| committer | Wolfram Sang <wsa@the-dreams.de> | 2016-04-22 09:00:19 -0400 |
| commit | 23fe440c59b9f08afe108e7ec7b6714cb2a3b955 (patch) | |
| tree | 1d4930ab5d71d9c3ca6357b95b43dda58ef46b4e /drivers/i2c | |
| parent | b6e3b7171b1e416963e36bb91ff6cce1caaaf675 (diff) | |
i2c: mux: drop old unused i2c-mux api
All i2c mux users are using an explicit i2c mux core, drop support
for implicit i2c mux cores.
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
| -rw-r--r-- | drivers/i2c/i2c-mux.c | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/drivers/i2c/i2c-mux.c b/drivers/i2c/i2c-mux.c index 5ce1b0704cb5..25e9336b0e6e 100644 --- a/drivers/i2c/i2c-mux.c +++ b/drivers/i2c/i2c-mux.c | |||
| @@ -28,12 +28,6 @@ | |||
| 28 | #include <linux/slab.h> | 28 | #include <linux/slab.h> |
| 29 | 29 | ||
| 30 | /* multiplexer per channel data */ | 30 | /* multiplexer per channel data */ |
| 31 | struct i2c_mux_priv_old { | ||
| 32 | void *mux_priv; | ||
| 33 | int (*select)(struct i2c_adapter *, void *mux_priv, u32 chan_id); | ||
| 34 | int (*deselect)(struct i2c_adapter *, void *mux_priv, u32 chan_id); | ||
| 35 | }; | ||
| 36 | |||
| 37 | struct i2c_mux_priv { | 31 | struct i2c_mux_priv { |
| 38 | struct i2c_adapter adap; | 32 | struct i2c_adapter adap; |
| 39 | struct i2c_algorithm algo; | 33 | struct i2c_algorithm algo; |
| @@ -104,53 +98,6 @@ static unsigned int i2c_mux_parent_classes(struct i2c_adapter *parent) | |||
| 104 | return class; | 98 | return class; |
| 105 | } | 99 | } |
| 106 | 100 | ||
| 107 | static int i2c_mux_select(struct i2c_mux_core *muxc, u32 chan) | ||
| 108 | { | ||
| 109 | struct i2c_mux_priv_old *priv = i2c_mux_priv(muxc); | ||
| 110 | |||
| 111 | return priv->select(muxc->parent, priv->mux_priv, chan); | ||
| 112 | } | ||
| 113 | |||
| 114 | static int i2c_mux_deselect(struct i2c_mux_core *muxc, u32 chan) | ||
| 115 | { | ||
| 116 | struct i2c_mux_priv_old *priv = i2c_mux_priv(muxc); | ||
| 117 | |||
| 118 | return priv->deselect(muxc->parent, priv->mux_priv, chan); | ||
| 119 | } | ||
| 120 | |||
| 121 | struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent, | ||
| 122 | struct device *mux_dev, | ||
| 123 | void *mux_priv, u32 force_nr, u32 chan_id, | ||
| 124 | unsigned int class, | ||
| 125 | int (*select) (struct i2c_adapter *, | ||
| 126 | void *, u32), | ||
| 127 | int (*deselect) (struct i2c_adapter *, | ||
| 128 | void *, u32)) | ||
| 129 | { | ||
| 130 | struct i2c_mux_core *muxc; | ||
| 131 | struct i2c_mux_priv_old *priv; | ||
| 132 | int ret; | ||
| 133 | |||
| 134 | muxc = i2c_mux_alloc(parent, mux_dev, 1, sizeof(*priv), 0, | ||
| 135 | i2c_mux_select, i2c_mux_deselect); | ||
| 136 | if (!muxc) | ||
| 137 | return NULL; | ||
| 138 | |||
| 139 | priv = i2c_mux_priv(muxc); | ||
| 140 | priv->select = select; | ||
| 141 | priv->deselect = deselect; | ||
| 142 | priv->mux_priv = mux_priv; | ||
| 143 | |||
| 144 | ret = i2c_mux_add_adapter(muxc, force_nr, chan_id, class); | ||
| 145 | if (ret) { | ||
| 146 | devm_kfree(mux_dev, muxc); | ||
| 147 | return NULL; | ||
| 148 | } | ||
| 149 | |||
| 150 | return muxc->adapter[0]; | ||
| 151 | } | ||
| 152 | EXPORT_SYMBOL_GPL(i2c_add_mux_adapter); | ||
| 153 | |||
| 154 | struct i2c_mux_core *i2c_mux_alloc(struct i2c_adapter *parent, | 101 | struct i2c_mux_core *i2c_mux_alloc(struct i2c_adapter *parent, |
| 155 | struct device *dev, int max_adapters, | 102 | struct device *dev, int max_adapters, |
| 156 | int sizeof_priv, u32 flags, | 103 | int sizeof_priv, u32 flags, |
| @@ -305,16 +252,6 @@ void i2c_mux_del_adapters(struct i2c_mux_core *muxc) | |||
| 305 | } | 252 | } |
| 306 | EXPORT_SYMBOL_GPL(i2c_mux_del_adapters); | 253 | EXPORT_SYMBOL_GPL(i2c_mux_del_adapters); |
| 307 | 254 | ||
| 308 | void i2c_del_mux_adapter(struct i2c_adapter *adap) | ||
| 309 | { | ||
| 310 | struct i2c_mux_priv *priv = adap->algo_data; | ||
| 311 | struct i2c_mux_core *muxc = priv->muxc; | ||
| 312 | |||
| 313 | i2c_mux_del_adapters(muxc); | ||
| 314 | devm_kfree(muxc->dev, muxc); | ||
| 315 | } | ||
| 316 | EXPORT_SYMBOL_GPL(i2c_del_mux_adapter); | ||
| 317 | |||
| 318 | MODULE_AUTHOR("Rodolfo Giometti <giometti@linux.it>"); | 255 | MODULE_AUTHOR("Rodolfo Giometti <giometti@linux.it>"); |
| 319 | MODULE_DESCRIPTION("I2C driver for multiplexed I2C busses"); | 256 | MODULE_DESCRIPTION("I2C driver for multiplexed I2C busses"); |
| 320 | MODULE_LICENSE("GPL v2"); | 257 | MODULE_LICENSE("GPL v2"); |
