mmc: fix dts cd-gpio setting
authorlintao <lintao@rock-chips.com>
Mon, 11 Aug 2014 02:46:25 +0000 (10:46 +0800)
committerlintao <lintao@rock-chips.com>
Mon, 11 Aug 2014 02:48:10 +0000 (10:48 +0800)
arch/arm/boot/dts/rk3126-sdk.dts
arch/arm/boot/dts/rk3128-sdk.dts
arch/arm/boot/dts/rk312x-sdk.dtsi
drivers/mmc/host/rk_sdmmc.c

index acdc0f59565df624e577ab292332962cb6a88bc8..eeb4943f91c48ffd8b239929d5aa1abfb6195049 100755 (executable)
@@ -45,3 +45,6 @@
 &key {
                io-channels = <&adc 2>;
 };
+&sdmmc {
+       cd-gpios = <&gpio2 GPIO_A3 GPIO_ACTIVE_HIGH>;/*CD GPIO*/
+};
index e5c7aabed088afbe3de0d959706c0bd094373500..0cc5cb71ebe73109c6792d0356a9dbcd6f96aef0 100755 (executable)
@@ -42,3 +42,7 @@
                };
        };
 };
+
+&sdmmc {
+       cd-gpios = <&gpio1 GPIO_C1 GPIO_ACTIVE_HIGH>;/*CD GPIO*/
+};
index 1390dd2af07fdac2efc354f8a6703e35eb52d6dd..ce073c1c1238a64ca838cfcc9ae0cf6fcaa4cff2 100755 (executable)
@@ -73,8 +73,8 @@
 };
 
 &emmc {
-       clock-frequency = <100000000>;
-       clock-freq-min-max = <400000 100000000>;
+       clock-frequency = <50000000>;
+       clock-freq-min-max = <400000 50000000>;
        supports-highspeed;
        supports-emmc;
        bootpart-no-access;
@@ -91,7 +91,6 @@
        clock-freq-min-max = <400000 50000000>;
        supports-highspeed;
        supports-sd;
-       cd-gpios = <&gpio2 GPIO_A7 GPIO_ACTIVE_HIGH>;/*CD GPIO*/
        broken-cd;
        card-detect-delay = <200>;
        ignore-pm-notify;
index 54465ae4615c226fcd5ad5aa1f69e4129af48d33..1fe1bcaa9d4d6d97b5b3293e57c9522026a2fc3a 100755 (executable)
@@ -3151,26 +3151,28 @@ static irqreturn_t dw_mci_gpio_cd_irqt(int irq, void *dev_id)
 static void dw_mci_of_set_cd_gpio_irq(struct device *dev, u32 gpio,
                                         struct mmc_host *mmc)
 {
-        struct dw_mci_slot *slot = mmc_priv(mmc);
-        struct dw_mci *host = slot->host;
-        int irq;
-        int ret;
-
-        /* Having a missing entry is valid; return silently */
-        if (!gpio_is_valid(gpio))
-                return;
-
-        irq = gpio_to_irq(gpio);
-        if (irq >= 0) {
-                ret = devm_request_threaded_irq(&mmc->class_dev, irq,
-                        NULL, dw_mci_gpio_cd_irqt,
-                        IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
-                        "dw_mci_cd", mmc);
-                if (ret < 0)
-                        irq = ret;
-        } else {
-                dev_err(host->dev, "Request cd-gpio interrupt error!\n");
-        }
+       struct dw_mci_slot *slot = mmc_priv(mmc);
+       struct dw_mci *host = slot->host;
+       int irq;
+       int ret;
+
+       /* Having a missing entry is valid; return silently */
+       if (!gpio_is_valid(gpio))
+               return;
+
+       irq = gpio_to_irq(gpio);
+       if (irq >= 0) {
+               ret = devm_request_threaded_irq(&mmc->class_dev, irq,
+                                               NULL, dw_mci_gpio_cd_irqt,
+                                               IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
+                                               "dw_mci_cd", mmc);
+               if (ret < 0) {
+                       irq = ret;
+                       dev_err(host->dev, "Request cd-gpio %d interrupt error!\n", gpio);
+               }
+       } else {
+               dev_err(host->dev, "Cannot convert gpio %d to irq!\n", gpio);
+       }
 }
 #else /* CONFIG_OF */
 static int dw_mci_of_get_slot_quirks(struct device *dev, u8 slot)