git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
arch
/
arm
/
mach-s3c2410
/
usb-simtec.c
diff --git
a/arch/arm/mach-s3c2410/usb-simtec.c
b/arch/arm/mach-s3c2410/usb-simtec.c
index
7f2b613
..
495f8c6
100644
(file)
--- a/
arch/arm/mach-s3c2410/usb-simtec.c
+++ b/
arch/arm/mach-s3c2410/usb-simtec.c
@@
-1,6
+1,6
@@
/* linux/arch/arm/mach-s3c2410/usb-simtec.c
*
/* linux/arch/arm/mach-s3c2410/usb-simtec.c
*
- * Copyright (c) 2004 Simtec Electronics
+ * Copyright (c) 2004
,2005
Simtec Electronics
* Ben Dooks <ben@simtec.co.uk>
*
* http://www.simtec.co.uk/products/EB2410ITX/
* Ben Dooks <ben@simtec.co.uk>
*
* http://www.simtec.co.uk/products/EB2410ITX/
@@
-14,6
+14,8
@@
* Modifications:
* 14-Sep-2004 BJD Created
* 18-Oct-2004 BJD Cleanups, and added code to report OC cleared
* Modifications:
* 14-Sep-2004 BJD Created
* 18-Oct-2004 BJD Cleanups, and added code to report OC cleared
+ * 09-Aug-2005 BJD Renamed s3c2410_report_oc to s3c2410_usb_report_oc
+ * 09-Aug-2005 BJD Ports powered only if both are enabled
*/
#define DEBUG
*/
#define DEBUG
@@
-38,7
+40,6
@@
#include <asm/hardware.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/hardware.h>
#include <asm/io.h>
#include <asm/irq.h>
-#include <asm/mach-types.h>
#include "devs.h"
#include "usb-simtec.h"
#include "devs.h"
#include "usb-simtec.h"
@@
-47,13
+48,19
@@
* designed boards.
*/
* designed boards.
*/
+static unsigned int power_state[2];
+
static void
usb_simtec_powercontrol(int port, int to)
{
pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to);
static void
usb_simtec_powercontrol(int port, int to)
{
pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to);
- if (port == 1)
- s3c2410_gpio_setpin(S3C2410_GPB4, to ? 0:1);
+ power_state[port] = to;
+
+ if (power_state[0] && power_state[1])
+ s3c2410_gpio_setpin(S3C2410_GPB4, 0);
+ else
+ s3c2410_gpio_setpin(S3C2410_GPB4, 1);
}
static irqreturn_t
}
static irqreturn_t
@@
-63,10
+70,10
@@
usb_simtec_ocirq(int irq, void *pw, struct pt_regs *regs)
if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) {
pr_debug("usb_simtec: over-current irq (oc detected)\n");
if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) {
pr_debug("usb_simtec: over-current irq (oc detected)\n");
- s3c2410_report_oc(info, 3);
+ s3c2410_
usb_
report_oc(info, 3);
} else {
pr_debug("usb_simtec: over-current irq (oc cleared)\n");
} else {
pr_debug("usb_simtec: over-current irq (oc cleared)\n");
- s3c2410_report_oc(info, 0);
+ s3c2410_
usb_
report_oc(info, 0);
}
return IRQ_HANDLED;
}
return IRQ_HANDLED;
@@
-77,13
+84,13
@@
static void usb_simtec_enableoc(struct s3c2410_hcd_info *info, int on)
int ret;
if (on) {
int ret;
if (on) {
- ret = request_irq(IRQ_USBOC, usb_simtec_ocirq, SA_INTERRUPT,
+ ret = request_irq(IRQ_USBOC, usb_simtec_ocirq,
+ SA_INTERRUPT | SA_TRIGGER_RISING |
+ SA_TRIGGER_FALLING,
"USB Over-current", info);
if (ret != 0) {
printk(KERN_ERR "failed to request usb oc irq\n");
}
"USB Over-current", info);
if (ret != 0) {
printk(KERN_ERR "failed to request usb oc irq\n");
}
-
- set_irq_type(IRQ_USBOC, IRQT_BOTHEDGE);
} else {
free_irq(IRQ_USBOC, info);
}
} else {
free_irq(IRQ_USBOC, info);
}