]> www.infradead.org Git - users/dwmw2/linux.git/commit
media: atomisp: Turn on sensor power from atomisp_set_fmt()
authorHans de Goede <hdegoede@redhat.com>
Thu, 11 Apr 2024 18:07:55 +0000 (19:07 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 26 Apr 2024 09:46:32 +0000 (10:46 +0100)
commit61d9b1ffc68f109f987811e6d31d6440608f6e5c
tree05606fc992a70b33ec23c802407bd6d73a27e9d9
parent2eee9581745441080ad0bb4df0e159a44b686fc5
media: atomisp: Turn on sensor power from atomisp_set_fmt()

ATM the atomisp driver does not call s_power() at all when no s_input
ioctl() is done by the application. This breaks older sensor drivers
which rely on s_power() for power-management.

Some drivers have worked around this, e.g. commit c5fafbadaeae ("media:
atomisp: gc0310: Power on sensor from set_fmt() callback") and
commit b3118a942c82 ("media: atomisp: ov2722: Power on sensor from
set_fmt() callback"), but this really should be fixed in the atomisp
driver itself, so that all old drivers can work.

A logical place to call s_power() would be from atomisp_start_streaming() /
atomisp_stop_streaming(). But some older drivers, e.g. the atomisp-ov2722
driver already write mode related registers on set_fmt() instead of waiting
on stream on. So the s_power(1) needs to happen at the first set_fmt().

Add an atomisp_s_sensor_power(..., 1) call just before calling set_fmt()
for this. If the power was already enabled through e.g. a s_input ioctl
atomisp_s_sensor_power() will skip calling the s_power() v4l2-subdev-op
a second time.

Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_cmd.c