All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 00/15] Add functionality to ipu3-cio2 driver allowing software_node connections to sensors on platforms designed for Windows
@ 2021-01-07 13:28 Daniel Scally
  2021-01-07 13:28 ` [PATCH v5 01/15] software_node: Fix refcounts in software_node_get_next_child() Daniel Scally
                   ` (16 more replies)
  0 siblings, 17 replies; 54+ messages in thread
From: Daniel Scally @ 2021-01-07 13:28 UTC (permalink / raw)
  To: linux-kernel, linux-acpi, linux-media, devel, rjw, lenb, gregkh,
	mchehab, sergey.senozhatsky
  Cc: yong.zhi, sakari.ailus, bingbu.cao, tian.shu.qiu, robert.moore,
	erik.kaneda, pmladek, rostedt, andriy.shevchenko, linux,
	laurent.pinchart+renesas, jacopo+renesas, kieran.bingham+renesas,
	hverkuil-cisco, m.felsch, niklas.soderlund+renesas,
	prabhakar.mahadev-lad.rj, slongerbeam, heikki.krogerus


Hello all

v4:
https://lore.kernel.org/linux-media/20210103231235.792999-1-djrscally@gmail.com/T/#m11b7cb977e1b73fba1e625c3d6a189e2943a7783
v3:
https://lore.kernel.org/linux-media/20201224010907.263125-1-djrscally@gmail.com/T/#m37b831bb2b406917d6db5da9acf9ed35df65d72d
v2:
https://lore.kernel.org/linux-media/20201217234337.1983732-1-djrscally@gmail.com/T/#md93fd090009b42a6a98aed892aff0d38cf07e0cd
v1:
https://lore.kernel.org/linux-media/20201130133129.1024662-1-djrscally@gmail.com/T/#m91934e12e3d033da2e768e952ea3b4a125ee3e67

This series is to start adding support for webcams on laptops with ACPI tables
designed for use with CIO2 on Windows. This series extends the ipu3-cio2
driver to allow for patching the firmware via software_nodes if endpoints
aren't defined by ACPI.

I'm hopeful that most or all of this series could get picked up for 5.12.
We touch a few different areas (listed below), but I think the easiest
approach would be to merge everything through media tree. Rafael, Greg,
Mauro and Sergey; are you ok with that plan, or would you prefer a
different approach? Mauro; if that plan is ok (and of course assuming that
the rest of the patches are acked by their respective maintainers) could
we get a dedicated feature branch just in case the following series ends
up being ready in time too?

lib
  lib/test_printf.c: Use helper function to unwind array of
    software_nodes

base
  software_node: Fix refcounts in software_node_get_next_child()
  property: Return true in fwnode_device_is_available for NULL ops
  property: Call fwnode_graph_get_endpoint_by_id() for fwnode->secondary
  software_node: Enforce parent before child ordering of nodes arrays
  software_node: unregister software_nodes in reverse order
  include: fwnode.h: Define format macros for ports and endpoints

acpi
  acpi: Add acpi_dev_get_next_match_dev() and helper macro

media
  media: v4l2-core: v4l2-async: Check sd->fwnode->secondary in
    match_fwnode()
  ipu3-cio2: Add T: entry to MAINTAINERS
  ipu3-cio2: Rename ipu3-cio2.c
  ipu3-cio2: Add cio2-bridge to ipu3-cio2 driver
  include: media: v4l2-fwnode: Include v4l2_fwnode_bus_type

Series-level changelog:
	- Rebased onto 5.11-rc1

Thanks
Dan

Andy Shevchenko (1):
  media: ipu3-cio2: Add headers that ipu3-cio2.h is direct user of

Daniel Scally (13):
  software_node: Fix refcounts in software_node_get_next_child()
  device property: Return true in fwnode_device_is_available for NULL
    ops
  device property: Call fwnode_graph_get_endpoint_by_id() for
    fwnode->secondary
  software_node: Enforce parent before child ordering of nodes arrays
  software_node: unregister software_nodes in reverse order
  device property: Define format macros for ports and endpoints
  lib/test_printf.c: Use helper function to unwind array of
    software_nodes
  ipu3-cio2: Add T: entry to MAINTAINERS
  ipu3-cio2: Rename ipu3-cio2.c
  media: v4l2-core: v4l2-async: Check sd->fwnode->secondary in
    match_fwnode()
  ACPI / bus: Add acpi_dev_get_next_match_dev() and helper macro
  media: v4l2-fwnode: Include v4l2_fwnode_bus_type
  ipu3-cio2: Add cio2-bridge to ipu3-cio2 driver

