summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/allegro-dvt
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2020-03-16 16:26:27 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-03-20 09:13:17 +0100
commitdfba38c841855536730bb577b02a42ec2f2bda4d (patch)
tree9feb40346ebab15f6bc253c9d8d222fab7e7ea12 /drivers/staging/media/allegro-dvt
parentc32c815503fa3bfae575cf92648685c30796f448 (diff)
downloadlinux-dfba38c841855536730bb577b02a42ec2f2bda4d.tar.bz2
media: allegro: fix reset if WAKEUP has not been set properly
The Zynq UltraScale+ Devices Register Reference states that the WAKEUP bit "should be set to 0 after the MCU sleep status bit gets back to 0." If this is not done, the mcu is not going to sleep on reset and fail the reset. Set WAKEUP to 0 before triggering a reset to make sure that the reset is successful. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/allegro-dvt')
-rw-r--r--drivers/staging/media/allegro-dvt/allegro-core.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/staging/media/allegro-dvt/allegro-core.c b/drivers/staging/media/allegro-dvt/allegro-core.c
index ab17e850bd1f..a56d157cb105 100644
--- a/drivers/staging/media/allegro-dvt/allegro-core.c
+++ b/drivers/staging/media/allegro-dvt/allegro-core.c
@@ -1990,6 +1990,14 @@ static int allegro_mcu_reset(struct allegro_dev *dev)
{
int err;
+ /*
+ * Ensure that the AL5_MCU_WAKEUP bit is set to 0 otherwise the mcu
+ * does not go to sleep after the reset.
+ */
+ err = regmap_write(dev->regmap, AL5_MCU_WAKEUP, 0);
+ if (err)
+ return err;
+
err = regmap_write(dev->regmap,
AL5_MCU_RESET_MODE, AL5_MCU_RESET_MODE_SLEEP);
if (err < 0)