aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/r8a66597-hcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/r8a66597-hcd.c')
-rw-r--r--drivers/usb/host/r8a66597-hcd.c41
1 files changed, 32 insertions, 9 deletions
diff --git a/drivers/usb/host/r8a66597-hcd.c b/drivers/usb/host/r8a66597-hcd.c
index ea7126f99cab..3a45ad275b41 100644
--- a/drivers/usb/host/r8a66597-hcd.c
+++ b/drivers/usb/host/r8a66597-hcd.c
@@ -66,7 +66,7 @@ static unsigned short endian;
66module_param(endian, ushort, 0644); 66module_param(endian, ushort, 0644);
67MODULE_PARM_DESC(endian, "data endian: big=256, little=0 (default=0)"); 67MODULE_PARM_DESC(endian, "data endian: big=256, little=0 (default=0)");
68 68
69static unsigned short irq_sense = INTL; 69static unsigned short irq_sense = 0xff;
70module_param(irq_sense, ushort, 0644); 70module_param(irq_sense, ushort, 0644);
71MODULE_PARM_DESC(irq_sense, "IRQ sense: low level=32, falling edge=0 " 71MODULE_PARM_DESC(irq_sense, "IRQ sense: low level=32, falling edge=0 "
72 "(default=32)"); 72 "(default=32)");
@@ -2263,7 +2263,7 @@ static int __init_or_module r8a66597_remove(struct platform_device *pdev)
2263#define resource_len(r) (((r)->end - (r)->start) + 1) 2263#define resource_len(r) (((r)->end - (r)->start) + 1)
2264static int __init r8a66597_probe(struct platform_device *pdev) 2264static int __init r8a66597_probe(struct platform_device *pdev)
2265{ 2265{
2266 struct resource *res = NULL; 2266 struct resource *res = NULL, *ires;
2267 int irq = -1; 2267 int irq = -1;
2268 void __iomem *reg = NULL; 2268 void __iomem *reg = NULL;
2269 struct usb_hcd *hcd = NULL; 2269 struct usb_hcd *hcd = NULL;
@@ -2286,13 +2286,16 @@ static int __init r8a66597_probe(struct platform_device *pdev)
2286 goto clean_up; 2286 goto clean_up;
2287 } 2287 }
2288 2288
2289 irq = platform_get_irq(pdev, 0); 2289 ires = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
2290 if (irq < 0) { 2290 if (!ires) {
2291 ret = -ENODEV; 2291 ret = -ENODEV;
2292 err("platform_get_irq error."); 2292 err("platform_get_resource IORESOURCE_IRQ error.");
2293 goto clean_up; 2293 goto clean_up;
2294 } 2294 }
2295 2295
2296 irq = ires->start;
2297 irq_trigger = ires->flags & IRQF_TRIGGER_MASK;
2298
2296 reg = ioremap(res->start, resource_len(res)); 2299 reg = ioremap(res->start, resource_len(res));
2297 if (reg == NULL) { 2300 if (reg == NULL) {
2298 ret = -ENOMEM; 2301 ret = -ENOMEM;
@@ -2329,10 +2332,30 @@ static int __init r8a66597_probe(struct platform_device *pdev)
2329 INIT_LIST_HEAD(&r8a66597->child_device); 2332 INIT_LIST_HEAD(&r8a66597->child_device);
2330 2333
2331 hcd->rsrc_start = res->start; 2334 hcd->rsrc_start = res->start;
2332 if (irq_sense == INTL) 2335
2333 irq_trigger = IRQF_TRIGGER_LOW; 2336 /* irq_sense setting on cmdline takes precedence over resource
2334 else 2337 * settings, so the introduction of irqflags in IRQ resourse
2335 irq_trigger = IRQF_TRIGGER_FALLING; 2338 * won't disturb existing setups */
2339 switch (irq_sense) {
2340 case INTL:
2341 irq_trigger = IRQF_TRIGGER_LOW;
2342 break;
2343 case 0:
2344 irq_trigger = IRQF_TRIGGER_FALLING;
2345 break;
2346 case 0xff:
2347 if (irq_trigger)
2348 irq_sense = (irq_trigger & IRQF_TRIGGER_LOW) ?
2349 INTL : 0;
2350 else {
2351 irq_sense = INTL;
2352 irq_trigger = IRQF_TRIGGER_LOW;
2353 }
2354 break;
2355 default:
2356 err("Unknown irq_sense value.");
2357 }
2358
2336 ret = usb_add_hcd(hcd, irq, IRQF_DISABLED | irq_trigger); 2359 ret = usb_add_hcd(hcd, irq, IRQF_DISABLED | irq_trigger);
2337 if (ret != 0) { 2360 if (ret != 0) {
2338 err("Failed to add hcd"); 2361 err("Failed to add hcd");