Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3340593ybc; Mon, 25 Nov 2019 12:51:40 -0800 (PST) X-Google-Smtp-Source: APXvYqwTUnfsWLZGnxD+T+lhUaPVohW7qaB/EbMWkUKw2YMwMrxfmWhiXg0mV2B5zKuu4WqOUQdl X-Received: by 2002:aa7:d346:: with SMTP id m6mr21299186edr.234.1574715100207; Mon, 25 Nov 2019 12:51:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574715100; cv=none; d=google.com; s=arc-20160816; b=emmlK/BlJgh7ZtRdQjPG5dA/QbXwWerf0Sl+JS7G8Kn77Qr5sEN26JYZdWjfc+48+c 9vcCetjGLRzdPeKvHQ4j7BsH15g4ZerfZSj1C0rBLyvkQcnL84/UYObXdvSFrcSfxxxb ivPaCrx7N1LufIKfJc7Kmc+ZwSIi/uq2R2SOX5txio294l/z+RO1F5LXSm9tyA7kzFiB CrCpOIuEWd36+PmXgQHA8SNRT+9qWWx5ZlyUeGn3hy9HPHpzTzKUzaYQ3VTpyLsw9CKz +gFrKipBhEBe1mt0kB6lNviYAJY8AaQcGhrMt6nZ7Vx7TMRI3JRzcgzD8rlO4U66baxl q0Dw== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1RVUoyzWI+ClgLw+yLNLbFpVZV16gwYnq0IxFB2yqrU=; b=GIfOnUEdHg5t789P2XvS8F6BNde/6xAuQN5OdfuHu8+AXX59AnE8sVCc8DLJvKLCkv zvbFs1kiggcH7c/qzp7u+/pWzjNKDjiGitveozPnR07fNdZ5U1d39N7sbOmcUg8K5uQd ELuAXdom1W2ZUOG5kJ9hd7KcEb+LN3mR/+7PH17MRlErlSad1LDvgrhQu0LErx+zEQOK 3SoGRCH0mfe5wwt7jZwy3mHc+eMfBqE57TiKB7w2Moia955c0C883Ha7woOu8yzescXv uIAuNgkwT74n0xj0Qe1WolBeYSk1cfWxmjx1Vg+BYjJQYd+vMQZ4OBv8ha+Cumva2CgN /UFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=be3Fe8QA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r17si5417679eje.139.2019.11.25.12.51.14; Mon, 25 Nov 2019 12:51:40 -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; dkim=pass header.i=@chromium.org header.s=google header.b=be3Fe8QA; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727111AbfKYUrl (ORCPT + 99 others); Mon, 25 Nov 2019 15:47:41 -0500 Received: from mail-il1-f194.google.com ([209.85.166.194]:37971 "EHLO mail-il1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725912AbfKYUrk (ORCPT ); Mon, 25 Nov 2019 15:47:40 -0500 Received: by mail-il1-f194.google.com with SMTP id u17so15507075ilq.5 for ; Mon, 25 Nov 2019 12:47:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1RVUoyzWI+ClgLw+yLNLbFpVZV16gwYnq0IxFB2yqrU=; b=be3Fe8QAuYQfhcxedqWoYGcg7rYUqpbFoIpvui+efYAi9W3ZJRmEz3+2ICYkRAgbrv dIx8F38PJJkNBAFjh9UfAr5Ex/io/xOvgZMii1hNMUChTf6n5A8T9fggft6LW11XQGJY +bG3akePbZ62+mDBgYx+yfycM/e4NR9/NZ2Lg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1RVUoyzWI+ClgLw+yLNLbFpVZV16gwYnq0IxFB2yqrU=; b=JbBwQdP6fxgnfMYqrYOffdQh9NH6VSfrY5GGAqWm8WdEzhmuBJbRmBRIVg/eDpxCnl t6chmYWPnyaK634kJTfvm9iECBRQRW1RT6KDFVDEkQMYZXiGbsG6wnNoSUvdZWywn1bU 6Sc1+1cxVqV2yOjwc8l1prPsE5+ClIKeqAuH30+es+K9fQydAHlXWflyyTsjBs5L46n5 KO5PkXaz7/CLFgf7+kx8voYsDJme8P1vMTCtenXTJh3MMfJeDpdIk/ZXk5Gzt+KJDquA /LfS9XP0SqDbbLYqvU3O+x440fPIaem+ua/E8ReJaqDXeSSbwVTp/e60OaGxB76csxNX p5LQ== X-Gm-Message-State: APjAAAUU/mYp1rNJHq+dDb3LiwUvTbi5pJvNceh0PBNYotenpR7TnXQ2 kwoeOwtvonxxJubhInquWZ1YLw== X-Received: by 2002:a92:c801:: with SMTP id v1mr31694050iln.253.1574714859866; Mon, 25 Nov 2019 12:47:39 -0800 (PST) Received: from localhost ([2620:15c:183:0:82e0:aef8:11bc:24c4]) by smtp.gmail.com with ESMTPSA id d75sm2533111ilk.65.2019.11.25.12.47.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Nov 2019 12:47:39 -0800 (PST) From: Raul E Rangel To: enric.balletbo@collabora.com, Wolfram Sang Cc: Akshu.Agrawal@amd.com, Raul E Rangel , Guenter Roeck , linux-kernel@vger.kernel.org, Benson Leung Subject: [PATCH v2 1/2] platform/chrome: cros_ec: Pass firmware node to MFD device Date: Mon, 25 Nov 2019 13:47:29 -0700 Message-Id: <20191125134551.v2.1.I1fbda3ecf40f4631420cbb75ba830d2d3b3bac1e@changeid> X-Mailer: git-send-email 2.24.0.432.g9d3f5f5b63-goog In-Reply-To: <20191125204730.187000-1-rrangel@chromium.org> References: <20191125204730.187000-1-rrangel@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Changes in v2: - Extracted platform_device_info into its own variable. drivers/platform/chrome/cros_ec.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/platform/chrome/cros_ec.c b/drivers/platform/chrome/cros_ec.c index 51d76037f52a..bb11bc5f73fb 100644 --- a/drivers/platform/chrome/cros_ec.c +++ b/drivers/platform/chrome/cros_ec.c @@ -131,6 +131,15 @@ int cros_ec_register(struct cros_ec_device *ec_dev) { struct device *dev = ec_dev->dev; int err = 0; + struct platform_device_info ec_platform_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 + }; BLOCKING_INIT_NOTIFIER_HEAD(&ec_dev->event_notifier); @@ -167,9 +176,8 @@ 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(&ec_platform_info); + if (IS_ERR(ec_dev->ec)) { dev_err(ec_dev->dev, "Failed to create CrOS EC platform device\n"); -- 2.24.0.432.g9d3f5f5b63-goog