Commit 8acc8296 authored by Robert Baldyga's avatar Robert Baldyga Committed by Felipe Balbi

usb: gadget: s3c-hsotg: fix interrupt configuration in dedicated-fifo mode

In dedicated-fifo mode TxFIFOEmpty interrupt should be asserted when TxFIFO
for this endpoint is completly empty, so NPTxFEmpLvl and PTxFEmpLvl bits are
set in GAHBCFG register.
In DIEPMSK register INTknTXFEmpMsk is set, becouse it's needed to indicate
FIFO Empty state.
Signed-off-by: default avatarRobert Baldyga <r.baldyga@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent bd9ef7bf
...@@ -2304,15 +2304,19 @@ static void s3c_hsotg_core_init(struct s3c_hsotg *hsotg) ...@@ -2304,15 +2304,19 @@ static void s3c_hsotg_core_init(struct s3c_hsotg *hsotg)
GAHBCFG_HBstLen_Incr4, GAHBCFG_HBstLen_Incr4,
hsotg->regs + GAHBCFG); hsotg->regs + GAHBCFG);
else else
writel(GAHBCFG_GlblIntrEn, hsotg->regs + GAHBCFG); writel(((hsotg->dedicated_fifos) ? (GAHBCFG_NPTxFEmpLvl |
GAHBCFG_PTxFEmpLvl) : 0) |
GAHBCFG_GlblIntrEn,
hsotg->regs + GAHBCFG);
/* /*
* Enabling INTknTXFEmpMsk here seems to be a big mistake, we end * If INTknTXFEmpMsk is enabled, it's important to disable ep interrupts
* up being flooded with interrupts if the host is polling the * when we have no data to transfer. Otherwise we get being flooded by
* endpoint to try and read data. * interrupts.
*/ */
writel(((hsotg->dedicated_fifos) ? DIEPMSK_TxFIFOEmpty : 0) | writel(((hsotg->dedicated_fifos) ? DIEPMSK_TxFIFOEmpty |
DIEPMSK_INTknTXFEmpMsk : 0) |
DIEPMSK_EPDisbldMsk | DIEPMSK_XferComplMsk | DIEPMSK_EPDisbldMsk | DIEPMSK_XferComplMsk |
DIEPMSK_TimeOUTMsk | DIEPMSK_AHBErrMsk | DIEPMSK_TimeOUTMsk | DIEPMSK_AHBErrMsk |
DIEPMSK_INTknEPMisMsk, DIEPMSK_INTknEPMisMsk,
......
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