• Enric Balletbo i Serra's avatar
    mfd / platform: cros_ec: Handle chained ECs as platform devices · 7aa703bb
    Enric Balletbo i Serra authored
    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: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
    Acked-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
    Reviewed-by: default avatarGwendal Grignou <gwendal@chromium.org>
    Tested-by: default avatarGwendal Grignou <gwendal@chromium.org>
    Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
    7aa703bb
cros_ec_lpc.c 14.6 KB