Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp365314ybe; Mon, 2 Sep 2019 02:56:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqxgx8oIg6PrFlFPfatbES3nfCf3eKYvMmNHQfdNmb5Jbzmweb2t7UNCTNIAK9RCHN5aqx8V X-Received: by 2002:a17:902:6687:: with SMTP id e7mr29495027plk.211.1567418166256; Mon, 02 Sep 2019 02:56:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567418166; cv=none; d=google.com; s=arc-20160816; b=Z43oHqiOGebSFADbMEXIYNrRV36kOq7GxCSO9L7ny2PGdqzWSEmGJ2FTwvSdh7K6dT zj7aAvY00K1HLNuUrLBgKGrzsK6tmxB3f8imxQhZBEfhxbj3U58UTAxwFJQUTTEblYmO yt0Y2ZSaEHKWHZqfUZM07JoJH4FHjvzqQ7NQQ9ZtPIME+sXVPRtOS+G5xEgwyph2l1qX KOrKNqSTcCbTCAITdGk8oDRwdRf+hiGIL0Wgfs/UEJV/3NcY6thoyqKIrIcuLVHJ06Kv /kCkCgpUuJgXcuK/d+X7SvmDVDx2ZM5vVdFTMM9YcivYOYYY6Hgicc7udRINUYH7go6R Icuw== 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 :message-id:date:subject:cc:to:from; bh=hgCcYp2bsg2Us7lRqgI4lEng+gRJ+WRBj+K/tiIR4y0=; b=qyt8KkWzl+4xpLGAggGBJUHHiwx9noIqvOZQjkNoY+YIsG6znVHv8iF52Y6oqUwO7+ 3K3imghszlPp08QFcygsH3eaQ0E+WQ+QVFzT/FTwiILpcVV+rT97e5LE4gp5FG/0xuJ7 0Mn0PI7hVPxU8nZNyjPlBAPejm9lWnAoDVy/Ybn5ujV/8iV5/isxJupIAgEDn8kahzUF KEk9szBeZiQwEZdTQlR4yyfkyOdgO9rScL8KA1Ot3hPSKc6qb26HI0PJ3kNAI5ibYorf QmXKk6FGlps15/wHtSi2kclPPR/IMvP7Lyz7IRKIuBbeYT3Bg5NlU89IPQoAVUE/Bz9e Xj5w== 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 186si14269500pfd.44.2019.09.02.02.55.51; Mon, 02 Sep 2019 02:56:06 -0700 (PDT) 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 S1730711AbfIBJxU (ORCPT + 99 others); Mon, 2 Sep 2019 05:53:20 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:46620 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729626AbfIBJxT (ORCPT ); Mon, 2 Sep 2019 05:53:19 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id CA5C328CB6E From: Enric Balletbo i Serra To: linux-kernel@vger.kernel.org Cc: Jonathan Corbet , Krzysztof Kozlowski , Will Deacon , MyungJoo Ham , Chanwoo Choi , Benson Leung , Guenter Roeck , Jonathan Cameron , Dmitry Torokhov , Mauro Carvalho Chehab , Lee Jones , Sebastian Reichel , Thierry Reding , Alexandre Belloni , Liam Girdwood , Mark Brown , Neil Armstrong , Greg Kroah-Hartman , Collabora kernel ML , arnd@arndb.de Subject: [PATCH v7 00/10] Move part of cros-ec out of MFD subsystem Date: Mon, 2 Sep 2019 11:52:59 +0200 Message-Id: <20190902095309.18574-1-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.20.1 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 Hi, Now that rc1 is released is time to send another patchset rebased on top. This is an attempt to clean up a bit more the cros-ec driver to have a better separation on what is part of the MFD subsystem and what is part of platform/chrome. The major changes introduced by this patchset are: 1. Move the core driver to platform/chrome, as is not really related to an MFD device driver. 2. Create a new misc chardev driver to replace the chardev bits from cros-ec-dev (MFD) 3. Added some convenience structs on cros-ec-dev (MFD) to easy add more subdrivers avoiding to add more boiler plate. Once applied we have moved all the code to platform/chrome except the cros-ec-dev driver, which is the one that instantiates the different subdrivers as cells of the MFD driver. I tested the following patches on Veyron, Kevin, Samus, Peach Pi and Peach Pit without noticing any problem, but they would need more tests. Thanks, Enric Changes in v7: - Add a transitional config option to help bisectability (Arnd, Lee) - Add Acket-by tags from Lee Jones. Changes in v6: - Rebase on top of for-mfd-next to avoid conflicts. - Add Acked-by tags from Lee Jones. - Move cros_ec_chardev.h to include/linux/platform_data - Add a break statement once the MCU type has been determined (Lee Jones) - Improve patch description stating the reason of the change (Lee Jones) Changes in v5: - Prefix the versions strings with CROS_EC_DEV_VERSION (Gwendal) Changes in v4: - Rebase on top of for-mfd-next to avoid conflicts. Changes in v3: - Collect more acks an tested-by - Fix 'linux/mfd/cros_ec.h' is not exported (reported by lkp) - Use mfd_add_hotplug_devices helper (Gwendal) - Add a new patch to use mfd_add_hoplug_devices to register subdevices Changes in v2: - Collect acks received. - Remove '[PATCH 07/10] mfd: cros_ec: Update with SPDX Licence identifier and fix description' to avoid conflicts with some tree-wide patches that actually updates the Licence identifier. - Add '[PATCH 10/10] arm/arm64: defconfig: Update configs to use the new CROS_EC options' to update the defconfigs after change some config symbols. - Remove the list, and the lock, as are not needed (Greg Kroah-Hartman) - Remove dev_info in probe, anyway we will see the chardev or not if the probe fails (Greg Kroah-Hartman) Enric Balletbo i Serra (10): mfd / platform: cros_ec: Handle chained ECs as platform devices mfd / platform: cros_ec: Move cros-ec core driver out from MFD mfd / platform: cros_ec: Miscellaneous character device to talk with the EC mfd: cros_ec: Switch to use the new cros-ec-chardev driver mfd / platform: cros_ec: Rename config to a better name mfd / platform: cros_ec: Reorganize platform and mfd includes mfd: cros_ec: Use kzalloc and cros_ec_cmd_xfer_status helper mfd: cros_ec: Add convenience struct to define dedicated CrOS EC MCUs mfd: cros_ec: Add convenience struct to define autodetectable CrOS EC subdevices mfd: cros_ec: Use mfd_add_hotplug_devices() helper drivers/extcon/Kconfig | 2 +- drivers/extcon/extcon-usbc-cros-ec.c | 3 +- drivers/hid/Kconfig | 2 +- drivers/hid/hid-google-hammer.c | 4 +- drivers/i2c/busses/Kconfig | 2 +- drivers/i2c/busses/i2c-cros-ec-tunnel.c | 4 +- drivers/iio/accel/cros_ec_accel_legacy.c | 3 +- drivers/iio/common/cros_ec_sensors/Kconfig | 2 +- .../cros_ec_sensors/cros_ec_lid_angle.c | 3 +- .../common/cros_ec_sensors/cros_ec_sensors.c | 3 +- .../cros_ec_sensors/cros_ec_sensors_core.c | 3 +- drivers/iio/light/cros_ec_light_prox.c | 3 +- drivers/iio/pressure/cros_ec_baro.c | 3 +- drivers/input/keyboard/Kconfig | 2 +- drivers/input/keyboard/cros_ec_keyb.c | 4 +- drivers/media/platform/Kconfig | 3 +- .../media/platform/cros-ec-cec/cros-ec-cec.c | 5 +- drivers/mfd/Kconfig | 26 +- drivers/mfd/Makefile | 4 +- drivers/mfd/cros_ec_dev.c | 463 ++++++------------ drivers/platform/chrome/Kconfig | 60 ++- drivers/platform/chrome/Makefile | 2 + drivers/{mfd => platform/chrome}/cros_ec.c | 64 +-- drivers/platform/chrome/cros_ec_chardev.c | 252 ++++++++++ drivers/platform/chrome/cros_ec_debugfs.c | 3 +- drivers/platform/chrome/cros_ec_i2c.c | 12 +- drivers/platform/chrome/cros_ec_ishtp.c | 5 +- drivers/platform/chrome/cros_ec_lightbar.c | 3 +- drivers/platform/chrome/cros_ec_lpc.c | 7 +- drivers/platform/chrome/cros_ec_proto.c | 3 +- drivers/platform/chrome/cros_ec_rpmsg.c | 6 +- drivers/platform/chrome/cros_ec_spi.c | 12 +- drivers/platform/chrome/cros_ec_sysfs.c | 3 +- drivers/platform/chrome/cros_ec_trace.c | 2 +- drivers/platform/chrome/cros_ec_trace.h | 4 +- drivers/platform/chrome/cros_ec_vbc.c | 3 +- drivers/platform/chrome/cros_usbpd_logger.c | 5 +- drivers/power/supply/Kconfig | 2 +- drivers/power/supply/cros_usbpd-charger.c | 5 +- drivers/pwm/Kconfig | 2 +- drivers/pwm/pwm-cros-ec.c | 4 +- drivers/rtc/Kconfig | 2 +- drivers/rtc/rtc-cros-ec.c | 3 +- include/Kbuild | 2 +- .../linux/iio/common/cros_ec_sensors_core.h | 3 +- include/linux/mfd/cros_ec.h | 292 ----------- .../linux/platform_data/cros_ec_chardev.h | 12 +- .../{mfd => platform_data}/cros_ec_commands.h | 0 include/linux/platform_data/cros_ec_proto.h | 319 ++++++++++++ sound/soc/codecs/Kconfig | 4 +- sound/soc/codecs/cros_ec_codec.c | 4 +- sound/soc/qcom/Kconfig | 2 +- 52 files changed, 900 insertions(+), 746 deletions(-) rename drivers/{mfd => platform/chrome}/cros_ec.c (84%) create mode 100644 drivers/platform/chrome/cros_ec_chardev.c rename drivers/mfd/cros_ec_dev.h => include/linux/platform_data/cros_ec_chardev.h (79%) rename include/linux/{mfd => platform_data}/cros_ec_commands.h (100%) create mode 100644 include/linux/platform_data/cros_ec_proto.h -- 2.20.1