i2c: mux: drop old unused i2c-mux api
authorPeter Rosin <peda@axentia.se>
Wed, 2 Mar 2016 14:14:22 +0000 (15:14 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Fri, 22 Apr 2016 13:00:19 +0000 (15:00 +0200)
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>
drivers/i2c/i2c-mux.c
include/linux/i2c-mux.h

index 5ce1b0704cb59f838eddc845eef5ca33a318b9f4..25e9336b0e6e3e63529b66d9421f93acf204858c 100644 (file)
 #include <linux/slab.h>
 
 /* multiplexer per channel data */
-struct i2c_mux_priv_old {
-       void *mux_priv;
-       int (*select)(struct i2c_adapter *, void *mux_priv, u32 chan_id);
-       int (*deselect)(struct i2c_adapter *, void *mux_priv, u32 chan_id);
-};
-
 struct i2c_mux_priv {
        struct i2c_adapter adap;
        struct i2c_algorithm algo;
@@ -104,53 +98,6 @@ static unsigned int i2c_mux_parent_classes(struct i2c_adapter *parent)
        return class;
 }
 
-static int i2c_mux_select(struct i2c_mux_core *muxc, u32 chan)
-{
-       struct i2c_mux_priv_old *priv = i2c_mux_priv(muxc);
-
-       return priv->select(muxc->parent, priv->mux_priv, chan);
-}
-
-static int i2c_mux_deselect(struct i2c_mux_core *muxc, u32 chan)
-{
-       struct i2c_mux_priv_old *priv = i2c_mux_priv(muxc);
-
-       return priv->deselect(muxc->parent, priv->mux_priv, chan);
-}
-
-struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent,
-                               struct device *mux_dev,
-                               void *mux_priv, u32 force_nr, u32 chan_id,
-                               unsigned int class,
-                               int (*select) (struct i2c_adapter *,
-                                              void *, u32),
-                               int (*deselect) (struct i2c_adapter *,
-                                                void *, u32))
-{
-       struct i2c_mux_core *muxc;
-       struct i2c_mux_priv_old *priv;
-       int ret;
-
-       muxc = i2c_mux_alloc(parent, mux_dev, 1, sizeof(*priv), 0,
-                            i2c_mux_select, i2c_mux_deselect);
-       if (!muxc)
-               return NULL;
-
-       priv = i2c_mux_priv(muxc);
-       priv->select = select;
-       priv->deselect = deselect;
-       priv->mux_priv = mux_priv;
-
-       ret = i2c_mux_add_adapter(muxc, force_nr, chan_id, class);
-       if (ret) {
-               devm_kfree(mux_dev, muxc);
-               return NULL;
-       }
-
-       return muxc->adapter[0];
-}
-EXPORT_SYMBOL_GPL(i2c_add_mux_adapter);
-
 struct i2c_mux_core *i2c_mux_alloc(struct i2c_adapter *parent,
                                   struct device *dev, int max_adapters,
                                   int sizeof_priv, u32 flags,
@@ -305,16 +252,6 @@ void i2c_mux_del_adapters(struct i2c_mux_core *muxc)
 }
 EXPORT_SYMBOL_GPL(i2c_mux_del_adapters);
 
-void i2c_del_mux_adapter(struct i2c_adapter *adap)
-{
-       struct i2c_mux_priv *priv = adap->algo_data;
-       struct i2c_mux_core *muxc = priv->muxc;
-
-       i2c_mux_del_adapters(muxc);
-       devm_kfree(muxc->dev, muxc);
-}
-EXPORT_SYMBOL_GPL(i2c_del_mux_adapter);
-
 MODULE_AUTHOR("Rodolfo Giometti <giometti@linux.it>");
 MODULE_DESCRIPTION("I2C driver for multiplexed I2C busses");
 MODULE_LICENSE("GPL v2");
index 71ac1b3f4f68f81033d5699a4e715cecc352d6ae..2fa93fe1345ee074175cb100021ed61cee84d93e 100644 (file)
@@ -52,20 +52,6 @@ static inline void *i2c_mux_priv(struct i2c_mux_core *muxc)
        return muxc->priv;
 }
 
-/*
- * Called to create a i2c bus on a multiplexed bus segment.
- * The mux_dev and chan_id parameters are passed to the select
- * and deselect callback functions to perform hardware-specific
- * mux control.
- */
-struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent,
-                               struct device *mux_dev,
-                               void *mux_priv, u32 force_nr, u32 chan_id,
-                               unsigned int class,
-                               int (*select) (struct i2c_adapter *,
-                                              void *mux_dev, u32 chan_id),
-                               int (*deselect) (struct i2c_adapter *,
-                                                void *mux_dev, u32 chan_id));
 /*
  * Called to create an i2c bus on a multiplexed bus segment.
  * The chan_id parameter is passed to the select and deselect
@@ -75,7 +61,6 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
                        u32 force_nr, u32 chan_id,
                        unsigned int class);
 
-void i2c_del_mux_adapter(struct i2c_adapter *adap);
 void i2c_mux_del_adapters(struct i2c_mux_core *muxc);
 
 #endif /* __KERNEL__ */
This page took 0.027004 seconds and 5 git commands to generate.