diff options
author | Tony Lindgren <tony@atomide.com> | 2012-01-20 08:31:52 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2012-01-20 08:31:52 -0500 |
commit | 967809bd7faf71ddc29c8081e0f21db8b201a0f4 (patch) | |
tree | 256bcce2b13a45b573b02ef73dcebe1f08a03593 /drivers | |
parent | dcd6c92267155e70a94b3927bce681ce74b80d1f (diff) | |
parent | 8d09a1bb3147ddbcf0a9483021ca699c54c54732 (diff) |
Merge branch 'omap1-part2' into omap1
Conflicts:
drivers/leds/leds-ams-delta.c
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/input/serio/ams_delta_serio.c | 54 | ||||
-rw-r--r-- | drivers/leds/Kconfig | 7 | ||||
-rw-r--r-- | drivers/leds/Makefile | 1 | ||||
-rw-r--r-- | drivers/leds/leds-ams-delta.c | 126 | ||||
-rw-r--r-- | drivers/mtd/nand/ams-delta.c | 74 | ||||
-rw-r--r-- | drivers/video/omap/lcd_ams_delta.c | 27 |
6 files changed, 106 insertions, 183 deletions
diff --git a/drivers/input/serio/ams_delta_serio.c b/drivers/input/serio/ams_delta_serio.c index d4d08bd9205b..0571e2ec358b 100644 --- a/drivers/input/serio/ams_delta_serio.c +++ b/drivers/input/serio/ams_delta_serio.c | |||
@@ -92,8 +92,7 @@ static irqreturn_t ams_delta_serio_interrupt(int irq, void *dev_id) | |||
92 | static int ams_delta_serio_open(struct serio *serio) | 92 | static int ams_delta_serio_open(struct serio *serio) |
93 | { | 93 | { |
94 | /* enable keyboard */ | 94 | /* enable keyboard */ |
95 | ams_delta_latch2_write(AMD_DELTA_LATCH2_KEYBRD_PWR, | 95 | gpio_set_value(AMS_DELTA_GPIO_PIN_KEYBRD_PWR, 1); |
96 | AMD_DELTA_LATCH2_KEYBRD_PWR); | ||
97 | 96 | ||
98 | return 0; | 97 | return 0; |
99 | } | 98 | } |
@@ -101,9 +100,32 @@ static int ams_delta_serio_open(struct serio *serio) | |||
101 | static void ams_delta_serio_close(struct serio *serio) | 100 | static void ams_delta_serio_close(struct serio *serio) |
102 | { | 101 | { |
103 | /* disable keyboard */ | 102 | /* disable keyboard */ |
104 | ams_delta_latch2_write(AMD_DELTA_LATCH2_KEYBRD_PWR, 0); | 103 | gpio_set_value(AMS_DELTA_GPIO_PIN_KEYBRD_PWR, 0); |
105 | } | 104 | } |
106 | 105 | ||
106 | static struct gpio ams_delta_gpios[] __initconst_or_module = { | ||
107 | { | ||
108 | .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATA, | ||
109 | .flags = GPIOF_DIR_IN, | ||
110 | .label = "serio-data", | ||
111 | }, | ||
112 | { | ||
113 | .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_CLK, | ||
114 | .flags = GPIOF_DIR_IN, | ||
115 | .label = "serio-clock", | ||
116 | }, | ||
117 | { | ||
118 | .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_PWR, | ||
119 | .flags = GPIOF_OUT_INIT_LOW, | ||
120 | .label = "serio-power", | ||
121 | }, | ||
122 | { | ||
123 | .gpio = AMS_DELTA_GPIO_PIN_KEYBRD_DATAOUT, | ||
124 | .flags = GPIOF_OUT_INIT_LOW, | ||
125 | .label = "serio-dataout", | ||
126 | }, | ||
127 | }; | ||
128 | |||
107 | static int __init ams_delta_serio_init(void) | 129 | static int __init ams_delta_serio_init(void) |
108 | { | 130 | { |
109 | int err; | 131 | int err; |
@@ -123,19 +145,12 @@ static int __init ams_delta_serio_init(void) | |||
123 | strlcpy(ams_delta_serio->phys, "GPIO/serio0", | 145 | strlcpy(ams_delta_serio->phys, "GPIO/serio0", |
124 | sizeof(ams_delta_serio->phys)); | 146 | sizeof(ams_delta_serio->phys)); |
125 | 147 | ||
126 | err = gpio_request(AMS_DELTA_GPIO_PIN_KEYBRD_DATA, "serio-data"); | 148 | err = gpio_request_array(ams_delta_gpios, |
149 | ARRAY_SIZE(ams_delta_gpios)); | ||
127 | if (err) { | 150 | if (err) { |
128 | pr_err("ams_delta_serio: Couldn't request gpio pin for data\n"); | 151 | pr_err("ams_delta_serio: Couldn't request gpio pins\n"); |
129 | goto serio; | 152 | goto serio; |
130 | } | 153 | } |
131 | gpio_direction_input(AMS_DELTA_GPIO_PIN_KEYBRD_DATA); | ||
132 | |||
133 | err = gpio_request(AMS_DELTA_GPIO_PIN_KEYBRD_CLK, "serio-clock"); | ||
134 | if (err) { | ||
135 | pr_err("ams_delta_serio: couldn't request gpio pin for clock\n"); | ||
136 | goto gpio_data; | ||
137 | } | ||
138 | gpio_direction_input(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); | ||
139 | 154 | ||
140 | err = request_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), | 155 | err = request_irq(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), |
141 | ams_delta_serio_interrupt, IRQ_TYPE_EDGE_RISING, | 156 | ams_delta_serio_interrupt, IRQ_TYPE_EDGE_RISING, |
@@ -143,7 +158,7 @@ static int __init ams_delta_serio_init(void) | |||
143 | if (err < 0) { | 158 | if (err < 0) { |
144 | pr_err("ams_delta_serio: couldn't request gpio interrupt %d\n", | 159 | pr_err("ams_delta_serio: couldn't request gpio interrupt %d\n", |
145 | gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK)); | 160 | gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK)); |
146 | goto gpio_clk; | 161 | goto gpio; |
147 | } | 162 | } |
148 | /* | 163 | /* |
149 | * Since GPIO register handling for keyboard clock pin is performed | 164 | * Since GPIO register handling for keyboard clock pin is performed |
@@ -157,10 +172,9 @@ static int __init ams_delta_serio_init(void) | |||
157 | dev_info(&ams_delta_serio->dev, "%s\n", ams_delta_serio->name); | 172 | dev_info(&ams_delta_serio->dev, "%s\n", ams_delta_serio->name); |
158 | 173 | ||
159 | return 0; | 174 | return 0; |
160 | gpio_clk: | 175 | gpio: |
161 | gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); | 176 | gpio_free_array(ams_delta_gpios, |
162 | gpio_data: | 177 | ARRAY_SIZE(ams_delta_gpios)); |
163 | gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_DATA); | ||
164 | serio: | 178 | serio: |
165 | kfree(ams_delta_serio); | 179 | kfree(ams_delta_serio); |
166 | return err; | 180 | return err; |
@@ -171,7 +185,7 @@ static void __exit ams_delta_serio_exit(void) | |||
171 | { | 185 | { |
172 | serio_unregister_port(ams_delta_serio); | 186 | serio_unregister_port(ams_delta_serio); |
173 | free_irq(OMAP_GPIO_IRQ(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 0); | 187 | free_irq(OMAP_GPIO_IRQ(AMS_DELTA_GPIO_PIN_KEYBRD_CLK), 0); |
174 | gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_CLK); | 188 | gpio_free_array(ams_delta_gpios, |
175 | gpio_free(AMS_DELTA_GPIO_PIN_KEYBRD_DATA); | 189 | ARRAY_SIZE(ams_delta_gpios)); |
176 | } | 190 | } |
177 | module_exit(ams_delta_serio_exit); | 191 | module_exit(ams_delta_serio_exit); |
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index c957c344233f..5234db9d3fbf 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig | |||
@@ -74,13 +74,6 @@ config LEDS_S3C24XX | |||
74 | This option enables support for LEDs connected to GPIO lines | 74 | This option enables support for LEDs connected to GPIO lines |
75 | on Samsung S3C24XX series CPUs, such as the S3C2410 and S3C2440. | 75 | on Samsung S3C24XX series CPUs, such as the S3C2410 and S3C2440. |
76 | 76 | ||
77 | config LEDS_AMS_DELTA | ||
78 | tristate "LED Support for the Amstrad Delta (E3)" | ||
79 | depends on LEDS_CLASS | ||
80 | depends on MACH_AMS_DELTA | ||
81 | help | ||
82 | This option enables support for the LEDs on Amstrad Delta (E3). | ||
83 | |||
84 | config LEDS_NET48XX | 77 | config LEDS_NET48XX |
85 | tristate "LED Support for Soekris net48xx series Error LED" | 78 | tristate "LED Support for Soekris net48xx series Error LED" |
86 | depends on LEDS_CLASS | 79 | depends on LEDS_CLASS |
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile index b8a9723477f0..10badfc99f10 100644 --- a/drivers/leds/Makefile +++ b/drivers/leds/Makefile | |||
@@ -12,7 +12,6 @@ obj-$(CONFIG_LEDS_LOCOMO) += leds-locomo.o | |||
12 | obj-$(CONFIG_LEDS_LM3530) += leds-lm3530.o | 12 | obj-$(CONFIG_LEDS_LM3530) += leds-lm3530.o |
13 | obj-$(CONFIG_LEDS_MIKROTIK_RB532) += leds-rb532.o | 13 | obj-$(CONFIG_LEDS_MIKROTIK_RB532) += leds-rb532.o |
14 | obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o | 14 | obj-$(CONFIG_LEDS_S3C24XX) += leds-s3c24xx.o |
15 | obj-$(CONFIG_LEDS_AMS_DELTA) += leds-ams-delta.o | ||
16 | obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o | 15 | obj-$(CONFIG_LEDS_NET48XX) += leds-net48xx.o |
17 | obj-$(CONFIG_LEDS_NET5501) += leds-net5501.o | 16 | obj-$(CONFIG_LEDS_NET5501) += leds-net5501.o |
18 | obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o | 17 | obj-$(CONFIG_LEDS_WRAP) += leds-wrap.o |
diff --git a/drivers/leds/leds-ams-delta.c b/drivers/leds/leds-ams-delta.c deleted file mode 100644 index 07428357c83f..000000000000 --- a/drivers/leds/leds-ams-delta.c +++ /dev/null | |||
@@ -1,126 +0,0 @@ | |||
1 | /* | ||
2 | * LEDs driver for Amstrad Delta (E3) | ||
3 | * | ||
4 | * Copyright (C) 2006 Jonathan McDowell <noodles@earth.li> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #include <linux/module.h> | ||
12 | #include <linux/kernel.h> | ||
13 | #include <linux/init.h> | ||
14 | #include <linux/platform_device.h> | ||
15 | #include <linux/leds.h> | ||
16 | #include <plat/board-ams-delta.h> | ||
17 | |||
18 | /* | ||
19 | * Our context | ||
20 | */ | ||
21 | struct ams_delta_led { | ||
22 | struct led_classdev cdev; | ||
23 | u8 bitmask; | ||
24 | }; | ||
25 | |||
26 | static void ams_delta_led_set(struct led_classdev *led_cdev, | ||
27 | enum led_brightness value) | ||
28 | { | ||
29 | struct ams_delta_led *led_dev = | ||
30 | container_of(led_cdev, struct ams_delta_led, cdev); | ||
31 | |||
32 | if (value) | ||
33 | ams_delta_latch1_write(led_dev->bitmask, led_dev->bitmask); | ||
34 | else | ||
35 | ams_delta_latch1_write(led_dev->bitmask, 0); | ||
36 | } | ||
37 | |||
38 | static struct ams_delta_led ams_delta_leds[] = { | ||
39 | { | ||
40 | .cdev = { | ||
41 | .name = "ams-delta::camera", | ||
42 | .brightness_set = ams_delta_led_set, | ||
43 | }, | ||
44 | .bitmask = AMS_DELTA_LATCH1_LED_CAMERA, | ||
45 | }, | ||
46 | { | ||
47 | .cdev = { | ||
48 | .name = "ams-delta::advert", | ||
49 | .brightness_set = ams_delta_led_set, | ||
50 | }, | ||
51 | .bitmask = AMS_DELTA_LATCH1_LED_ADVERT, | ||
52 | }, | ||
53 | { | ||
54 | .cdev = { | ||
55 | .name = "ams-delta::email", | ||
56 | .brightness_set = ams_delta_led_set, | ||
57 | }, | ||
58 | .bitmask = AMS_DELTA_LATCH1_LED_EMAIL, | ||
59 | }, | ||
60 | { | ||
61 | .cdev = { | ||
62 | .name = "ams-delta::handsfree", | ||
63 | .brightness_set = ams_delta_led_set, | ||
64 | }, | ||
65 | .bitmask = AMS_DELTA_LATCH1_LED_HANDSFREE, | ||
66 | }, | ||
67 | { | ||
68 | .cdev = { | ||
69 | .name = "ams-delta::voicemail", | ||
70 | .brightness_set = ams_delta_led_set, | ||
71 | }, | ||
72 | .bitmask = AMS_DELTA_LATCH1_LED_VOICEMAIL, | ||
73 | }, | ||
74 | { | ||
75 | .cdev = { | ||
76 | .name = "ams-delta::voice", | ||
77 | .brightness_set = ams_delta_led_set, | ||
78 | }, | ||
79 | .bitmask = AMS_DELTA_LATCH1_LED_VOICE, | ||
80 | }, | ||
81 | }; | ||
82 | |||
83 | static int ams_delta_led_probe(struct platform_device *pdev) | ||
84 | { | ||
85 | int i, ret; | ||
86 | |||
87 | for (i = 0; i < ARRAY_SIZE(ams_delta_leds); i++) { | ||
88 | ams_delta_leds[i].cdev.flags |= LED_CORE_SUSPENDRESUME; | ||
89 | ret = led_classdev_register(&pdev->dev, | ||
90 | &ams_delta_leds[i].cdev); | ||
91 | if (ret < 0) | ||
92 | goto fail; | ||
93 | } | ||
94 | |||
95 | return 0; | ||
96 | fail: | ||
97 | while (--i >= 0) | ||
98 | led_classdev_unregister(&ams_delta_leds[i].cdev); | ||
99 | return ret; | ||
100 | } | ||
101 | |||
102 | static int ams_delta_led_remove(struct platform_device *pdev) | ||
103 | { | ||
104 | int i; | ||
105 | |||
106 | for (i = 0; i < ARRAY_SIZE(ams_delta_leds); i++) | ||
107 | led_classdev_unregister(&ams_delta_leds[i].cdev); | ||
108 | |||
109 | return 0; | ||
110 | } | ||
111 | |||
112 | static struct platform_driver ams_delta_led_driver = { | ||
113 | .probe = ams_delta_led_probe, | ||
114 | .remove = ams_delta_led_remove, | ||
115 | .driver = { | ||
116 | .name = "ams-delta-led", | ||
117 | .owner = THIS_MODULE, | ||
118 | }, | ||
119 | }; | ||
120 | |||
121 | module_platform_driver(ams_delta_led_driver); | ||
122 | |||
123 | MODULE_AUTHOR("Jonathan McDowell <noodles@earth.li>"); | ||
124 | MODULE_DESCRIPTION("Amstrad Delta LED driver"); | ||
125 | MODULE_LICENSE("GPL"); | ||
126 | MODULE_ALIAS("platform:ams-delta-led"); | ||
diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c index 3197e9764fcd..85934dc8546f 100644 --- a/drivers/mtd/nand/ams-delta.c +++ b/drivers/mtd/nand/ams-delta.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include <asm/io.h> | 26 | #include <asm/io.h> |
27 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
28 | #include <asm/sizes.h> | 28 | #include <asm/sizes.h> |
29 | #include <asm/gpio.h> | 29 | #include <linux/gpio.h> |
30 | #include <plat/board-ams-delta.h> | 30 | #include <plat/board-ams-delta.h> |
31 | 31 | ||
32 | /* | 32 | /* |
@@ -34,8 +34,6 @@ | |||
34 | */ | 34 | */ |
35 | static struct mtd_info *ams_delta_mtd = NULL; | 35 | static struct mtd_info *ams_delta_mtd = NULL; |
36 | 36 | ||
37 | #define NAND_MASK (AMS_DELTA_LATCH2_NAND_NRE | AMS_DELTA_LATCH2_NAND_NWE | AMS_DELTA_LATCH2_NAND_CLE | AMS_DELTA_LATCH2_NAND_ALE | AMS_DELTA_LATCH2_NAND_NCE | AMS_DELTA_LATCH2_NAND_NWP) | ||
38 | |||
39 | /* | 37 | /* |
40 | * Define partitions for flash devices | 38 | * Define partitions for flash devices |
41 | */ | 39 | */ |
@@ -68,10 +66,9 @@ static void ams_delta_write_byte(struct mtd_info *mtd, u_char byte) | |||
68 | 66 | ||
69 | writew(0, io_base + OMAP_MPUIO_IO_CNTL); | 67 | writew(0, io_base + OMAP_MPUIO_IO_CNTL); |
70 | writew(byte, this->IO_ADDR_W); | 68 | writew(byte, this->IO_ADDR_W); |
71 | ams_delta_latch2_write(AMS_DELTA_LATCH2_NAND_NWE, 0); | 69 | gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NWE, 0); |
72 | ndelay(40); | 70 | ndelay(40); |
73 | ams_delta_latch2_write(AMS_DELTA_LATCH2_NAND_NWE, | 71 | gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NWE, 1); |
74 | AMS_DELTA_LATCH2_NAND_NWE); | ||
75 | } | 72 | } |
76 | 73 | ||
77 | static u_char ams_delta_read_byte(struct mtd_info *mtd) | 74 | static u_char ams_delta_read_byte(struct mtd_info *mtd) |
@@ -80,12 +77,11 @@ static u_char ams_delta_read_byte(struct mtd_info *mtd) | |||
80 | struct nand_chip *this = mtd->priv; | 77 | struct nand_chip *this = mtd->priv; |
81 | void __iomem *io_base = this->priv; | 78 | void __iomem *io_base = this->priv; |
82 | 79 | ||
83 | ams_delta_latch2_write(AMS_DELTA_LATCH2_NAND_NRE, 0); | 80 | gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NRE, 0); |
84 | ndelay(40); | 81 | ndelay(40); |
85 | writew(~0, io_base + OMAP_MPUIO_IO_CNTL); | 82 | writew(~0, io_base + OMAP_MPUIO_IO_CNTL); |
86 | res = readw(this->IO_ADDR_R); | 83 | res = readw(this->IO_ADDR_R); |
87 | ams_delta_latch2_write(AMS_DELTA_LATCH2_NAND_NRE, | 84 | gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NRE, 1); |
88 | AMS_DELTA_LATCH2_NAND_NRE); | ||
89 | 85 | ||
90 | return res; | 86 | return res; |
91 | } | 87 | } |
@@ -132,15 +128,12 @@ static void ams_delta_hwcontrol(struct mtd_info *mtd, int cmd, | |||
132 | { | 128 | { |
133 | 129 | ||
134 | if (ctrl & NAND_CTRL_CHANGE) { | 130 | if (ctrl & NAND_CTRL_CHANGE) { |
135 | unsigned long bits; | 131 | gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_NCE, |
136 | 132 | (ctrl & NAND_NCE) == 0); | |
137 | bits = (~ctrl & NAND_NCE) ? AMS_DELTA_LATCH2_NAND_NCE : 0; | 133 | gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_CLE, |
138 | bits |= (ctrl & NAND_CLE) ? AMS_DELTA_LATCH2_NAND_CLE : 0; | 134 | (ctrl & NAND_CLE) != 0); |
139 | bits |= (ctrl & NAND_ALE) ? AMS_DELTA_LATCH2_NAND_ALE : 0; | 135 | gpio_set_value(AMS_DELTA_GPIO_PIN_NAND_ALE, |
140 | 136 | (ctrl & NAND_ALE) != 0); | |
141 | ams_delta_latch2_write(AMS_DELTA_LATCH2_NAND_CLE | | ||
142 | AMS_DELTA_LATCH2_NAND_ALE | | ||
143 | AMS_DELTA_LATCH2_NAND_NCE, bits); | ||
144 | } | 137 | } |
145 | 138 | ||
146 | if (cmd != NAND_CMD_NONE) | 139 | if (cmd != NAND_CMD_NONE) |
@@ -152,6 +145,39 @@ static int ams_delta_nand_ready(struct mtd_info *mtd) | |||
152 | return gpio_get_value(AMS_DELTA_GPIO_PIN_NAND_RB); | 145 | return gpio_get_value(AMS_DELTA_GPIO_PIN_NAND_RB); |
153 | } | 146 | } |
154 | 147 | ||
148 | static struct gpio _mandatory_gpio[] __initconst_or_module = { | ||
149 | { | ||
150 | .gpio = AMS_DELTA_GPIO_PIN_NAND_NCE, | ||
151 | .flags = GPIOF_OUT_INIT_HIGH, | ||
152 | .label = "nand_nce", | ||
153 | }, | ||
154 | { | ||
155 | .gpio = AMS_DELTA_GPIO_PIN_NAND_NRE, | ||
156 | .flags = GPIOF_OUT_INIT_HIGH, | ||
157 | .label = "nand_nre", | ||
158 | }, | ||
159 | { | ||
160 | .gpio = AMS_DELTA_GPIO_PIN_NAND_NWP, | ||
161 | .flags = GPIOF_OUT_INIT_HIGH, | ||
162 | .label = "nand_nwp", | ||
163 | }, | ||
164 | { | ||
165 | .gpio = AMS_DELTA_GPIO_PIN_NAND_NWE, | ||
166 | .flags = GPIOF_OUT_INIT_HIGH, | ||
167 | .label = "nand_nwe", | ||
168 | }, | ||
169 | { | ||
170 | .gpio = AMS_DELTA_GPIO_PIN_NAND_ALE, | ||
171 | .flags = GPIOF_OUT_INIT_LOW, | ||
172 | .label = "nand_ale", | ||
173 | }, | ||
174 | { | ||
175 | .gpio = AMS_DELTA_GPIO_PIN_NAND_CLE, | ||
176 | .flags = GPIOF_OUT_INIT_LOW, | ||
177 | .label = "nand_cle", | ||
178 | }, | ||
179 | }; | ||
180 | |||
155 | /* | 181 | /* |
156 | * Main initialization routine | 182 | * Main initialization routine |
157 | */ | 183 | */ |
@@ -223,10 +249,9 @@ static int __devinit ams_delta_init(struct platform_device *pdev) | |||
223 | platform_set_drvdata(pdev, io_base); | 249 | platform_set_drvdata(pdev, io_base); |
224 | 250 | ||
225 | /* Set chip enabled, but */ | 251 | /* Set chip enabled, but */ |
226 | ams_delta_latch2_write(NAND_MASK, AMS_DELTA_LATCH2_NAND_NRE | | 252 | err = gpio_request_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio)); |
227 | AMS_DELTA_LATCH2_NAND_NWE | | 253 | if (err) |
228 | AMS_DELTA_LATCH2_NAND_NCE | | 254 | goto out_gpio; |
229 | AMS_DELTA_LATCH2_NAND_NWP); | ||
230 | 255 | ||
231 | /* Scan to find existence of the device */ | 256 | /* Scan to find existence of the device */ |
232 | if (nand_scan(ams_delta_mtd, 1)) { | 257 | if (nand_scan(ams_delta_mtd, 1)) { |
@@ -241,7 +266,10 @@ static int __devinit ams_delta_init(struct platform_device *pdev) | |||
241 | goto out; | 266 | goto out; |
242 | 267 | ||
243 | out_mtd: | 268 | out_mtd: |
269 | gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio)); | ||
270 | out_gpio: | ||
244 | platform_set_drvdata(pdev, NULL); | 271 | platform_set_drvdata(pdev, NULL); |
272 | gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); | ||
245 | iounmap(io_base); | 273 | iounmap(io_base); |
246 | out_release_io: | 274 | out_release_io: |
247 | release_mem_region(res->start, resource_size(res)); | 275 | release_mem_region(res->start, resource_size(res)); |
@@ -262,6 +290,8 @@ static int __devexit ams_delta_cleanup(struct platform_device *pdev) | |||
262 | /* Release resources, unregister device */ | 290 | /* Release resources, unregister device */ |
263 | nand_release(ams_delta_mtd); | 291 | nand_release(ams_delta_mtd); |
264 | 292 | ||
293 | gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio)); | ||
294 | gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); | ||
265 | iounmap(io_base); | 295 | iounmap(io_base); |
266 | release_mem_region(res->start, resource_size(res)); | 296 | release_mem_region(res->start, resource_size(res)); |
267 | 297 | ||
diff --git a/drivers/video/omap/lcd_ams_delta.c b/drivers/video/omap/lcd_ams_delta.c index 0fdd6f6873bf..0e71e2898b18 100644 --- a/drivers/video/omap/lcd_ams_delta.c +++ b/drivers/video/omap/lcd_ams_delta.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/delay.h> | 26 | #include <linux/delay.h> |
27 | #include <linux/lcd.h> | 27 | #include <linux/lcd.h> |
28 | #include <linux/gpio.h> | ||
28 | 29 | ||
29 | #include <plat/board-ams-delta.h> | 30 | #include <plat/board-ams-delta.h> |
30 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
@@ -98,29 +99,41 @@ static struct lcd_ops ams_delta_lcd_ops = { | |||
98 | 99 | ||
99 | /* omapfb panel section */ | 100 | /* omapfb panel section */ |
100 | 101 | ||
102 | static struct gpio _gpios[] __initconst_or_module = { | ||
103 | { | ||
104 | .gpio = AMS_DELTA_GPIO_PIN_LCD_VBLEN, | ||
105 | .flags = GPIOF_OUT_INIT_LOW, | ||
106 | .label = "lcd_vblen", | ||
107 | }, | ||
108 | { | ||
109 | .gpio = AMS_DELTA_GPIO_PIN_LCD_NDISP, | ||
110 | .flags = GPIOF_OUT_INIT_LOW, | ||
111 | .label = "lcd_ndisp", | ||
112 | }, | ||
113 | }; | ||
114 | |||
101 | static int ams_delta_panel_init(struct lcd_panel *panel, | 115 | static int ams_delta_panel_init(struct lcd_panel *panel, |
102 | struct omapfb_device *fbdev) | 116 | struct omapfb_device *fbdev) |
103 | { | 117 | { |
104 | return 0; | 118 | return gpio_request_array(_gpios, ARRAY_SIZE(_gpios)); |
105 | } | 119 | } |
106 | 120 | ||
107 | static void ams_delta_panel_cleanup(struct lcd_panel *panel) | 121 | static void ams_delta_panel_cleanup(struct lcd_panel *panel) |
108 | { | 122 | { |
123 | gpio_free_array(_gpios, ARRAY_SIZE(_gpios)); | ||
109 | } | 124 | } |
110 | 125 | ||
111 | static int ams_delta_panel_enable(struct lcd_panel *panel) | 126 | static int ams_delta_panel_enable(struct lcd_panel *panel) |
112 | { | 127 | { |
113 | ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP, | 128 | gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 1); |
114 | AMS_DELTA_LATCH2_LCD_NDISP); | 129 | gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_VBLEN, 1); |
115 | ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN, | ||
116 | AMS_DELTA_LATCH2_LCD_VBLEN); | ||
117 | return 0; | 130 | return 0; |
118 | } | 131 | } |
119 | 132 | ||
120 | static void ams_delta_panel_disable(struct lcd_panel *panel) | 133 | static void ams_delta_panel_disable(struct lcd_panel *panel) |
121 | { | 134 | { |
122 | ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_VBLEN, 0); | 135 | gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_VBLEN, 0); |
123 | ams_delta_latch2_write(AMS_DELTA_LATCH2_LCD_NDISP, 0); | 136 | gpio_set_value(AMS_DELTA_GPIO_PIN_LCD_NDISP, 0); |
124 | } | 137 | } |
125 | 138 | ||
126 | static unsigned long ams_delta_panel_get_caps(struct lcd_panel *panel) | 139 | static unsigned long ams_delta_panel_get_caps(struct lcd_panel *panel) |