diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-05-18 11:29:34 -0400 |
---|---|---|
committer | Wolfram Sang <w.sang@pengutronix.de> | 2012-06-04 10:49:43 -0400 |
commit | ae58d1e406986f31d1e88b32f5ac601506c196d8 (patch) | |
tree | 85f8973189b8e7bab81bdc235eeb1fb48176bb9d /include | |
parent | f8f5701bdaf9134b1f90e5044a82c66324d2073f (diff) |
i2c: Add generic I2C multiplexer using pinctrl API
This is useful for SoCs whose I2C module's signals can be routed to
different sets of pins at run-time, using the pinctrl API.
+-----+ +-----+
| dev | | dev |
+------------------------+ +-----+ +-----+
| SoC | | |
| /----|------+--------+
| +---+ +------+ | child bus A, on first set of pins
| |I2C|---|Pinmux| |
| +---+ +------+ | child bus B, on second set of pins
| \----|------+--------+--------+
| | | | |
+------------------------+ +-----+ +-----+ +-----+
| dev | | dev | | dev |
+-----+ +-----+ +-----+
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/i2c-mux-pinctrl.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/include/linux/i2c-mux-pinctrl.h b/include/linux/i2c-mux-pinctrl.h new file mode 100644 index 000000000000..a65c86429e84 --- /dev/null +++ b/include/linux/i2c-mux-pinctrl.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * i2c-mux-pinctrl platform data | ||
3 | * | ||
4 | * Copyright (c) 2012, NVIDIA CORPORATION. All rights reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms and conditions of the GNU General Public License, | ||
8 | * version 2, as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
13 | * more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | |||
19 | #ifndef _LINUX_I2C_MUX_PINCTRL_H | ||
20 | #define _LINUX_I2C_MUX_PINCTRL_H | ||
21 | |||
22 | /** | ||
23 | * struct i2c_mux_pinctrl_platform_data - Platform data for i2c-mux-pinctrl | ||
24 | * @parent_bus_num: Parent I2C bus number | ||
25 | * @base_bus_num: Base I2C bus number for the child busses. 0 for dynamic. | ||
26 | * @bus_count: Number of child busses. Also the number of elements in | ||
27 | * @pinctrl_states | ||
28 | * @pinctrl_states: The names of the pinctrl state to select for each child bus | ||
29 | * @pinctrl_state_idle: The pinctrl state to select when no child bus is being | ||
30 | * accessed. If NULL, the most recently used pinctrl state will be left | ||
31 | * selected. | ||
32 | */ | ||
33 | struct i2c_mux_pinctrl_platform_data { | ||
34 | int parent_bus_num; | ||
35 | int base_bus_num; | ||
36 | int bus_count; | ||
37 | const char **pinctrl_states; | ||
38 | const char *pinctrl_state_idle; | ||
39 | }; | ||
40 | |||
41 | #endif | ||