Commit e25e0eb2 authored by Arvid Brodin's avatar Arvid Brodin Committed by Greg Kroah-Hartman

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: default avatarArvid Brodin <arvid.brodin@enea.com>
Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 507a3ea7
...@@ -514,23 +514,18 @@ static int isp1760_hc_setup(struct usb_hcd *hcd) ...@@ -514,23 +514,18 @@ static int isp1760_hc_setup(struct usb_hcd *hcd)
return priv_init(hcd); return priv_init(hcd);
} }
static void isp1760_init_maps(struct usb_hcd *hcd) static int isp1760_run(struct usb_hcd *hcd)
{ {
/*set last maps, for iso its only 1, else 32 tds bitmap*/ int retval;
reg_write32(hcd->regs, HC_ATL_PTD_LASTPTD_REG, 0x80000000); u32 temp;
reg_write32(hcd->regs, HC_INT_PTD_LASTPTD_REG, 0x80000000); u32 command;
reg_write32(hcd->regs, HC_ISO_PTD_LASTPTD_REG, 0x00000001); u32 chipid;
reg_write32(hcd->regs, HC_ATL_PTD_SKIPMAP_REG, 0xffffffff); hcd->uses_new_polling = 1;
reg_write32(hcd->regs, HC_INT_PTD_SKIPMAP_REG, 0xffffffff);
reg_write32(hcd->regs, HC_ISO_PTD_SKIPMAP_REG, 0xffffffff);
reg_write32(hcd->regs, HC_BUFFER_STATUS_REG, hcd->state = HC_STATE_RUNNING;
ATL_BUF_FILL | INT_BUF_FILL);
}
static void isp1760_enable_interrupts(struct usb_hcd *hcd) /* Set PTD interrupt AND & OR maps */
{
reg_write32(hcd->regs, HC_ATL_IRQ_MASK_AND_REG, 0); reg_write32(hcd->regs, HC_ATL_IRQ_MASK_AND_REG, 0);
reg_write32(hcd->regs, HC_ATL_IRQ_MASK_OR_REG, 0xffffffff); reg_write32(hcd->regs, HC_ATL_IRQ_MASK_OR_REG, 0xffffffff);
reg_write32(hcd->regs, HC_INT_IRQ_MASK_AND_REG, 0); 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,19 +533,7 @@ static void isp1760_enable_interrupts(struct usb_hcd *hcd)
reg_write32(hcd->regs, HC_ISO_IRQ_MASK_AND_REG, 0); reg_write32(hcd->regs, HC_ISO_IRQ_MASK_AND_REG, 0);
reg_write32(hcd->regs, HC_ISO_IRQ_MASK_OR_REG, 0xffffffff); reg_write32(hcd->regs, HC_ISO_IRQ_MASK_OR_REG, 0xffffffff);
/* step 23 passed */ /* step 23 passed */
}
static int isp1760_run(struct usb_hcd *hcd)
{
int retval;
u32 temp;
u32 command;
u32 chipid;
hcd->uses_new_polling = 1;
hcd->state = HC_STATE_RUNNING;
isp1760_enable_interrupts(hcd);
temp = reg_read32(hcd->regs, HC_HW_MODE_CTRL); temp = reg_read32(hcd->regs, HC_HW_MODE_CTRL);
reg_write32(hcd->regs, HC_HW_MODE_CTRL, temp | HW_GLOBAL_INTR_EN); reg_write32(hcd->regs, HC_HW_MODE_CTRL, temp | HW_GLOBAL_INTR_EN);
...@@ -581,8 +564,16 @@ static int isp1760_run(struct usb_hcd *hcd) ...@@ -581,8 +564,16 @@ static int isp1760_run(struct usb_hcd *hcd)
chipid & 0xffff, chipid >> 16); chipid & 0xffff, chipid >> 16);
/* PTD Register Init Part 2, Step 28 */ /* PTD Register Init Part 2, Step 28 */
/* enable INTs */
isp1760_init_maps(hcd); /* Setup registers controlling PTD checking */
reg_write32(hcd->regs, HC_ATL_PTD_LASTPTD_REG, 0x80000000);
reg_write32(hcd->regs, HC_INT_PTD_LASTPTD_REG, 0x80000000);
reg_write32(hcd->regs, HC_ISO_PTD_LASTPTD_REG, 0x00000001);
reg_write32(hcd->regs, HC_ATL_PTD_SKIPMAP_REG, 0xffffffff);
reg_write32(hcd->regs, HC_INT_PTD_SKIPMAP_REG, 0xffffffff);
reg_write32(hcd->regs, HC_ISO_PTD_SKIPMAP_REG, 0xffffffff);
reg_write32(hcd->regs, HC_BUFFER_STATUS_REG,
ATL_BUF_FILL | INT_BUF_FILL);
/* GRR this is run-once init(), being done every time the HC starts. /* GRR this is run-once init(), being done every time the HC starts.
* So long as they're part of class devices, we can't do it init() * So long as they're part of class devices, we can't do it init()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment