diff options
author | Adam Thomson <[email protected]> | 2018-05-22 16:16:24 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2018-05-24 18:14:27 +0200 |
commit | c97a8cc17f4472d85f889230ea6bac5aa8c53560 (patch) | |
tree | 236fb1a9b26c8bcd549911f7c4c44b27dabcaac6 | |
parent | ece711b5a42ce9b99a2a3706c56bf70a5425a7bf (diff) |
typec: tcpm: Provide fwnode pointer as part of psy_cfg
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 <[email protected]>
Suggested-by: Heikki Krogerus <[email protected]>
Reviewed-by: Heikki Krogerus <[email protected]>
Reviewed-by: Guenter Roeck <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
-rw-r--r-- | drivers/usb/typec/tcpm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c index 72996cca0fe5..0ccd2ce1eb59 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; |