From: Enric Balletbo i Serra <enric.balletbo@collabora.com>
To: Raul E Rangel <rrangel@chromium.org>, Wolfram Sang <wsa@the-dreams.de>
Cc: Akshu.Agrawal@amd.com, Guenter Roeck <groeck@chromium.org>,
linux-kernel@vger.kernel.org, Benson Leung <bleung@chromium.org>
Subject: Re: [PATCH 3/4] platform/chrome: cros_ec: Pass firmware node to MFD device
Date: Mon, 25 Nov 2019 17:30:21 +0100 [thread overview]
Message-ID: <86f40fab-3e68-bc1c-425b-94f681c7b6c6@collabora.com> (raw)
In-Reply-To: <20191121140830.3.I1fbda3ecf40f4631420cbb75ba830d2d3b3bac1e@changeid>
Hi Raul,
One comment below.
On 21/11/19 22:10, Raul E Rangel wrote:
> cros_ec_dev needs to have a firmware node associated with it so mfd
> cells can be properly bound to the correct ACPI/DT nodes.
>
> Signed-off-by: Raul E Rangel <rrangel@chromium.org>
> ---
>
> Before this patch:
> $ find /sys/bus/platform/devices/cros-ec-* -iname firmware_node -exec ls -l '{}' \;
> <nothing>
>
> After this patch:
> $ find /sys/bus/platform/devices/cros-ec-dev.0.auto/ -iname firmware_node -exec ls -l '{}' \;
> /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-ec-accel.1.auto/firmware_node -> ../../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/PNP0C09:00/GOOG0004:00
> /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-ec-chardev.7.auto/firmware_node -> ../../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/PNP0C09:00/GOOG0004:00
> /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-ec-debugfs.8.auto/firmware_node -> ../../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/PNP0C09:00/GOOG0004:00
> /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-ec-gyro.2.auto/firmware_node -> ../../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/PNP0C09:00/GOOG0004:00
> /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-ec-lid-angle.4.auto/firmware_node -> ../../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/PNP0C09:00/GOOG0004:00
> /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-ec-lightbar.9.auto/firmware_node -> ../../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/PNP0C09:00/GOOG0004:00
> /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-ec-pd-sysfs.10.auto/firmware_node -> ../../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/PNP0C09:00/GOOG0004:00
> /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-ec-ring.3.auto/firmware_node -> ../../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/PNP0C09:00/GOOG0004:00
> /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-ec-sysfs.11.auto/firmware_node -> ../../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/PNP0C09:00/GOOG0004:00
> /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-usbpd-charger.5.auto/firmware_node -> ../../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/PNP0C09:00/GOOG0004:00
> /sys/bus/platform/devices/cros-ec-dev.0.auto/cros-usbpd-logger.6.auto/firmware_node -> ../../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/PNP0C09:00/GOOG0004:00
> /sys/bus/platform/devices/cros-ec-dev.0.auto/firmware_node -> ../../../../../LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:1c/PNP0C09:00/GOOG0004:00
>
> drivers/platform/chrome/cros_ec.c | 13 ++++++++++---
> 1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c
> index 51d76037f52a..3c08c9098d29 100644
> --- a/drivers/platform/chrome/cros_ec.c
> +++ b/drivers/platform/chrome/cros_ec.c
> @@ -167,9 +167,16 @@ int cros_ec_register(struct cros_ec_device *ec_dev)
> }
>
> /* Register a platform device for the main EC instance */
> - ec_dev->ec = platform_device_register_data(ec_dev->dev, "cros-ec-dev",
> - PLATFORM_DEVID_AUTO, &ec_p,
> - sizeof(struct cros_ec_platform));
> + ec_dev->ec =
> + platform_device_register_full(&(struct platform_device_info){
> + .parent = ec_dev->dev,
> + .name = "cros-ec-dev",
> + .id = PLATFORM_DEVID_AUTO,
> + .data = &ec_p,
> + .size_data = sizeof(struct cros_ec_platform),
> + .fwnode = ec_dev->dev->fwnode,
> + .of_node_reused = 1});
Please create a local `struct platform_device_info`, fill and pass the &pdevinfo
in platform_device_register_full, I think is more clear.
Thanks,
Enric
> +
> if (IS_ERR(ec_dev->ec)) {
> dev_err(ec_dev->dev,
> "Failed to create CrOS EC platform device\n");
>
next prev parent reply other threads:[~2019-11-25 16:30 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-21 21:10 [PATCH 0/4] Convert cros-ec-i2c-tunnel to MFD Cell Raul E Rangel
2019-11-21 21:10 ` [PATCH 1/4] i2c: i2c-cros-ec-tunnel: Pass ACPI node to i2c adapter Raul E Rangel
2019-11-25 16:06 ` Enric Balletbo i Serra
2019-11-25 18:05 ` Raul Rangel
2020-01-31 7:48 ` Wolfram Sang
2019-11-21 21:10 ` [PATCH 2/4] i2c: i2c-cros-ec-tunnel: Fix ACPI identifier Raul E Rangel
2019-11-25 16:23 ` Enric Balletbo i Serra
2019-11-25 18:12 ` Raul Rangel
2020-01-31 7:48 ` Wolfram Sang
2019-11-21 21:10 ` [PATCH 3/4] platform/chrome: cros_ec: Pass firmware node to MFD device Raul E Rangel
2019-11-25 16:30 ` Enric Balletbo i Serra [this message]
2019-11-21 21:10 ` [PATCH 4/4] platform/chrome: i2c: i2c-cros-ec-tunnel: Convert i2c tunnel to MFD Cell Raul E Rangel
2019-11-21 21:40 ` Guenter Roeck
2019-11-21 21:49 ` Raul Rangel
2019-11-22 8:03 ` Lee Jones
2019-11-22 10:42 ` Guenter Roeck
2019-11-25 16:51 ` Enric Balletbo i Serra
2019-11-25 19:38 ` Raul Rangel
2019-12-09 13:17 ` Lee Jones
2019-12-09 14:41 ` Enric Balletbo i Serra
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=86f40fab-3e68-bc1c-425b-94f681c7b6c6@collabora.com \
--to=enric.balletbo@collabora.com \
--cc=Akshu.Agrawal@amd.com \
--cc=bleung@chromium.org \
--cc=groeck@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rrangel@chromium.org \
--cc=wsa@the-dreams.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®