diff options
Diffstat (limited to 'arch/arm/plat-samsung/include/plat/gpio-cfg.h')
-rw-r--r-- | arch/arm/plat-samsung/include/plat/gpio-cfg.h | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg.h b/arch/arm/plat-samsung/include/plat/gpio-cfg.h index 1762dcb4cb9..e750ec6fef2 100644 --- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h +++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h | |||
@@ -26,6 +26,8 @@ | |||
26 | 26 | ||
27 | typedef unsigned int __bitwise__ s3c_gpio_pull_t; | 27 | typedef unsigned int __bitwise__ s3c_gpio_pull_t; |
28 | typedef unsigned int __bitwise__ s5p_gpio_drvstr_t; | 28 | typedef unsigned int __bitwise__ s5p_gpio_drvstr_t; |
29 | typedef unsigned int __bitwise__ s5p_gpio_pd_cfg_t; | ||
30 | typedef unsigned int __bitwise__ s5p_gpio_pd_pull_t; | ||
29 | 31 | ||
30 | /* forward declaration if gpio-core.h hasn't been included */ | 32 | /* forward declaration if gpio-core.h hasn't been included */ |
31 | struct s3c_gpio_chip; | 33 | struct s3c_gpio_chip; |
@@ -207,6 +209,65 @@ extern s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin); | |||
207 | */ | 209 | */ |
208 | extern int s5p_gpio_set_drvstr(unsigned int pin, s5p_gpio_drvstr_t drvstr); | 210 | extern int s5p_gpio_set_drvstr(unsigned int pin, s5p_gpio_drvstr_t drvstr); |
209 | 211 | ||
212 | /* Define values for the power down configuration available for each gpio pin. | ||
213 | * | ||
214 | * These values control the state of the power down configuration resistors | ||
215 | * available on most pins on the S5P series. | ||
216 | */ | ||
217 | #define S5P_GPIO_PD_OUTPUT0 ((__force s5p_gpio_pd_cfg_t)0x00) | ||
218 | #define S5P_GPIO_PD_OUTPUT1 ((__force s5p_gpio_pd_cfg_t)0x01) | ||
219 | #define S5P_GPIO_PD_INPUT ((__force s5p_gpio_pd_cfg_t)0x02) | ||
220 | #define S5P_GPIO_PD_PREV_STATE ((__force s5p_gpio_pd_cfg_t)0x03) | ||
221 | |||
222 | /** | ||
223 | * s5p_gpio_set_pd_cfg() - set the configuration of a gpio power down mode | ||
224 | * @pin: The pin number to configure the pull resistor. | ||
225 | * @pd_cfg: The configuration for the pwer down mode configuration register. | ||
226 | * | ||
227 | * This function sets the configuration of the power down mode resistor for the | ||
228 | * specified pin. It will return 0 if successful, or a negative error | ||
229 | * code if the pin cannot support the requested power down mode. | ||
230 | * | ||
231 | */ | ||
232 | extern int s5p_gpio_set_pd_cfg(unsigned int pin, s5p_gpio_pd_cfg_t pd_cfg); | ||
233 | |||
234 | /** | ||
235 | * s5p_gpio_get_pd_cfg() - get the power down mode configuration of a gpio pin | ||
236 | * @pin: The pin number to get the settings for | ||
237 | * | ||
238 | * Read the power down mode resistor value for the specified pin. | ||
239 | */ | ||
240 | extern s5p_gpio_pd_cfg_t s5p_gpio_get_pd_cfg(unsigned int pin); | ||
241 | |||
242 | /* Define values for the power down pull-{up,down} available for each gpio pin. | ||
243 | * | ||
244 | * These values control the state of the power down mode pull-{up,down} | ||
245 | * resistors available on most pins on the S5P series. | ||
246 | */ | ||
247 | #define S5P_GPIO_PD_UPDOWN_DISABLE ((__force s5p_gpio_pd_pull_t)0x00) | ||
248 | #define S5P_GPIO_PD_DOWN_ENABLE ((__force s5p_gpio_pd_pull_t)0x01) | ||
249 | #define S5P_GPIO_PD_UP_ENABLE ((__force s5p_gpio_pd_pull_t)0x03) | ||
250 | |||
251 | /** | ||
252 | * s5p_gpio_set_pd_pull() - set the pull-{up,down} of a gpio pin power down mode | ||
253 | * @pin: The pin number to configure the pull resistor. | ||
254 | * @pd_pull: The configuration for the power down mode pull resistor. | ||
255 | * | ||
256 | * This function sets the configuration of the pull-{up,down} resistor for the | ||
257 | * specified pin. It will return 0 if successful, or a negative error | ||
258 | * code if the pin cannot support the requested pull setting. | ||
259 | * | ||
260 | */ | ||
261 | extern int s5p_gpio_set_pd_pull(unsigned int pin, s5p_gpio_pd_pull_t pd_pull); | ||
262 | |||
263 | /** | ||
264 | * s5p_gpio_get_pd_pull() - get the power down pull resistor config of gpio pin | ||
265 | * @pin: The pin number to get the settings for | ||
266 | * | ||
267 | * Read the power mode pull resistor value for the specified pin. | ||
268 | */ | ||
269 | extern s5p_gpio_pd_pull_t s5p_gpio_get_pd_pull(unsigned int pin); | ||
270 | |||
210 | /** | 271 | /** |
211 | * s5p_register_gpio_interrupt() - register interrupt support for a gpio group | 272 | * s5p_register_gpio_interrupt() - register interrupt support for a gpio group |
212 | * @pin: The pin number from the group to be registered | 273 | * @pin: The pin number from the group to be registered |