[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2E89032DDAA8B9408CB92943514A0337014C1EE0EE@SW-EX-MBX01.diasemi.com>
Date: Mon, 21 May 2018 13:58:16 +0000
From: Adam Thomson <Adam.Thomson.Opensource@...semi.com>
To: Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
Adam Thomson <Adam.Thomson.Opensource@...semi.com>
CC: Guenter Roeck <linux@...ck-us.net>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Support Opensource <Support.Opensource@...semi.com>
Subject: RE: [PATCH] typec: tcpm: Provide of_node pointer as part of psy_cfg
Hi Heikki,
On 21 May 2018 14:20, Heikki Krogerus wrote:
> On Wed, May 16, 2018 at 05:00:46PM +0100, Adam Thomson wrote:
> > For supply registration, provide of_node pointer of the port device,
> > via the power_supply_config structure, to allow other psy drivers
> > to add us as a supplier using the 'power-supplies' DT property.
> >
> > Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@...semi.com>
> > ---
> > drivers/usb/typec/tcpm.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/usb/typec/tcpm.c b/drivers/usb/typec/tcpm.c
> > index 72996cc..e7c0b95 100644
> > --- a/drivers/usb/typec/tcpm.c
> > +++ b/drivers/usb/typec/tcpm.c
> > @@ -4500,6 +4500,7 @@ static int devm_tcpm_psy_register(struct tcpm_port
> *port)
> > char *psy_name;
> >
> > psy_cfg.drv_data = port;
> > + psy_cfg.of_node = port->dev->of_node;
> > psy_name = devm_kzalloc(port->dev, psy_name_len, GFP_KERNEL);
> > if (!psy_name)
> > return -ENOMEM;
>
> Would it be possible to use fwnode here instead? It would mean that
> you add a member for it to the struct power_supply_config, and handle
> it separately in power_supply_core.c. You could just convert it to
> of_node there for now.
>
> That is just a request, I'm fine with this, but it would prepare this
> driver for all types of platforms, so less patching would be needed
> once we add ACPI support to the power_supply_core.c.
Would the following commit from Hans, already present in power_supply_core.c,
not fit the bill:
[58a36bb06891ee779074db6ef84e98347c634d38]
power: supply: core: Add support for supplied-from device-property
Or was that just meant as a stop gap for something more?
I have no problems adding something further, but I don't have a means to verify
anything ACPI based, beyond a simple build test, so would ideally want someone
to verify that path through the code.
Powered by blists - more mailing lists