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 | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg.h b/arch/arm/plat-samsung/include/plat/gpio-cfg.h index 34efdd2b032c..db4112c6f2be 100644 --- a/arch/arm/plat-samsung/include/plat/gpio-cfg.h +++ b/arch/arm/plat-samsung/include/plat/gpio-cfg.h | |||
@@ -43,6 +43,11 @@ struct s3c_gpio_chip; | |||
43 | * layouts. Provide an point to vector control routine and provide any | 43 | * layouts. Provide an point to vector control routine and provide any |
44 | * per-bank configuration information that other systems such as the | 44 | * per-bank configuration information that other systems such as the |
45 | * external interrupt code will need. | 45 | * external interrupt code will need. |
46 | * | ||
47 | * @sa s3c_gpio_cfgpin | ||
48 | * @sa s3c_gpio_getcfg | ||
49 | * @sa s3c_gpio_setpull | ||
50 | * @sa s3c_gpio_getpull | ||
46 | */ | 51 | */ |
47 | struct s3c_gpio_cfg { | 52 | struct s3c_gpio_cfg { |
48 | unsigned int cfg_eint; | 53 | unsigned int cfg_eint; |
@@ -70,11 +75,25 @@ struct s3c_gpio_cfg { | |||
70 | /** | 75 | /** |
71 | * s3c_gpio_cfgpin() - Change the GPIO function of a pin. | 76 | * s3c_gpio_cfgpin() - Change the GPIO function of a pin. |
72 | * @pin pin The pin number to configure. | 77 | * @pin pin The pin number to configure. |
73 | * @pin to The configuration for the pin's function. | 78 | * @to to The configuration for the pin's function. |
74 | * | 79 | * |
75 | * Configure which function is actually connected to the external | 80 | * Configure which function is actually connected to the external |
76 | * pin, such as an gpio input, output or some form of special function | 81 | * pin, such as an gpio input, output or some form of special function |
77 | * connected to an internal peripheral block. | 82 | * connected to an internal peripheral block. |
83 | * | ||
84 | * The @to parameter can be one of the generic S3C_GPIO_INPUT, S3C_GPIO_OUTPUT | ||
85 | * or S3C_GPIO_SFN() to indicate one of the possible values that the helper | ||
86 | * will then generate the correct bit mask and shift for the configuration. | ||
87 | * | ||
88 | * If a bank of GPIOs all needs to be set to special-function 2, then | ||
89 | * the following code will work: | ||
90 | * | ||
91 | * for (gpio = start; gpio < end; gpio++) | ||
92 | * s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | ||
93 | * | ||
94 | * The @to parameter can also be a specific value already shifted to the | ||
95 | * correct position in the control register, although these are discouraged | ||
96 | * in newer kernels and are only being kept for compatibility. | ||
78 | */ | 97 | */ |
79 | extern int s3c_gpio_cfgpin(unsigned int pin, unsigned int to); | 98 | extern int s3c_gpio_cfgpin(unsigned int pin, unsigned int to); |
80 | 99 | ||
@@ -108,6 +127,8 @@ extern unsigned s3c_gpio_getcfg(unsigned int pin); | |||
108 | * This function sets the state of the pull-{up,down} resistor for the | 127 | * This function sets the state of the pull-{up,down} resistor for the |
109 | * specified pin. It will return 0 if successfull, or a negative error | 128 | * specified pin. It will return 0 if successfull, or a negative error |
110 | * code if the pin cannot support the requested pull setting. | 129 | * code if the pin cannot support the requested pull setting. |
130 | * | ||
131 | * @pull is one of S3C_GPIO_PULL_NONE, S3C_GPIO_PULL_DOWN or S3C_GPIO_PULL_UP. | ||
111 | */ | 132 | */ |
112 | extern int s3c_gpio_setpull(unsigned int pin, s3c_gpio_pull_t pull); | 133 | extern int s3c_gpio_setpull(unsigned int pin, s3c_gpio_pull_t pull); |
113 | 134 | ||