Merge branch 'docs-move' of git://git.kernel.org/pub/scm/linux/kernel/git/rdunlap...
[pandora-kernel.git] / arch / arm / mach-integrator / integrator_ap.c
index d3e9645..2fbbdd5 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/clockchips.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
+#include <linux/mtd/physmap.h>
 
 #include <mach/hardware.h>
 #include <mach/platform.h>
@@ -43,7 +44,6 @@
 #include <mach/lm.h>
 
 #include <asm/mach/arch.h>
-#include <asm/mach/flash.h>
 #include <asm/mach/irq.h>
 #include <asm/mach/map.h>
 #include <asm/mach/time.h>
@@ -222,7 +222,7 @@ device_initcall(irq_syscore_init);
 #define EBI_CSR1 (VA_EBI_BASE + INTEGRATOR_EBI_CSR1_OFFSET)
 #define EBI_LOCK (VA_EBI_BASE + INTEGRATOR_EBI_LOCK_OFFSET)
 
-static int ap_flash_init(void)
+static int ap_flash_init(struct platform_device *dev)
 {
        u32 tmp;
 
@@ -239,7 +239,7 @@ static int ap_flash_init(void)
        return 0;
 }
 
-static void ap_flash_exit(void)
+static void ap_flash_exit(struct platform_device *dev)
 {
        u32 tmp;
 
@@ -255,15 +255,14 @@ static void ap_flash_exit(void)
        }
 }
 
-static void ap_flash_set_vpp(int on)
+static void ap_flash_set_vpp(struct platform_device *pdev, int on)
 {
        void __iomem *reg = on ? SC_CTRLS : SC_CTRLC;
 
        writel(INTEGRATOR_SC_CTRL_nFLVPPEN, reg);
 }
 
-static struct flash_platform_data ap_flash_data = {
-       .map_name       = "cfi_probe",
+static struct physmap_flash_data ap_flash_data = {
        .width          = 4,
        .init           = ap_flash_init,
        .exit           = ap_flash_exit,
@@ -277,7 +276,7 @@ static struct resource cfi_flash_resource = {
 };
 
 static struct platform_device cfi_flash_device = {
-       .name           = "armflash",
+       .name           = "physmap-flash",
        .id             = 0,
        .dev            = {
                .platform_data  = &ap_flash_data,
@@ -335,25 +334,9 @@ static void __init ap_init(void)
 
 static unsigned long timer_reload;
 
-static void __iomem * const clksrc_base = (void __iomem *)TIMER2_VA_BASE;
-
-static cycle_t timersp_read(struct clocksource *cs)
-{
-       return ~(readl(clksrc_base + TIMER_VALUE) & 0xffff);
-}
-
-static struct clocksource clocksource_timersp = {
-       .name           = "timer2",
-       .rating         = 200,
-       .read           = timersp_read,
-       .mask           = CLOCKSOURCE_MASK(16),
-       .flags          = CLOCK_SOURCE_IS_CONTINUOUS,
-};
-
 static void integrator_clocksource_init(u32 khz)
 {
-       struct clocksource *cs = &clocksource_timersp;
-       void __iomem *base = clksrc_base;
+       void __iomem *base = (void __iomem *)TIMER2_VA_BASE;
        u32 ctrl = TIMER_CTRL_ENABLE;
 
        if (khz >= 1500) {
@@ -364,7 +347,8 @@ static void integrator_clocksource_init(u32 khz)
        writel(ctrl, base + TIMER_CTRL);
        writel(0xffff, base + TIMER_LOAD);
 
-       clocksource_register_khz(cs, khz);
+       clocksource_mmio_init(base + TIMER_VALUE, "timer2",
+               khz * 1000, 200, 16, clocksource_mmio_readl_down);
 }
 
 static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE;