• Chen-Yu Tsai's avatar
    pinctrl: sunxi: Support I/O bias voltage setting on A80 · 402bfb3c
    Chen-Yu Tsai authored
    The A80 SoC has configuration registers for I/O bias voltage. Incorrect
    settings would make the affected peripherals inoperable in some cases,
    such as Ethernet RGMII signals biased at 2.5V with the settings still
    at 3.3V. However low speed signals such as MDIO on the same group of
    pins seem to be unaffected.
    
    Previously there was no way to know what the actual voltage used was,
    short of hard-coding a value in the device tree. With the new pin bank
    regulator supply support in place, the driver can now query the
    regulator for its voltage, and if it's valid (as opposed to being the
    dummy regulator), set the bias voltage setting accordingly.
    
    Add a quirk to denote the presence of the configuration registers, and
    a function to set the correct setting based on the voltage read back
    from the regulator.
    
    This is only done when the regulator is first acquired and enabled.
    While it would be nice to have a notifier on the regulator so that when
    the voltage changes, the driver can update the setting, in practice no
    board currently supports dynamic changing of the I/O voltages.
    Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
    Acked-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
    Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
    402bfb3c
pinctrl-sunxi.h 8.49 KB