Re: [PATCH v5 01/11] mfd / platform: cros_ec: Handle chained ECs as platform devices

Lee Jones
2019-08-12T07:24:40Z

On Mon, 22 Jul 2019, Enric Balletbo i Serra wrote:

> An MFD is a device that contains several sub-devices (cells). For instance,
> the ChromeOS EC fits in this description as usually contains a charger and
> can have other devices with different functions like a Real-Time Clock,
> an Audio codec, a Real-Time Clock, ...
>
> If you look at the driver, though, we're doing something odd. We have
> two MFD cros-ec drivers where one of them (cros-ec-core) instantiates
> another MFD driver as sub-driver (cros-ec-dev), and the latest
> instantiates the different sub-devices (Real-Time Clock, Audio codec,
> etc).
>
> MFD
> ------------------------------------------
> cros-ec-core
> |___ mfd-cellA (cros-ec-dev)
> | |__ mfd-cell0
> | |__ mfd-cell1
> | |__ ...
> |
> |___ mfd-cellB (cros-ec-dev)
> |__ mfd-cell0
> |__ mfd-cell1
> |__ ...
>
> The problem that was trying to solve is to describe some kind of topology for
> the case where we have an EC (cros-ec) chained with another EC
> (cros-pd). Apart from that this extends the bounds of what MFD was
> designed to do we might be interested on have other kinds of topology that
> can't be implemented in that way.
>
> Let's prepare the code to move the cros-ec-core part from MFD to
> platform/chrome as this is clearly a platform specific thing non-related
> to a MFD device.
>
> platform/chrome | MFD
> ------------------------------------------
> |
> cros-ec ________|___ cros-ec-dev
> | |__ mfd-cell0
> | |__ mfd-cell1
> | |__ ...
> |
> cros-pd ________|___ cros-ec-dev
> | |__ mfd-cell0
> | |__ mfd-cell1
> | |__ ...
>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
> Tested-by: Gwendal Grignou <gwendal@chromium.org>
> ---
>
> Changes in v5:
> - Rebased on top of 5.3-rc1
>
> Changes in v4:
> - Rebase again on top of for-mfd-next to avoid conflicts.
>
> Changes in v3:
> - Collect more acks an tested-by
>
> 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.
>
> drivers/mfd/cros_ec.c | 61 +++++++++++++------------
> drivers/platform/chrome/cros_ec_i2c.c | 8 ++++
> drivers/platform/chrome/cros_ec_lpc.c | 3 +-
> drivers/platform/chrome/cros_ec_rpmsg.c | 2 +
> drivers/platform/chrome/cros_ec_spi.c | 8 ++++
> include/linux/mfd/cros_ec.h | 18 ++++++++
> 6 files changed, 69 insertions(+), 31 deletions(-)

For my own reference:
Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>

--
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog