]> git.baikalelectronics.ru Git - kernel.git/commit
media: ov7670: don't access registers when the device is powered off
authorAkinobu Mita <akinobu.mita@gmail.com>
Mon, 11 Mar 2019 15:36:03 +0000 (11:36 -0400)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Wed, 20 Mar 2019 10:34:09 +0000 (06:34 -0400)
commit802974c07a4f7a9c4b8abdf67afa67cfcd201326
treeb6f121753f59ba557f1f72de965b730efaa8c350
parent31f8fe89f21b65d3962538da60e840a80c1d4219
media: ov7670: don't access registers when the device is powered off

Since commit 4fa7196fb694 ("media: ov7670: hook s_power onto v4l2 core"),
the device is actually powered off while the video stream is stopped.

So now set_format and s_frame_interval could be called while the device
is powered off, but these callbacks try to change the register settings
at this time.

The frame format and framerate will be restored right after power-up, so
we can just postpone applying these changes at these callbacks if the
device is not powered up.

Fixes: 4fa7196fb694 ("media: ov7670: hook s_power onto v4l2 core")
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Reviewed-by: Lubomir Rintel <lkundrak@v3.sk>
Tested-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/ov7670.c