From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
support.opensource@diasemi.com
Subject: typec: tcpm: Provide of_node pointer as part of psy_cfg
Date: Mon, 21 May 2018 16:20:16 +0300 [thread overview]
Message-ID: <20180521132016.GC10677@kuha.fi.intel.com> (raw)
Hi Adam,
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@diasemi.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.
Thanks,
WARNING: multiple messages have this Message-ID (diff)
From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
support.opensource@diasemi.com
Subject: Re: [PATCH] typec: tcpm: Provide of_node pointer as part of psy_cfg
Date: Mon, 21 May 2018 16:20:16 +0300 [thread overview]
Message-ID: <20180521132016.GC10677@kuha.fi.intel.com> (raw)
In-Reply-To: <20180516160046.18FCF3FAD3@swsrvapps-01.diasemi.com>
Hi Adam,
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@diasemi.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.
Thanks,
--
heikki
next reply other threads:[~2018-05-21 13:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-21 13:20 Heikki Krogerus [this message]
2018-05-21 13:20 ` [PATCH] typec: tcpm: Provide of_node pointer as part of psy_cfg Heikki Krogerus
-- strict thread matches above, loose matches on Subject: below --
2018-05-22 9:47 Heikki Krogerus
2018-05-22 9:47 ` [PATCH] " Heikki Krogerus
2018-05-21 15:34 Opensource [Adam Thomson]
2018-05-21 15:34 ` [PATCH] " Adam Thomson
2018-05-21 14:55 Heikki Krogerus
2018-05-21 14:55 ` [PATCH] " Heikki Krogerus
2018-05-21 13:58 Opensource [Adam Thomson]
2018-05-21 13:58 ` [PATCH] " Adam Thomson
2018-05-16 16:00 Opensource [Adam Thomson]
2018-05-16 16:00 ` [PATCH] " Adam Thomson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180521132016.GC10677@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=Adam.Thomson.Opensource@diasemi.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=support.opensource@diasemi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.