Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3218015ybc; Mon, 25 Nov 2019 10:49:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzdye+lKUxz9c87Hlm8QWBncDbsbMHoo5BhZORr66o7c4aPht4F0aW04JmXTC4lcQWEPJgd X-Received: by 2002:a50:970e:: with SMTP id c14mr20499134edb.20.1574707782197; Mon, 25 Nov 2019 10:49:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574707782; cv=none; d=google.com; s=arc-20160816; b=WFwLAo+xkbj9iao9FgYSEsGOg/cFFUS5vy5DOE5WrTVky3GXyGsX6kMLLkuEycOaFi MI8Wv2Z8evwm2YbZa2ET5mNuIfb8Ix5497rN7rdRcwfq6H4FV+PNTcQ0xYwbjj4cQOs5 +OZIx6Rk+pSRt4B1k1nv2GEZBKitQyGVztfxyJKB7IP4VZp5ecV1zpX1EEmHkwTNJC9f 0s6OxiUZJsimaMlf1pFCiSf/HY2/odGK2igJWTL1IN95VU92pqfz5nfLpTgTxH8fM3nM MchpOYSbs+jWH0Doyvj5eT8cEnHKZWpoayhMY62bddpp+4DzRl5obWw4Bwyn3EMdeYjE Litw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=+dvpGBJRBVIhp7k+Xz4VyIZsQ+u321t4hDFQpekcNrM=; b=abXZtAdN1QdrarymxCkNAg+r9ad7RcbI6EFRojv+CT1IEG5oas8haGPH4WWwtLLD31 /z5QL+y5uD07G1jLbq+hwVw4u/xEgNP+zZNDWE+cL733q9RkBKjyvltcu+dbu4CC9Obr +9yiq8N0q47/M0y+ZasqY3dkQkrgpbDaDU902c9G/LLAYscCavtIvmoDZAoyNmGhu+ho b1EaMdkntJbU5K1IIhWVAWOruTazReBaf1mWPcrCuYZbAaKjxiFtCu5EyMM3df6AhPPb IzWxsjF7ywwn8HdVkHgD9h1T/B6TOthyqTxkNTzln13uqlQjVknY1EuA0KcUqTkPJRC4 ELaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si6840236edn.266.2019.11.25.10.49.18; Mon, 25 Nov 2019 10:49:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728896AbfKYQa1 (ORCPT + 99 others); Mon, 25 Nov 2019 11:30:27 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:60520 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728871AbfKYQa1 (ORCPT ); Mon, 25 Nov 2019 11:30:27 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id D5AEC28A0E9 Subject: Re: [PATCH 3/4] platform/chrome: cros_ec: Pass firmware node to MFD device To: Raul E Rangel , Wolfram Sang Cc: Akshu.Agrawal@amd.com, Guenter Roeck , linux-kernel@vger.kernel.org, Benson Leung References: <20191121211053.48861-1-rrangel@chromium.org> <20191121140830.3.I1fbda3ecf40f4631420cbb75ba830d2d3b3bac1e@changeid> From: Enric Balletbo i Serra Message-ID: <86f40fab-3e68-bc1c-425b-94f681c7b6c6@collabora.com> Date: Mon, 25 Nov 2019 17:30:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <20191121140830.3.I1fbda3ecf40f4631420cbb75ba830d2d3b3bac1e@changeid> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > > Before this patch: > $ find /sys/bus/platform/devices/cros-ec-* -iname firmware_node -exec ls -l '{}' \; > > > 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"); >