media: atomisp: Add support for v4l2-async sensor registration
authorHans de Goede <hdegoede@redhat.com>
Thu, 25 May 2023 19:00:56 +0000 (20:00 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 9 Jun 2023 14:12:25 +0000 (15:12 +0100)
commit8d28ec7e9145ef6308ab3438d73308ec6ea14360
tree6dfba03d4372763327d715ea06850809443431b7
parent5e131b80605a391bb61c23e1f5950a343b4d8a58
media: atomisp: Add support for v4l2-async sensor registration

Add support for using v4l2-async sensor registration.

This has been tested with both the gc0310 and the ov2680 sensor drivers.

Drivers must add the ACPI HIDs they match on to the supported_sensors[]
array in the same commit as that they are converted to
v4l2_async_register_subdev_sensor().

Sensor drivers also must check they have a fwnode graph endpoint and return
-EPROBE_DEFER from probe() if there is no endpoint yet. This guarantees
that the GPIO mappings are in place before the driver tries to get GPIOs.

For now it also is still possible to use the old atomisp_gmin_platform
based sensor drivers. This is mainly intended for testing while moving
other sensor drivers over to runtime-pm + v4l2-async.

Link: https://lore.kernel.org/r/20230525190100.130010-2-hdegoede@redhat.com
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/atomisp/Makefile
drivers/staging/media/atomisp/pci/atomisp_csi2.c
drivers/staging/media/atomisp/pci/atomisp_csi2.h
drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c [new file with mode: 0644]
drivers/staging/media/atomisp/pci/atomisp_internal.h
drivers/staging/media/atomisp/pci/atomisp_v4l2.c
drivers/staging/media/atomisp/pci/atomisp_v4l2.h