From patchwork Tue Jun 4 15:20:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo i Serra X-Patchwork-Id: 10983253 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 41FF21708 for ; Sat, 8 Jun 2019 16:46:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2ABF728A60 for ; Sat, 8 Jun 2019 16:46:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1AACB28A64; Sat, 8 Jun 2019 16:46:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 138A828A60 for ; Sat, 8 Jun 2019 16:46:28 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 6A7B11689; Sat, 8 Jun 2019 18:45:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 6A7B11689 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1560012386; bh=k+/daIVF7ZzzUi2L/slEGSUYVtkAX8yQwRJLRrwGQFo=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=Y2fKSAYTmVGiwNwo2obM7q90J0ZBzaCo7YlJGSjr0LsgSR6DXQz9hOUKGkVUNQKrc kI9pzDJB56PDfGUoN6PSb9wiaI4Y/dolLm06tb6yRwHQzeW/oUcPphOI8MfYyShp7S D7ZxLoGt3DmhGI8ItFHm/KHL4CjoOgYkx2FDi0Go= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4F05CF89754; Sat, 8 Jun 2019 18:40:27 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id A341EF896F7; Tue, 4 Jun 2019 17:20:35 +0200 (CEST) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 42CC9F89673 for ; Tue, 4 Jun 2019 17:20:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 42CC9F89673 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id D262326C0BD From: Enric Balletbo i Serra To: linux-kernel@vger.kernel.org Date: Tue, 4 Jun 2019 17:20:09 +0200 Message-Id: <20190604152019.16100-1-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Mailman-Approved-At: Sat, 08 Jun 2019 18:39:51 +0200 Cc: Kate Stewart , Enno Luebbers , gwendal@chromium.org, Banajit Goswami , Heiko Stuebner , Alexandre Belloni , linux-doc@vger.kernel.org, Wolfram Sang , Mark Brown , Juergen Fitschen , alsa-devel@alsa-project.org, Stefan Agner , Douglas Anderson , Jilayne Lovejoy , Benjamin Tissoires , Dmitry Torokhov , linux-i2c@vger.kernel.org, Peter Meerwald-Stadler , Manivannan Sadhasivam , Guenter Roeck , Lorenzo Pieralisi , Ravi Chandra Sadineni , kernel@collabora.com, dtor@chromium.org, Rushikesh S Kadam , Jean Delvare , Vignesh R , linux-rtc@vger.kernel.org, Tycho Andersen , Andy Shevchenko , Shreesha Rajashekar , Sean Young , Jonathan Corbet , Lee Jones , Patrick Lai , Brian Norris , "Gustavo A. R. Silva" , Evan Green , Kishon Vijay Abraham I , Neil Armstrong , Chanwoo Choi , MyungJoo Ham , Hans Verkuil , Karthikeyan Ramasubramanian , linux-input@vger.kernel.org, Elie Morisse , Cheng-Yi Chiang , Wu Hao , Ettore Chimenti , linux-pwm@vger.kernel.org, Jiri Kosina , Sakari Ailus , Arnd Bergmann , linux-pm@vger.kernel.org, Kees Cook , Liam Girdwood , Hartmut Knaack , Marco Felsch , Guido Kiener , Florian Fainelli , Takashi Iwai , Thomas Gleixner , Mauro Carvalho Chehab , Benson Leung , Dong Aisheng , Alessandro Zummo , Lars-Peter Clausen , Gustavo Pimentel , Ajay Gupta , Randy Dunlap , Sebastian Reichel , linux-iio@vger.kernel.org, Jacky Bai , Fabien Lahoudere , Thierry Reding , Jarkko Nikula , Philipp Zabel , Greg Kroah-Hartman , Hans Verkuil , Colin Ian King , linux-media@vger.kernel.org, Eddie James , Jonathan Cameron , Gerd Hoffmann Subject: [alsa-devel] [PATCH 00/10] Move part of cros-ec out of MFD subsystem X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi, This is the first attempt to clean up a bit more the cros-ec drivers to have a better separation on what is part of the MFD subsystem and what is part of platform/chrome. It'd be really nice have some reviews, acks and tested on different platforms from the chromiumos people before merge all this patchset, as this moves a lot of code. 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 in cros-ec-dev (MFD) to easy add more subdrivers and avoid 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 device. I tested the following patches on Veyron, Kevin, Samus, Peach Pi and Peach Pit without noticing any problem, but they would need a lot of more tests. I'll continue testing while the reviewing process of this patchset. Waiting for your feedback, Enric 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: Update with SPDX Licence identifier and fix description 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 Documentation/ioctl/ioctl-number.txt | 2 +- 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 +- .../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 | 4 +- drivers/mfd/Kconfig | 26 +- drivers/mfd/Makefile | 4 +- drivers/mfd/cros_ec_dev.c | 433 +++++------------- drivers/platform/chrome/Kconfig | 48 +- drivers/platform/chrome/Makefile | 2 + drivers/{mfd => platform/chrome}/cros_ec.c | 64 +-- drivers/platform/chrome/cros_ec_chardev.c | 279 +++++++++++ drivers/platform/chrome/cros_ec_debugfs.c | 3 +- drivers/platform/chrome/cros_ec_i2c.c | 12 +- drivers/platform/chrome/cros_ec_lightbar.c | 3 +- drivers/platform/chrome/cros_ec_lpc.c | 7 +- drivers/platform/chrome/cros_ec_lpc_reg.c | 4 +- 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 +- .../linux/iio/common/cros_ec_sensors_core.h | 3 +- include/linux/mfd/cros_ec.h | 302 +----------- .../{mfd => platform_data}/cros_ec_commands.h | 0 include/linux/platform_data/cros_ec_proto.h | 315 +++++++++++++ .../uapi/linux/cros_ec_chardev.h | 18 +- sound/soc/codecs/cros_ec_codec.c | 4 +- sound/soc/qcom/Kconfig | 2 +- 50 files changed, 902 insertions(+), 732 deletions(-) rename drivers/{mfd => platform/chrome}/cros_ec.c (85%) create mode 100644 drivers/platform/chrome/cros_ec_chardev.c rename include/linux/{mfd => platform_data}/cros_ec_commands.h (100%) create mode 100644 include/linux/platform_data/cros_ec_proto.h rename drivers/mfd/cros_ec_dev.h => include/uapi/linux/cros_ec_chardev.h (70%) Acked-by: Andy Shevchenko