aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-iop
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-09-09 05:59:51 -0400
committerLinus Walleij <linus.walleij@linaro.org>2013-09-20 17:03:36 -0400
commite9004f5039b3840089cb1cb0fe558a81e2bb55f0 (patch)
tree8c0effa3ea4b6e68786c7f11d16de1514746e615 /arch/arm/plat-iop
parent272b98c6455f00884f0350f775c5342358ebb73f (diff)
ARM: plat-iop: move the GPIO driver to drivers/gpio
Move the IOP GPIO driver to live with its siblings in the GPIO subsystem. Cc: Lennert Buytenhek <kernel@wantstofly.org> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Mikael Pettersson <mikpe@it.uu.se> Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/plat-iop')
-rw-r--r--arch/arm/plat-iop/Makefile2
-rw-r--r--arch/arm/plat-iop/gpio.c93
2 files changed, 0 insertions, 95 deletions
diff --git a/arch/arm/plat-iop/Makefile b/arch/arm/plat-iop/Makefile
index a99dc15a70f7..224e56c6049b 100644
--- a/arch/arm/plat-iop/Makefile
+++ b/arch/arm/plat-iop/Makefile
@@ -5,7 +5,6 @@
5obj-y := 5obj-y :=
6 6
7# IOP32X 7# IOP32X
8obj-$(CONFIG_ARCH_IOP32X) += gpio.o
9obj-$(CONFIG_ARCH_IOP32X) += i2c.o 8obj-$(CONFIG_ARCH_IOP32X) += i2c.o
10obj-$(CONFIG_ARCH_IOP32X) += pci.o 9obj-$(CONFIG_ARCH_IOP32X) += pci.o
11obj-$(CONFIG_ARCH_IOP32X) += setup.o 10obj-$(CONFIG_ARCH_IOP32X) += setup.o
@@ -16,7 +15,6 @@ obj-$(CONFIG_ARCH_IOP32X) += pmu.o
16obj-$(CONFIG_ARCH_IOP32X) += restart.o 15obj-$(CONFIG_ARCH_IOP32X) += restart.o
17 16
18# IOP33X 17# IOP33X
19obj-$(CONFIG_ARCH_IOP33X) += gpio.o
20obj-$(CONFIG_ARCH_IOP33X) += i2c.o 18obj-$(CONFIG_ARCH_IOP33X) += i2c.o
21obj-$(CONFIG_ARCH_IOP33X) += pci.o 19obj-$(CONFIG_ARCH_IOP33X) += pci.o
22obj-$(CONFIG_ARCH_IOP33X) += setup.o 20obj-$(CONFIG_ARCH_IOP33X) += setup.o
diff --git a/arch/arm/plat-iop/gpio.c b/arch/arm/plat-iop/gpio.c
deleted file mode 100644
index 697de6dc4936..000000000000
--- a/arch/arm/plat-iop/gpio.c
+++ /dev/null
@@ -1,93 +0,0 @@
1/*
2 * arch/arm/plat-iop/gpio.c
3 * GPIO handling for Intel IOP3xx processors.
4 *
5 * Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 */
12
13#include <linux/device.h>
14#include <linux/init.h>
15#include <linux/types.h>
16#include <linux/errno.h>
17#include <linux/gpio.h>
18#include <linux/export.h>
19#include <asm/hardware/iop3xx.h>
20#include <mach/gpio.h>
21
22void gpio_line_config(int line, int direction)
23{
24 unsigned long flags;
25
26 local_irq_save(flags);
27 if (direction == GPIO_IN) {
28 *IOP3XX_GPOE |= 1 << line;
29 } else if (direction == GPIO_OUT) {
30 *IOP3XX_GPOE &= ~(1 << line);
31 }
32 local_irq_restore(flags);
33}
34EXPORT_SYMBOL(gpio_line_config);
35
36int gpio_line_get(int line)
37{
38 return !!(*IOP3XX_GPID & (1 << line));
39}
40EXPORT_SYMBOL(gpio_line_get);
41
42void gpio_line_set(int line, int value)
43{
44 unsigned long flags;
45
46 local_irq_save(flags);
47 if (value == GPIO_LOW) {
48 *IOP3XX_GPOD &= ~(1 << line);
49 } else if (value == GPIO_HIGH) {
50 *IOP3XX_GPOD |= 1 << line;
51 }
52 local_irq_restore(flags);
53}
54EXPORT_SYMBOL(gpio_line_set);
55
56static int iop3xx_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
57{
58 gpio_line_config(gpio, GPIO_IN);
59 return 0;
60}
61
62static int iop3xx_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, int level)
63{
64 gpio_line_set(gpio, level);
65 gpio_line_config(gpio, GPIO_OUT);
66 return 0;
67}
68
69static int iop3xx_gpio_get_value(struct gpio_chip *chip, unsigned gpio)
70{
71 return gpio_line_get(gpio);
72}
73
74static void iop3xx_gpio_set_value(struct gpio_chip *chip, unsigned gpio, int value)
75{
76 gpio_line_set(gpio, value);
77}
78
79static struct gpio_chip iop3xx_chip = {
80 .label = "iop3xx",
81 .direction_input = iop3xx_gpio_direction_input,
82 .get = iop3xx_gpio_get_value,
83 .direction_output = iop3xx_gpio_direction_output,
84 .set = iop3xx_gpio_set_value,
85 .base = 0,
86 .ngpio = IOP3XX_N_GPIOS,
87};
88
89static int __init iop3xx_gpio_setup(void)
90{
91 return gpiochip_add(&iop3xx_chip);
92}
93arch_initcall(iop3xx_gpio_setup);