mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
mmc: fix dts cd-gpio setting
This commit is contained in:
@@ -45,3 +45,6 @@
|
||||
&key {
|
||||
io-channels = <&adc 2>;
|
||||
};
|
||||
&sdmmc {
|
||||
cd-gpios = <&gpio2 GPIO_A3 GPIO_ACTIVE_HIGH>;/*CD GPIO*/
|
||||
};
|
||||
|
||||
@@ -42,3 +42,7 @@
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&sdmmc {
|
||||
cd-gpios = <&gpio1 GPIO_C1 GPIO_ACTIVE_HIGH>;/*CD GPIO*/
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
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;
|
||||
/* 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");
|
||||
}
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user