media: marvell-ccic/mmp: enable clock before accessing registers
authorLubomir Rintel <lkundrak@v3.sk>
Tue, 28 May 2019 09:07:27 +0000 (05:07 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 24 Jun 2019 15:23:34 +0000 (11:23 -0400)
The access to REG_CLKCTRL or REG_CTRL1 without the clock enabled hangs
the machine. Enable the clock first.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/platform/marvell-ccic/mmp-driver.c

index 25a4e2b580f428d93c86085531a0912d8dae5d3c..bd2934a4d7ce4623b2b4b93958c0a59d95b47505 100644 (file)
@@ -142,6 +142,7 @@ static int mmpcam_power_up(struct mcam_camera *mcam)
  * Turn on power and clocks to the controller.
  */
        mmpcam_power_up_ctlr(cam);
+       mcam_clk_enable(mcam);
 /*
  * Provide power to the sensor.
  */
@@ -155,8 +156,6 @@ static int mmpcam_power_up(struct mcam_camera *mcam)
        gpio_set_value(pdata->sensor_reset_gpio, 1); /* reset is active low */
        mdelay(5);
 
-       mcam_clk_enable(mcam);
-
        return 0;
 }