• Mark Brown's avatar
    power: supply: Use an rbtree rather than flat register cache · 4c678b7a
    Mark Brown authored
    The smb347 has a very sparse register map (the maximum register is 0x3f but
    less than 10% of the possible registers appear to be defined) and doesn't
    have any hardware defaults specified so the sparser data structure of an
    rbtree is a better fit for it's needs than a flat cache. Since it uses I2C
    for the control interface there is no performance concern with the slightly
    more involved code so let's convert it.
    
    This will mean we avoid any issues created by assuming that any previously
    unaccessed registers hold a value that doesn't match what's in the hardware
    (eg, an _update_bits() suppressing a write).
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
    4c678b7a
smb347-charger.c 42.7 KB