return 0;
}
-static int cci_reset(struct cci *cci)
-{
- /*
- * we reset the whole controller, here and for implicity use
- * master[0].xxx for waiting on it.
- */
- reinit_completion(&cci->master[0].irq_complete);
- writel(CCI_RESET_CMD_MASK, cci->base + CCI_RESET_CMD);
-
- if (!wait_for_completion_timeout(&cci->master[0].irq_complete,
- CCI_TIMEOUT)) {
- dev_err(cci->dev, "CCI reset timeout\n");
- return -ETIMEDOUT;
- }
-
- return 0;
-}
-
static void cci_init(struct cci *cci)
{
u32 val = CCI_IRQ_MASK_0_I2C_M0_RD_DONE |
}
}
+static int cci_reset(struct cci *cci)
+{
+ /*
+ * we reset the whole controller, here and for implicity use
+ * master[0].xxx for waiting on it.
+ */
+ reinit_completion(&cci->master[0].irq_complete);
+ writel(CCI_RESET_CMD_MASK, cci->base + CCI_RESET_CMD);
+
+ if (!wait_for_completion_timeout(&cci->master[0].irq_complete,
+ CCI_TIMEOUT)) {
+ dev_err(cci->dev, "CCI reset timeout\n");
+ return -ETIMEDOUT;
+ }
+
+ cci_init(cci);
+
+ return 0;
+}
+
static int cci_run_queue(struct cci *cci, u8 master, u8 queue)
{
u32 val;
dev_err(cci->dev, "master %d queue %d timeout\n",
master, queue);
cci_reset(cci);
- cci_init(cci);
return -ETIMEDOUT;
}
if (ret < 0)
goto error;
- cci_init(cci);
-
pm_runtime_set_autosuspend_delay(dev, MSEC_PER_SEC);
pm_runtime_use_autosuspend(dev);
pm_runtime_set_active(dev);