media: atomisp: Add atomisp_select_input() helper
authorHans de Goede <hdegoede@redhat.com>
Thu, 11 Apr 2024 17:56:47 +0000 (18:56 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 26 Apr 2024 09:48:40 +0000 (10:48 +0100)
commit1a1ce0c308136e2bfdf326e1100809fe34558a4e
tree505f76d2d68da0ef97fdac10d63bbdbc3dfe5234
parent61d9b1ffc68f109f987811e6d31d6440608f6e5c
media: atomisp: Add atomisp_select_input() helper

When switching input/sensor the s_power() callback must be called
for old sensor drivers to power on the new sensor and power off
the previous sensor.

atomisp_s_input() already does this but atomisp_link_setup()
did not do this.

Add a new atomisp_select_input() helper which does this and use this
in both atomisp_s_input() and atomisp_link_setup() for consistent
behavior.

Also make atomisp_link_setup() turn the sensor back off when
a link gets disabled.

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
drivers/staging/media/atomisp/pci/atomisp_cmd.h
drivers/staging/media/atomisp/pci/atomisp_ioctl.c
drivers/staging/media/atomisp/pci/atomisp_subdev.c