Heikki Krogerus (1):
  software_node: Add support for fwnode_graph*() family of functions

 MAINTAINERS                                   |   2 +
 drivers/acpi/utils.c                          |  30 +-
 drivers/base/property.c                       |  15 +-
 drivers/base/swnode.c                         | 180 ++++++++--
 drivers/media/pci/intel/ipu3/Kconfig          |  18 +
 drivers/media/pci/intel/ipu3/Makefile         |   3 +
 drivers/media/pci/intel/ipu3/cio2-bridge.c    | 311 ++++++++++++++++++
 drivers/media/pci/intel/ipu3/cio2-bridge.h    | 125 +++++++
 .../ipu3/{ipu3-cio2.c => ipu3-cio2-main.c}    |  34 ++
 drivers/media/pci/intel/ipu3/ipu3-cio2.h      |  24 ++
 drivers/media/v4l2-core/v4l2-async.c          |   8 +
 drivers/media/v4l2-core/v4l2-fwnode.c         |  11 -
 include/acpi/acpi_bus.h                       |   7 +
 include/linux/fwnode.h                        |   7 +
 include/media/v4l2-fwnode.h                   |  22 ++
 lib/test_printf.c                             |   4 +-
 16 files changed, 763 insertions(+), 38 deletions(-)
 create mode 100644 drivers/media/pci/intel/ipu3/cio2-bridge.c
 create mode 100644 drivers/media/pci/intel/ipu3/cio2-bridge.h
 rename drivers/media/pci/intel/ipu3/{ipu3-cio2.c => ipu3-cio2-main.c} (98%)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 54+ messages in thread
* [Devel] Re: [PATCH v5 13/15] ACPI / bus: Add acpi_dev_get_next_match_dev() and helper macro
  2021-01-07 13:28 ` [PATCH v5 13/15] ACPI / bus: Add acpi_dev_get_next_match_dev() and helper macro Daniel Scally
@ 2021-01-12 19:25 ` Rafael J. Wysocki
  0 siblings, 0 replies; 54+ messages in thread
From: Rafael J. Wysocki @ 2021-01-12 19:25 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 4848 bytes --]

On Thu, Jan 7, 2021 at 2:31 PM Daniel Scally <djrscally(a)gmail.com> wrote:
>
> To ensure we handle situations in which multiple sensors of the same
> model (and therefore _HID) are present in a system, we need to be able
> to iterate over devices matching a known _HID but unknown _UID and _HRV
>  - add acpi_dev_get_next_match_dev() to accommodate that possibility and
> change acpi_dev_get_first_match_dev() to simply call the new function
> with a NULL starting point. Add an iterator macro for convenience.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko(a)linux.intel.com>
> Reviewed-by: Sakari Ailus <sakari.ailus(a)linux.intel.com>
> Suggested-by: Andy Shevchenko <andriy.shevchenko(a)linux.intel.com>
> Signed-off-by: Daniel Scally <djrscally(a)gmail.com>

Acked-by: Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>

