mmc: core: change quirks.c to be a header file
authorShawn Lin <shawn.lin@rock-chips.com>
Wed, 15 Feb 2017 08:35:28 +0000 (16:35 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Wed, 15 Feb 2017 10:34:26 +0000 (11:34 +0100)
Rename quirks.c to quirks.h, and include it for
individual C files which need it.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/core/Makefile
drivers/mmc/core/block.c
drivers/mmc/core/card.h
drivers/mmc/core/mmc.c
drivers/mmc/core/quirks.c [deleted file]
drivers/mmc/core/quirks.h [new file with mode: 0644]
drivers/mmc/core/sdio.c

index 0f81464fa824f6ed7e802d5f7ab98e1ce7d67d09..7e3ed1aeada2b59d6e3db2b9189d985d9a2cc958 100644 (file)
@@ -7,7 +7,7 @@ mmc_core-y                      := core.o bus.o host.o \
                                   mmc.o mmc_ops.o sd.o sd_ops.o \
                                   sdio.o sdio_ops.o sdio_bus.o \
                                   sdio_cis.o sdio_io.o sdio_irq.o \
-                                  quirks.o slot-gpio.o
+                                  slot-gpio.o
 mmc_core-$(CONFIG_OF)          += pwrseq.o
 obj-$(CONFIG_PWRSEQ_SIMPLE)    += pwrseq_simple.o
 obj-$(CONFIG_PWRSEQ_SD8787)    += pwrseq_sd8787.o
index cd909aecfdedfb2cf7b91657bb26736ec7e42b59..6f3a5ff8559057cfffa0bb1ddca846bef93ee38f 100644 (file)
@@ -52,6 +52,7 @@
 #include "host.h"
 #include "bus.h"
 #include "mmc_ops.h"
+#include "quirks.h"
 #include "sd_ops.h"
 
 MODULE_ALIAS("mmc:block");
index 95e8fc54eb21f28631db6962bb2b08f2baf6e48c..f06cd91964ce970b0c623dd662c335eb0fc4dadb 100644 (file)
@@ -218,6 +218,4 @@ static inline int mmc_card_broken_hpi(const struct mmc_card *c)
        return c->quirks & MMC_QUIRK_BROKEN_HPI;
 }
 
-void mmc_fixup_device(struct mmc_card *card, const struct mmc_fixup *table);
-
 #endif
index ad1089c713e526d3cca7a03640f7da08ef5746a8..f830970958e6796fcd9fb0fa32e16e402f73c360 100644 (file)
@@ -25,6 +25,7 @@
 #include "host.h"
 #include "bus.h"
 #include "mmc_ops.h"
+#include "quirks.h"
 #include "sd_ops.h"
 
 #define DEFAULT_CMD6_TIMEOUT_MS        500
