sunxi: mmc: Enable pull-up on card-detect gpio pin
authorHans de Goede <hdegoede@redhat.com>
Sat, 30 May 2015 14:39:10 +0000 (16:39 +0200)
committerHans de Goede <hdegoede@redhat.com>
Thu, 4 Jun 2015 12:08:28 +0000 (14:08 +0200)
On some boards we need to enable the internal pull-up te reliable detect
that no card is inserted.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/mmc/sunxi_mmc.c

index bb0814706c56597d7131f434cc246b3d71e36672..e7ab828a8f1e1f5df54088e8d9d52e0d1c1b1889 100644 (file)
@@ -75,8 +75,10 @@ static int mmc_resource_init(int sdc_no)
        cd_pin = sunxi_mmc_getcd_gpio(sdc_no);
        if (cd_pin >= 0) {
                ret = gpio_request(cd_pin, "mmc_cd");
-               if (!ret)
+               if (!ret) {
+                       sunxi_gpio_set_pull(cd_pin, SUNXI_GPIO_PULL_UP);
                        ret = gpio_direction_input(cd_pin);
+               }
        }
 
        return ret;