> ---
> Changes in v5:
>
>         - Changed commit subject
>
>  drivers/acpi/utils.c    | 30 ++++++++++++++++++++++++++----
>  include/acpi/acpi_bus.h |  7 +++++++
>  2 files changed, 33 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
> index d5411a166685..ddca1550cce6 100644
> --- a/drivers/acpi/utils.c
> +++ b/drivers/acpi/utils.c
> @@ -843,12 +843,13 @@ bool acpi_dev_present(const char *hid, const char *uid, s64 hrv)
>  EXPORT_SYMBOL(acpi_dev_present);
>
>  /**
> - * acpi_dev_get_first_match_dev - Return the first match of ACPI device
> + * acpi_dev_get_next_match_dev - Return the next match of ACPI device
> + * @adev: Pointer to the previous acpi_device matching this @hid, @uid and @hrv
>   * @hid: Hardware ID of the device.
>   * @uid: Unique ID of the device, pass NULL to not check _UID
>   * @hrv: Hardware Revision of the device, pass -1 to not check _HRV
>   *
> - * Return the first match of ACPI device if a matching device was present
> + * Return the next match of ACPI device if another matching device was present
>   * at the moment of invocation, or NULL otherwise.
>   *
>   * The caller is responsible to call put_device() on the returned device.
> @@ -856,8 +857,9 @@ EXPORT_SYMBOL(acpi_dev_present);
>   * See additional information in acpi_dev_present() as well.
>   */
>  struct acpi_device *
> -acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv)
> +acpi_dev_get_next_match_dev(struct acpi_device *adev, const char *hid, const char *uid, s64 hrv)
>  {
> +       struct device *start = adev ? &adev->dev : NULL;
>         struct acpi_dev_match_info match = {};
>         struct device *dev;
>
> @@ -865,9 +867,29 @@ acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv)
>         match.uid = uid;
>         match.hrv = hrv;
>
> -       dev = bus_find_device(&acpi_bus_type, NULL, &match, acpi_dev_match_cb);
> +       dev = bus_find_device(&acpi_bus_type, start, &match, acpi_dev_match_cb);
>         return dev ? to_acpi_device(dev) : NULL;
>  }
> +EXPORT_SYMBOL(acpi_dev_get_next_match_dev);
> +
> +/**
> + * acpi_dev_get_first_match_dev - Return the first match of ACPI device
> + * @hid: Hardware ID of the device.
> + * @uid: Unique ID of the device, pass NULL to not check _UID
> + * @hrv: Hardware Revision of the device, pass -1 to not check _HRV
> + *
> + * Return the first match of ACPI device if a matching device was present
> + * at the moment of invocation, or NULL otherwise.
> + *
> + * The caller is responsible to call put_device() on the returned device.
> + *
> + * See additional information in acpi_dev_present() as well.
> + */
> +struct acpi_device *
> +acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv)
> +{
> +       return acpi_dev_get_next_match_dev(NULL, hid, uid, hrv);
> +}
>  EXPORT_SYMBOL(acpi_dev_get_first_match_dev);
>
>  /*
> diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
> index 6d1879bf9440..02a716a0af5d 100644
> --- a/include/acpi/acpi_bus.h
> +++ b/include/acpi/acpi_bus.h
> @@ -683,9 +683,16 @@ static inline bool acpi_device_can_poweroff(struct acpi_device *adev)
>
>  bool acpi_dev_hid_uid_match(struct acpi_device *adev, const char *hid2, const char *uid2);
>
> +struct acpi_device *
> +acpi_dev_get_next_match_dev(struct acpi_device *adev, const char *hid, const char *uid, s64 hrv);
>  struct acpi_device *
>  acpi_dev_get_first_match_dev(const char *hid, const char *uid, s64 hrv);
>
> +#define for_each_acpi_dev_match(adev, hid, uid, hrv)                   \
> +       for (adev = acpi_dev_get_first_match_dev(hid, uid, hrv);        \
> +            adev;                                                      \
> +            adev = acpi_dev_get_next_match_dev(adev, hid, uid, hrv))
> +
>  static inline void acpi_dev_put(struct acpi_device *adev)
>  {
>         put_device(&adev->dev);
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 54+ messages in thread
* [Devel] Re: [PATCH v5 13/15] ACPI / bus: Add acpi_dev_get_next_match_dev() and helper macro
  2021-01-09  1:54   ` Laurent Pinchart
@ 2021-01-12 19:26 ` Rafael J. Wysocki
  -1 siblings, 0 replies; 54+ messages in thread
From: Rafael J. Wysocki @ 2021-01-12 19:26 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 339 bytes --]

Hi,

On Sat, Jan 9, 2021 at 2:55 AM Laurent Pinchart
<laurent.pinchart(a)ideasonboard.com> wrote:
>
> Hi Rafael,
>
> Could you please review this patch, and let us know (see question in the
> cover letter)

Done, sorry for the delay.

> if it can be merged through the linux-media tree for v5.12
> ?

Yes, it can.

Thanks!

^ permalink raw reply	[flat|nested] 54+ messages in thread
* [Devel] Re: [PATCH v5 07/15] device property: Define format macros for ports and endpoints
  2021-01-07 13:28 ` [PATCH v5 07/15] device property: Define format macros for ports and endpoints Daniel Scally
@ 2021-01-12 19:29 ` Rafael J. Wysocki
  2021-01-09  2:05   ` Laurent Pinchart
  1 sibling, 0 replies; 54+ messages in thread
From: Rafael J. Wysocki @ 2021-01-12 19:29 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 1543 bytes --]

On Thu, Jan 7, 2021 at 2:31 PM Daniel Scally <djrscally(a)gmail.com> wrote:
>
> OF, ACPI and software_nodes all implement graphs including nodes for ports
> and endpoints. These are all intended to be named with a common schema,
> as "port(a)n" and "endpoint(a)n" where n is an unsigned int representing the
> index of the node. To ensure commonality across the subsystems, provide a
> set of macros to define the format.
>
> Suggested-by: Andy Shevchenko <andriy.shevchenko(a)linux.intel.com>
> Reviewed-by: Andy Shevchenko <andy.shevchenko(a)gmail.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart(a)ideasonboard.com>
> Signed-off-by: Daniel Scally <djrscally(a)gmail.com>

Acked-by: Rafael J. Wysocki <rafael.j.wysocki(a)intel.com>

> ---
> Changes in v5:
>
>         - Changed commit subject
>
>  include/linux/fwnode.h | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
> index fde4ad97564c..77414e431e89 100644
> --- a/include/linux/fwnode.h
> +++ b/include/linux/fwnode.h
> @@ -50,6 +50,13 @@ struct fwnode_endpoint {
>         const struct fwnode_handle *local_fwnode;
>  };
>
> +/*
> + * ports and endpoints defined as software_nodes should all follow a common
> + * naming scheme; use these macros to ensure commonality.
> + */
> +#define SWNODE_GRAPH_PORT_NAME_FMT             "port@%u"
> +#define SWNODE_GRAPH_ENDPOINT_NAME_FMT         "endpoint@%u"
> +
>  #define NR_FWNODE_REFERENCE_ARGS       8
>
>  /**
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 54+ messages in thread
* [Devel] Re: [PATCH v5 07/15] device property: Define format macros for ports and endpoints
  2021-01-09  2:05   ` Laurent Pinchart
@ 2021-01-12 19:30 ` Rafael J. Wysocki
  -1 siblings, 0 replies; 54+ messages in thread
From: Rafael J. Wysocki @ 2021-01-12 19:30 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 293 bytes --]

On Sat, Jan 9, 2021 at 3:06 AM Laurent Pinchart
<laurent.pinchart(a)ideasonboard.com> wrote:
>
> Hi Rafael,
>
> Could you please let us know with an Acked-by

Done, sorry for the delay.

> if this patch can be merged through the linux-media tree for v5.12 ?

Yes, it can.

Thanks!

^ permalink raw reply	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2021-01-27  9:29 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-07 13:28 [PATCH v5 00/15] Add functionality to ipu3-cio2 driver allowing software_node connections to sensors on platforms designed for Windows Daniel Scally
2021-01-07 13:28 ` [PATCH v5 01/15] software_node: Fix refcounts in software_node_get_next_child() Daniel Scally
2021-01-07 13:45   ` Heikki Krogerus
2021-01-10 15:09   ` Greg KH
2021-01-07 13:28 ` [PATCH v5 02/15] media: ipu3-cio2: Add headers that ipu3-cio2.h is direct user of Daniel Scally
2021-01-07 13:28 ` [PATCH v5 03/15] device property: Return true in fwnode_device_is_available for NULL ops Daniel Scally
2021-01-07 13:47   ` Heikki Krogerus
2021-01-10 15:09   ` Greg KH
2021-01-07 13:28 ` [PATCH v5 04/15] device property: Call fwnode_graph_get_endpoint_by_id() for fwnode->secondary Daniel Scally
2021-01-10 15:09   ` Greg KH
2021-01-07 13:28 ` [PATCH v5 05/15] software_node: Enforce parent before child ordering of nodes arrays Daniel Scally
2021-01-07 14:04   ` Heikki Krogerus
2021-01-10 15:09   ` Greg KH
2021-01-07 13:28 ` [PATCH v5 06/15] software_node: unregister software_nodes in reverse order Daniel Scally
2021-01-07 14:05   ` Heikki Krogerus
2021-01-10 15:09   ` Greg KH
2021-01-07 13:28 ` [PATCH v5 07/15] device property: Define format macros for ports and endpoints Daniel Scally
2021-01-07 14:06   ` Heikki Krogerus
2021-01-09  2:05   ` Laurent Pinchart
2021-01-07 13:28 ` [PATCH v5 08/15] software_node: Add support for fwnode_graph*() family of functions Daniel Scally
2021-01-10 15:08   ` Greg KH
2021-01-07 13:28 ` [PATCH v5 09/15] lib/test_printf.c: Use helper function to unwind array of software_nodes Daniel Scally
2021-01-09  2:01   ` Laurent Pinchart
2021-01-09  9:07     ` [Devel] " Andy Shevchenko
2021-01-10 11:16       ` Laurent Pinchart
2021-01-10 15:38         ` Andy Shevchenko
2021-01-10 15:38           ` [Devel] " Andy Shevchenko
2021-01-10 15:52           ` Laurent Pinchart
2021-01-13 13:23     ` Sakari Ailus
2021-01-27  9:25       ` Geert Uytterhoeven
2021-01-07 13:28 ` [PATCH v5 10/15] ipu3-cio2: Add T: entry to MAINTAINERS Daniel Scally
2021-01-07 13:28 ` [PATCH v5 11/15] ipu3-cio2: Rename ipu3-cio2.c Daniel Scally
2021-01-07 13:28 ` [PATCH v5 12/15] media: v4l2-core: v4l2-async: Check sd->fwnode->secondary in match_fwnode() Daniel Scally
2021-01-07 13:28 ` [PATCH v5 13/15] ACPI / bus: Add acpi_dev_get_next_match_dev() and helper macro Daniel Scally
2021-01-09  1:54   ` Laurent Pinchart
2021-01-07 13:28 ` [PATCH v5 14/15] media: v4l2-fwnode: Include v4l2_fwnode_bus_type Daniel Scally
2021-01-07 13:28 ` [PATCH v5 15/15] ipu3-cio2: Add cio2-bridge to ipu3-cio2 driver Daniel Scally
2021-01-07 14:05   ` Andy Shevchenko
2021-01-07 14:05     ` Andy Shevchenko
2021-01-07 14:07   ` Daniel Scally
2021-01-09  2:08 ` [PATCH v5 00/15] Add functionality to ipu3-cio2 driver allowing software_node connections to sensors on platforms designed for Windows Laurent Pinchart
2021-01-10 15:08   ` Greg Kroah-Hartman
2021-01-12 19:34 ` [Devel] " Rafael J. Wysocki
2021-01-12 19:34   ` Rafael J. Wysocki
2021-01-12 23:35   ` Daniel Scally
2021-01-13 11:42     ` Sakari Ailus
  -- strict thread matches above, loose matches on Subject: below --
2021-01-12 19:25 [Devel] Re: [PATCH v5 13/15] ACPI / bus: Add acpi_dev_get_next_match_dev() and helper macro Rafael J. Wysocki
2021-01-12 19:25 ` Rafael J. Wysocki
2021-01-12 19:26 [Devel] " Rafael J. Wysocki
2021-01-12 19:26 ` Rafael J. Wysocki
2021-01-12 19:29 [Devel] Re: [PATCH v5 07/15] device property: Define format macros for ports and endpoints Rafael J. Wysocki
2021-01-12 19:29 ` Rafael J. Wysocki
2021-01-12 19:30 [Devel] " Rafael J. Wysocki
2021-01-12 19:30 ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.