diff options
author | John Crispin <blogic@openwrt.org> | 2015-10-02 10:52:43 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2015-10-02 10:52:43 +0000 |
commit | cb4fb019dff121111fb73604320051b067c3641b (patch) | |
tree | 7bb3ff8e566eeda1c2dfc63f6b89322ad23a639a /target | |
parent | a5b64f60e69a1bb4ec15cf0d7a2aeed41185b000 (diff) | |
download | upstream-cb4fb019dff121111fb73604320051b067c3641b.tar.gz upstream-cb4fb019dff121111fb73604320051b067c3641b.tar.bz2 upstream-cb4fb019dff121111fb73604320051b067c3641b.zip |
ralink: the mmc driver can now handle CD lines that are active low
Signed-off-by: John Crispin <blogic@openwrt.org>
Backport of r47074
git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@47099 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/ramips/patches-3.18/0053-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/target/linux/ramips/patches-3.18/0053-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch b/target/linux/ramips/patches-3.18/0053-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch index e8086b1358..a3688138f8 100644 --- a/target/linux/ramips/patches-3.18/0053-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch +++ b/target/linux/ramips/patches-3.18/0053-mmc-MIPS-ralink-add-sdhci-for-mt7620a-SoC.patch @@ -1760,7 +1760,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org> + --- /dev/null +++ b/drivers/mmc/host/mtk-mmc/sd.c -@@ -0,0 +1,3050 @@ +@@ -0,0 +1,3060 @@ +/* Copyright Statement: + * + * This software/firmware and related documentation ("MediaTek Software") are @@ -1919,6 +1919,8 @@ Signed-off-by: John Crispin <blogic@openwrt.org> + +static int mtk_sw_poll; + ++static int cd_active_low = 1; ++ +//================================= +#define PERI_MSDC0_PDN (15) +//#define PERI_MSDC1_PDN (16) @@ -2337,7 +2339,10 @@ Signed-off-by: John Crispin <blogic@openwrt.org> + inserted = hw->get_cd_status(); + } else { + status = sdr_read32(MSDC_PS); -+ inserted = (status & MSDC_PS_CDSTS) ? 0 : 1; ++ if (cd_active_low) ++ inserted = (status & MSDC_PS_CDSTS) ? 0 : 1; ++ else ++ inserted = (status & MSDC_PS_CDSTS) ? 1 : 0; + } + +#if 0 @@ -4081,7 +4086,11 @@ Signed-off-by: John Crispin <blogic@openwrt.org> +#if 0 + present = host->card_inserted; /* why not read from H/W: Fix me*/ +#else -+ present = (sdr_read32(MSDC_PS) & MSDC_PS_CDSTS) ? 0 : 1; ++ // CD ++ if (cd_active_low) ++ present = (sdr_read32(MSDC_PS) & MSDC_PS_CDSTS) ? 0 : 1; ++ else ++ present = (sdr_read32(MSDC_PS) & MSDC_PS_CDSTS) ? 1 : 0; + host->card_inserted = present; +#endif + spin_unlock_irqrestore(&host->lock, flags); @@ -4534,6 +4543,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org> + if ((hw->flags & MSDC_SDIO_IRQ) || (hw->flags & MSDC_EXT_SDIO_IRQ)) + mmc->caps |= MMC_CAP_SDIO_IRQ; /* yes for sdio */ + ++ cd_active_low = !of_property_read_bool(pdev->dev.of_node, "mediatek,cd-high"); + mtk_sw_poll = of_property_read_bool(pdev->dev.of_node, "mediatek,cd-poll"); + + if (mtk_sw_poll) |