diff options
author | Ben Dooks <ben-linux@fluff.org> | 2005-08-10 11:45:14 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-08-10 11:45:14 -0400 |
commit | 484ae6bd9506488089c33784eff35b190fa80e03 (patch) | |
tree | 389ab376598b97db693d8a8f468ecdb174a0a881 /arch/arm/mach-s3c2410/usb-simtec.c | |
parent | c59d071d4a32e1c45cac6d47f5b59ec36a9a997b (diff) |
[PATCH] ARM: 2849/1: S3C24XX - USB host update (2848/1)
Patch from Ben Dooks
Rename the s3c2410_report_oc() to s3c2410_usb_report_oc()
as this is an usb specific function.
Change port power on the usb-simtec implementation to only
power up the output if both are set, as per the usb 1.1
specification
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-s3c2410/usb-simtec.c')
-rw-r--r-- | arch/arm/mach-s3c2410/usb-simtec.c | 18 |
1 files changed, 13 insertions, 5 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 | ||
52 | static unsigned int power_state[2]; | ||
53 | |||
50 | static void | 54 | static void |
51 | usb_simtec_powercontrol(int port, int to) | 55 | usb_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 | ||
59 | static irqreturn_t | 67 | static 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; |