diff options
Diffstat (limited to 'include/linux')
| -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 | */ |
