diff options
| author | Stephen Warren <swarren@nvidia.com> | 2012-03-01 20:48:32 -0500 |
|---|---|---|
| committer | Linus Walleij <linus.walleij@linaro.org> | 2012-03-02 10:18:24 -0500 |
| commit | 46919ae63d4820e76724beb655274ce143f0da0b (patch) | |
| tree | a16dfab490eb0d68db9d633f172bab98b1035485 /include/linux/pinctrl | |
| parent | d4e3198736d9d64e4ba4d2b46ab75cbcf5d0a4e0 (diff) | |
pinctrl: introduce PINCTRL_STATE_DEFAULT, define hogs as that state
This provides a single centralized name for the default state.
Update PIN_MAP_* macros to use this state name, instead of requiring the
user to pass a state name in.
With this change, hog entries in the mapping table are defined as those
with state name PINCTRL_STATE_DEFAULT, i.e. all entries have the same
name. This interacts badly with the nested iteration over mapping table
entries in pinctrl_hog_maps() and pinctrl_hog_map() which would now
attempt to claim each hog mapping table entry multiple times. Replacing
the custom hog code with a simple pinctrl_get()/pinctrl_enable().
Update documentation and mapping tables to use this.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'include/linux/pinctrl')
| -rw-r--r-- | include/linux/pinctrl/machine.h | 13 | ||||
| -rw-r--r-- | include/linux/pinctrl/pinctrl.h | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/include/linux/pinctrl/machine.h b/include/linux/pinctrl/machine.h index 73fbb2745301..20e97353d5f9 100644 --- a/include/linux/pinctrl/machine.h +++ b/include/linux/pinctrl/machine.h | |||
| @@ -12,6 +12,8 @@ | |||
| 12 | #ifndef __LINUX_PINCTRL_MACHINE_H | 12 | #ifndef __LINUX_PINCTRL_MACHINE_H |
| 13 | #define __LINUX_PINCTRL_MACHINE_H | 13 | #define __LINUX_PINCTRL_MACHINE_H |
| 14 | 14 | ||
| 15 | #include "pinctrl.h" | ||
| 16 | |||
| 15 | /** | 17 | /** |
| 16 | * struct pinctrl_map - boards/machines shall provide this map for devices | 18 | * struct pinctrl_map - boards/machines shall provide this map for devices |
| 17 | * @dev_name: the name of the device using this specific mapping, the name | 19 | * @dev_name: the name of the device using this specific mapping, the name |
| @@ -49,17 +51,18 @@ struct pinctrl_map { | |||
| 49 | * Convenience macro to map a system function onto a certain pinctrl device, | 51 | * Convenience macro to map a system function onto a certain pinctrl device, |
| 50 | * to be hogged by the pin control core until the system shuts down. | 52 | * to be hogged by the pin control core until the system shuts down. |
| 51 | */ | 53 | */ |
| 52 | #define PIN_MAP_SYS_HOG(a, b, c) \ | 54 | #define PIN_MAP_SYS_HOG(a, b) \ |
| 53 | { .name = a, .ctrl_dev_name = b, .dev_name = b, .function = c, } | 55 | { .name = PINCTRL_STATE_DEFAULT, .ctrl_dev_name = a, .dev_name = a, \ |
| 56 | .function = b, } | ||
| 54 | 57 | ||
| 55 | /* | 58 | /* |
| 56 | * Convenience macro to map a system function onto a certain pinctrl device | 59 | * Convenience macro to map a system function onto a certain pinctrl device |
| 57 | * using a specified group, to be hogged by the pin control core until the | 60 | * using a specified group, to be hogged by the pin control core until the |
| 58 | * system shuts down. | 61 | * system shuts down. |
| 59 | */ | 62 | */ |
| 60 | #define PIN_MAP_SYS_HOG_GROUP(a, b, c, d) \ | 63 | #define PIN_MAP_SYS_HOG_GROUP(a, b, c) \ |
| 61 | { .name = a, .ctrl_dev_name = b, .dev_name = b, .function = c, \ | 64 | { .name = PINCTRL_STATE_DEFAULT, .ctrl_dev_name = a, .dev_name = a, \ |
| 62 | .group = d, } | 65 | .function = b, .group = c, } |
| 63 | 66 | ||
| 64 | #ifdef CONFIG_PINMUX | 67 | #ifdef CONFIG_PINMUX |
| 65 | 68 | ||
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 8bd22ee7aa09..411fe232adf1 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h | |||
| @@ -19,6 +19,8 @@ | |||
| 19 | #include <linux/list.h> | 19 | #include <linux/list.h> |
| 20 | #include <linux/seq_file.h> | 20 | #include <linux/seq_file.h> |
| 21 | 21 | ||
| 22 | #define PINCTRL_STATE_DEFAULT "default" | ||
| 23 | |||
| 22 | struct pinctrl_dev; | 24 | struct pinctrl_dev; |
| 23 | struct pinmux_ops; | 25 | struct pinmux_ops; |
| 24 | struct pinconf_ops; | 26 | struct pinconf_ops; |
