Skip to contentSkip to conversation

mtd/gpmi : move the __mxs_setl()/__mxs_clrl() to gpmi-lib.c

PATCH New Huang Shijie 1 participant 2 messages Mar 3, 2012 – Mar 4, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd/gpmi : move the __mxs_setl()/__mxs_clrl() to gpmi-lib.c

We will meet the compiler error in mx6q, since there is no mxs.h header anymore. So move these two helper functions to gpmi-lib.c.

---
 drivers/mtd/nand/gpmi-nand/gpmi-lib.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
drivers/mtd/nand/gpmi-nand/gpmi-lib.c +13 -1
index 5e3c505..9a208cb 100644
@@ -21,7 +21,6 @@
 #include <linux/mtd/gpmi-nand.h>
 #include <linux/delay.h>
 #include <linux/clk.h>
-#include <mach/mxs.h>
 
 #include "gpmi-nand.h"
 #include "gpmi-regs.h"
@@ -37,6 +36,19 @@ struct timing_threshod timing_default_threshold = {
 	.max_dll_delay_in_ns         = 16,
 };
 
+#define MXS_SET_ADDR		0x4
+#define MXS_CLR_ADDR		0x8
+
+static inline void __mxs_setl(u32 mask, void __iomem *reg)
+{
+	writel(mask, reg + MXS_SET_ADDR);
+}
+
+static inline void __mxs_clrl(u32 mask, void __iomem *reg)
+{
+	writel(mask, reg + MXS_CLR_ADDR);
+}
+
 /*
  * Clear the bit and poll it cleared.  This is usually called with
  * a reset address and mask being either SFTRST(bit 31) or CLKGATE
Signature · 1 line
1.7.4
#1 lore raw

PATCH 1/1 mtd/gpmi : move the __mxs_setl()/__mxs_clrl() to gpmi-lib.c

please ignore this patch.

mxs-dma and some other module also have the same problem. A more powerful patch is needed.

BR
Huang Shijie

Quoted 43 lines · Huang Shijie

We will meet the compiler error in mx6q, since there is no mxs.h header anymore. So move these two helper functions to gpmi-lib.c.

---
?drivers/mtd/nand/gpmi-nand/gpmi-lib.c | ? 14 +++++++++++++- ?1 files changed, 13 insertions(+), 1 deletions(-)

drivers/mtd/nand/gpmi-nand/gpmi-lib.c +0 -0
index 5e3c505..9a208cb 100644
@@ -21,7 +21,6 @@

?#include <linux/mtd/gpmi-nand.h>
?#include <linux/delay.h>
?#include <linux/clk.h>
-#include <mach/mxs.h>

?#include "gpmi-nand.h"
?#include "gpmi-regs.h"

drivers/mtd/nand/gpmi-nand/gpmi-lib.c +13 -0
@@ -37,6 +36,19 @@ struct timing_threshod timing_default_threshold = {
 ? ? ? ?.max_dll_delay_in_ns ? ? ? ? = 16,
 ?};
 
+#define MXS_SET_ADDR ? ? ? ? ? 0x4
+#define MXS_CLR_ADDR ? ? ? ? ? 0x8
+
+static inline void __mxs_setl(u32 mask, void __iomem *reg)
+{
+ ? ? ? writel(mask, reg + MXS_SET_ADDR);
+}
+
+static inline void __mxs_clrl(u32 mask, void __iomem *reg)
+{
+ ? ? ? writel(mask, reg + MXS_CLR_ADDR);
+}
+

?/*
?* Clear the bit and poll it cleared. ?This is usually called with ?* a reset address and mask being either SFTRST(bit 31) or CLKGATE --
1.7.4