Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2108381imu; Wed, 12 Dec 2018 09:36:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/UPJUGQYrX0MmJ9pwm6Ml8ZOG5cwWuofsTc0Ft55xpxqCxzvEgrZVOgbmA4w3bLuYpsurCY X-Received: by 2002:a62:1a44:: with SMTP id a65mr21403993pfa.30.1544636178328; Wed, 12 Dec 2018 09:36:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544636178; cv=none; d=google.com; s=arc-20160816; b=1CG4Y15z5BCtsFQ1CDY5nuBqWezFT+AroNIRNl2X7xpyxjpqCuKM0mOrsiHvLAcndL YXOPhuRWN9DDBfBOOo17aGqXgQbxBDwUoD8Scy1k54Gv7XjNkaOW4dKrPfmlDDHlPLyh Np8WpMqhm4tANczTfC2Nc1vZUhF5YlhSE/wLWI7CooYNE/7YuYttCYej1CPGrm9HAHBx La3PdVkxlZUexuD38nhCvTCq1R9nzduuuZ6rPOBGkHRtmRDSsJJhMRrApGntXQR8WldH U3KV3EMvWMQ6Dd3Pcyfr9O86xKdUmANc34fOzCVSXWVwLzGkUHPin1TF29ChBkmZ6rLt 8JLw== 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=g0hCPJhyntyR28/V/5JYfWKb62u6nVOoM0ykqm4an+o=; b=fQir5z7DyWuHSKRhmAuRiikjnq9qf5EY3dCOz+biZQzyyiP7RlgpD0kZG4jV1tz4ch eHdzC4J5dyHW3xgPL39HO8P09KT/ZjvfucCxqzgxWRmoKK6KnKrMQBqQgfbDUVndmIn4 nBFOBKXuDHinQYKADIR09obT7ya0feedLI54qMatRkldV+VsSWU8rC0/v9wRzxV9fDFy NUSKGrplOAmgNhhd7HAEdryTRo0SvzI3UU8yAgNmac69CjvcB5evheVIVXnBPN9YXCYI 6VZkTeUC/YkQMbAx6HPPGb+ossWQcK/zqVBRmeL+pg073U77kQUv7aOfZkUOeiWiM9kO 2ehQ== 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 t184si16012057pfb.22.2018.12.12.09.36.03; Wed, 12 Dec 2018 09:36:18 -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 S1728029AbeLLReM (ORCPT + 99 others); Wed, 12 Dec 2018 12:34:12 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:54274 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727691AbeLLReM (ORCPT ); Wed, 12 Dec 2018 12:34:12 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id EC115260A1E From: Enric Balletbo i Serra To: lee.jones@linaro.org Cc: gwendal@chromium.org, drinkcat@chromium.org, linux-kernel@vger.kernel.org, groeck@chromium.org, kernel@collabora.com, bleung@chromium.org Subject: [PATCH v5 0/7] mfd / platform: cros_ec: move cros_ec sysfs attributes to its own drivers. Date: Wed, 12 Dec 2018 18:33:55 +0100 Message-Id: <20181212173402.27086-1-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.19.2 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, This is another patchset to try to cleanup a bit more the crossed references for cros-ec driver between the MFD and the platform/chrome subsystems. The purpose of these patches is get rid of the different cros-ec attributes from mfd/cros_ec_dev to its own sub-driver in platform/chrome. cros_ec_dev continues instantiating the sub-devices but the sysfs attributes are owned by the platform driver.E.g. The lightbar driver should own his sysfs attributes and be instantiated only if the Embedded Controller has a lightbar. The patchset also adds the documentation of the sysfs attributes. Most of the patches touches mfd subsystem and platform/chrome so I'd suggest go all using and inmutable branch. Best regards, Enric Changes in v5: - Add static at cros_ec_attr_group. Changes in v4: - Added Reviewed-by tags. - Moved mfd_remove_devices to another patch, it's already queued in Lee's tree. - Removed patch 8 from the series, was a fix and it's already applied in current mainline. - Use instead of in documentation. - Use default MFD_CROS_EC_CHARDEV in Kconfig. - Changed the subject to specify the cros_ec_vbc driver. - Fix typo s/th/the - Get rid of the cros_ec_has_lightbar function. Changes in v3: - Removed cros_ec_remove from include file. - Removed unneded check for ec_dev. - Fixed build error as reported by the kbuild test robot. - Do not print ec_platform name as is with dev_err is enough. Changes in v2: - Use devm only for the cros-ec core. - Removed the two exported functions to attach/detach to the cros_class. - Use dev_warn instead of dev_err when adding the lightbar. - Removed unneeded check of ec_dev. - Add a "default MFD_CROS_EC_CHARDEV" in Kconfig for this. - Remove the checks for missing debug_info, are not needed now. - Remove a comment that no longer applies. - Create the attributes directly instead of use the attach/detach callbacks. - Remove unnecessary IS_ENABLED. - Remove dev_err message telling that VBC is found. - Use dev_warn instead of dev_err as the error is ignored. - Removed ec_with_lightbar variable. Enric Balletbo i Serra (7): mfd / platform: cros_ec: use devm_mfd_add_devices mfd / platform: cros_ec: move lightbar attributes to its own driver mfd / platform: cros_ec: move vbc attributes to its own driver mfd / platform: cros_ec: move debugfs attributes to its own driver mfd / platform: cros_ec: move device sysfs attributes to its own driver mfd / platform: cros_ec_vbc: instantiate only if the EC has a VBC NVRAM platform/chrome: cros_ec_lightbar: instantiate only if the EC has a lightbar .../ABI/testing/sysfs-class-chromeos | 32 +++++ ...sfs-class-chromeos-driver-cros-ec-lightbar | 74 ++++++++++ .../sysfs-class-chromeos-driver-cros-ec-vbc | 6 + drivers/mfd/Kconfig | 1 - drivers/mfd/cros_ec.c | 14 +- drivers/mfd/cros_ec_dev.c | 89 +++++-------- drivers/mfd/cros_ec_dev.h | 6 - drivers/platform/chrome/Kconfig | 47 ++++++- drivers/platform/chrome/Makefile | 7 +- drivers/platform/chrome/cros_ec_debugfs.c | 62 ++++++--- drivers/platform/chrome/cros_ec_i2c.c | 10 -- drivers/platform/chrome/cros_ec_lightbar.c | 126 +++++++++++------- drivers/platform/chrome/cros_ec_lpc.c | 4 - drivers/platform/chrome/cros_ec_spi.c | 11 -- drivers/platform/chrome/cros_ec_sysfs.c | 36 ++++- drivers/platform/chrome/cros_ec_vbc.c | 59 +++++--- include/linux/mfd/cros_ec.h | 21 --- 17 files changed, 394 insertions(+), 211 deletions(-) create mode 100644 Documentation/ABI/testing/sysfs-class-chromeos create mode 100644 Documentation/ABI/testing/sysfs-class-chromeos-driver-cros-ec-lightbar create mode 100644 Documentation/ABI/testing/sysfs-class-chromeos-driver-cros-ec-vbc -- 2.19.2