[v2,0/5] media: atomisp: Add support for v4l2-async sensor registration

Message ID 20230525190100.130010-1-hdegoede@redhat.com (mailing list archive)
Headers
Series media: atomisp: Add support for v4l2-async sensor registration |

Message

Hans de Goede May 25, 2023, 7 p.m. UTC
  Hi All,

Here is a new version of my v4l2-async sensor registration support
for atomisp. I have merged all the prep / cleanup patches which Andy
already gave his Reviewed-by for in my media-atomisp branch:

https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/log/?h=media-atomisp

This v2 series applies on top of that branch!

This v2 series is the remainder (and core part) of
my previous 2 related patch-series:

https://lore.kernel.org/linux-media/20230518153733.195306-1-hdegoede@redhat.com/
https://lore.kernel.org/linux-media/20230518153214.194976-1-hdegoede@redhat.com/

The big change in this v2 is making atomisp_csi2_bridge_init() also
add the ACPI GPIO mappings to the sensors it finds / it is adding
fwnode graph endpoints for. Combined with making sensor drivers
check there is a fwnode graph endpoint (and return -EPROBE_DEFER if not)
before trying to get GPIOs so that the mappings are in place before
getting the GPIOs.

Thank you Sakari for suggesting this nice solution.

Patch 1    Adds the v4l2-async sensor registration support
Patch 2-3  Convert the ov2680 and gc0310 drivers to this
Patch 4    Removes some now dead code
Patch 5    Moves the now fully standard / no custom atomisp API
           gc0310 sensor driver to drivers/media/i2c

Patches 1-4 only touch atomisp code and build on top of previous
work so I plan to merge these through my media-atomisp branch.

Patch 5 also depends on all the others, so it should also
get merged through my media-atomisp branch. Sakari may I have
your Ack for this ?  Alternatively we could delay the move to
the next kernel cycle and then it could be merged directly
into some other linux-media branch. Either way works for me.

Regards,

Hans


Hans de Goede (5):
  media: atomisp: Add support for v4l2-async sensor registration
  media: atomisp: ov2680: Turn into standard v4l2 sensor driver
  media: atomisp: gc0310: Turn into standard v4l2 sensor driver
  media: atomisp: Drop v4l2_get_acpi_sensor_info() function
  media: Move gc0310 sensor drivers to drivers/media/i2c/

 drivers/media/i2c/Kconfig                     |  10 +
 drivers/media/i2c/Makefile                    |   1 +
 .../atomisp-gc0310.c => media/i2c/gc0310.c}   |  29 +-
 drivers/staging/media/atomisp/Makefile        |   1 +
 drivers/staging/media/atomisp/i2c/Kconfig     |   8 -
 drivers/staging/media/atomisp/i2c/Makefile    |   1 -
 .../media/atomisp/i2c/atomisp-ov2680.c        |  38 +-
 drivers/staging/media/atomisp/i2c/ov2680.h    |   3 +-
 .../staging/media/atomisp/pci/atomisp_csi2.c  |   4 +
 .../staging/media/atomisp/pci/atomisp_csi2.h  |  88 +-
 .../media/atomisp/pci/atomisp_csi2_bridge.c   | 805 ++++++++++++++++++
 .../media/atomisp/pci/atomisp_gmin_platform.c | 240 ------
 .../media/atomisp/pci/atomisp_internal.h      |   2 +
 .../staging/media/atomisp/pci/atomisp_v4l2.c  |  38 +-
 .../staging/media/atomisp/pci/atomisp_v4l2.h  |   1 +
 15 files changed, 962 insertions(+), 307 deletions(-)
 rename drivers/{staging/media/atomisp/i2c/atomisp-gc0310.c => media/i2c/gc0310.c} (96%)
 create mode 100644 drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c
  

Comments