diff --git a/drivers/mmc/core/quirks.c b/drivers/mmc/core/quirks.c
deleted file mode 100644 (file)
index bf25a9c..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- *  This file contains work-arounds for many known SD/MMC
- *  and SDIO hardware bugs.
- *
- *  Copyright (c) 2011 Andrei Warkentin <andreiw@motorola.com>
- *  Copyright (c) 2011 Pierre Tardy <tardyp@gmail.com>
- *  Inspired from pci fixup code:
- *  Copyright (c) 1999 Martin Mares <mj@ucw.cz>
- *
- */
-
-#include <linux/types.h>
-#include <linux/kernel.h>
-#include <linux/export.h>
-#include <linux/mmc/card.h>
-#include <linux/mmc/sdio_ids.h>
-
-#include "card.h"
-
-#ifndef SDIO_VENDOR_ID_TI
-#define SDIO_VENDOR_ID_TI              0x0097
-#endif
-
-#ifndef SDIO_DEVICE_ID_TI_WL1271
-#define SDIO_DEVICE_ID_TI_WL1271       0x4076
-#endif
-
-#ifndef SDIO_VENDOR_ID_STE
-#define SDIO_VENDOR_ID_STE             0x0020
-#endif
-
-#ifndef SDIO_DEVICE_ID_STE_CW1200
-#define SDIO_DEVICE_ID_STE_CW1200      0x2280
-#endif
-
-#ifndef SDIO_DEVICE_ID_MARVELL_8797_F0
-#define SDIO_DEVICE_ID_MARVELL_8797_F0 0x9128
-#endif
-
-static const struct mmc_fixup mmc_fixup_methods[] = {
-       SDIO_FIXUP(SDIO_VENDOR_ID_TI, SDIO_DEVICE_ID_TI_WL1271,
-                  add_quirk, MMC_QUIRK_NONSTD_FUNC_IF),
-
-       SDIO_FIXUP(SDIO_VENDOR_ID_TI, SDIO_DEVICE_ID_TI_WL1271,
-                  add_quirk, MMC_QUIRK_DISABLE_CD),
-
-       SDIO_FIXUP(SDIO_VENDOR_ID_STE, SDIO_DEVICE_ID_STE_CW1200,
-                  add_quirk, MMC_QUIRK_BROKEN_BYTE_MODE_512),
-
-       SDIO_FIXUP(SDIO_VENDOR_ID_MARVELL, SDIO_DEVICE_ID_MARVELL_8797_F0,
-                  add_quirk, MMC_QUIRK_BROKEN_IRQ_POLLING),
-
-       END_FIXUP
-};
-
-void mmc_fixup_device(struct mmc_card *card, const struct mmc_fixup *table)
-{
-       const struct mmc_fixup *f;
-       u64 rev = cid_rev_card(card);
-
-       /* Non-core specific workarounds. */
-       if (!table)
-               table = mmc_fixup_methods;
-
-       for (f = table; f->vendor_fixup; f++) {
-               if ((f->manfid == CID_MANFID_ANY ||
-                    f->manfid == card->cid.manfid) &&
-                   (f->oemid == CID_OEMID_ANY ||
-                    f->oemid == card->cid.oemid) &&
-                   (f->name == CID_NAME_ANY ||
-                    !strncmp(f->name, card->cid.prod_name,
-                             sizeof(card->cid.prod_name))) &&
-                   (f->cis_vendor == card->cis.vendor ||
-                    f->cis_vendor == (u16) SDIO_ANY_ID) &&
-                   (f->cis_device == card->cis.device ||
-                    f->cis_device == (u16) SDIO_ANY_ID) &&
-                   (f->ext_csd_rev == EXT_CSD_REV_ANY ||
-                    f->ext_csd_rev == card->ext_csd.rev) &&
-                   rev >= f->rev_start && rev <= f->rev_end) {
-                       dev_dbg(&card->dev, "calling %pf\n", f->vendor_fixup);
-                       f->vendor_fixup(card, f->data);
-               }
-       }
-}
-EXPORT_SYMBOL(mmc_fixup_device);
diff --git a/drivers/mmc/core/quirks.h b/drivers/mmc/core/quirks.h
new file mode 100644 (file)
index 0000000..1e56ec4
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ *  This file contains work-arounds for many known SD/MMC
+ *  and SDIO hardware bugs.
+ *
+ *  Copyright (c) 2011 Andrei Warkentin <andreiw@motorola.com>
+ *  Copyright (c) 2011 Pierre Tardy <tardyp@gmail.com>
+ *  Inspired from pci fixup code:
+ *  Copyright (c) 1999 Martin Mares <mj@ucw.cz>
+ *
+ */
+
+#include <linux/mmc/sdio_ids.h>
+
+#include "card.h"
+
+#ifndef SDIO_VENDOR_ID_TI
+#define SDIO_VENDOR_ID_TI              0x0097
+#endif
+
+#ifndef SDIO_DEVICE_ID_TI_WL1271
+#define SDIO_DEVICE_ID_TI_WL1271       0x4076
+#endif
+
+#ifndef SDIO_VENDOR_ID_STE
+#define SDIO_VENDOR_ID_STE             0x0020
+#endif
+
+#ifndef SDIO_DEVICE_ID_STE_CW1200
+#define SDIO_DEVICE_ID_STE_CW1200      0x2280
+#endif
+
+#ifndef SDIO_DEVICE_ID_MARVELL_8797_F0
+#define SDIO_DEVICE_ID_MARVELL_8797_F0 0x9128
+#endif
+
+static const struct mmc_fixup mmc_fixup_methods[] = {
+       SDIO_FIXUP(SDIO_VENDOR_ID_TI, SDIO_DEVICE_ID_TI_WL1271,
+                  add_quirk, MMC_QUIRK_NONSTD_FUNC_IF),
+
+       SDIO_FIXUP(SDIO_VENDOR_ID_TI, SDIO_DEVICE_ID_TI_WL1271,
+                  add_quirk, MMC_QUIRK_DISABLE_CD),
+
+       SDIO_FIXUP(SDIO_VENDOR_ID_STE, SDIO_DEVICE_ID_STE_CW1200,
+                  add_quirk, MMC_QUIRK_BROKEN_BYTE_MODE_512),
+
+       SDIO_FIXUP(SDIO_VENDOR_ID_MARVELL, SDIO_DEVICE_ID_MARVELL_8797_F0,
+                  add_quirk, MMC_QUIRK_BROKEN_IRQ_POLLING),
+
+       END_FIXUP
+};
+
+static inline void mmc_fixup_device(struct mmc_card *card,
+                                   const struct mmc_fixup *table)
+{
+       const struct mmc_fixup *f;
+       u64 rev = cid_rev_card(card);
+
+       /* Non-core specific workarounds. */
+       if (!table)
+               table = mmc_fixup_methods;
+
+       for (f = table; f->vendor_fixup; f++) {
+               if ((f->manfid == CID_MANFID_ANY ||
+                    f->manfid == card->cid.manfid) &&
+                   (f->oemid == CID_OEMID_ANY ||
+                    f->oemid == card->cid.oemid) &&
+                   (f->name == CID_NAME_ANY ||
+                    !strncmp(f->name, card->cid.prod_name,
+                             sizeof(card->cid.prod_name))) &&
+                   (f->cis_vendor == card->cis.vendor ||
+                    f->cis_vendor == (u16) SDIO_ANY_ID) &&
+                   (f->cis_device == card->cis.device ||
+                    f->cis_device == (u16) SDIO_ANY_ID) &&
+                   (f->ext_csd_rev == EXT_CSD_REV_ANY ||
+                    f->ext_csd_rev == card->ext_csd.rev) &&
+                   rev >= f->rev_start && rev <= f->rev_end) {
+                       dev_dbg(&card->dev, "calling %pf\n", f->vendor_fixup);
+                       f->vendor_fixup(card, f->data);
+               }
+       }
+}
index a64a8709ec72327eb171715f82a4c03bb93a0b00..f092a55c5064b9905fc4c69aa9b8ab6abe8ba787 100644 (file)
@@ -23,6 +23,7 @@
 #include "card.h"
 #include "host.h"
 #include "bus.h"
+#include "quirks.h"
 #include "sd.h"
 #include "sdio_bus.h"
 #include "mmc_ops.h"