diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2009-06-10 17:40:55 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-06-10 17:41:06 -0400 |
commit | 547c32aeb5a24178ef20488ae0508efcc32ae8e4 (patch) | |
tree | fdc33154820cfddc845cef2f67380dace655b28f /arch/arm/mach-s3c2410/usb-simtec.c | |
parent | b0efb42478c81ed0ed9aa0dc444db200c32624f0 (diff) | |
parent | 99ae99533a059750c4b0f76295625b8ac5ea751a (diff) |
Merge branch for-rmk-devel of git://aeryn.fluff.org.uk/bjdooks/linux into devel
Diffstat (limited to 'arch/arm/mach-s3c2410/usb-simtec.c')
-rw-r--r-- | arch/arm/mach-s3c2410/usb-simtec.c | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c index 8331e8d97e20..6cd9377ddb82 100644 --- a/arch/arm/mach-s3c2410/usb-simtec.c +++ b/arch/arm/mach-s3c2410/usb-simtec.c | |||
@@ -18,9 +18,11 @@ | |||
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
20 | #include <linux/list.h> | 20 | #include <linux/list.h> |
21 | #include <linux/gpio.h> | ||
21 | #include <linux/timer.h> | 22 | #include <linux/timer.h> |
22 | #include <linux/init.h> | 23 | #include <linux/init.h> |
23 | #include <linux/device.h> | 24 | #include <linux/device.h> |
25 | #include <linux/gpio.h> | ||
24 | #include <linux/io.h> | 26 | #include <linux/io.h> |
25 | 27 | ||
26 | #include <asm/mach/arch.h> | 28 | #include <asm/mach/arch.h> |
@@ -29,7 +31,6 @@ | |||
29 | 31 | ||
30 | #include <mach/bast-map.h> | 32 | #include <mach/bast-map.h> |
31 | #include <mach/bast-irq.h> | 33 | #include <mach/bast-irq.h> |
32 | #include <mach/regs-gpio.h> | ||
33 | 34 | ||
34 | #include <mach/hardware.h> | 35 | #include <mach/hardware.h> |
35 | #include <asm/irq.h> | 36 | #include <asm/irq.h> |
@@ -53,9 +54,9 @@ usb_simtec_powercontrol(int port, int to) | |||
53 | power_state[port] = to; | 54 | power_state[port] = to; |
54 | 55 | ||
55 | if (power_state[0] && power_state[1]) | 56 | if (power_state[0] && power_state[1]) |
56 | s3c2410_gpio_setpin(S3C2410_GPB4, 0); | 57 | gpio_set_value(S3C2410_GPB(4), 0); |
57 | else | 58 | else |
58 | s3c2410_gpio_setpin(S3C2410_GPB4, 1); | 59 | gpio_set_value(S3C2410_GPB(4), 1); |
59 | } | 60 | } |
60 | 61 | ||
61 | static irqreturn_t | 62 | static irqreturn_t |
@@ -63,7 +64,7 @@ usb_simtec_ocirq(int irq, void *pw) | |||
63 | { | 64 | { |
64 | struct s3c2410_hcd_info *info = pw; | 65 | struct s3c2410_hcd_info *info = pw; |
65 | 66 | ||
66 | if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) { | 67 | if (gpio_get_value(S3C2410_GPG(10)) == 0) { |
67 | pr_debug("usb_simtec: over-current irq (oc detected)\n"); | 68 | pr_debug("usb_simtec: over-current irq (oc detected)\n"); |
68 | s3c2410_usb_report_oc(info, 3); | 69 | s3c2410_usb_report_oc(info, 3); |
69 | } else { | 70 | } else { |
@@ -106,10 +107,27 @@ static struct s3c2410_hcd_info usb_simtec_info = { | |||
106 | 107 | ||
107 | int usb_simtec_init(void) | 108 | int usb_simtec_init(void) |
108 | { | 109 | { |
110 | int ret; | ||
111 | |||
109 | printk("USB Power Control, (c) 2004 Simtec Electronics\n"); | 112 | printk("USB Power Control, (c) 2004 Simtec Electronics\n"); |
110 | s3c_device_usb.dev.platform_data = &usb_simtec_info; | ||
111 | 113 | ||
112 | s3c2410_gpio_cfgpin(S3C2410_GPB4, S3C2410_GPB4_OUTP); | 114 | ret = gpio_request(S3C2410_GPB(4), "USB power control"); |
113 | s3c2410_gpio_setpin(S3C2410_GPB4, 1); | 115 | if (ret < 0) { |
116 | pr_err("%s: failed to get GPB4\n", __func__); | ||
117 | return ret; | ||
118 | } | ||
119 | |||
120 | ret = gpio_request(S3C2410_GPG(10), "USB overcurrent"); | ||
121 | if (ret < 0) { | ||
122 | pr_err("%s: failed to get GPG10\n", __func__); | ||
123 | gpio_free(S3C2410_GPB(4)); | ||
124 | return ret; | ||
125 | } | ||
126 | |||
127 | /* turn power on */ | ||
128 | gpio_direction_output(S3C2410_GPB(4), 1); | ||
129 | gpio_direction_input(S3C2410_GPG(10)); | ||
130 | |||
131 | s3c_device_usb.dev.platform_data = &usb_simtec_info; | ||
114 | return 0; | 132 | return 0; |
115 | } | 133 | } |