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

login
register
mail settings
Submitter Huang Shijie
Date March 3, 2012, 8:40 p.m.
Message ID <1330807232-5616-1-git-send-email-shijie8@gmail.com>
Download mbox | patch
Permalink /patch/144409/
State New
Headers show

Comments

Huang Shijie - March 3, 2012, 8:40 p.m.
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.

Signed-off-by: Huang Shijie <shijie8@gmail.com>
---
 drivers/mtd/nand/gpmi-nand/gpmi-lib.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
Huang Shijie - March 4, 2012, 1:11 a.m.
please ignore this patch.

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

BR
Huang Shijie


On Sat, Mar 3, 2012 at 3:40 PM, Huang Shijie <shijie8@gmail.com> wrote:
> 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.
>
> Signed-off-by: Huang Shijie <shijie8@gmail.com>
> ---
>  drivers/mtd/nand/gpmi-nand/gpmi-lib.c |   14 +++++++++++++-
>  1 files changed, 13 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
> index 5e3c505..9a208cb 100644
> --- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
> +++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
> @@ -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
> --
> 1.7.4
>

Patch

diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
index 5e3c505..9a208cb 100644
--- a/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
+++ b/drivers/mtd/nand/gpmi-nand/gpmi-lib.c
@@ -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