1. 10 Aug, 2023 32 commits
  2. 28 Jul, 2023 8 commits
    • Sakari Ailus's avatar
      media: v4l: async: Support fwnode endpoint list matching for subdevs · e74f7a96
      Sakari Ailus authored
      Support matching V4L2 async sub-devices based on particular fwnode
      endpoint. This makes it possible to instantiate multiple V4L2 sub-devices
      based on given fwnode endpoints from a single device, based on driver
      needs.
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Tested-by: Philipp Zabel <p.zabel@pengutronix.de> # imx6qp
      Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> # rcar + adv746x
      Tested-by: Aishwarya Kothari <aishwarya.kothari@toradex.com> # Apalis i.MX6Q with TC358743
      Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # Renesas RZ/G2L SMARC
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      e74f7a96
    • Sakari Ailus's avatar
      media: v4l: async: Try more connections · 765f6056
      Sakari Ailus authored
      When an async sub-device is registered, it used to be that the first one
      of its connections were matched when found. Continue looking for matches
      until a notifier no longer has any.
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Tested-by: Philipp Zabel <p.zabel@pengutronix.de> # imx6qp
      Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> # rcar + adv746x
      Tested-by: Aishwarya Kothari <aishwarya.kothari@toradex.com> # Apalis i.MX6Q with TC358743
      Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # Renesas RZ/G2L SMARC
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      765f6056
    • Sakari Ailus's avatar
      media: v4l: async: Drop unneeded list entry initialisation · cb8c9f31
      Sakari Ailus authored
      The list entry is initialised as a head in v4l2_async_register_subdev()
      just before being added to the list. This isn't needed, drop the
      initialisation.
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Tested-by: Philipp Zabel <p.zabel@pengutronix.de> # imx6qp
      Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> # rcar + adv746x
      Tested-by: Aishwarya Kothari <aishwarya.kothari@toradex.com> # Apalis i.MX6Q with TC358743
      Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # Renesas RZ/G2L SMARC
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      cb8c9f31
    • Sakari Ailus's avatar
      media: v4l: async: Allow multiple connections between entities · 28a12957
      Sakari Ailus authored
      When the v4l2-async framework was introduced, the use case for it was to
      connect a camera sensor with a parallel receiver. Both tended to be rather
      simple devices with a single connection between them.
      
      The framework has been since improved in multiple ways but there are
      limitations that have remained, for instance the assumption an async
      sub-device is connected towards a single notifier and via a single link
      only.
      
      This patch enables connecting a sub-device to one or more notifiers
      simultaneously, with one or more connections per notifier. The notifier
      information is moved from the sub-device to the connection and the
      connections in sub-device are no longer a pointer but a linked list.
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Tested-by: Philipp Zabel <p.zabel@pengutronix.de> # imx6qp
      Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> # rcar + adv746x
      Tested-by: Aishwarya Kothari <aishwarya.kothari@toradex.com> # Apalis i.MX6Q with TC358743
      Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # Renesas RZ/G2L SMARC
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      28a12957
    • Sakari Ailus's avatar
      media: v4l: async: Obtain async connection based on sub-device · c91fd7b7
      Sakari Ailus authored
      Add v4l2_async_connection_unique() function for obtaining a struct
      v4l2_async_connection, typically allocated by drivers together with their
      own information on an external sub-device.
      
      The relation between connections and sub-devices still remains 1:1 but
      this code becomes more complex when the relation soon changes.
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Tested-by: Philipp Zabel <p.zabel@pengutronix.de> # imx6qp
      Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> # rcar + adv746x
      Tested-by: Aishwarya Kothari <aishwarya.kothari@toradex.com> # Apalis i.MX6Q with TC358743
      Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # Renesas RZ/G2L SMARC
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      c91fd7b7
    • Sakari Ailus's avatar
      media: v4l: async: Rework internal lists · 9bf19fbf
      Sakari Ailus authored
      This patch re-arranges internal V4L2 async lists for preparation of
      supporting multiple connections per sub-device as well as cleaning up used
      lists.
      
      The list of unbound V4L2 sub-devices shall be maintained for the purpose of
      listing those sub-devices only, not for their bindin status. Also, the V4L2
      async connections now have, instead of two list entries, a single list
      entry in the notifier's list, be that either waiting or done lists, while
      the notifier's asc_list is removed.
      
      The one-to-one relation between a sub-device and a connection is still
      maintained in this patch.
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Tested-by: Philipp Zabel <p.zabel@pengutronix.de> # imx6qp
      Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> # rcar + adv746x
      Tested-by: Aishwarya Kothari <aishwarya.kothari@toradex.com> # Apalis i.MX6Q with TC358743
      Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # Renesas RZ/G2L SMARC
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      9bf19fbf
    • Sakari Ailus's avatar
      media: v4l: async: Drop duplicate handling when adding connections · 393cfcc0
      Sakari Ailus authored
      The connections are checked for duplicates already when the notifier is
      registered. This is effectively a sanity check for driver (and possibly
      obscure firmware) bugs. Don't do this when adding the connection.
      
      Retain the int return type for now. It'll be needed very soon again.
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Tested-by: Philipp Zabel <p.zabel@pengutronix.de> # imx6qp
      Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> # rcar + adv746x
      Tested-by: Aishwarya Kothari <aishwarya.kothari@toradex.com> # Apalis i.MX6Q with TC358743
      Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # Renesas RZ/G2L SMARC
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      393cfcc0
    • Sakari Ailus's avatar
      media: v4l: async: Clean up error handling in v4l2_async_match_notify · ed59bbe1
      Sakari Ailus authored
      Add labels for error handling instead of doing it all in individual cases.
      Prepare for more functionality in this function.
      Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Tested-by: Philipp Zabel <p.zabel@pengutronix.de> # imx6qp
      Tested-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> # rcar + adv746x
      Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
      Tested-by: Aishwarya Kothari <aishwarya.kothari@toradex.com> # Apalis i.MX6Q with TC358743
      Tested-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> # Renesas RZ/G2L SMARC
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
      ed59bbe1