aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap2/usb-tusb6010.c
diff options
context:
space:
mode:
authorJon Hunter <jon-hunter@ti.com>2013-02-21 14:01:47 -0500
committerJon Hunter <jon-hunter@ti.com>2013-04-01 15:53:43 -0400
commit012e338625f5ea58d2a16cf98a44779255b458ca (patch)
tree8b8b92be09b90554a85ff2e7ff14c80782dea1e1 /arch/arm/mach-omap2/usb-tusb6010.c
parent1119f3c3cee1b27f7d488510af5e96ddba438ee9 (diff)
ARM: OMAP2+: Convert TUSB to use gpmc_cs_program_settings()
Convert the OMAP2+ TUSB code to use the gpmc_cs_program_settings() function for configuring the various GPMC options instead of directly programming the CONFIG1 register. Signed-off-by: Jon Hunter <jon-hunter@ti.com> Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Diffstat (limited to 'arch/arm/mach-omap2/usb-tusb6010.c')
-rw-r--r--arch/arm/mach-omap2/usb-tusb6010.c43
1 files changed, 19 insertions, 24 deletions
diff --git a/arch/arm/mach-omap2/usb-tusb6010.c b/arch/arm/mach-omap2/usb-tusb6010.c
index faaf96dca0fa..e832bc7b8e2d 100644
--- a/arch/arm/mach-omap2/usb-tusb6010.c
+++ b/arch/arm/mach-omap2/usb-tusb6010.c
@@ -8,6 +8,7 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#include <linux/err.h>
11#include <linux/string.h> 12#include <linux/string.h>
12#include <linux/types.h> 13#include <linux/types.h>
13#include <linux/errno.h> 14#include <linux/errno.h>
@@ -27,12 +28,21 @@ static u8 async_cs, sync_cs;
27static unsigned refclk_psec; 28static unsigned refclk_psec;
28 29
29static struct gpmc_settings tusb_async = { 30static struct gpmc_settings tusb_async = {
31 .wait_on_read = true,
32 .wait_on_write = true,
33 .device_width = GPMC_DEVWIDTH_16BIT,
30 .mux_add_data = GPMC_MUX_AD, 34 .mux_add_data = GPMC_MUX_AD,
31}; 35};
32 36
33static struct gpmc_settings tusb_sync = { 37static struct gpmc_settings tusb_sync = {
38 .burst_read = true,
39 .burst_write = true,
34 .sync_read = true, 40 .sync_read = true,
35 .sync_write = true, 41 .sync_write = true,
42 .wait_on_read = true,
43 .wait_on_write = true,
44 .burst_len = GPMC_BURST_16,
45 .device_width = GPMC_DEVWIDTH_16BIT,
36 .mux_add_data = GPMC_MUX_AD, 46 .mux_add_data = GPMC_MUX_AD,
37}; 47};
38 48
@@ -168,18 +178,12 @@ tusb6010_setup_interface(struct musb_hdrc_platform_data *data,
168 return status; 178 return status;
169 } 179 }
170 tusb_resources[0].end = tusb_resources[0].start + 0x9ff; 180 tusb_resources[0].end = tusb_resources[0].start + 0x9ff;
181 tusb_async.wait_pin = waitpin;
171 async_cs = async; 182 async_cs = async;
172 gpmc_cs_write_reg(async, GPMC_CS_CONFIG1,
173 GPMC_CONFIG1_PAGE_LEN(2)
174 | GPMC_CONFIG1_WAIT_READ_MON
175 | GPMC_CONFIG1_WAIT_WRITE_MON
176 | GPMC_CONFIG1_WAIT_PIN_SEL(waitpin)
177 | GPMC_CONFIG1_READTYPE_ASYNC
178 | GPMC_CONFIG1_WRITETYPE_ASYNC
179 | GPMC_CONFIG1_DEVICESIZE_16
180 | GPMC_CONFIG1_DEVICETYPE_NOR
181 | GPMC_CONFIG1_MUXADDDATA);
182 183
184 status = gpmc_cs_program_settings(async_cs, &tusb_async);
185 if (status < 0)
186 return status;
183 187
184 /* SYNC region, primarily for DMA */ 188 /* SYNC region, primarily for DMA */
185 status = gpmc_cs_request(sync, SZ_16M, (unsigned long *) 189 status = gpmc_cs_request(sync, SZ_16M, (unsigned long *)
@@ -189,21 +193,12 @@ tusb6010_setup_interface(struct musb_hdrc_platform_data *data,
189 return status; 193 return status;
190 } 194 }
191 tusb_resources[1].end = tusb_resources[1].start + 0x9ff; 195 tusb_resources[1].end = tusb_resources[1].start + 0x9ff;
196 tusb_sync.wait_pin = waitpin;
192 sync_cs = sync; 197 sync_cs = sync;
193 gpmc_cs_write_reg(sync, GPMC_CS_CONFIG1, 198
194 GPMC_CONFIG1_READMULTIPLE_SUPP 199 status = gpmc_cs_program_settings(sync_cs, &tusb_sync);
195 | GPMC_CONFIG1_READTYPE_SYNC 200 if (status < 0)
196 | GPMC_CONFIG1_WRITEMULTIPLE_SUPP 201 return status;
197 | GPMC_CONFIG1_WRITETYPE_SYNC
198 | GPMC_CONFIG1_PAGE_LEN(2)
199 | GPMC_CONFIG1_WAIT_READ_MON
200 | GPMC_CONFIG1_WAIT_WRITE_MON
201 | GPMC_CONFIG1_WAIT_PIN_SEL(waitpin)
202 | GPMC_CONFIG1_DEVICESIZE_16
203 | GPMC_CONFIG1_DEVICETYPE_NOR
204 | GPMC_CONFIG1_MUXADDDATA
205 /* fclk divider gets set later */
206 );
207 202
208 /* IRQ */ 203 /* IRQ */
209 status = gpio_request_one(irq, GPIOF_IN, "TUSB6010 irq"); 204 status = gpio_request_one(irq, GPIOF_IN, "TUSB6010 irq");