Commit 46a12f74 authored by Paul Mundt's avatar Paul Mundt

sh: Consolidate MTU2/CMT/TMU timer platform data.

All of the SH timers use a roughly identical structure for platform data,
which presently is broken out for each block. Consolidate all of these
definitions, as there is no reason for them to be broken out in the first
place.
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent d43a41bf
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/sh_cmt.h> #include <linux/sh_timer.h>
#include <linux/io.h> #include <linux/io.h>
enum { enum {
...@@ -111,7 +111,7 @@ static struct platform_device eth_device = { ...@@ -111,7 +111,7 @@ static struct platform_device eth_device = {
.resource = eth_resources, .resource = eth_resources,
}; };
static struct sh_cmt_config cmt0_platform_data = { static struct sh_timer_config cmt0_platform_data = {
.name = "CMT0", .name = "CMT0",
.channel_offset = 0x02, .channel_offset = 0x02,
.timer_bit = 0, .timer_bit = 0,
...@@ -143,7 +143,7 @@ static struct platform_device cmt0_device = { ...@@ -143,7 +143,7 @@ static struct platform_device cmt0_device = {
.num_resources = ARRAY_SIZE(cmt0_resources), .num_resources = ARRAY_SIZE(cmt0_resources),
}; };
static struct sh_cmt_config cmt1_platform_data = { static struct sh_timer_config cmt1_platform_data = {
.name = "CMT1", .name = "CMT1",
.channel_offset = 0x08, .channel_offset = 0x08,
.timer_bit = 1, .timer_bit = 1,
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/sh_mtu2.h> #include <linux/sh_timer.h>
enum { enum {
UNUSED = 0, UNUSED = 0,
...@@ -114,7 +114,7 @@ static struct intc_mask_reg mask_registers[] __initdata = { ...@@ -114,7 +114,7 @@ static struct intc_mask_reg mask_registers[] __initdata = {
static DECLARE_INTC_DESC(intc_desc, "mxg", vectors, groups, static DECLARE_INTC_DESC(intc_desc, "mxg", vectors, groups,
mask_registers, prio_registers, NULL); mask_registers, prio_registers, NULL);
static struct sh_mtu2_config mtu2_0_platform_data = { static struct sh_timer_config mtu2_0_platform_data = {
.name = "MTU2_0", .name = "MTU2_0",
.channel_offset = -0x80, .channel_offset = -0x80,
.timer_bit = 0, .timer_bit = 0,
...@@ -145,7 +145,7 @@ static struct platform_device mtu2_0_device = { ...@@ -145,7 +145,7 @@ static struct platform_device mtu2_0_device = {
.num_resources = ARRAY_SIZE(mtu2_0_resources), .num_resources = ARRAY_SIZE(mtu2_0_resources),
}; };
static struct sh_mtu2_config mtu2_1_platform_data = { static struct sh_timer_config mtu2_1_platform_data = {
.name = "MTU2_1", .name = "MTU2_1",
.channel_offset = -0x100, .channel_offset = -0x100,
.timer_bit = 1, .timer_bit = 1,
...@@ -176,7 +176,7 @@ static struct platform_device mtu2_1_device = { ...@@ -176,7 +176,7 @@ static struct platform_device mtu2_1_device = {
.num_resources = ARRAY_SIZE(mtu2_1_resources), .num_resources = ARRAY_SIZE(mtu2_1_resources),
}; };
static struct sh_mtu2_config mtu2_2_platform_data = { static struct sh_timer_config mtu2_2_platform_data = {
.name = "MTU2_2", .name = "MTU2_2",
.channel_offset = 0x80, .channel_offset = 0x80,
.timer_bit = 2, .timer_bit = 2,
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/sh_mtu2.h> #include <linux/sh_timer.h>
#include <linux/io.h> #include <linux/io.h>
enum { enum {
...@@ -251,7 +251,7 @@ static struct platform_device rtc_device = { ...@@ -251,7 +251,7 @@ static struct platform_device rtc_device = {
.resource = rtc_resources, .resource = rtc_resources,
}; };
static struct sh_mtu2_config mtu2_0_platform_data = { static struct sh_timer_config mtu2_0_platform_data = {
.name = "MTU2_0", .name = "MTU2_0",
.channel_offset = -0x80, .channel_offset = -0x80,
.timer_bit = 0, .timer_bit = 0,
...@@ -282,7 +282,7 @@ static struct platform_device mtu2_0_device = { ...@@ -282,7 +282,7 @@ static struct platform_device mtu2_0_device = {
.num_resources = ARRAY_SIZE(mtu2_0_resources), .num_resources = ARRAY_SIZE(mtu2_0_resources),
}; };
static struct sh_mtu2_config mtu2_1_platform_data = { static struct sh_timer_config mtu2_1_platform_data = {
.name = "MTU2_1", .name = "MTU2_1",
.channel_offset = -0x100, .channel_offset = -0x100,
.timer_bit = 1, .timer_bit = 1,
...@@ -313,7 +313,7 @@ static struct platform_device mtu2_1_device = { ...@@ -313,7 +313,7 @@ static struct platform_device mtu2_1_device = {
.num_resources = ARRAY_SIZE(mtu2_1_resources), .num_resources = ARRAY_SIZE(mtu2_1_resources),
}; };
static struct sh_mtu2_config mtu2_2_platform_data = { static struct sh_timer_config mtu2_2_platform_data = {
.name = "MTU2_2", .name = "MTU2_2",
.channel_offset = 0x80, .channel_offset = 0x80,
.timer_bit = 2, .timer_bit = 2,
......
...@@ -11,8 +11,7 @@ ...@@ -11,8 +11,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/sh_cmt.h> #include <linux/sh_timer.h>
#include <linux/sh_mtu2.h>
#include <linux/io.h> #include <linux/io.h>
enum { enum {
...@@ -208,7 +207,7 @@ static struct platform_device sci_device = { ...@@ -208,7 +207,7 @@ static struct platform_device sci_device = {
}, },
}; };
static struct sh_cmt_config cmt0_platform_data = { static struct sh_timer_config cmt0_platform_data = {
.name = "CMT0", .name = "CMT0",
.channel_offset = 0x02, .channel_offset = 0x02,
.timer_bit = 0, .timer_bit = 0,
...@@ -240,7 +239,7 @@ static struct platform_device cmt0_device = { ...@@ -240,7 +239,7 @@ static struct platform_device cmt0_device = {
.num_resources = ARRAY_SIZE(cmt0_resources), .num_resources = ARRAY_SIZE(cmt0_resources),
}; };
static struct sh_cmt_config cmt1_platform_data = { static struct sh_timer_config cmt1_platform_data = {
.name = "CMT1", .name = "CMT1",
.channel_offset = 0x08, .channel_offset = 0x08,
.timer_bit = 1, .timer_bit = 1,
...@@ -272,7 +271,7 @@ static struct platform_device cmt1_device = { ...@@ -272,7 +271,7 @@ static struct platform_device cmt1_device = {
.num_resources = ARRAY_SIZE(cmt1_resources), .num_resources = ARRAY_SIZE(cmt1_resources),
}; };
static struct sh_mtu2_config mtu2_0_platform_data = { static struct sh_timer_config mtu2_0_platform_data = {
.name = "MTU2_0", .name = "MTU2_0",
.channel_offset = -0x80, .channel_offset = -0x80,
.timer_bit = 0, .timer_bit = 0,
...@@ -303,7 +302,7 @@ static struct platform_device mtu2_0_device = { ...@@ -303,7 +302,7 @@ static struct platform_device mtu2_0_device = {
.num_resources = ARRAY_SIZE(mtu2_0_resources), .num_resources = ARRAY_SIZE(mtu2_0_resources),
}; };
static struct sh_mtu2_config mtu2_1_platform_data = { static struct sh_timer_config mtu2_1_platform_data = {
.name = "MTU2_1", .name = "MTU2_1",
.channel_offset = -0x100, .channel_offset = -0x100,
.timer_bit = 1, .timer_bit = 1,
......
...@@ -12,8 +12,7 @@ ...@@ -12,8 +12,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/sh_cmt.h> #include <linux/sh_timer.h>
#include <linux/sh_mtu2.h>
#include <linux/io.h> #include <linux/io.h>
enum { enum {
...@@ -168,7 +167,7 @@ static struct platform_device sci_device = { ...@@ -168,7 +167,7 @@ static struct platform_device sci_device = {
}, },
}; };
static struct sh_cmt_config cmt0_platform_data = { static struct sh_timer_config cmt0_platform_data = {
.name = "CMT0", .name = "CMT0",
.channel_offset = 0x02, .channel_offset = 0x02,
.timer_bit = 0, .timer_bit = 0,
...@@ -200,7 +199,7 @@ static struct platform_device cmt0_device = { ...@@ -200,7 +199,7 @@ static struct platform_device cmt0_device = {
.num_resources = ARRAY_SIZE(cmt0_resources), .num_resources = ARRAY_SIZE(cmt0_resources),
}; };
static struct sh_cmt_config cmt1_platform_data = { static struct sh_timer_config cmt1_platform_data = {
.name = "CMT1", .name = "CMT1",
.channel_offset = 0x08, .channel_offset = 0x08,
.timer_bit = 1, .timer_bit = 1,
...@@ -232,7 +231,7 @@ static struct platform_device cmt1_device = { ...@@ -232,7 +231,7 @@ static struct platform_device cmt1_device = {
.num_resources = ARRAY_SIZE(cmt1_resources), .num_resources = ARRAY_SIZE(cmt1_resources),
}; };
static struct sh_mtu2_config mtu2_0_platform_data = { static struct sh_timer_config mtu2_0_platform_data = {
.name = "MTU2_0", .name = "MTU2_0",
.channel_offset = -0x80, .channel_offset = -0x80,
.timer_bit = 0, .timer_bit = 0,
...@@ -263,7 +262,7 @@ static struct platform_device mtu2_0_device = { ...@@ -263,7 +262,7 @@ static struct platform_device mtu2_0_device = {
.num_resources = ARRAY_SIZE(mtu2_0_resources), .num_resources = ARRAY_SIZE(mtu2_0_resources),
}; };
static struct sh_mtu2_config mtu2_1_platform_data = { static struct sh_timer_config mtu2_1_platform_data = {
.name = "MTU2_1", .name = "MTU2_1",
.channel_offset = -0x100, .channel_offset = -0x100,
.timer_bit = 1, .timer_bit = 1,
...@@ -294,7 +293,7 @@ static struct platform_device mtu2_1_device = { ...@@ -294,7 +293,7 @@ static struct platform_device mtu2_1_device = {
.num_resources = ARRAY_SIZE(mtu2_1_resources), .num_resources = ARRAY_SIZE(mtu2_1_resources),
}; };
static struct sh_mtu2_config mtu2_2_platform_data = { static struct sh_timer_config mtu2_2_platform_data = {
.name = "MTU2_2", .name = "MTU2_2",
.channel_offset = 0x80, .channel_offset = 0x80,
.timer_bit = 2, .timer_bit = 2,
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/uio_driver.h> #include <linux/uio_driver.h>
#include <linux/sh_cmt.h> #include <linux/sh_timer.h>
#include <asm/clock.h> #include <asm/clock.h>
static struct resource iic0_resources[] = { static struct resource iic0_resources[] = {
...@@ -141,7 +141,7 @@ static struct platform_device jpu_device = { ...@@ -141,7 +141,7 @@ static struct platform_device jpu_device = {
.num_resources = ARRAY_SIZE(jpu_resources), .num_resources = ARRAY_SIZE(jpu_resources),
}; };
static struct sh_cmt_config cmt_platform_data = { static struct sh_timer_config cmt_platform_data = {
.name = "CMT", .name = "CMT",
.channel_offset = 0x60, .channel_offset = 0x60,
.timer_bit = 5, .timer_bit = 5,
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include <linux/serial.h> #include <linux/serial.h>
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/uio_driver.h> #include <linux/uio_driver.h>
#include <linux/sh_cmt.h> #include <linux/sh_timer.h>
#include <asm/clock.h> #include <asm/clock.h>
static struct resource iic_resources[] = { static struct resource iic_resources[] = {
...@@ -148,7 +148,7 @@ static struct platform_device veu1_device = { ...@@ -148,7 +148,7 @@ static struct platform_device veu1_device = {
.num_resources = ARRAY_SIZE(veu1_resources), .num_resources = ARRAY_SIZE(veu1_resources),
}; };
static struct sh_cmt_config cmt_platform_data = { static struct sh_timer_config cmt_platform_data = {
.name = "CMT", .name = "CMT",
.channel_offset = 0x60, .channel_offset = 0x60,
.timer_bit = 5, .timer_bit = 5,
......
...@@ -13,8 +13,7 @@ ...@@ -13,8 +13,7 @@
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/uio_driver.h> #include <linux/uio_driver.h>
#include <linux/sh_cmt.h> #include <linux/sh_timer.h>
#include <linux/sh_tmu.h>
#include <asm/clock.h> #include <asm/clock.h>
#include <asm/mmzone.h> #include <asm/mmzone.h>
...@@ -178,7 +177,7 @@ static struct platform_device jpu_device = { ...@@ -178,7 +177,7 @@ static struct platform_device jpu_device = {
.num_resources = ARRAY_SIZE(jpu_resources), .num_resources = ARRAY_SIZE(jpu_resources),
}; };
static struct sh_cmt_config cmt_platform_data = { static struct sh_timer_config cmt_platform_data = {
.name = "CMT", .name = "CMT",
.channel_offset = 0x60, .channel_offset = 0x60,
.timer_bit = 5, .timer_bit = 5,
...@@ -210,7 +209,7 @@ static struct platform_device cmt_device = { ...@@ -210,7 +209,7 @@ static struct platform_device cmt_device = {
.num_resources = ARRAY_SIZE(cmt_resources), .num_resources = ARRAY_SIZE(cmt_resources),
}; };
static struct sh_tmu_config tmu0_platform_data = { static struct sh_timer_config tmu0_platform_data = {
.name = "TMU0", .name = "TMU0",
.channel_offset = 0x04, .channel_offset = 0x04,
.timer_bit = 0, .timer_bit = 0,
...@@ -241,7 +240,7 @@ static struct platform_device tmu0_device = { ...@@ -241,7 +240,7 @@ static struct platform_device tmu0_device = {
.num_resources = ARRAY_SIZE(tmu0_resources), .num_resources = ARRAY_SIZE(tmu0_resources),
}; };
static struct sh_tmu_config tmu1_platform_data = { static struct sh_timer_config tmu1_platform_data = {
.name = "TMU1", .name = "TMU1",
.channel_offset = 0x10, .channel_offset = 0x10,
.timer_bit = 1, .timer_bit = 1,
...@@ -272,7 +271,7 @@ static struct platform_device tmu1_device = { ...@@ -272,7 +271,7 @@ static struct platform_device tmu1_device = {
.num_resources = ARRAY_SIZE(tmu1_resources), .num_resources = ARRAY_SIZE(tmu1_resources),
}; };
static struct sh_tmu_config tmu2_platform_data = { static struct sh_timer_config tmu2_platform_data = {
.name = "TMU2", .name = "TMU2",
.channel_offset = 0x1c, .channel_offset = 0x1c,
.timer_bit = 2, .timer_bit = 2,
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/uio_driver.h> #include <linux/uio_driver.h>
#include <linux/sh_cmt.h> #include <linux/sh_timer.h>
#include <asm/clock.h> #include <asm/clock.h>
#include <asm/mmzone.h> #include <asm/mmzone.h>
...@@ -101,7 +101,7 @@ static struct platform_device veu1_device = { ...@@ -101,7 +101,7 @@ static struct platform_device veu1_device = {
.num_resources = ARRAY_SIZE(veu1_resources), .num_resources = ARRAY_SIZE(veu1_resources),
}; };
static struct sh_cmt_config cmt_platform_data = { static struct sh_timer_config cmt_platform_data = {
.name = "CMT", .name = "CMT",
.channel_offset = 0x60, .channel_offset = 0x60,
.timer_bit = 5, .timer_bit = 5,
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/uio_driver.h> #include <linux/uio_driver.h>
#include <linux/sh_cmt.h> #include <linux/sh_timer.h>
#include <linux/io.h> #include <linux/io.h>
#include <asm/clock.h> #include <asm/clock.h>
#include <asm/mmzone.h> #include <asm/mmzone.h>
...@@ -230,7 +230,7 @@ static struct platform_device veu1_device = { ...@@ -230,7 +230,7 @@ static struct platform_device veu1_device = {
.num_resources = ARRAY_SIZE(veu1_resources), .num_resources = ARRAY_SIZE(veu1_resources),
}; };
static struct sh_cmt_config cmt_platform_data = { static struct sh_timer_config cmt_platform_data = {
.name = "CMT", .name = "CMT",
.channel_offset = 0x60, .channel_offset = 0x60,
.timer_bit = 5, .timer_bit = 5,
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/clocksource.h> #include <linux/clocksource.h>
#include <linux/clockchips.h> #include <linux/clockchips.h>
#include <linux/sh_cmt.h> #include <linux/sh_timer.h>
struct sh_cmt_priv { struct sh_cmt_priv {
void __iomem *mapbase; void __iomem *mapbase;
...@@ -59,7 +59,7 @@ static DEFINE_SPINLOCK(sh_cmt_lock); ...@@ -59,7 +59,7 @@ static DEFINE_SPINLOCK(sh_cmt_lock);
static inline unsigned long sh_cmt_read(struct sh_cmt_priv *p, int reg_nr) static inline unsigned long sh_cmt_read(struct sh_cmt_priv *p, int reg_nr)
{ {
struct sh_cmt_config *cfg = p->pdev->dev.platform_data; struct sh_timer_config *cfg = p->pdev->dev.platform_data;
void __iomem *base = p->mapbase; void __iomem *base = p->mapbase;
unsigned long offs; unsigned long offs;
...@@ -83,7 +83,7 @@ static inline unsigned long sh_cmt_read(struct sh_cmt_priv *p, int reg_nr) ...@@ -83,7 +83,7 @@ static inline unsigned long sh_cmt_read(struct sh_cmt_priv *p, int reg_nr)
static inline void sh_cmt_write(struct sh_cmt_priv *p, int reg_nr, static inline void sh_cmt_write(struct sh_cmt_priv *p, int reg_nr,
unsigned long value) unsigned long value)
{ {
struct sh_cmt_config *cfg = p->pdev->dev.platform_data; struct sh_timer_config *cfg = p->pdev->dev.platform_data;
void __iomem *base = p->mapbase; void __iomem *base = p->mapbase;
unsigned long offs; unsigned long offs;
...@@ -131,7 +131,7 @@ static unsigned long sh_cmt_get_counter(struct sh_cmt_priv *p, ...@@ -131,7 +131,7 @@ static unsigned long sh_cmt_get_counter(struct sh_cmt_priv *p,
static void sh_cmt_start_stop_ch(struct sh_cmt_priv *p, int start) static void sh_cmt_start_stop_ch(struct sh_cmt_priv *p, int start)
{ {
struct sh_cmt_config *cfg = p->pdev->dev.platform_data; struct sh_timer_config *cfg = p->pdev->dev.platform_data;
unsigned long flags, value; unsigned long flags, value;
/* start stop register shared by multiple timer channels */ /* start stop register shared by multiple timer channels */
...@@ -149,7 +149,7 @@ static void sh_cmt_start_stop_ch(struct sh_cmt_priv *p, int start) ...@@ -149,7 +149,7 @@ static void sh_cmt_start_stop_ch(struct sh_cmt_priv *p, int start)
static int sh_cmt_enable(struct sh_cmt_priv *p, unsigned long *rate) static int sh_cmt_enable(struct sh_cmt_priv *p, unsigned long *rate)
{ {
struct sh_cmt_config *cfg = p->pdev->dev.platform_data; struct sh_timer_config *cfg = p->pdev->dev.platform_data;
int ret; int ret;
/* enable clock */ /* enable clock */
...@@ -560,7 +560,7 @@ int sh_cmt_register(struct sh_cmt_priv *p, char *name, ...@@ -560,7 +560,7 @@ int sh_cmt_register(struct sh_cmt_priv *p, char *name,
static int sh_cmt_setup(struct sh_cmt_priv *p, struct platform_device *pdev) static int sh_cmt_setup(struct sh_cmt_priv *p, struct platform_device *pdev)
{ {
struct sh_cmt_config *cfg = pdev->dev.platform_data; struct sh_timer_config *cfg = pdev->dev.platform_data;
struct resource *res; struct resource *res;
int irq, ret; int irq, ret;
ret = -ENXIO; ret = -ENXIO;
...@@ -638,7 +638,7 @@ static int sh_cmt_setup(struct sh_cmt_priv *p, struct platform_device *pdev) ...@@ -638,7 +638,7 @@ static int sh_cmt_setup(struct sh_cmt_priv *p, struct platform_device *pdev)
static int __devinit sh_cmt_probe(struct platform_device *pdev) static int __devinit sh_cmt_probe(struct platform_device *pdev)
{ {
struct sh_cmt_priv *p = platform_get_drvdata(pdev); struct sh_cmt_priv *p = platform_get_drvdata(pdev);
struct sh_cmt_config *cfg = pdev->dev.platform_data; struct sh_timer_config *cfg = pdev->dev.platform_data;
int ret; int ret;
if (p) { if (p) {
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/err.h> #include <linux/err.h>
#include <linux/clockchips.h> #include <linux/clockchips.h>
#include <linux/sh_mtu2.h> #include <linux/sh_timer.h>
struct sh_mtu2_priv { struct sh_mtu2_priv {
void __iomem *mapbase; void __iomem *mapbase;
...@@ -63,7 +63,7 @@ static unsigned long mtu2_reg_offs[] = { ...@@ -63,7 +63,7 @@ static unsigned long mtu2_reg_offs[] = {
static inline unsigned long sh_mtu2_read(struct sh_mtu2_priv *p, int reg_nr) static inline unsigned long sh_mtu2_read(struct sh_mtu2_priv *p, int reg_nr)
{ {
struct sh_mtu2_config *cfg = p->pdev->dev.platform_data; struct sh_timer_config *cfg = p->pdev->dev.platform_data;
void __iomem *base = p->mapbase; void __iomem *base = p->mapbase;
unsigned long offs; unsigned long offs;
...@@ -81,7 +81,7 @@ static inline unsigned long sh_mtu2_read(struct sh_mtu2_priv *p, int reg_nr) ...@@ -81,7 +81,7 @@ static inline unsigned long sh_mtu2_read(struct sh_mtu2_priv *p, int reg_nr)
static inline void sh_mtu2_write(struct sh_mtu2_priv *p, int reg_nr, static inline void sh_mtu2_write(struct sh_mtu2_priv *p, int reg_nr,
unsigned long value) unsigned long value)
{ {
struct sh_mtu2_config *cfg = p->pdev->dev.platform_data; struct sh_timer_config *cfg = p->pdev->dev.platform_data;
void __iomem *base = p->mapbase; void __iomem *base = p->mapbase;
unsigned long offs; unsigned long offs;
...@@ -100,7 +100,7 @@ static inline void sh_mtu2_write(struct sh_mtu2_priv *p, int reg_nr, ...@@ -100,7 +100,7 @@ static inline void sh_mtu2_write(struct sh_mtu2_priv *p, int reg_nr,
static void sh_mtu2_start_stop_ch(struct sh_mtu2_priv *p, int start) static void sh_mtu2_start_stop_ch(struct sh_mtu2_priv *p, int start)
{ {
struct sh_mtu2_config *cfg = p->pdev->dev.platform_data; struct sh_timer_config *cfg = p->pdev->dev.platform_data;
unsigned long flags, value; unsigned long flags, value;
/* start stop register shared by multiple timer channels */ /* start stop register shared by multiple timer channels */
...@@ -118,7 +118,7 @@ static void sh_mtu2_start_stop_ch(struct sh_mtu2_priv *p, int start) ...@@ -118,7 +118,7 @@ static void sh_mtu2_start_stop_ch(struct sh_mtu2_priv *p, int start)
static int sh_mtu2_enable(struct sh_mtu2_priv *p) static int sh_mtu2_enable(struct sh_mtu2_priv *p)
{ {
struct sh_mtu2_config *cfg = p->pdev->dev.platform_data; struct sh_timer_config *cfg = p->pdev->dev.platform_data;
int ret; int ret;
/* enable clock */ /* enable clock */
...@@ -243,7 +243,7 @@ int sh_mtu2_register(struct sh_mtu2_priv *p, char *name, ...@@ -243,7 +243,7 @@ int sh_mtu2_register(struct sh_mtu2_priv *p, char *name,
static int sh_mtu2_setup(struct sh_mtu2_priv *p, struct platform_device *pdev) static int sh_mtu2_setup(struct sh_mtu2_priv *p, struct platform_device *pdev)
{ {
struct sh_mtu2_config *cfg = pdev->dev.platform_data; struct sh_timer_config *cfg = pdev->dev.platform_data;
struct resource *res; struct resource *res;
int irq, ret; int irq, ret;
ret = -ENXIO; ret = -ENXIO;
...@@ -303,7 +303,7 @@ static int sh_mtu2_setup(struct sh_mtu2_priv *p, struct platform_device *pdev) ...@@ -303,7 +303,7 @@ static int sh_mtu2_setup(struct sh_mtu2_priv *p, struct platform_device *pdev)
static int __devinit sh_mtu2_probe(struct platform_device *pdev) static int __devinit sh_mtu2_probe(struct platform_device *pdev)
{ {
struct sh_mtu2_priv *p = platform_get_drvdata(pdev); struct sh_mtu2_priv *p = platform_get_drvdata(pdev);
struct sh_mtu2_config *cfg = pdev->dev.platform_data; struct sh_timer_config *cfg = pdev->dev.platform_data;
int ret; int ret;
if (p) { if (p) {
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/clocksource.h> #include <linux/clocksource.h>
#include <linux/clockchips.h> #include <linux/clockchips.h>
#include <linux/sh_tmu.h> #include <linux/sh_timer.h>
struct sh_tmu_priv { struct sh_tmu_priv {
void __iomem *mapbase; void __iomem *mapbase;
...@@ -51,7 +51,7 @@ static DEFINE_SPINLOCK(sh_tmu_lock); ...@@ -51,7 +51,7 @@ static DEFINE_SPINLOCK(sh_tmu_lock);
static inline unsigned long sh_tmu_read(struct sh_tmu_priv *p, int reg_nr) static inline unsigned long sh_tmu_read(struct sh_tmu_priv *p, int reg_nr)
{ {
struct sh_tmu_config *cfg = p->pdev->dev.platform_data; struct sh_timer_config *cfg = p->pdev->dev.platform_data;
void __iomem *base = p->mapbase; void __iomem *base = p->mapbase;
unsigned long offs; unsigned long offs;
...@@ -69,7 +69,7 @@ static inline unsigned long sh_tmu_read(struct sh_tmu_priv *p, int reg_nr) ...@@ -69,7 +69,7 @@ static inline unsigned long sh_tmu_read(struct sh_tmu_priv *p, int reg_nr)
static inline void sh_tmu_write(struct sh_tmu_priv *p, int reg_nr, static inline void sh_tmu_write(struct sh_tmu_priv *p, int reg_nr,
unsigned long value) unsigned long value)
{ {
struct sh_tmu_config *cfg = p->pdev->dev.platform_data; struct sh_timer_config *cfg = p->pdev->dev.platform_data;
void __iomem *base = p->mapbase; void __iomem *base = p->mapbase;
unsigned long offs; unsigned long offs;
...@@ -88,7 +88,7 @@ static inline void sh_tmu_write(struct sh_tmu_priv *p, int reg_nr, ...@@ -88,7 +88,7 @@ static inline void sh_tmu_write(struct sh_tmu_priv *p, int reg_nr,
static void sh_tmu_start_stop_ch(struct sh_tmu_priv *p, int start) static void sh_tmu_start_stop_ch(struct sh_tmu_priv *p, int start)
{ {
struct sh_tmu_config *cfg = p->pdev->dev.platform_data; struct sh_timer_config *cfg = p->pdev->dev.platform_data;
unsigned long flags, value; unsigned long flags, value;
/* start stop register shared by multiple timer channels */ /* start stop register shared by multiple timer channels */
...@@ -106,7 +106,7 @@ static void sh_tmu_start_stop_ch(struct sh_tmu_priv *p, int start) ...@@ -106,7 +106,7 @@ static void sh_tmu_start_stop_ch(struct sh_tmu_priv *p, int start)
static int sh_tmu_enable(struct sh_tmu_priv *p) static int sh_tmu_enable(struct sh_tmu_priv *p)
{ {
struct sh_tmu_config *cfg = p->pdev->dev.platform_data; struct sh_timer_config *cfg = p->pdev->dev.platform_data;
int ret; int ret;
/* enable clock */ /* enable clock */
...@@ -345,7 +345,7 @@ static int sh_tmu_register(struct sh_tmu_priv *p, char *name, ...@@ -345,7 +345,7 @@ static int sh_tmu_register(struct sh_tmu_priv *p, char *name,
static int sh_tmu_setup(struct sh_tmu_priv *p, struct platform_device *pdev) static int sh_tmu_setup(struct sh_tmu_priv *p, struct platform_device *pdev)
{ {
struct sh_tmu_config *cfg = pdev->dev.platform_data; struct sh_timer_config *cfg = pdev->dev.platform_data;
struct resource *res; struct resource *res;
int irq, ret; int irq, ret;
ret = -ENXIO; ret = -ENXIO;
...@@ -407,7 +407,7 @@ static int sh_tmu_setup(struct sh_tmu_priv *p, struct platform_device *pdev) ...@@ -407,7 +407,7 @@ static int sh_tmu_setup(struct sh_tmu_priv *p, struct platform_device *pdev)
static int __devinit sh_tmu_probe(struct platform_device *pdev) static int __devinit sh_tmu_probe(struct platform_device *pdev)
{ {
struct sh_tmu_priv *p = platform_get_drvdata(pdev); struct sh_tmu_priv *p = platform_get_drvdata(pdev);
struct sh_tmu_config *cfg = pdev->dev.platform_data; struct sh_timer_config *cfg = pdev->dev.platform_data;
int ret; int ret;
if (p) { if (p) {
......
#ifndef __SH_MTU2_H__
#define __SH_MTU2_H__
struct sh_mtu2_config {
char *name;
int channel_offset;
int timer_bit;
char *clk;
unsigned long clockevent_rating;
};
#endif /* __SH_MTU2_H__ */
#ifndef __SH_CMT_H__ #ifndef __SH_TIMER_H__
#define __SH_CMT_H__ #define __SH_TIMER_H__
struct sh_cmt_config { struct sh_timer_config {
char *name; char *name;
unsigned long channel_offset; long channel_offset;
int timer_bit; int timer_bit;
char *clk; char *clk;
unsigned long clockevent_rating; unsigned long clockevent_rating;
unsigned long clocksource_rating; unsigned long clocksource_rating;
}; };
#endif /* __SH_CMT_H__ */ #endif /* __SH_TIMER_H__ */
#ifndef __SH_TMU_H__
#define __SH_TMU_H__
struct sh_tmu_config {
char *name;
unsigned long channel_offset;
int timer_bit;
char *clk;
unsigned long clockevent_rating;
unsigned long clocksource_rating;
};
#endif /* __SH_TMU_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment