aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/gpio15xx.c
diff options
context:
space:
mode:
authorKevin Hilman <khilman@ti.com>2011-04-20 19:31:23 -0400
committerKevin Hilman <khilman@ti.com>2011-06-16 14:13:42 -0400
commitfa87931acb8203a1f40a3c637863ad238f70cd40 (patch)
treefd79e56fb9819bbb1096c9d3904f0ba04bec832a /arch/arm/mach-omap1/gpio15xx.c
parenta8be8dafd00e3ccf4f85e2f30babf42be5076324 (diff)
gpio/omap: consolidate direction, input, output, remove #ifdefs
Add register offset fields to GPIO platform_data for registers. This patch adds registers that control direction, input and output data. Using these register offsets in the common driver allows removal of #ifdefs and greatly improves readability. Also create dedicated data out functions: one for banks with dedicated set/clear registers, and another for banks with a single mask register. Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-omap1/gpio15xx.c')
-rw-r--r--arch/arm/mach-omap1/gpio15xx.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mach-omap1/gpio15xx.c b/arch/arm/mach-omap1/gpio15xx.c
index 04c4b04cf54e..a622d567b53e 100644
--- a/arch/arm/mach-omap1/gpio15xx.c
+++ b/arch/arm/mach-omap1/gpio15xx.c
@@ -34,11 +34,18 @@ static struct __initdata resource omap15xx_mpu_gpio_resources[] = {
34 }, 34 },
35}; 35};
36 36
37static struct omap_gpio_reg_offs omap15xx_mpuio_regs = {
38 .direction = OMAP_MPUIO_IO_CNTL,
39 .datain = OMAP_MPUIO_INPUT_LATCH,
40 .dataout = OMAP_MPUIO_OUTPUT,
41};
42
37static struct __initdata omap_gpio_platform_data omap15xx_mpu_gpio_config = { 43static struct __initdata omap_gpio_platform_data omap15xx_mpu_gpio_config = {
38 .virtual_irq_start = IH_MPUIO_BASE, 44 .virtual_irq_start = IH_MPUIO_BASE,
39 .bank_type = METHOD_MPUIO, 45 .bank_type = METHOD_MPUIO,
40 .bank_width = 16, 46 .bank_width = 16,
41 .bank_stride = 1, 47 .bank_stride = 1,
48 .regs = &omap15xx_mpuio_regs,
42}; 49};
43 50
44static struct __initdata platform_device omap15xx_mpu_gpio = { 51static struct __initdata platform_device omap15xx_mpu_gpio = {
@@ -64,10 +71,17 @@ static struct __initdata resource omap15xx_gpio_resources[] = {
64 }, 71 },
65}; 72};
66 73
74static struct omap_gpio_reg_offs omap15xx_gpio_regs = {
75 .direction = OMAP1510_GPIO_DIR_CONTROL,
76 .datain = OMAP1510_GPIO_DATA_INPUT,
77 .dataout = OMAP1510_GPIO_DATA_OUTPUT,
78};
79
67static struct __initdata omap_gpio_platform_data omap15xx_gpio_config = { 80static struct __initdata omap_gpio_platform_data omap15xx_gpio_config = {
68 .virtual_irq_start = IH_GPIO_BASE, 81 .virtual_irq_start = IH_GPIO_BASE,
69 .bank_type = METHOD_GPIO_1510, 82 .bank_type = METHOD_GPIO_1510,
70 .bank_width = 16, 83 .bank_width = 16,
84 .regs = &omap15xx_gpio_regs,
71}; 85};
72 86
73static struct __initdata platform_device omap15xx_gpio = { 87static struct __initdata platform_device omap15xx_gpio = {