Andy Shevchenko May 26, 2023, 9:23 p.m. UTC | #1
On Thu, May 25, 2023 at 10:01 PM Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi All,
>
> Here is a new version of my v4l2-async sensor registration support
> for atomisp. I have merged all the prep / cleanup patches which Andy
> already gave his Reviewed-by for in my media-atomisp branch:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/log/?h=media-atomisp
>
> This v2 series applies on top of that branch!
>
> This v2 series is the remainder (and core part) of
> my previous 2 related patch-series:
>
> https://lore.kernel.org/linux-media/20230518153733.195306-1-hdegoede@redhat.com/
> https://lore.kernel.org/linux-media/20230518153214.194976-1-hdegoede@redhat.com/
>
> The big change in this v2 is making atomisp_csi2_bridge_init() also
> add the ACPI GPIO mappings to the sensors it finds / it is adding
> fwnode graph endpoints for. Combined with making sensor drivers
> check there is a fwnode graph endpoint (and return -EPROBE_DEFER if not)
> before trying to get GPIOs so that the mappings are in place before
> getting the GPIOs.
>
> Thank you Sakari for suggesting this nice solution.

Indeed, it looks nicer!

So far I looked into this series and for non-commented ones:
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Patch 1    Adds the v4l2-async sensor registration support
> Patch 2-3  Convert the ov2680 and gc0310 drivers to this
> Patch 4    Removes some now dead code
> Patch 5    Moves the now fully standard / no custom atomisp API
>            gc0310 sensor driver to drivers/media/i2c
>
> Patches 1-4 only touch atomisp code and build on top of previous
> work so I plan to merge these through my media-atomisp branch.
>
> Patch 5 also depends on all the others, so it should also
> get merged through my media-atomisp branch. Sakari may I have
> your Ack for this ?  Alternatively we could delay the move to
> the next kernel cycle and then it could be merged directly
> into some other linux-media branch. Either way works for me.
  
Hans de Goede May 27, 2023, 3:54 p.m. UTC | #2
Hi All,

On 5/25/23 21:00, Hans de Goede wrote:
> Hi All,
> 
> Here is a new version of my v4l2-async sensor registration support
> for atomisp. I have merged all the prep / cleanup patches which Andy
> already gave his Reviewed-by for in my media-atomisp branch:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/hansg/linux.git/log/?h=media-atomisp
> 
> This v2 series applies on top of that branch!
> 
> This v2 series is the remainder (and core part) of
> my previous 2 related patch-series:
> 
> https://lore.kernel.org/linux-media/20230518153733.195306-1-hdegoede@redhat.com/
> https://lore.kernel.org/linux-media/20230518153214.194976-1-hdegoede@redhat.com/
> 
> The big change in this v2 is making atomisp_csi2_bridge_init() also
> add the ACPI GPIO mappings to the sensors it finds / it is adding
> fwnode graph endpoints for. Combined with making sensor drivers
> check there is a fwnode graph endpoint (and return -EPROBE_DEFER if not)
> before trying to get GPIOs so that the mappings are in place before
> getting the GPIOs.
> 
> Thank you Sakari for suggesting this nice solution.
> 
> Patch 1    Adds the v4l2-async sensor registration support
> Patch 2-3  Convert the ov2680 and gc0310 drivers to this
> Patch 4    Removes some now dead code
> Patch 5    Moves the now fully standard / no custom atomisp API
>            gc0310 sensor driver to drivers/media/i2c
> 
> Patches 1-4 only touch atomisp code and build on top of previous
> work so I plan to merge these through my media-atomisp branch.

I have pushed patches 1-4 to my media-atomisp branch now with
Andy's Reviewed-by added (and with Andy's review remarks addressed).

> Patch 5 also depends on all the others, so it should also
> get merged through my media-atomisp branch. Sakari may I have
> your Ack for this ?  Alternatively we could delay the move to
> the next kernel cycle and then it could be merged directly
> into some other linux-media branch. Either way works for me.

How to merge patch 5/5 moving the gc0310 driver from staging
to drivers/media/i2c is still something which needs to be
decided...

Regards,

Hans