diff mbox series

[4.19.y-cip,01/23] device connection: Add fwnode member to struct device_connection

Message ID 1582034720-5249-2-git-send-email-marian-cristian.rotariu.rb@bp.renesas.com (mailing list archive)
State Rejected, archived
Delegated to: Pavel Machek
Headers show
Series [4.19.y-cip,01/23] device connection: Add fwnode member to struct device_connection | expand

Commit Message

Marian-Cristian Rotariu Feb. 18, 2020, 2:04 p.m. UTC
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>

commit 09aa11cfda9d8186046bcd1adcd6498b688114f4 upstream.

This will prepare the device connection API for connections
described in firmware.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Marian-Cristian Rotariu <marian-cristian.rotariu.rb@bp.renesas.com>
---
 include/linux/device.h | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Pavel Machek Feb. 19, 2020, 7:42 a.m. UTC | #1
Hi!

> From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> 
> commit 09aa11cfda9d8186046bcd1adcd6498b688114f4 upstream.
> 
> This will prepare the device connection API for connections
> described in firmware.

> @@ -753,11 +753,17 @@ struct device_dma_parameters {
>   */
>  struct device_connection {
> +	struct fwnode_handle	*fwnode;
>  	const char		*endpoint[2];
>  	const char		*id;
>  	struct list_head	list;

Ok, so this really needs to be 0-initialized in all cases, or we'll be
breaking existing setups. Are we reasonably sure that's the case?

Best regards,
									Pavel
Marian-Cristian Rotariu Feb. 19, 2020, 7:11 p.m. UTC | #2
> > From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> >
> > commit 09aa11cfda9d8186046bcd1adcd6498b688114f4 upstream.
> >
> > This will prepare the device connection API for connections described
> > in firmware.
> 
> > @@ -753,11 +753,17 @@ struct device_dma_parameters {
> >   */
> >  struct device_connection {
> > +	struct fwnode_handle	*fwnode;
> >  	const char		*endpoint[2];
> >  	const char		*id;
> >  	struct list_head	list;
> 
> Ok, so this really needs to be 0-initialized in all cases, or we'll be breaking
> existing setups. Are we reasonably sure that's the case?

Yes, I need to add two 0-initialization to the following drivers:
drivers/platform/x86/intel_cht_int33fe.c
drivers/extcon/extcon-axp288.c

In upstream, these drivers opt for fwnode node discovery instead of device_connection definitions.
I will do the modifications in v2.

Thanks,
Marian
diff mbox series

Patch

diff --git a/include/linux/device.h b/include/linux/device.h
index 19dd885..ceb69b9 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -753,11 +753,17 @@  struct device_dma_parameters {
 
 /**
  * struct device_connection - Device Connection Descriptor
+ * @fwnode: The device node of the connected device
  * @endpoint: The names of the two devices connected together
  * @id: Unique identifier for the connection
  * @list: List head, private, for internal use only
+ *
+ * NOTE: @fwnode is not used together with @endpoint. @fwnode is used when
+ * platform firmware defines the connection. When the connection is registered
+ * with device_connection_add() @endpoint is used instead.
  */
 struct device_connection {
+	struct fwnode_handle	*fwnode;
 	const char		*endpoint[2];
 	const char		*id;
 	struct list_head	list;