|
@@ -1819,6 +1819,7 @@ static void swrm_enable_slave_irq(struct swr_mstr_ctrl *swrm)
|
|
|
{
|
|
|
int i;
|
|
|
int status = 0;
|
|
|
+ u32 temp;
|
|
|
|
|
|
status = swr_master_read(swrm, SWRM_MCP_SLV_STATUS);
|
|
|
if (!status) {
|
|
@@ -1829,6 +1830,8 @@ static void swrm_enable_slave_irq(struct swr_mstr_ctrl *swrm)
|
|
|
dev_dbg(swrm->dev, "%s: slave status: 0x%x\n", __func__, status);
|
|
|
for (i = 0; i < (swrm->master.num_dev + 1); i++) {
|
|
|
if (status & SWRM_MCP_SLV_STATUS_MASK) {
|
|
|
+ swrm_cmd_fifo_rd_cmd(swrm, &temp, i, 0x0,
|
|
|
+ SWRS_SCP_INT_STATUS_CLEAR_1, 1);
|
|
|
swrm_cmd_fifo_wr_cmd(swrm, 0xFF, i, 0x0,
|
|
|
SWRS_SCP_INT_STATUS_CLEAR_1);
|
|
|
swrm_cmd_fifo_wr_cmd(swrm, 0x4, i, 0x0,
|
|
@@ -1967,10 +1970,7 @@ handle_irq:
|
|
|
* as hw will mask host_irq at slave
|
|
|
* but will not unmask it afterwards.
|
|
|
*/
|
|
|
- swrm_cmd_fifo_wr_cmd(swrm, 0xFF, devnum, 0x0,
|
|
|
- SWRS_SCP_INT_STATUS_CLEAR_1);
|
|
|
- swrm_cmd_fifo_wr_cmd(swrm, 0x4, devnum, 0x0,
|
|
|
- SWRS_SCP_INT_STATUS_MASK_1);
|
|
|
+ swrm->enable_slave_irq = true;
|
|
|
}
|
|
|
break;
|
|
|
case SWR_ATTACHED_OK:
|
|
@@ -1978,11 +1978,7 @@ handle_irq:
|
|
|
"%s: device %d got attached\n",
|
|
|
__func__, devnum);
|
|
|
/* enable host irq from slave device*/
|
|
|
- swrm_cmd_fifo_wr_cmd(swrm, 0xFF, devnum, 0x0,
|
|
|
- SWRS_SCP_INT_STATUS_CLEAR_1);
|
|
|
- swrm_cmd_fifo_wr_cmd(swrm, 0x4, devnum, 0x0,
|
|
|
- SWRS_SCP_INT_STATUS_MASK_1);
|
|
|
-
|
|
|
+ swrm->enable_slave_irq = true;
|
|
|
break;
|
|
|
case SWR_ALERT:
|
|
|
dev_dbg(swrm->dev,
|
|
@@ -2096,6 +2092,12 @@ handle_irq:
|
|
|
swr_master_write(swrm, SWRM_INTERRUPT_CLEAR, intr_sts);
|
|
|
swr_master_write(swrm, SWRM_INTERRUPT_CLEAR, 0x0);
|
|
|
|
|
|
+ if (swrm->enable_slave_irq) {
|
|
|
+ /* Enable slave irq here */
|
|
|
+ swrm_enable_slave_irq(swrm);
|
|
|
+ swrm->enable_slave_irq = false;
|
|
|
+ }
|
|
|
+
|
|
|
intr_sts = swr_master_read(swrm, SWRM_INTERRUPT_STATUS);
|
|
|
intr_sts_masked = intr_sts & swrm->intr_mask;
|
|
|
|