Message ID | 20200701062140.12953-2-laurent.pinchart+renesas@ideasonboard.com (mailing list archive) |
---|---|
State | Mainlined |
Commit | 35694afc92646ac24d7f3ef34a7387876d998fe7 |
Delegated to: | Geert Uytterhoeven |
Headers | show |
Series | media: v4l2-async: Accept endpoints and devices for fwnode matching | expand |
Hi Laurent, On Wed, Jul 01, 2020 at 09:21:37AM +0300, Laurent Pinchart wrote: > Drivers may need to test if a fwnode is a graph endpoint. To avoid > hand-written solutions that wouldn't work for all fwnode types, add a > new fwnode_graph_is_endpoint() function for this purpose. We don't need > to wire it up to different backends for OF and ACPI for now, as the > implementation can simply be based on checkout the presence of a > remote-endpoint property. > > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > include/linux/property.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/property.h b/include/linux/property.h > index 10d03572f52e..9f805c442819 100644 > --- a/include/linux/property.h > +++ b/include/linux/property.h > @@ -389,6 +389,11 @@ struct fwnode_handle * > fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port, > u32 endpoint); > > +static inline bool fwnode_graph_is_endpoint(struct fwnode_handle *fwnode) > +{ > + return fwnode_property_present(fwnode, "remote-endpoint"); > +} > + > /* > * Fwnode lookup flags > * Thanks for the patch. I've bounced it to devicetree and linux-acpi lists (now cc'd) --- hope that works. Rafael: do you think this simple patch could go though the media tree, assuming that folks are generally fine with the patch as such? Alternatively, Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
On Wed, Jul 1, 2020 at 9:34 AM Sakari Ailus <sakari.ailus@iki.fi> wrote: > > Hi Laurent, > > On Wed, Jul 01, 2020 at 09:21:37AM +0300, Laurent Pinchart wrote: > > Drivers may need to test if a fwnode is a graph endpoint. To avoid > > hand-written solutions that wouldn't work for all fwnode types, add a > > new fwnode_graph_is_endpoint() function for this purpose. We don't need > > to wire it up to different backends for OF and ACPI for now, as the > > implementation can simply be based on checkout the presence of a > > remote-endpoint property. > > > > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > > --- > > include/linux/property.h | 5 +++++ > > 1 file changed, 5 insertions(+) > > > > diff --git a/include/linux/property.h b/include/linux/property.h > > index 10d03572f52e..9f805c442819 100644 > > --- a/include/linux/property.h > > +++ b/include/linux/property.h > > @@ -389,6 +389,11 @@ struct fwnode_handle * > > fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port, > > u32 endpoint); > > > > +static inline bool fwnode_graph_is_endpoint(struct fwnode_handle *fwnode) > > +{ > > + return fwnode_property_present(fwnode, "remote-endpoint"); > > +} > > + > > /* > > * Fwnode lookup flags > > * > > Thanks for the patch. I've bounced it to devicetree and linux-acpi lists > (now cc'd) --- hope that works. > > Rafael: do you think this simple patch could go though the media tree, > assuming that folks are generally fine with the patch as such? Yes, it could.
Hi Laurent, Thanks for your work. On 2020-07-01 09:21:37 +0300, Laurent Pinchart wrote: > Drivers may need to test if a fwnode is a graph endpoint. To avoid > hand-written solutions that wouldn't work for all fwnode types, add a > new fwnode_graph_is_endpoint() function for this purpose. We don't need > to wire it up to different backends for OF and ACPI for now, as the > implementation can simply be based on checkout the presence of a > remote-endpoint property. > > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> > --- > include/linux/property.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/property.h b/include/linux/property.h > index 10d03572f52e..9f805c442819 100644 > --- a/include/linux/property.h > +++ b/include/linux/property.h > @@ -389,6 +389,11 @@ struct fwnode_handle * > fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port, > u32 endpoint); > > +static inline bool fwnode_graph_is_endpoint(struct fwnode_handle *fwnode) > +{ > + return fwnode_property_present(fwnode, "remote-endpoint"); > +} > + > /* > * Fwnode lookup flags > * > -- > Regards, > > Laurent Pinchart >
Hi Laurent, Thank you for the patch. On Wed, Jul 1, 2020 at 7:21 AM Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> wrote: > > Drivers may need to test if a fwnode is a graph endpoint. To avoid > hand-written solutions that wouldn't work for all fwnode types, add a > new fwnode_graph_is_endpoint() function for this purpose. We don't need > to wire it up to different backends for OF and ACPI for now, as the > implementation can simply be based on checkout the presence of a > remote-endpoint property. > > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > include/linux/property.h | 5 +++++ > 1 file changed, 5 insertions(+) > Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Cheers, --Prabhakar > diff --git a/include/linux/property.h b/include/linux/property.h > index 10d03572f52e..9f805c442819 100644 > --- a/include/linux/property.h > +++ b/include/linux/property.h > @@ -389,6 +389,11 @@ struct fwnode_handle * > fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port, > u32 endpoint); > > +static inline bool fwnode_graph_is_endpoint(struct fwnode_handle *fwnode) > +{ > + return fwnode_property_present(fwnode, "remote-endpoint"); > +} > + > /* > * Fwnode lookup flags > * > -- > Regards, > > Laurent Pinchart >
Hi Laurent, On 01/07/2020 07:21, Laurent Pinchart wrote: > Drivers may need to test if a fwnode is a graph endpoint. To avoid > hand-written solutions that wouldn't work for all fwnode types, add a > new fwnode_graph_is_endpoint() function for this purpose. We don't need > to wire it up to different backends for OF and ACPI for now, as the > implementation can simply be based on checkout the presence of a > remote-endpoint property. > > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Great, this makes the usage in [2/4] much more readable, and isolates the internal knowledge of fw_node_properties where it should be. Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> > --- > include/linux/property.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/property.h b/include/linux/property.h > index 10d03572f52e..9f805c442819 100644 > --- a/include/linux/property.h > +++ b/include/linux/property.h > @@ -389,6 +389,11 @@ struct fwnode_handle * > fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port, > u32 endpoint); > > +static inline bool fwnode_graph_is_endpoint(struct fwnode_handle *fwnode) > +{ > + return fwnode_property_present(fwnode, "remote-endpoint"); > +} > + > /* > * Fwnode lookup flags > * >
Rafael, On Wed, Jul 01, 2020 at 02:19:21PM +0200, Rafael J. Wysocki wrote: > On Wed, Jul 1, 2020 at 9:34 AM Sakari Ailus <sakari.ailus@iki.fi> wrote: > > > > Hi Laurent, > > > > On Wed, Jul 01, 2020 at 09:21:37AM +0300, Laurent Pinchart wrote: > > > Drivers may need to test if a fwnode is a graph endpoint. To avoid > > > hand-written solutions that wouldn't work for all fwnode types, add a > > > new fwnode_graph_is_endpoint() function for this purpose. We don't need > > > to wire it up to different backends for OF and ACPI for now, as the > > > implementation can simply be based on checkout the presence of a > > > remote-endpoint property. > > > > > > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > > > --- > > > include/linux/property.h | 5 +++++ > > > 1 file changed, 5 insertions(+) > > > > > > diff --git a/include/linux/property.h b/include/linux/property.h > > > index 10d03572f52e..9f805c442819 100644 > > > --- a/include/linux/property.h > > > +++ b/include/linux/property.h > > > @@ -389,6 +389,11 @@ struct fwnode_handle * > > > fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port, > > > u32 endpoint); > > > > > > +static inline bool fwnode_graph_is_endpoint(struct fwnode_handle *fwnode) > > > +{ > > > + return fwnode_property_present(fwnode, "remote-endpoint"); > > > +} > > > + > > > /* > > > * Fwnode lookup flags > > > * > > > > Thanks for the patch. I've bounced it to devicetree and linux-acpi lists > > (now cc'd) --- hope that works. > > > > Rafael: do you think this simple patch could go though the media tree, > > assuming that folks are generally fine with the patch as such? > > Yes, it could. Thanks! I've applied this to my tree.
Hi Sakari, On Wed, Jul 15, 2020 at 11:57:17PM +0300, Sakari Ailus wrote: > On Wed, Jul 01, 2020 at 02:19:21PM +0200, Rafael J. Wysocki wrote: > > On Wed, Jul 1, 2020 at 9:34 AM Sakari Ailus <sakari.ailus@iki.fi> wrote: > > > On Wed, Jul 01, 2020 at 09:21:37AM +0300, Laurent Pinchart wrote: > > > > Drivers may need to test if a fwnode is a graph endpoint. To avoid > > > > hand-written solutions that wouldn't work for all fwnode types, add a > > > > new fwnode_graph_is_endpoint() function for this purpose. We don't need > > > > to wire it up to different backends for OF and ACPI for now, as the > > > > implementation can simply be based on checkout the presence of a > > > > remote-endpoint property. > > > > > > > > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > > > > --- > > > > include/linux/property.h | 5 +++++ > > > > 1 file changed, 5 insertions(+) > > > > > > > > diff --git a/include/linux/property.h b/include/linux/property.h > > > > index 10d03572f52e..9f805c442819 100644 > > > > --- a/include/linux/property.h > > > > +++ b/include/linux/property.h > > > > @@ -389,6 +389,11 @@ struct fwnode_handle * > > > > fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port, > > > > u32 endpoint); > > > > > > > > +static inline bool fwnode_graph_is_endpoint(struct fwnode_handle *fwnode) > > > > +{ > > > > + return fwnode_property_present(fwnode, "remote-endpoint"); > > > > +} > > > > + > > > > /* > > > > * Fwnode lookup flags > > > > * > > > > > > Thanks for the patch. I've bounced it to devicetree and linux-acpi lists > > > (now cc'd) --- hope that works. > > > > > > Rafael: do you think this simple patch could go though the media tree, > > > assuming that folks are generally fine with the patch as such? > > > > Yes, it could. > > Thanks! I've applied this to my tree. Do you mean the whole series ? :-) Do you intend to send a pull request for v5.9 ?
On Fri, Jul 17, 2020 at 05:19:16AM +0300, Laurent Pinchart wrote: > Hi Sakari, > > On Wed, Jul 15, 2020 at 11:57:17PM +0300, Sakari Ailus wrote: > > On Wed, Jul 01, 2020 at 02:19:21PM +0200, Rafael J. Wysocki wrote: > > > On Wed, Jul 1, 2020 at 9:34 AM Sakari Ailus <sakari.ailus@iki.fi> wrote: > > > > On Wed, Jul 01, 2020 at 09:21:37AM +0300, Laurent Pinchart wrote: > > > > > Drivers may need to test if a fwnode is a graph endpoint. To avoid > > > > > hand-written solutions that wouldn't work for all fwnode types, add a > > > > > new fwnode_graph_is_endpoint() function for this purpose. We don't need > > > > > to wire it up to different backends for OF and ACPI for now, as the > > > > > implementation can simply be based on checkout the presence of a > > > > > remote-endpoint property. > > > > > > > > > > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > > > > > --- > > > > > include/linux/property.h | 5 +++++ > > > > > 1 file changed, 5 insertions(+) > > > > > > > > > > diff --git a/include/linux/property.h b/include/linux/property.h > > > > > index 10d03572f52e..9f805c442819 100644 > > > > > --- a/include/linux/property.h > > > > > +++ b/include/linux/property.h > > > > > @@ -389,6 +389,11 @@ struct fwnode_handle * > > > > > fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port, > > > > > u32 endpoint); > > > > > > > > > > +static inline bool fwnode_graph_is_endpoint(struct fwnode_handle *fwnode) > > > > > +{ > > > > > + return fwnode_property_present(fwnode, "remote-endpoint"); > > > > > +} > > > > > + > > > > > /* > > > > > * Fwnode lookup flags > > > > > * > > > > > > > > Thanks for the patch. I've bounced it to devicetree and linux-acpi lists > > > > (now cc'd) --- hope that works. > > > > > > > > Rafael: do you think this simple patch could go though the media tree, > > > > assuming that folks are generally fine with the patch as such? > > > > > > Yes, it could. > > > > Thanks! I've applied this to my tree. > > Do you mean the whole series ? :-) Do you intend to send a pull request > for v5.9 ? It's here: <URL:https://patchwork.linuxtv.org/project/linux-media/patch/20200715222030.GG836@valkosipuli.retiisi.org.uk/>
diff --git a/include/linux/property.h b/include/linux/property.h index 10d03572f52e..9f805c442819 100644 --- a/include/linux/property.h +++ b/include/linux/property.h @@ -389,6 +389,11 @@ struct fwnode_handle * fwnode_graph_get_remote_node(const struct fwnode_handle *fwnode, u32 port, u32 endpoint); +static inline bool fwnode_graph_is_endpoint(struct fwnode_handle *fwnode) +{ + return fwnode_property_present(fwnode, "remote-endpoint"); +} + /* * Fwnode lookup flags *
Drivers may need to test if a fwnode is a graph endpoint. To avoid hand-written solutions that wouldn't work for all fwnode types, add a new fwnode_graph_is_endpoint() function for this purpose. We don't need to wire it up to different backends for OF and ACPI for now, as the implementation can simply be based on checkout the presence of a remote-endpoint property. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> --- include/linux/property.h | 5 +++++ 1 file changed, 5 insertions(+)