diff options
author | Arvid Brodin <arvid.brodin@enea.com> | 2011-08-21 02:29:24 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-22 18:32:11 -0400 |
commit | e25e0eb209bf945db554512430ee128e6bb7b291 (patch) | |
tree | 0df783327afb166a3b41c0e034859a722cb37b0d /drivers/usb/host/isp1760-hcd.c | |
parent | 507a3ea7f20b0964e459f0ed5125717e8b46d159 (diff) |
usb/isp1760: Move some code (prepare for next patch)
Move the few lines of code in isp1760_enable_interrupts() and
isp1760_init_maps() into isp1760_run(). This makes the following patch
easier.
Signed-off-by: Arvid Brodin <arvid.brodin@enea.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/isp1760-hcd.c')
-rw-r--r-- | drivers/usb/host/isp1760-hcd.c | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c index 840beda66dd9..a46ccf97a5c9 100644 --- a/drivers/usb/host/isp1760-hcd.c +++ b/drivers/usb/host/isp1760-hcd.c | |||
@@ -514,23 +514,18 @@ static int isp1760_hc_setup(struct usb_hcd *hcd) | |||
514 | return priv_init(hcd); | 514 | return priv_init(hcd); |
515 | } | 515 | } |
516 | 516 | ||
517 | static void isp1760_init_maps(struct usb_hcd *hcd) | 517 | static int isp1760_run(struct usb_hcd *hcd) |
518 | { | 518 | { |
519 | /*set last maps, for iso its only 1, else 32 tds bitmap*/ | 519 | int retval; |
520 | reg_write32(hcd->regs, HC_ATL_PTD_LASTPTD_REG, 0x80000000); | 520 | u32 temp; |
521 | reg_write32(hcd->regs, HC_INT_PTD_LASTPTD_REG, 0x80000000); | 521 | u32 command; |
522 | reg_write32(hcd->regs, HC_ISO_PTD_LASTPTD_REG, 0x00000001); | 522 | u32 chipid; |
523 | 523 | ||
524 | reg_write32(hcd->regs, HC_ATL_PTD_SKIPMAP_REG, 0xffffffff); | 524 | hcd->uses_new_polling = 1; |
525 | reg_write32(hcd->regs, HC_INT_PTD_SKIPMAP_REG, 0xffffffff); | ||
526 | reg_write32(hcd->regs, HC_ISO_PTD_SKIPMAP_REG, 0xffffffff); | ||
527 | 525 | ||
528 | reg_write32(hcd->regs, HC_BUFFER_STATUS_REG, | 526 | hcd->state = HC_STATE_RUNNING; |
529 | ATL_BUF_FILL | INT_BUF_FILL); | ||
530 | } | ||
531 | 527 | ||
532 | static void isp1760_enable_interrupts(struct usb_hcd *hcd) | 528 | /* Set PTD interrupt AND & OR maps */ |
533 | { | ||
534 | reg_write32(hcd->regs, HC_ATL_IRQ_MASK_AND_REG, 0); | 529 | reg_write32(hcd->regs, HC_ATL_IRQ_MASK_AND_REG, 0); |
535 | reg_write32(hcd->regs, HC_ATL_IRQ_MASK_OR_REG, 0xffffffff); | 530 | reg_write32(hcd->regs, HC_ATL_IRQ_MASK_OR_REG, 0xffffffff); |
536 | reg_write32(hcd->regs, HC_INT_IRQ_MASK_AND_REG, 0); | 531 | reg_write32(hcd->regs, HC_INT_IRQ_MASK_AND_REG, 0); |
@@ -538,19 +533,7 @@ static void isp1760_enable_interrupts(struct usb_hcd *hcd) | |||
538 | reg_write32(hcd->regs, HC_ISO_IRQ_MASK_AND_REG, 0); | 533 | reg_write32(hcd->regs, HC_ISO_IRQ_MASK_AND_REG, 0); |
539 | reg_write32(hcd->regs, HC_ISO_IRQ_MASK_OR_REG, 0xffffffff); | 534 | reg_write32(hcd->regs, HC_ISO_IRQ_MASK_OR_REG, 0xffffffff); |
540 | /* step 23 passed */ | 535 | /* step 23 passed */ |
541 | } | ||
542 | 536 | ||
543 | static int isp1760_run(struct usb_hcd *hcd) | ||
544 | { | ||
545 | int retval; | ||
546 | u32 temp; | ||
547 | u32 command; | ||
548 | u32 chipid; | ||
549 | |||
550 | hcd->uses_new_polling = 1; | ||
551 | |||
552 | hcd->state = HC_STATE_RUNNING; | ||
553 | isp1760_enable_interrupts(hcd); | ||
554 | temp = reg_read32(hcd->regs, HC_HW_MODE_CTRL); | 537 | temp = reg_read32(hcd->regs, HC_HW_MODE_CTRL); |
555 | reg_write32(hcd->regs, HC_HW_MODE_CTRL, temp | HW_GLOBAL_INTR_EN); | 538 | reg_write32(hcd->regs, HC_HW_MODE_CTRL, temp | HW_GLOBAL_INTR_EN); |
556 | 539 | ||
@@ -581,8 +564,16 @@ static int isp1760_run(struct usb_hcd *hcd) | |||
581 | chipid & 0xffff, chipid >> 16); | 564 | chipid & 0xffff, chipid >> 16); |
582 | 565 | ||
583 | /* PTD Register Init Part 2, Step 28 */ | 566 | /* PTD Register Init Part 2, Step 28 */ |
584 | /* enable INTs */ | 567 | |
585 | isp1760_init_maps(hcd); | 568 | /* Setup registers controlling PTD checking */ |
569 | reg_write32(hcd->regs, HC_ATL_PTD_LASTPTD_REG, 0x80000000); | ||
570 | reg_write32(hcd->regs, HC_INT_PTD_LASTPTD_REG, 0x80000000); | ||
571 | reg_write32(hcd->regs, HC_ISO_PTD_LASTPTD_REG, 0x00000001); | ||
572 | reg_write32(hcd->regs, HC_ATL_PTD_SKIPMAP_REG, 0xffffffff); | ||
573 | reg_write32(hcd->regs, HC_INT_PTD_SKIPMAP_REG, 0xffffffff); | ||
574 | reg_write32(hcd->regs, HC_ISO_PTD_SKIPMAP_REG, 0xffffffff); | ||
575 | reg_write32(hcd->regs, HC_BUFFER_STATUS_REG, | ||
576 | ATL_BUF_FILL | INT_BUF_FILL); | ||
586 | 577 | ||
587 | /* GRR this is run-once init(), being done every time the HC starts. | 578 | /* GRR this is run-once init(), being done every time the HC starts. |
588 | * So long as they're part of class devices, we can't do it init() | 579 | * So long as they're part of class devices, we can't do it init() |