diff options
Diffstat (limited to 'arch/arm/mach-at91/gpio.c')
| -rw-r--r-- | arch/arm/mach-at91/gpio.c | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c index f2236f0e101f..ae4772e744ac 100644 --- a/arch/arm/mach-at91/gpio.c +++ b/arch/arm/mach-at91/gpio.c | |||
| @@ -44,13 +44,11 @@ static int at91_gpiolib_direction_output(struct gpio_chip *chip, | |||
| 44 | unsigned offset, int val); | 44 | unsigned offset, int val); |
| 45 | static int at91_gpiolib_direction_input(struct gpio_chip *chip, | 45 | static int at91_gpiolib_direction_input(struct gpio_chip *chip, |
| 46 | unsigned offset); | 46 | unsigned offset); |
| 47 | static int at91_gpiolib_request(struct gpio_chip *chip, unsigned offset); | ||
| 48 | 47 | ||
| 49 | #define AT91_GPIO_CHIP(name, base_gpio, nr_gpio) \ | 48 | #define AT91_GPIO_CHIP(name, base_gpio, nr_gpio) \ |
| 50 | { \ | 49 | { \ |
| 51 | .chip = { \ | 50 | .chip = { \ |
| 52 | .label = name, \ | 51 | .label = name, \ |
| 53 | .request = at91_gpiolib_request, \ | ||
| 54 | .direction_input = at91_gpiolib_direction_input, \ | 52 | .direction_input = at91_gpiolib_direction_input, \ |
| 55 | .direction_output = at91_gpiolib_direction_output, \ | 53 | .direction_output = at91_gpiolib_direction_output, \ |
| 56 | .get = at91_gpiolib_get, \ | 54 | .get = at91_gpiolib_get, \ |
| @@ -588,19 +586,6 @@ static void at91_gpiolib_set(struct gpio_chip *chip, unsigned offset, int val) | |||
| 588 | __raw_writel(mask, pio + (val ? PIO_SODR : PIO_CODR)); | 586 | __raw_writel(mask, pio + (val ? PIO_SODR : PIO_CODR)); |
| 589 | } | 587 | } |
| 590 | 588 | ||
| 591 | static int at91_gpiolib_request(struct gpio_chip *chip, unsigned offset) | ||
| 592 | { | ||
| 593 | unsigned pin = chip->base + offset; | ||
| 594 | void __iomem *pio = pin_to_controller(pin); | ||
| 595 | unsigned mask = pin_to_mask(pin); | ||
| 596 | |||
| 597 | /* Cannot request GPIOs that are in alternate function mode */ | ||
| 598 | if (!(__raw_readl(pio + PIO_PSR) & mask)) | ||
| 599 | return -EPERM; | ||
| 600 | |||
| 601 | return 0; | ||
| 602 | } | ||
| 603 | |||
| 604 | static void at91_gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip) | 589 | static void at91_gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip) |
| 605 | { | 590 | { |
| 606 | int i; | 591 | int i; |
