aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-s3c2410/usb-simtec.c18
-rw-r--r--include/asm-arm/arch-s3c2410/usb-control.h3
2 files changed, 15 insertions, 6 deletions
diff --git a/arch/arm/mach-s3c2410/usb-simtec.c b/arch/arm/mach-s3c2410/usb-simtec.c
index 7f2b61362976..f021fd82be52 100644
--- a/arch/arm/mach-s3c2410/usb-simtec.c
+++ b/arch/arm/mach-s3c2410/usb-simtec.c
@@ -1,6 +1,6 @@
1/* linux/arch/arm/mach-s3c2410/usb-simtec.c 1/* linux/arch/arm/mach-s3c2410/usb-simtec.c
2 * 2 *
3 * Copyright (c) 2004 Simtec Electronics 3 * Copyright (c) 2004,2005 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk> 4 * Ben Dooks <ben@simtec.co.uk>
5 * 5 *
6 * http://www.simtec.co.uk/products/EB2410ITX/ 6 * http://www.simtec.co.uk/products/EB2410ITX/
@@ -14,6 +14,8 @@
14 * Modifications: 14 * Modifications:
15 * 14-Sep-2004 BJD Created 15 * 14-Sep-2004 BJD Created
16 * 18-Oct-2004 BJD Cleanups, and added code to report OC cleared 16 * 18-Oct-2004 BJD Cleanups, and added code to report OC cleared
17 * 09-Aug-2005 BJD Renamed s3c2410_report_oc to s3c2410_usb_report_oc
18 * 09-Aug-2005 BJD Ports powered only if both are enabled
17*/ 19*/
18 20
19#define DEBUG 21#define DEBUG
@@ -47,13 +49,19 @@
47 * designed boards. 49 * designed boards.
48*/ 50*/
49 51
52static unsigned int power_state[2];
53
50static void 54static void
51usb_simtec_powercontrol(int port, int to) 55usb_simtec_powercontrol(int port, int to)
52{ 56{
53 pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to); 57 pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to);
54 58
55 if (port == 1) 59 power_state[port] = to;
56 s3c2410_gpio_setpin(S3C2410_GPB4, to ? 0:1); 60
61 if (power_state[0] && power_state[1])
62 s3c2410_gpio_setpin(S3C2410_GPB4, 0);
63 else
64 s3c2410_gpio_setpin(S3C2410_GPB4, 1);
57} 65}
58 66
59static irqreturn_t 67static irqreturn_t
@@ -63,10 +71,10 @@ usb_simtec_ocirq(int irq, void *pw, struct pt_regs *regs)
63 71
64 if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) { 72 if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) {
65 pr_debug("usb_simtec: over-current irq (oc detected)\n"); 73 pr_debug("usb_simtec: over-current irq (oc detected)\n");
66 s3c2410_report_oc(info, 3); 74 s3c2410_usb_report_oc(info, 3);
67 } else { 75 } else {
68 pr_debug("usb_simtec: over-current irq (oc cleared)\n"); 76 pr_debug("usb_simtec: over-current irq (oc cleared)\n");
69 s3c2410_report_oc(info, 0); 77 s3c2410_usb_report_oc(info, 0);
70 } 78 }
71 79
72 return IRQ_HANDLED; 80 return IRQ_HANDLED;
diff --git a/include/asm-arm/arch-s3c2410/usb-control.h b/include/asm-arm/arch-s3c2410/usb-control.h
index 1cc85a096b23..bd43b566db3e 100644
--- a/include/asm-arm/arch-s3c2410/usb-control.h
+++ b/include/asm-arm/arch-s3c2410/usb-control.h
@@ -12,6 +12,7 @@
12 * Changelog: 12 * Changelog:
13 * 11-Sep-2004 BJD Created file 13 * 11-Sep-2004 BJD Created file
14 * 21-Sep-2004 BJD Updated port info 14 * 21-Sep-2004 BJD Updated port info
15 * 09-Aug-2005 BJD Renamed s3c2410_report_oc s3c2410_usb_report_oc
15*/ 16*/
16 17
17#ifndef __ASM_ARCH_USBCONTROL_H 18#ifndef __ASM_ARCH_USBCONTROL_H
@@ -35,7 +36,7 @@ struct s3c2410_hcd_info {
35 void (*report_oc)(struct s3c2410_hcd_info *, int ports); 36 void (*report_oc)(struct s3c2410_hcd_info *, int ports);
36}; 37};
37 38
38static void inline s3c2410_report_oc(struct s3c2410_hcd_info *info, int ports) 39static void inline s3c2410_usb_report_oc(struct s3c2410_hcd_info *info, int ports)
39{ 40{
40 if (info->report_oc != NULL) { 41 if (info->report_oc != NULL) {
41 (info->report_oc)(info, ports); 42 (info->report_oc)(info, ports);