aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2010-01-13 00:59:46 -0500
committerBen Dooks <ben-linux@fluff.org>2010-01-18 19:23:51 -0500
commitf126752043c67003de6d34b14160f87ba0323c98 (patch)
tree383f3596e6b2ed862a5eed52e560404f95aa56e9
parent0a6361316d6493b9dcbdda9a6a4586c3ccbfd008 (diff)
ARM: SAMSUNG: Add platform data registration for OHCI
Add a platform data helper for the OHCI device Signed-off-by: Ben Dooks <ben-linux@fluff.org>
-rw-r--r--arch/arm/mach-s3c2410/usb-simtec.c4
-rw-r--r--arch/arm/mach-s3c2442/mach-gta02.c5
-rw-r--r--arch/arm/plat-s3c/include/plat/usb-control.h2
-rw-r--r--arch/arm/plat-samsung/dev-usb.c21
4 files changed, 26 insertions, 6 deletions
diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c
index 199bb4ffe689..29bd3d987bec 100644
--- a/arch/arm/mach-s3c2410/usb-simtec.c
+++ b/arch/arm/mach-s3c2410/usb-simtec.c
@@ -91,7 +91,7 @@ static void usb_simtec_enableoc(struct s3c2410_hcd_info *info, int on)
91 } 91 }
92} 92}
93 93
94static struct s3c2410_hcd_info usb_simtec_info = { 94static struct s3c2410_hcd_info usb_simtec_info __initdata = {
95 .port[0] = { 95 .port[0] = {
96 .flags = S3C_HCDFLG_USED 96 .flags = S3C_HCDFLG_USED
97 }, 97 },
@@ -127,6 +127,6 @@ int usb_simtec_init(void)
127 gpio_direction_output(S3C2410_GPB(4), 1); 127 gpio_direction_output(S3C2410_GPB(4), 1);
128 gpio_direction_input(S3C2410_GPG(10)); 128 gpio_direction_input(S3C2410_GPG(10));
129 129
130 s3c_device_ohci.dev.platform_data = &usb_simtec_info; 130 s3c_ohci_set_platdata(&usb_simtec_info);
131 return 0; 131 return 0;
132} 132}
diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c
index 825800bf5506..45799c608d8f 100644
--- a/arch/arm/mach-s3c2442/mach-gta02.c
+++ b/arch/arm/mach-s3c2442/mach-gta02.c
@@ -544,7 +544,7 @@ static struct platform_device gta02_bl_dev = {
544 544
545 545
546/* USB */ 546/* USB */
547static struct s3c2410_hcd_info gta02_usb_info = { 547static struct s3c2410_hcd_info gta02_usb_info __initdata = {
548 .port[0] = { 548 .port[0] = {
549 .flags = S3C_HCDFLG_USED, 549 .flags = S3C_HCDFLG_USED,
550 }, 550 },
@@ -623,9 +623,8 @@ static void __init gta02_machine_init(void)
623 INIT_DELAYED_WORK(&gta02_charger_work, gta02_charger_worker); 623 INIT_DELAYED_WORK(&gta02_charger_work, gta02_charger_worker);
624#endif 624#endif
625 625
626 s3c_device_ohci.dev.platform_data = &gta02_usb_info;
627
628 s3c24xx_udc_set_platdata(&gta02_udc_cfg); 626 s3c24xx_udc_set_platdata(&gta02_udc_cfg);
627 s3c_ohci_set_platdata(&gta02_usb_info);
629 s3c_nand_set_platdata(&gta02_nand_info); 628 s3c_nand_set_platdata(&gta02_nand_info);
630 s3c_i2c0_set_platdata(NULL); 629 s3c_i2c0_set_platdata(NULL);
631 630
diff --git a/arch/arm/plat-s3c/include/plat/usb-control.h b/arch/arm/plat-s3c/include/plat/usb-control.h
index 822c87fe948e..a6a57bf796bd 100644
--- a/arch/arm/plat-s3c/include/plat/usb-control.h
+++ b/arch/arm/plat-s3c/include/plat/usb-control.h
@@ -38,4 +38,6 @@ static void inline s3c2410_usb_report_oc(struct s3c2410_hcd_info *info, int port
38 } 38 }
39} 39}
40 40
41extern void s3c_ohci_set_platdata(struct s3c2410_hcd_info *info);
42
41#endif /*__ASM_ARCH_USBCONTROL_H */ 43#endif /*__ASM_ARCH_USBCONTROL_H */
diff --git a/arch/arm/plat-samsung/dev-usb.c b/arch/arm/plat-samsung/dev-usb.c
index 431ae5dfd3fb..88165657fa53 100644
--- a/arch/arm/plat-samsung/dev-usb.c
+++ b/arch/arm/plat-samsung/dev-usb.c
@@ -19,7 +19,7 @@
19#include <mach/map.h> 19#include <mach/map.h>
20 20
21#include <plat/devs.h> 21#include <plat/devs.h>
22 22#include <plat/usb-control.h>
23 23
24static struct resource s3c_usb_resource[] = { 24static struct resource s3c_usb_resource[] = {
25 [0] = { 25 [0] = {
@@ -48,3 +48,22 @@ struct platform_device s3c_device_ohci = {
48}; 48};
49 49
50EXPORT_SYMBOL(s3c_device_ohci); 50EXPORT_SYMBOL(s3c_device_ohci);
51
52/**
53 * s3c_ohci_set_platdata - initialise OHCI device platform data
54 * @info: The platform data.
55 *
56 * This call copies the @info passed in and sets the device .platform_data
57 * field to that copy. The @info is copied so that the original can be marked
58 * __initdata.
59 */
60void __init s3c_ohci_set_platdata(struct s3c2410_hcd_info *info)
61{
62 struct s3c2410_hcd_info *npd;
63
64 npd = kmemdup(info, sizeof(struct s3c2410_hcd_info), GFP_KERNEL);
65 if (!npd)
66 printk(KERN_ERR "%s: no memory for platform data\n", __func__);
67
68 s3c_device_ohci.dev.platform_data = npd;
69}