diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-04 19:24:33 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-04 19:24:33 -0400 |
| commit | aa7054f5a5a9ff728ce291cb103afa19f4f849eb (patch) | |
| tree | 83ddb460e2dca239f35d64a33054c100fe7f9e5d /include | |
| parent | 816434ec4a674fcdb3c2221a6dffdc8f34020550 (diff) | |
| parent | c9e3b2d8f75d84c7b333761471f6cef98ec4429a (diff) | |
Merge tag 'pinctrl-v3.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
Pull pin control changes from Linus Walleij:
"Here is the bulk of pin control changes for the v3.12 series. Most of
the relevant information is in the tag.
I merged in v3.11-rc7 last week to get rid of a largeish conflict
within the sunxi (AllWinner) driver in linux-next and fix up the
non-trivial merge the right way. That driver had a rather large fix
adding locking late in the release cycle.
Overall the bulk changes this time is cleanups and refactorings and
not much new features, which is nice.
- Refactorings for generic pin config handling in the core.
- Factor out a set of device tree utilities for use in all drivers,
to parse and allocate maps from the device tree.
- Some fixes to the core such as more nitpicky locking.
- Pushed down config array iteration into the drivers.
This patch is necessary for drivers that want to iterate over
configs and pile up a stack of alterations to the same register(s),
or if the driver wants to take a local spinlock when committing the
configuration.
- A new driver for the Texas Instruments Palmas PMIC by Laxman
Dewangan. This is used on the Tegra systems.
- A major cleanup and modernization of the PFC (Super Hitachi and ARM
SHmobile) pin controller and subdrivers.
- Support for the A20 and A31 sunxi (AllWinner) SoCs.
- A huge pile of fixes and cleanups: Axel Lin, Jingoo Han Dan
Carpenter, Julia Lawall and Sachin Kamat did an excellent job here"
* tag 'pinctrl-v3.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl: (124 commits)
pinctrl: sunxi: Fix off-by-one for valid offset range checking
pinctrl: sunxi: drop lock on error path
pinctrl: pinconf-generic: Remove ti prefix in dev_err messages
pinctrl: rockchip: Implement .request() and .free() callbacks
pinctrl: at91: fix get_pullup/down function return
pinctrl: sh-pfc: remove unnecessary platform_set_drvdata()
pinctrl: Add s5pv210 support to pinctrl-exynos
pinctrl: utils: include export.h to avoid warnings
pinctrl: s3c24xx: off by one in s3c24xx_eint_init()
pinctrl: mvebu: testing the wrong variable
pinctrl: abx500: fix bitwise AND test
pinctrl: mvebu: Convert to use devm_ioremap_resource
pinctrl: Pass all configs to driver on pin_config_set()
pinctrl: tz1090-pdc: Convert to devm_ioremap_resource
pinctrl: tz1090: Convert to devm_ioremap_resource
pinctrl: tegra: Convert to devm_ioremap_resource
pinctrl: rockchip: Simplify pin_to_bank equation
pinctrl: spear: Convert to devm_ioremap_resource
pinctrl: rockchip: Remove of_match_ptr macro for DT only driver
pinctrl: palmas: PINCTRL_PALMAS needs to select PINMUX
...
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/mfd/palmas.h | 35 | ||||
| -rw-r--r-- | include/linux/pinctrl/pinconf-generic.h | 33 | ||||
| -rw-r--r-- | include/linux/pinctrl/pinconf.h | 6 | ||||
| -rw-r--r-- | include/linux/platform_data/pinctrl-nomadik.h | 24 |
4 files changed, 61 insertions, 37 deletions
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index e6090d88e91d..37e48c957791 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h | |||
| @@ -448,7 +448,7 @@ enum usb_irq_events { | |||
| 448 | #define PALMAS_DVFS_BASE 0x180 | 448 | #define PALMAS_DVFS_BASE 0x180 |
| 449 | #define PALMAS_PMU_CONTROL_BASE 0x1A0 | 449 | #define PALMAS_PMU_CONTROL_BASE 0x1A0 |
| 450 | #define PALMAS_RESOURCE_BASE 0x1D4 | 450 | #define PALMAS_RESOURCE_BASE 0x1D4 |
| 451 | #define PALMAS_PU_PD_OD_BASE 0x1F4 | 451 | #define PALMAS_PU_PD_OD_BASE 0x1F0 |
| 452 | #define PALMAS_LED_BASE 0x200 | 452 | #define PALMAS_LED_BASE 0x200 |
| 453 | #define PALMAS_INTERRUPT_BASE 0x210 | 453 | #define PALMAS_INTERRUPT_BASE 0x210 |
| 454 | #define PALMAS_USB_OTG_BASE 0x250 | 454 | #define PALMAS_USB_OTG_BASE 0x250 |
| @@ -1733,16 +1733,20 @@ enum usb_irq_events { | |||
| 1733 | #define PALMAS_REGEN3_CTRL_MODE_ACTIVE_SHIFT 0 | 1733 | #define PALMAS_REGEN3_CTRL_MODE_ACTIVE_SHIFT 0 |
| 1734 | 1734 | ||
| 1735 | /* Registers for function PAD_CONTROL */ | 1735 | /* Registers for function PAD_CONTROL */ |
| 1736 | #define PALMAS_PU_PD_INPUT_CTRL1 0x0 | 1736 | #define PALMAS_OD_OUTPUT_CTRL2 0x2 |
| 1737 | #define PALMAS_PU_PD_INPUT_CTRL2 0x1 | 1737 | #define PALMAS_POLARITY_CTRL2 0x3 |
| 1738 | #define PALMAS_PU_PD_INPUT_CTRL3 0x2 | 1738 | #define PALMAS_PU_PD_INPUT_CTRL1 0x4 |
| 1739 | #define PALMAS_OD_OUTPUT_CTRL 0x4 | 1739 | #define PALMAS_PU_PD_INPUT_CTRL2 0x5 |
| 1740 | #define PALMAS_POLARITY_CTRL 0x5 | 1740 | #define PALMAS_PU_PD_INPUT_CTRL3 0x6 |
| 1741 | #define PALMAS_PRIMARY_SECONDARY_PAD1 0x6 | 1741 | #define PALMAS_PU_PD_INPUT_CTRL5 0x7 |
| 1742 | #define PALMAS_PRIMARY_SECONDARY_PAD2 0x7 | 1742 | #define PALMAS_OD_OUTPUT_CTRL 0x8 |
| 1743 | #define PALMAS_I2C_SPI 0x8 | 1743 | #define PALMAS_POLARITY_CTRL 0x9 |
| 1744 | #define PALMAS_PU_PD_INPUT_CTRL4 0x9 | 1744 | #define PALMAS_PRIMARY_SECONDARY_PAD1 0xA |
| 1745 | #define PALMAS_PRIMARY_SECONDARY_PAD3 0xA | 1745 | #define PALMAS_PRIMARY_SECONDARY_PAD2 0xB |
| 1746 | #define PALMAS_I2C_SPI 0xC | ||
| 1747 | #define PALMAS_PU_PD_INPUT_CTRL4 0xD | ||
| 1748 | #define PALMAS_PRIMARY_SECONDARY_PAD3 0xE | ||
| 1749 | #define PALMAS_PRIMARY_SECONDARY_PAD4 0xF | ||
| 1746 | 1750 | ||
| 1747 | /* Bit definitions for PU_PD_INPUT_CTRL1 */ | 1751 | /* Bit definitions for PU_PD_INPUT_CTRL1 */ |
| 1748 | #define PALMAS_PU_PD_INPUT_CTRL1_RESET_IN_PD 0x40 | 1752 | #define PALMAS_PU_PD_INPUT_CTRL1_RESET_IN_PD 0x40 |
| @@ -2500,6 +2504,15 @@ enum usb_irq_events { | |||
| 2500 | #define PALMAS_PU_PD_GPIO_CTRL1 0x6 | 2504 | #define PALMAS_PU_PD_GPIO_CTRL1 0x6 |
| 2501 | #define PALMAS_PU_PD_GPIO_CTRL2 0x7 | 2505 | #define PALMAS_PU_PD_GPIO_CTRL2 0x7 |
| 2502 | #define PALMAS_OD_OUTPUT_GPIO_CTRL 0x8 | 2506 | #define PALMAS_OD_OUTPUT_GPIO_CTRL 0x8 |
| 2507 | #define PALMAS_GPIO_DATA_IN2 0x9 | ||
| 2508 | #define PALMAS_GPIO_DATA_DIR2 0x0A | ||
| 2509 | #define PALMAS_GPIO_DATA_OUT2 0x0B | ||
| 2510 | #define PALMAS_GPIO_DEBOUNCE_EN2 0x0C | ||
| 2511 | #define PALMAS_GPIO_CLEAR_DATA_OUT2 0x0D | ||
| 2512 | #define PALMAS_GPIO_SET_DATA_OUT2 0x0E | ||
| 2513 | #define PALMAS_PU_PD_GPIO_CTRL3 0x0F | ||
| 2514 | #define PALMAS_PU_PD_GPIO_CTRL4 0x10 | ||
| 2515 | #define PALMAS_OD_OUTPUT_GPIO_CTRL2 0x11 | ||
| 2503 | 2516 | ||
| 2504 | /* Bit definitions for GPIO_DATA_IN */ | 2517 | /* Bit definitions for GPIO_DATA_IN */ |
| 2505 | #define PALMAS_GPIO_DATA_IN_GPIO_7_IN 0x80 | 2518 | #define PALMAS_GPIO_DATA_IN_GPIO_7_IN 0x80 |
diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index bf7e989abcb5..fb90ef5eb038 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h | |||
| @@ -137,6 +137,39 @@ static inline unsigned long pinconf_to_config_packed(enum pin_config_param param | |||
| 137 | return PIN_CONF_PACKED(param, argument); | 137 | return PIN_CONF_PACKED(param, argument); |
| 138 | } | 138 | } |
| 139 | 139 | ||
| 140 | #ifdef CONFIG_OF | ||
| 141 | |||
| 142 | #include <linux/device.h> | ||
| 143 | #include <linux/pinctrl/machine.h> | ||
| 144 | struct pinctrl_dev; | ||
| 145 | struct pinctrl_map; | ||
| 146 | |||
| 147 | int pinconf_generic_dt_subnode_to_map(struct pinctrl_dev *pctldev, | ||
| 148 | struct device_node *np, struct pinctrl_map **map, | ||
| 149 | unsigned *reserved_maps, unsigned *num_maps, | ||
| 150 | enum pinctrl_map_type type); | ||
| 151 | int pinconf_generic_dt_node_to_map(struct pinctrl_dev *pctldev, | ||
| 152 | struct device_node *np_config, struct pinctrl_map **map, | ||
| 153 | unsigned *num_maps, enum pinctrl_map_type type); | ||
| 154 | |||
| 155 | static inline int pinconf_generic_dt_node_to_map_group( | ||
| 156 | struct pinctrl_dev *pctldev, struct device_node *np_config, | ||
| 157 | struct pinctrl_map **map, unsigned *num_maps) | ||
| 158 | { | ||
| 159 | return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps, | ||
| 160 | PIN_MAP_TYPE_CONFIGS_GROUP); | ||
| 161 | } | ||
| 162 | |||
| 163 | static inline int pinconf_generic_dt_node_to_map_pin( | ||
| 164 | struct pinctrl_dev *pctldev, struct device_node *np_config, | ||
| 165 | struct pinctrl_map **map, unsigned *num_maps) | ||
| 166 | { | ||
| 167 | return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps, | ||
| 168 | PIN_MAP_TYPE_CONFIGS_PIN); | ||
| 169 | } | ||
| 170 | |||
| 171 | #endif | ||
| 172 | |||
| 140 | #endif /* CONFIG_GENERIC_PINCONF */ | 173 | #endif /* CONFIG_GENERIC_PINCONF */ |
| 141 | 174 | ||
| 142 | #endif /* __LINUX_PINCTRL_PINCONF_GENERIC_H */ | 175 | #endif /* __LINUX_PINCTRL_PINCONF_GENERIC_H */ |
diff --git a/include/linux/pinctrl/pinconf.h b/include/linux/pinctrl/pinconf.h index f6998692bdc9..09eb80f2574a 100644 --- a/include/linux/pinctrl/pinconf.h +++ b/include/linux/pinctrl/pinconf.h | |||
| @@ -47,13 +47,15 @@ struct pinconf_ops { | |||
| 47 | unsigned long *config); | 47 | unsigned long *config); |
| 48 | int (*pin_config_set) (struct pinctrl_dev *pctldev, | 48 | int (*pin_config_set) (struct pinctrl_dev *pctldev, |
| 49 | unsigned pin, | 49 | unsigned pin, |
| 50 | unsigned long config); | 50 | unsigned long *configs, |
| 51 | unsigned num_configs); | ||
| 51 | int (*pin_config_group_get) (struct pinctrl_dev *pctldev, | 52 | int (*pin_config_group_get) (struct pinctrl_dev *pctldev, |
| 52 | unsigned selector, | 53 | unsigned selector, |
| 53 | unsigned long *config); | 54 | unsigned long *config); |
| 54 | int (*pin_config_group_set) (struct pinctrl_dev *pctldev, | 55 | int (*pin_config_group_set) (struct pinctrl_dev *pctldev, |
| 55 | unsigned selector, | 56 | unsigned selector, |
| 56 | unsigned long config); | 57 | unsigned long *configs, |
| 58 | unsigned num_configs); | ||
| 57 | int (*pin_config_dbg_parse_modify) (struct pinctrl_dev *pctldev, | 59 | int (*pin_config_dbg_parse_modify) (struct pinctrl_dev *pctldev, |
| 58 | const char *arg, | 60 | const char *arg, |
| 59 | unsigned long *config); | 61 | unsigned long *config); |
diff --git a/include/linux/platform_data/pinctrl-nomadik.h b/include/linux/platform_data/pinctrl-nomadik.h index f73b2f0c55b7..abf5bed84df3 100644 --- a/include/linux/platform_data/pinctrl-nomadik.h +++ b/include/linux/platform_data/pinctrl-nomadik.h | |||
| @@ -226,30 +226,6 @@ enum nmk_gpio_slpm { | |||
| 226 | NMK_GPIO_SLPM_WAKEUP_DISABLE = NMK_GPIO_SLPM_NOCHANGE, | 226 | NMK_GPIO_SLPM_WAKEUP_DISABLE = NMK_GPIO_SLPM_NOCHANGE, |
| 227 | }; | 227 | }; |
| 228 | 228 | ||
| 229 | /* Older deprecated pin config API that should go away soon */ | ||
| 230 | extern int nmk_config_pin(pin_cfg_t cfg, bool sleep); | ||
| 231 | extern int nmk_config_pins(pin_cfg_t *cfgs, int num); | ||
| 232 | extern int nmk_config_pins_sleep(pin_cfg_t *cfgs, int num); | ||
| 233 | extern int nmk_gpio_set_slpm(int gpio, enum nmk_gpio_slpm mode); | ||
| 234 | extern int nmk_gpio_set_pull(int gpio, enum nmk_gpio_pull pull); | ||
| 235 | #ifdef CONFIG_PINCTRL_NOMADIK | ||
| 236 | extern int nmk_gpio_set_mode(int gpio, int gpio_mode); | ||
| 237 | #else | ||
| 238 | static inline int nmk_gpio_set_mode(int gpio, int gpio_mode) | ||
| 239 | { | ||
| 240 | return -ENODEV; | ||
| 241 | } | ||
| 242 | #endif | ||
| 243 | extern int nmk_gpio_get_mode(int gpio); | ||
| 244 | |||
| 245 | extern void nmk_gpio_wakeups_suspend(void); | ||
| 246 | extern void nmk_gpio_wakeups_resume(void); | ||
| 247 | |||
| 248 | extern void nmk_gpio_clocks_enable(void); | ||
| 249 | extern void nmk_gpio_clocks_disable(void); | ||
| 250 | |||
| 251 | extern void nmk_gpio_read_pull(int gpio_bank, u32 *pull_up); | ||
| 252 | |||
| 253 | /* | 229 | /* |
| 254 | * Platform data to register a block: only the initial gpio/irq number. | 230 | * Platform data to register a block: only the initial gpio/irq number. |
| 255 | */ | 231 | */ |
