• Stephan Gerhold's avatar
    arm64: dts: qcom: msm8916/39: Fix SD card detect pinctrl · dfbda20d
    Stephan Gerhold authored
    The current SD card detect pinctrl setup configures bias-pull-up for
    the "default" (active) case and bias-disable for the "sleep" case.
    Before commit b5c833b7 ("mmc: sdhci-msm: Set IO pins in low power
    state during suspend") the pull up was permanently active. Since then
    it is only active when a valid SD card is inserted.
    
    This does not really make sense: For an active-low CD, the pull up is
    needed to pull the GPIO high when the card is not inserted. When the
    card gets inserted CD is shorted to ground (low). This means right now
    the pull-up is removed exactly when it is needed to detect the next
    card insertion. Generally, applying different bias for CD does not
    really make sense. It should always stay the same so card removals and
    insertions can be detected properly.
    
    The reason why card detection still works fine in practice is that most
    boards seem to have external pull up on the CD pin. However, this means
    that there is no need to configure an internal pull-up at all and we
    can keep bias-disable permanently.
    
    There are also some boards with different CD polarity (acer-a1-724) and
    with different GPIO number (huawei-g7). All in all this makes it
    obvious that the CD pin is board-specific and the pinctrl for it should
    be defined in the board DT.
    
    Move it to the boards that need it and use bias-disable permanently for
    the boards that seem to have external pull-up. The vendor device tree
    for msm8939-sony-xperia-kanuti-tulip suggests that it needs the
    internal pull-up permanently [1] so it gets bias-pull-up to be sure.
    
    [1]: https://github.com/sonyxperiadev/kernel/blob/57b5050e340f40a88e1ddb8d16fd9adb44418923/arch/arm/boot/dts/qcom/msm8939-kanuti_tulip.dtsi#L634-L636Signed-off-by: default avatarStephan Gerhold <stephan@gerhold.net>
    Signed-off-by: default avatarBjorn Andersson <andersson@kernel.org>
    Link: https://lore.kernel.org/r/20230529-msm8916-pinctrl-v1-1-11f540b51c93@gerhold.net
    dfbda20d
msm8916-pins.dtsi 9.74 KB