提交 484ae6bd 编写于 作者: B Ben Dooks 提交者: Russell King

[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: NBen Dooks <ben-linux@fluff.org>
Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
上级 c59d071d
/* 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> * Ben Dooks <ben@simtec.co.uk>
* *
* http://www.simtec.co.uk/products/EB2410ITX/ * http://www.simtec.co.uk/products/EB2410ITX/
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
* Modifications: * Modifications:
* 14-Sep-2004 BJD Created * 14-Sep-2004 BJD Created
* 18-Oct-2004 BJD Cleanups, and added code to report OC cleared * 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
...@@ -47,13 +49,19 @@ ...@@ -47,13 +49,19 @@
* designed boards. * designed boards.
*/ */
static unsigned int power_state[2];
static void static void
usb_simtec_powercontrol(int port, int to) usb_simtec_powercontrol(int port, int to)
{ {
pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to); pr_debug("usb_simtec_powercontrol(%d,%d)\n", port, to);
if (port == 1) power_state[port] = to;
s3c2410_gpio_setpin(S3C2410_GPB4, to ? 0:1);
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 +71,10 @@ usb_simtec_ocirq(int irq, void *pw, struct pt_regs *regs) ...@@ -63,10 +71,10 @@ usb_simtec_ocirq(int irq, void *pw, struct pt_regs *regs)
if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) { if (s3c2410_gpio_getpin(S3C2410_GPG10) == 0) {
pr_debug("usb_simtec: over-current irq (oc detected)\n"); pr_debug("usb_simtec: over-current irq (oc detected)\n");
s3c2410_report_oc(info, 3); s3c2410_usb_report_oc(info, 3);
} else { } else {
pr_debug("usb_simtec: over-current irq (oc cleared)\n"); 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;
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
* Changelog: * Changelog:
* 11-Sep-2004 BJD Created file * 11-Sep-2004 BJD Created file
* 21-Sep-2004 BJD Updated port info * 21-Sep-2004 BJD Updated port info
* 09-Aug-2005 BJD Renamed s3c2410_report_oc s3c2410_usb_report_oc
*/ */
#ifndef __ASM_ARCH_USBCONTROL_H #ifndef __ASM_ARCH_USBCONTROL_H
...@@ -35,7 +36,7 @@ struct s3c2410_hcd_info { ...@@ -35,7 +36,7 @@ struct s3c2410_hcd_info {
void (*report_oc)(struct s3c2410_hcd_info *, int ports); void (*report_oc)(struct s3c2410_hcd_info *, int ports);
}; };
static void inline s3c2410_report_oc(struct s3c2410_hcd_info *info, int ports) static void inline s3c2410_usb_report_oc(struct s3c2410_hcd_info *info, int ports)
{ {
if (info->report_oc != NULL) { if (info->report_oc != NULL) {
(info->report_oc)(info, ports); (info->report_oc)(info, ports);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册