mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
i2c: qcom-cci: Move cci_init() under cci_reset() function
On probe or runtime errors cci_reset() is called and it should be coupled with cci_init(), instead of doing this on caller's side, embed cci_init() directly into the cci_reset() function. This is a non-functional change, cci_reset() and cci_init() function bodies are reordered. Signed-off-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org> Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20260515234121.1607425-4-vladimir.zapolskiy@linaro.org
This commit is contained in:
parent
17c5d247e3
commit
697d58d457
|
|
@ -225,24 +225,6 @@ static int cci_halt(struct cci *cci, u8 master_num)
|
|||
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 |
|
||||
|
|
@ -286,6 +268,26 @@ static void cci_init(struct cci *cci)
|
|||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
@ -302,7 +304,6 @@ static int cci_run_queue(struct cci *cci, u8 master, u8 queue)
|
|||
dev_err(cci->dev, "master %d queue %d timeout\n",
|
||||
master, queue);
|
||||
cci_reset(cci);
|
||||
cci_init(cci);
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
|
|
@ -609,8 +610,6 @@ static int cci_probe(struct platform_device *pdev)
|
|||
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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user