aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-samsung/gpio-config.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/plat-samsung/gpio-config.c')
-rw-r--r--arch/arm/plat-samsung/gpio-config.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-samsung/gpio-config.c
index c5832824e198..8aca88d6c486 100644
--- a/arch/arm/plat-samsung/gpio-config.c
+++ b/arch/arm/plat-samsung/gpio-config.c
@@ -164,3 +164,35 @@ s3c_gpio_pull_t s3c_gpio_getpull_updown(struct s3c_gpio_chip *chip,
164 return (__force s3c_gpio_pull_t)pup; 164 return (__force s3c_gpio_pull_t)pup;
165} 165}
166#endif 166#endif
167
168#ifdef CONFIG_S3C_GPIO_PULL_UP
169int s3c_gpio_setpull_1up(struct s3c_gpio_chip *chip,
170 unsigned int off, s3c_gpio_pull_t pull)
171{
172 void __iomem *reg = chip->base + 0x08;
173 u32 pup = __raw_readl(reg);
174
175 pup = __raw_readl(reg);
176
177 if (pup == S3C_GPIO_PULL_UP)
178 pup &= ~(1 << off);
179 else if (pup == S3C_GPIO_PULL_NONE)
180 pup |= (1 << off);
181 else
182 return -EINVAL;
183
184 __raw_writel(pup, reg);
185 return 0;
186}
187
188s3c_gpio_pull_t s3c_gpio_getpull_1up(struct s3c_gpio_chip *chip,
189 unsigned int off)
190{
191 void __iomem *reg = chip->base + 0x08;
192 u32 pup = __raw_readl(reg);
193
194 pup &= (1 << off);
195 return pup ? S3C_GPIO_PULL_NONE : S3C_GPIO_PULL_UP;
196}
197#endif /* CONFIG_S3C_GPIO_PULL_UP */
198