Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 364122
b: refs/heads/master
c: 6706c72
h: refs/heads/master
v: v3
  • Loading branch information
Matthijs Kooijman authored and Greg Kroah-Hartman committed Apr 11, 2013
1 parent 64b583b commit ec3464f
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7c360aa7cd6b469671fc2ea7a889516095cd0efe
refs/heads/master: 6706c721b22aadffbffec7550b81efedddd05cfb
13 changes: 12 additions & 1 deletion trunk/drivers/staging/dwc2/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,9 @@ static void dwc2_gusbcfg_init(struct dwc2_hsotg *hsotg)
*
* @hsotg: Programming view of the DWC_otg controller
* @select_phy: If true then also set the Phy type
* @irq: If >= 0, the irq to register
*/
int dwc2_core_init(struct dwc2_hsotg *hsotg, bool select_phy)
int dwc2_core_init(struct dwc2_hsotg *hsotg, bool select_phy, int irq)
{
u32 usbcfg, otgctl;
int retval;
Expand Down Expand Up @@ -430,6 +431,16 @@ int dwc2_core_init(struct dwc2_hsotg *hsotg, bool select_phy)
/* Clear the SRP success bit for FS-I2c */
hsotg->srp_success = 0;

if (irq >= 0) {
dev_dbg(hsotg->dev, "registering common handler for irq%d\n",
irq);
retval = devm_request_irq(hsotg->dev, irq,
dwc2_handle_common_intr, IRQF_SHARED,
dev_name(hsotg->dev), hsotg);
if (retval)
return retval;
}

/* Enable common interrupts */
dwc2_enable_common_interrupts(hsotg);

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/staging/dwc2/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ extern void dwc2_read_packet(struct dwc2_hsotg *hsotg, u8 *dest, u16 bytes);
extern void dwc2_flush_tx_fifo(struct dwc2_hsotg *hsotg, const int num);
extern void dwc2_flush_rx_fifo(struct dwc2_hsotg *hsotg);

extern int dwc2_core_init(struct dwc2_hsotg *hsotg, bool select_phy);
extern int dwc2_core_init(struct dwc2_hsotg *hsotg, bool select_phy, int irq);
extern void dwc2_enable_global_interrupts(struct dwc2_hsotg *hcd);
extern void dwc2_disable_global_interrupts(struct dwc2_hsotg *hcd);

Expand Down
14 changes: 7 additions & 7 deletions trunk/drivers/staging/dwc2/hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1313,7 +1313,7 @@ static void dwc2_conn_id_status_change(struct work_struct *work)
dev_err(hsotg->dev,
"Connection id status change timed out");
hsotg->op_state = OTG_STATE_B_PERIPHERAL;
dwc2_core_init(hsotg, false);
dwc2_core_init(hsotg, false, -1);
dwc2_enable_global_interrupts(hsotg);
} else {
/* A-Device connector (Host Mode) */
Expand All @@ -1332,7 +1332,7 @@ static void dwc2_conn_id_status_change(struct work_struct *work)
hsotg->op_state = OTG_STATE_A_HOST;

/* Initialize the Core for Host mode */
dwc2_core_init(hsotg, false);
dwc2_core_init(hsotg, false, -1);
dwc2_enable_global_interrupts(hsotg);
dwc2_hcd_start(hsotg);
}
Expand Down Expand Up @@ -2818,17 +2818,17 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg, int irq,
((struct wrapper_priv_data *) &hcd->hcd_priv)->hsotg = hsotg;
hsotg->priv = hcd;

/* Initialize the DWC_otg core, and select the Phy type */
retval = dwc2_core_init(hsotg, true);
if (retval)
goto error2;

/*
* Disable the global interrupt until all the interrupt handlers are
* installed
*/
dwc2_disable_global_interrupts(hsotg);

/* Initialize the DWC_otg core, and select the Phy type */
retval = dwc2_core_init(hsotg, true, irq);
if (retval)
goto error2;

/* Create new workqueue and init work */
hsotg->wq_otg = create_singlethread_workqueue("dwc_otg");
if (!hsotg->wq_otg) {
Expand Down
7 changes: 0 additions & 7 deletions trunk/drivers/staging/dwc2/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,6 @@ static int dwc2_driver_probe(struct pci_dev *dev,
pci_set_drvdata(dev, hsotg);
dev_dbg(&dev->dev, "hsotg=%p\n", hsotg);

dev_dbg(&dev->dev, "registering common handler for irq%d\n", dev->irq);
retval = devm_request_irq(&dev->dev, dev->irq, dwc2_handle_common_intr,
IRQF_SHARED, dev_name(&dev->dev),
hsotg);
if (retval)
dwc2_hcd_remove(hsotg);

return retval;
}

Expand Down

0 comments on commit ec3464f

Please sign in to comment.