2012-05-18 19:29:34 +04:00
|
|
|
/*
|
|
|
|
* I2C multiplexer using pinctrl API
|
|
|
|
*
|
|
|
|
* Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU General Public License,
|
|
|
|
* version 2, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/i2c.h>
|
|
|
|
#include <linux/i2c-mux.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
#include <linux/pinctrl/consumer.h>
|
|
|
|
#include <linux/i2c-mux-pinctrl.h>
|
|
|
|
#include <linux/platform_device.h>
|
|
|
|
#include <linux/slab.h>
|
2013-10-16 13:56:33 +04:00
|
|
|
#include <linux/of.h>
|
i2c: mux: relax locking of the top i2c adapter during mux-locked muxing
With a i2c topology like the following
GPIO ---| ------ BAT1
| v /
I2C -----+----------+---- MUX
| \
EEPROM ------ BAT2
there is a locking problem with the GPIO controller since it is a client
on the same i2c bus that it muxes. Transfers to the mux clients (e.g. BAT1)
will lock the whole i2c bus prior to attempting to switch the mux to the
correct i2c segment. In the above case, the GPIO device is an I/O expander
with an i2c interface, and since the GPIO subsystem knows nothing (and
rightfully so) about the lockless needs of the i2c mux code, this results
in a deadlock when the GPIO driver issues i2c transfers to modify the
mux.
So, observing that while it is needed to have the i2c bus locked during the
actual MUX update in order to avoid random garbage on the slave side, it
is not strictly a must to have it locked over the whole sequence of a full
select-transfer-deselect mux client operation. The mux itself needs to be
locked, so transfers to clients behind the mux are serialized, and the mux
needs to be stable during all i2c traffic (otherwise individual mux slave
segments might see garbage, or worse).
Introduce this new locking concept as "mux-locked" muxes, and call the
pre-existing mux locking scheme "parent-locked".
Modify the i2c mux locking so that muxes that are "mux-locked" locks only
the muxes on the parent adapter instead of the whole i2c bus when there is
a transfer to the slave side of the mux. This lock serializes transfers to
the slave side of the muxes on the parent adapter.
Add code to i2c-mux-gpio and i2c-mux-pinctrl that checks if all involved
gpio/pinctrl devices have a parent that is an i2c adapter in the same
adapter tree that is muxed, and request a "mux-locked mux" if that is the
case.
Modify the select-transfer-deselect code for "mux-locked" muxes so
that each of the select-transfer-deselect ops locks the mux parent
adapter individually.
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-05-04 23:15:29 +03:00
|
|
|
#include "../../pinctrl/core.h"
|
2012-05-18 19:29:34 +04:00
|
|
|
|
|
|
|
struct i2c_mux_pinctrl {
|
|
|
|
struct i2c_mux_pinctrl_platform_data *pdata;
|
|
|
|
struct pinctrl *pinctrl;
|
|
|
|
struct pinctrl_state **states;
|
|
|
|
struct pinctrl_state *state_idle;
|
|
|
|
};
|
|
|
|
|
2016-04-20 09:39:31 +03:00
|
|
|
static int i2c_mux_pinctrl_select(struct i2c_mux_core *muxc, u32 chan)
|
2012-05-18 19:29:34 +04:00
|
|
|
{
|
2016-04-20 09:39:31 +03:00
|
|
|
struct i2c_mux_pinctrl *mux = i2c_mux_priv(muxc);
|
2012-05-18 19:29:34 +04:00
|
|
|
|
|
|
|
return pinctrl_select_state(mux->pinctrl, mux->states[chan]);
|
|
|
|
}
|
|
|
|
|
2016-04-20 09:39:31 +03:00
|
|
|
static int i2c_mux_pinctrl_deselect(struct i2c_mux_core *muxc, u32 chan)
|
2012-05-18 19:29:34 +04:00
|
|
|
{
|
2016-04-20 09:39:31 +03:00
|
|
|
struct i2c_mux_pinctrl *mux = i2c_mux_priv(muxc);
|
2012-05-18 19:29:34 +04:00
|
|
|
|
|
|
|
return pinctrl_select_state(mux->pinctrl, mux->state_idle);
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CONFIG_OF
|
|
|
|
static int i2c_mux_pinctrl_parse_dt(struct i2c_mux_pinctrl *mux,
|
2016-04-20 09:39:31 +03:00
|
|
|
struct platform_device *pdev)
|
2012-05-18 19:29:34 +04:00
|
|
|
{
|
|
|
|
struct device_node *np = pdev->dev.of_node;
|
|
|
|
int num_names, i, ret;
|
|
|
|
struct device_node *adapter_np;
|
|
|
|
struct i2c_adapter *adapter;
|
|
|
|
|
|
|
|
if (!np)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
mux->pdata = devm_kzalloc(&pdev->dev, sizeof(*mux->pdata), GFP_KERNEL);
|
2016-04-20 09:39:31 +03:00
|
|
|
if (!mux->pdata)
|
2012-05-18 19:29:34 +04:00
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
num_names = of_property_count_strings(np, "pinctrl-names");
|
|
|
|
if (num_names < 0) {
|
2016-04-20 09:39:31 +03:00
|
|
|
dev_err(&pdev->dev, "Cannot parse pinctrl-names: %d\n",
|
2012-05-18 19:29:34 +04:00
|
|
|
num_names);
|
|
|
|
return num_names;
|
|
|
|
}
|
|
|
|
|
|
|
|
mux->pdata->pinctrl_states = devm_kzalloc(&pdev->dev,
|
|
|
|
sizeof(*mux->pdata->pinctrl_states) * num_names,
|
|
|
|
GFP_KERNEL);
|
2016-04-20 09:39:31 +03:00
|
|
|
if (!mux->pdata->pinctrl_states)
|
2012-05-18 19:29:34 +04:00
|
|
|
return -ENOMEM;
|
|
|
|
|
|
|
|
for (i = 0; i < num_names; i++) {
|
|
|
|
ret = of_property_read_string_index(np, "pinctrl-names", i,
|
|
|
|
&mux->pdata->pinctrl_states[mux->pdata->bus_count]);
|
|
|
|
if (ret < 0) {
|
2016-04-20 09:39:31 +03:00
|
|
|
dev_err(&pdev->dev, "Cannot parse pinctrl-names: %d\n",
|
2012-05-18 19:29:34 +04:00
|
|
|
ret);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
if (!strcmp(mux->pdata->pinctrl_states[mux->pdata->bus_count],
|
|
|
|
"idle")) {
|
|
|
|
if (i != num_names - 1) {
|
2016-04-20 09:39:31 +03:00
|
|
|
dev_err(&pdev->dev,
|
|
|
|
"idle state must be last\n");
|
2012-05-18 19:29:34 +04:00
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
mux->pdata->pinctrl_state_idle = "idle";
|
|
|
|
} else {
|
|
|
|
mux->pdata->bus_count++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
adapter_np = of_parse_phandle(np, "i2c-parent", 0);
|
|
|
|
if (!adapter_np) {
|
2016-04-20 09:39:31 +03:00
|
|
|
dev_err(&pdev->dev, "Cannot parse i2c-parent\n");
|
2012-05-18 19:29:34 +04:00
|
|
|
return -ENODEV;
|
|
|
|
}
|
|
|
|
adapter = of_find_i2c_adapter_by_node(adapter_np);
|
2015-08-26 23:59:33 +03:00
|
|
|
of_node_put(adapter_np);
|
2012-05-18 19:29:34 +04:00
|
|
|
if (!adapter) {
|
2016-04-20 09:39:31 +03:00
|
|
|
dev_err(&pdev->dev, "Cannot find parent bus\n");
|
2013-10-10 12:19:13 +04:00
|
|
|
return -EPROBE_DEFER;
|
2012-05-18 19:29:34 +04:00
|
|
|
}
|
|
|
|
mux->pdata->parent_bus_num = i2c_adapter_id(adapter);
|
|
|
|
put_device(&adapter->dev);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#else
|
|
|
|
static inline int i2c_mux_pinctrl_parse_dt(struct i2c_mux_pinctrl *mux,
|
|
|
|
struct platform_device *pdev)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
i2c: mux: relax locking of the top i2c adapter during mux-locked muxing
With a i2c topology like the following
GPIO ---| ------ BAT1
| v /
I2C -----+----------+---- MUX
| \
EEPROM ------ BAT2
there is a locking problem with the GPIO controller since it is a client
on the same i2c bus that it muxes. Transfers to the mux clients (e.g. BAT1)
will lock the whole i2c bus prior to attempting to switch the mux to the
correct i2c segment. In the above case, the GPIO device is an I/O expander
with an i2c interface, and since the GPIO subsystem knows nothing (and
rightfully so) about the lockless needs of the i2c mux code, this results
in a deadlock when the GPIO driver issues i2c transfers to modify the
mux.
So, observing that while it is needed to have the i2c bus locked during the
actual MUX update in order to avoid random garbage on the slave side, it
is not strictly a must to have it locked over the whole sequence of a full
select-transfer-deselect mux client operation. The mux itself needs to be
locked, so transfers to clients behind the mux are serialized, and the mux
needs to be stable during all i2c traffic (otherwise individual mux slave
segments might see garbage, or worse).
Introduce this new locking concept as "mux-locked" muxes, and call the
pre-existing mux locking scheme "parent-locked".
Modify the i2c mux locking so that muxes that are "mux-locked" locks only
the muxes on the parent adapter instead of the whole i2c bus when there is
a transfer to the slave side of the mux. This lock serializes transfers to
the slave side of the muxes on the parent adapter.
Add code to i2c-mux-gpio and i2c-mux-pinctrl that checks if all involved
gpio/pinctrl devices have a parent that is an i2c adapter in the same
adapter tree that is muxed, and request a "mux-locked mux" if that is the
case.
Modify the select-transfer-deselect code for "mux-locked" muxes so
that each of the select-transfer-deselect ops locks the mux parent
adapter individually.
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-05-04 23:15:29 +03:00
|
|
|
static struct i2c_adapter *i2c_mux_pinctrl_root_adapter(
|
|
|
|
struct pinctrl_state *state)
|
|
|
|
{
|
|
|
|
struct i2c_adapter *root = NULL;
|
|
|
|
struct pinctrl_setting *setting;
|
|
|
|
struct i2c_adapter *pin_root;
|
|
|
|
|
|
|
|
list_for_each_entry(setting, &state->settings, node) {
|
|
|
|
pin_root = i2c_root_adapter(setting->pctldev->dev);
|
|
|
|
if (!pin_root)
|
|
|
|
return NULL;
|
|
|
|
if (!root)
|
|
|
|
root = pin_root;
|
|
|
|
else if (root != pin_root)
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return root;
|
|
|
|
}
|
|
|
|
|
2012-11-28 00:59:38 +04:00
|
|
|
static int i2c_mux_pinctrl_probe(struct platform_device *pdev)
|
2012-05-18 19:29:34 +04:00
|
|
|
{
|
2016-04-20 09:39:31 +03:00
|
|
|
struct i2c_mux_core *muxc;
|
2012-05-18 19:29:34 +04:00
|
|
|
struct i2c_mux_pinctrl *mux;
|
i2c: mux: relax locking of the top i2c adapter during mux-locked muxing
With a i2c topology like the following
GPIO ---| ------ BAT1
| v /
I2C -----+----------+---- MUX
| \
EEPROM ------ BAT2
there is a locking problem with the GPIO controller since it is a client
on the same i2c bus that it muxes. Transfers to the mux clients (e.g. BAT1)
will lock the whole i2c bus prior to attempting to switch the mux to the
correct i2c segment. In the above case, the GPIO device is an I/O expander
with an i2c interface, and since the GPIO subsystem knows nothing (and
rightfully so) about the lockless needs of the i2c mux code, this results
in a deadlock when the GPIO driver issues i2c transfers to modify the
mux.
So, observing that while it is needed to have the i2c bus locked during the
actual MUX update in order to avoid random garbage on the slave side, it
is not strictly a must to have it locked over the whole sequence of a full
select-transfer-deselect mux client operation. The mux itself needs to be
locked, so transfers to clients behind the mux are serialized, and the mux
needs to be stable during all i2c traffic (otherwise individual mux slave
segments might see garbage, or worse).
Introduce this new locking concept as "mux-locked" muxes, and call the
pre-existing mux locking scheme "parent-locked".
Modify the i2c mux locking so that muxes that are "mux-locked" locks only
the muxes on the parent adapter instead of the whole i2c bus when there is
a transfer to the slave side of the mux. This lock serializes transfers to
the slave side of the muxes on the parent adapter.
Add code to i2c-mux-gpio and i2c-mux-pinctrl that checks if all involved
gpio/pinctrl devices have a parent that is an i2c adapter in the same
adapter tree that is muxed, and request a "mux-locked mux" if that is the
case.
Modify the select-transfer-deselect code for "mux-locked" muxes so
that each of the select-transfer-deselect ops locks the mux parent
adapter individually.
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-05-04 23:15:29 +03:00
|
|
|
struct i2c_adapter *root;
|
2012-05-18 19:29:34 +04:00
|
|
|
int i, ret;
|
|
|
|
|
|
|
|
mux = devm_kzalloc(&pdev->dev, sizeof(*mux), GFP_KERNEL);
|
|
|
|
if (!mux) {
|
|
|
|
ret = -ENOMEM;
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
2013-07-30 11:59:33 +04:00
|
|
|
mux->pdata = dev_get_platdata(&pdev->dev);
|
2012-05-18 19:29:34 +04:00
|
|
|
if (!mux->pdata) {
|
|
|
|
ret = i2c_mux_pinctrl_parse_dt(mux, pdev);
|
|
|
|
if (ret < 0)
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
if (!mux->pdata) {
|
|
|
|
dev_err(&pdev->dev, "Missing platform data\n");
|
|
|
|
ret = -ENODEV;
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
|
|
|
mux->states = devm_kzalloc(&pdev->dev,
|
|
|
|
sizeof(*mux->states) * mux->pdata->bus_count,
|
|
|
|
GFP_KERNEL);
|
|
|
|
if (!mux->states) {
|
|
|
|
dev_err(&pdev->dev, "Cannot allocate states\n");
|
|
|
|
ret = -ENOMEM;
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
2016-04-20 09:39:31 +03:00
|
|
|
muxc = i2c_mux_alloc(NULL, &pdev->dev, mux->pdata->bus_count, 0, 0,
|
|
|
|
i2c_mux_pinctrl_select, NULL);
|
|
|
|
if (!muxc) {
|
2012-05-18 19:29:34 +04:00
|
|
|
ret = -ENOMEM;
|
|
|
|
goto err;
|
|
|
|
}
|
2016-04-20 09:39:31 +03:00
|
|
|
muxc->priv = mux;
|
|
|
|
|
|
|
|
platform_set_drvdata(pdev, muxc);
|
2012-05-18 19:29:34 +04:00
|
|
|
|
|
|
|
mux->pinctrl = devm_pinctrl_get(&pdev->dev);
|
|
|
|
if (IS_ERR(mux->pinctrl)) {
|
|
|
|
ret = PTR_ERR(mux->pinctrl);
|
|
|
|
dev_err(&pdev->dev, "Cannot get pinctrl: %d\n", ret);
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
for (i = 0; i < mux->pdata->bus_count; i++) {
|
|
|
|
mux->states[i] = pinctrl_lookup_state(mux->pinctrl,
|
|
|
|
mux->pdata->pinctrl_states[i]);
|
2016-04-22 16:44:07 +03:00
|
|
|
if (IS_ERR(mux->states[i])) {
|
|
|
|
ret = PTR_ERR(mux->states[i]);
|
|
|
|
dev_err(&pdev->dev,
|
|
|
|
"Cannot look up pinctrl state %s: %d\n",
|
|
|
|
mux->pdata->pinctrl_states[i], ret);
|
|
|
|
goto err;
|
|
|
|
}
|
2012-05-18 19:29:34 +04:00
|
|
|
}
|
|
|
|
if (mux->pdata->pinctrl_state_idle) {
|
|
|
|
mux->state_idle = pinctrl_lookup_state(mux->pinctrl,
|
|
|
|
mux->pdata->pinctrl_state_idle);
|
|
|
|
if (IS_ERR(mux->state_idle)) {
|
|
|
|
ret = PTR_ERR(mux->state_idle);
|
|
|
|
dev_err(&pdev->dev,
|
|
|
|
"Cannot look up pinctrl state %s: %d\n",
|
|
|
|
mux->pdata->pinctrl_state_idle, ret);
|
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
2016-04-20 09:39:31 +03:00
|
|
|
muxc->deselect = i2c_mux_pinctrl_deselect;
|
2012-05-18 19:29:34 +04:00
|
|
|
}
|
|
|
|
|
2016-04-20 09:39:31 +03:00
|
|
|
muxc->parent = i2c_get_adapter(mux->pdata->parent_bus_num);
|
|
|
|
if (!muxc->parent) {
|
2012-05-18 19:29:34 +04:00
|
|
|
dev_err(&pdev->dev, "Parent adapter (%d) not found\n",
|
|
|
|
mux->pdata->parent_bus_num);
|
2013-10-10 12:19:13 +04:00
|
|
|
ret = -EPROBE_DEFER;
|
2012-05-18 19:29:34 +04:00
|
|
|
goto err;
|
|
|
|
}
|
|
|
|
|
i2c: mux: relax locking of the top i2c adapter during mux-locked muxing
With a i2c topology like the following
GPIO ---| ------ BAT1
| v /
I2C -----+----------+---- MUX
| \
EEPROM ------ BAT2
there is a locking problem with the GPIO controller since it is a client
on the same i2c bus that it muxes. Transfers to the mux clients (e.g. BAT1)
will lock the whole i2c bus prior to attempting to switch the mux to the
correct i2c segment. In the above case, the GPIO device is an I/O expander
with an i2c interface, and since the GPIO subsystem knows nothing (and
rightfully so) about the lockless needs of the i2c mux code, this results
in a deadlock when the GPIO driver issues i2c transfers to modify the
mux.
So, observing that while it is needed to have the i2c bus locked during the
actual MUX update in order to avoid random garbage on the slave side, it
is not strictly a must to have it locked over the whole sequence of a full
select-transfer-deselect mux client operation. The mux itself needs to be
locked, so transfers to clients behind the mux are serialized, and the mux
needs to be stable during all i2c traffic (otherwise individual mux slave
segments might see garbage, or worse).
Introduce this new locking concept as "mux-locked" muxes, and call the
pre-existing mux locking scheme "parent-locked".
Modify the i2c mux locking so that muxes that are "mux-locked" locks only
the muxes on the parent adapter instead of the whole i2c bus when there is
a transfer to the slave side of the mux. This lock serializes transfers to
the slave side of the muxes on the parent adapter.
Add code to i2c-mux-gpio and i2c-mux-pinctrl that checks if all involved
gpio/pinctrl devices have a parent that is an i2c adapter in the same
adapter tree that is muxed, and request a "mux-locked mux" if that is the
case.
Modify the select-transfer-deselect code for "mux-locked" muxes so
that each of the select-transfer-deselect ops locks the mux parent
adapter individually.
Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-05-04 23:15:29 +03:00
|
|
|
root = i2c_root_adapter(&muxc->parent->dev);
|
|
|
|
|
|
|
|
muxc->mux_locked = true;
|
|
|
|
for (i = 0; i < mux->pdata->bus_count; i++) {
|
|
|
|
if (root != i2c_mux_pinctrl_root_adapter(mux->states[i])) {
|
|
|
|
muxc->mux_locked = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (muxc->mux_locked && mux->pdata->pinctrl_state_idle &&
|
|
|
|
root != i2c_mux_pinctrl_root_adapter(mux->state_idle))
|
|
|
|
muxc->mux_locked = false;
|
|
|
|
|
|
|
|
if (muxc->mux_locked)
|
|
|
|
dev_info(&pdev->dev, "mux-locked i2c mux\n");
|
|
|
|
|
2012-05-18 19:29:34 +04:00
|
|
|
for (i = 0; i < mux->pdata->bus_count; i++) {
|
|
|
|
u32 bus = mux->pdata->base_bus_num ?
|
|
|
|
(mux->pdata->base_bus_num + i) : 0;
|
|
|
|
|
2016-04-20 09:39:31 +03:00
|
|
|
ret = i2c_mux_add_adapter(muxc, bus, i, 0);
|
|
|
|
if (ret) {
|
2012-05-18 19:29:34 +04:00
|
|
|
dev_err(&pdev->dev, "Failed to add adapter %d\n", i);
|
|
|
|
goto err_del_adapter;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
err_del_adapter:
|
2016-04-20 09:39:31 +03:00
|
|
|
i2c_mux_del_adapters(muxc);
|
|
|
|
i2c_put_adapter(muxc->parent);
|
2012-05-18 19:29:34 +04:00
|
|
|
err:
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2012-11-28 00:59:38 +04:00
|
|
|
static int i2c_mux_pinctrl_remove(struct platform_device *pdev)
|
2012-05-18 19:29:34 +04:00
|
|
|
{
|
2016-04-20 09:39:31 +03:00
|
|
|
struct i2c_mux_core *muxc = platform_get_drvdata(pdev);
|
2012-05-18 19:29:34 +04:00
|
|
|
|
2016-04-20 09:39:31 +03:00
|
|
|
i2c_mux_del_adapters(muxc);
|
|
|
|
i2c_put_adapter(muxc->parent);
|
2012-05-18 19:29:34 +04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef CONFIG_OF
|
2012-11-28 00:59:38 +04:00
|
|
|
static const struct of_device_id i2c_mux_pinctrl_of_match[] = {
|
2012-05-18 19:29:34 +04:00
|
|
|
{ .compatible = "i2c-mux-pinctrl", },
|
|
|
|
{},
|
|
|
|
};
|
|
|
|
MODULE_DEVICE_TABLE(of, i2c_mux_pinctrl_of_match);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static struct platform_driver i2c_mux_pinctrl_driver = {
|
|
|
|
.driver = {
|
|
|
|
.name = "i2c-mux-pinctrl",
|
|
|
|
.of_match_table = of_match_ptr(i2c_mux_pinctrl_of_match),
|
|
|
|
},
|
|
|
|
.probe = i2c_mux_pinctrl_probe,
|
2012-11-28 00:59:38 +04:00
|
|
|
.remove = i2c_mux_pinctrl_remove,
|
2012-05-18 19:29:34 +04:00
|
|
|
};
|
|
|
|
module_platform_driver(i2c_mux_pinctrl_driver);
|
|
|
|
|
|
|
|
MODULE_DESCRIPTION("pinctrl-based I2C multiplexer driver");
|
|
|
|
MODULE_AUTHOR("Stephen Warren <swarren@nvidia.com>");
|
|
|
|
MODULE_LICENSE("GPL v2");
|
|
|
|
MODULE_ALIAS("platform:i2c-mux-pinctrl");
|