* [2/2] typec: tcpm: Provide fwnode pointer as part of psy_cfg
@ 2018-05-22 15:16 Opensource [Adam Thomson]
0 siblings, 0 replies; 3+ messages in thread
From: Opensource [Adam Thomson] @ 2018-05-22 15:16 UTC (permalink / raw)
To: Heikki Krogerus, Guenter Roeck, Greg Kroah-Hartman,
Sebastian Reichel
Cc: linux-usb, linux-pm, linux-kernel, support.opensource
For supply registration, provide fwnode pointer of the port device,
via the power_supply_config structure, to allow other psy drivers
to add us as a supplier. At present this only applies to DT
based platforms using the 'power-supplies' DT property, but in the
future should also work for ACPI platforms when the relevant support
is added to the power_supply core.
Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Suggested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
---
drivers/usb/typec/tcpm.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c
index 72996cc..0ccd2ce 100644
--- a/drivers/usb/typec/tcpm.c
+++ b/drivers/usb/typec/tcpm.c
@@ -14,6 +14,7 @@
#include <linux/mutex.h>
#include <linux/power_supply.h>
#include <linux/proc_fs.h>
+#include <linux/property.h>
#include <linux/sched/clock.h>
#include <linux/seq_file.h>
#include <linux/slab.h>
@@ -4500,6 +4501,7 @@ static int devm_tcpm_psy_register(struct tcpm_port *port)
char *psy_name;
psy_cfg.drv_data = port;
+ psy_cfg.fwnode = dev_fwnode(port->dev);
psy_name = devm_kzalloc(port->dev, psy_name_len, GFP_KERNEL);
if (!psy_name)
return -ENOMEM;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [2/2] typec: tcpm: Provide fwnode pointer as part of psy_cfg
@ 2018-05-22 16:08 Guenter Roeck
0 siblings, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2018-05-22 16:08 UTC (permalink / raw)
To: Adam Thomson
Cc: Heikki Krogerus, Greg Kroah-Hartman, Sebastian Reichel, linux-usb,
linux-pm, linux-kernel, support.opensource
On Tue, May 22, 2018 at 04:16:24PM +0100, Adam Thomson wrote:
> For supply registration, provide fwnode pointer of the port device,
> via the power_supply_config structure, to allow other psy drivers
> to add us as a supplier. At present this only applies to DT
> based platforms using the 'power-supplies' DT property, but in the
> future should also work for ACPI platforms when the relevant support
> is added to the power_supply core.
>
> Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
> Suggested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/usb/typec/tcpm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c
> index 72996cc..0ccd2ce 100644
> --- a/drivers/usb/typec/tcpm.c
> +++ b/drivers/usb/typec/tcpm.c
> @@ -14,6 +14,7 @@
> #include <linux/mutex.h>
> #include <linux/power_supply.h>
> #include <linux/proc_fs.h>
> +#include <linux/property.h>
> #include <linux/sched/clock.h>
> #include <linux/seq_file.h>
> #include <linux/slab.h>
> @@ -4500,6 +4501,7 @@ static int devm_tcpm_psy_register(struct tcpm_port *port)
> char *psy_name;
>
> psy_cfg.drv_data = port;
> + psy_cfg.fwnode = dev_fwnode(port->dev);
> psy_name = devm_kzalloc(port->dev, psy_name_len, GFP_KERNEL);
> if (!psy_name)
> return -ENOMEM;
> --
> 1.9.1
>
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* [2/2] typec: tcpm: Provide fwnode pointer as part of psy_cfg
@ 2018-05-23 6:52 Heikki Krogerus
0 siblings, 0 replies; 3+ messages in thread
From: Heikki Krogerus @ 2018-05-23 6:52 UTC (permalink / raw)
To: Adam Thomson
Cc: Guenter Roeck, Greg Kroah-Hartman, Sebastian Reichel, linux-usb,
linux-pm, linux-kernel, support.opensource
On Tue, May 22, 2018 at 04:16:24PM +0100, Adam Thomson wrote:
> For supply registration, provide fwnode pointer of the port device,
> via the power_supply_config structure, to allow other psy drivers
> to add us as a supplier. At present this only applies to DT
> based platforms using the 'power-supplies' DT property, but in the
> future should also work for ACPI platforms when the relevant support
> is added to the power_supply core.
>
> Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
> Suggested-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> ---
> drivers/usb/typec/tcpm.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c
> index 72996cc..0ccd2ce 100644
> --- a/drivers/usb/typec/tcpm.c
> +++ b/drivers/usb/typec/tcpm.c
> @@ -14,6 +14,7 @@
> #include <linux/mutex.h>
> #include <linux/power_supply.h>
> #include <linux/proc_fs.h>
> +#include <linux/property.h>
> #include <linux/sched/clock.h>
> #include <linux/seq_file.h>
> #include <linux/slab.h>
> @@ -4500,6 +4501,7 @@ static int devm_tcpm_psy_register(struct tcpm_port *port)
> char *psy_name;
>
> psy_cfg.drv_data = port;
> + psy_cfg.fwnode = dev_fwnode(port->dev);
> psy_name = devm_kzalloc(port->dev, psy_name_len, GFP_KERNEL);
> if (!psy_name)
> return -ENOMEM;
Thanks,
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-05-23 6:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-22 16:08 [2/2] typec: tcpm: Provide fwnode pointer as part of psy_cfg Guenter Roeck
-- strict thread matches above, loose matches on Subject: below --
2018-05-23 6:52 Heikki Krogerus
2018-05-22 15:16 Opensource [Adam Thomson]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).