Skip to contentSkip to conversation

media: marvell-ccic: power up the device on mclk enable

git:media_tree/master Mauro Carvalho Chehab 1 participant 1 message Feb 6, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

This is an automatic generated email to let you know that the following patch were queued:

Subject: media: marvell-ccic: power up the device on mclk enable
Author:  Lubomir Rintel <[email protected]>
Date:    Wed Jan 27 19:01:43 2021 +0100

Writing to REG_CLKCTRL with the power off causes a hang. Enable the device first.

 drivers/media/platform/marvell-ccic/mcam-core.c | 2 ++
 1 file changed, 2 insertions(+)

---

drivers/media/platform/marvell-ccic/mcam-core.c +2 -0
index 153277e4fe80..141bf5d97a04 100644
@@ -931,6 +931,7 @@ static int mclk_enable(struct clk_hw *hw)
 		mclk_div = 2;
 	}
 
+	pm_runtime_get_sync(cam->dev);
 	clk_enable(cam->clk[0]);
 	mcam_reg_write(cam, REG_CLKCTRL, (mclk_src << 29) | mclk_div);
 	mcam_ctlr_power_up(cam);
@@ -944,6 +945,7 @@ static void mclk_disable(struct clk_hw *hw)
 
 	mcam_ctlr_power_down(cam);
 	clk_disable(cam->clk[0]);
+	pm_runtime_put(cam->dev);
 }
 
 static unsigned long mclk_recalc_rate(struct clk_hw *hw,