• Krzysztof Kozlowski's avatar
    regulator: s2mps11: Fix invalid selector mask and voltages for buck9 · 3b672623
    Krzysztof Kozlowski authored
    The buck9 regulator of S2MPS11 PMIC had incorrect vsel_mask (0xff
    instead of 0x1f) thus reading entire register as buck9's voltage. This
    effectively caused regulator core to interpret values as higher voltages
    than they were and then to set real voltage much lower than intended.
    
    The buck9 provides power to other regulators, including LDO13
    and LDO19 which supply the MMC2 (SD card). On Odroid XU3/XU4 the lower
    voltage caused SD card detection errors on Odroid XU3/XU4:
    	mmc1: card never left busy state
    	mmc1: error -110 whilst initialising SD card
    
    During driver probe the regulator core was checking whether initial
    voltage matches the constraints. With incorrect vsel_mask of 0xff and
    default value of 0x50, the core interpreted this as 5 V which is outside
    of constraints (3-3.775 V). Then the regulator core was adjusting the
    voltage to match the constraints. With incorrect vsel_mask this new
    voltage mapped to a vere low voltage in the driver.
    Signed-off-by: default avatarKrzysztof Kozlowski <k.kozlowski@samsung.com>
    Reviewed-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
    Tested-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    Cc: <stable@vger.kernel.org>
    3b672623
s2mps11.c 41.3 KB