Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b17e48c authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Simon Horman
Browse files

sh: Switch to new style CMT device



The CMT (Compare Match Timer) driver implements a new style of platform
data that handles the timer as a single device with multiple channel.
Switch from the old-style platform data to the new-style platform data.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarSimon Horman <horms+renesas@verge.net.au>
parent 1c41ecb6
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -58,7 +58,8 @@ int __init __deprecated cpg_clk_init(void)

	clk_add_alias("tmu_fck", NULL, "peripheral_clk", NULL);
	clk_add_alias("mtu2_fck", NULL, "peripheral_clk", NULL);
	clk_add_alias("cmt_fck", NULL, "peripheral_clk", NULL);
	clk_add_alias("fck", "sh-cmt-16.0", "peripheral_clk", NULL);
	clk_add_alias("fck", "sh-cmt-32.0", "peripheral_clk", NULL);
	clk_add_alias("sci_ick", NULL, "peripheral_clk", NULL);

	return ret;
+13 −53
Original line number Diff line number Diff line
@@ -152,62 +152,24 @@ static struct platform_device eth_device = {
	.resource = eth_resources,
};

static struct sh_timer_config cmt0_platform_data = {
	.channel_offset = 0x02,
	.timer_bit = 0,
	.clockevent_rating = 125,
	.clocksource_rating = 0, /* disabled due to code generation issues */
static struct sh_timer_config cmt_platform_data = {
	.channels_mask = 3,
};

static struct resource cmt0_resources[] = {
	[0] = {
		.start	= 0xf84a0072,
		.end	= 0xf84a0077,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= 86,
		.flags	= IORESOURCE_IRQ,
	},
static struct resource cmt_resources[] = {
	DEFINE_RES_MEM(0xf84a0070, 0x10),
	DEFINE_RES_IRQ(86),
	DEFINE_RES_IRQ(87),
};

static struct platform_device cmt0_device = {
	.name		= "sh_cmt",
static struct platform_device cmt_device = {
	.name		= "sh-cmt-16",
	.id		= 0,
	.dev = {
		.platform_data	= &cmt0_platform_data,
	},
	.resource	= cmt0_resources,
	.num_resources	= ARRAY_SIZE(cmt0_resources),
};

static struct sh_timer_config cmt1_platform_data = {
	.channel_offset = 0x08,
	.timer_bit = 1,
	.clockevent_rating = 125,
	.clocksource_rating = 0, /* disabled due to code generation issues */
};

static struct resource cmt1_resources[] = {
	[0] = {
		.start	= 0xf84a0078,
		.end	= 0xf84a007d,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= 87,
		.flags	= IORESOURCE_IRQ,
	},
};

static struct platform_device cmt1_device = {
	.name		= "sh_cmt",
	.id		= 1,
	.dev = {
		.platform_data	= &cmt1_platform_data,
		.platform_data	= &cmt_platform_data,
	},
	.resource	= cmt1_resources,
	.num_resources	= ARRAY_SIZE(cmt1_resources),
	.resource	= cmt_resources,
	.num_resources	= ARRAY_SIZE(cmt_resources),
};

static struct platform_device *sh7619_devices[] __initdata = {
@@ -215,8 +177,7 @@ static struct platform_device *sh7619_devices[] __initdata = {
	&scif1_device,
	&scif2_device,
	&eth_device,
	&cmt0_device,
	&cmt1_device,
	&cmt_device,
};

static int __init sh7619_devices_setup(void)
@@ -235,8 +196,7 @@ static struct platform_device *sh7619_early_devices[] __initdata = {
	&scif0_device,
	&scif1_device,
	&scif2_device,
	&cmt0_device,
	&cmt1_device,
	&cmt_device,
};

#define STBCR3 0xf80a0000
+1 −1
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ static struct clk_lookup lookups[] = {
	/* MSTP clocks */
	CLKDEV_CON_ID("sci_ick", &mstp_clks[MSTP77]),
	CLKDEV_CON_ID("vdc3", &mstp_clks[MSTP74]),
	CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP72]),
	CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[MSTP72]),
	CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]),
	CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]),
	CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP34]),
+1 −1
Original line number Diff line number Diff line
@@ -158,7 +158,7 @@ static struct clk_lookup lookups[] = {
	CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]),
	CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]),
	CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]),
	CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP72]),
	CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[MSTP72]),
	CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]),
	CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]),
	CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]),
+13 −53
Original line number Diff line number Diff line
@@ -265,62 +265,24 @@ static struct platform_device scif3_device = {
	},
};

static struct sh_timer_config cmt0_platform_data = {
	.channel_offset = 0x02,
	.timer_bit = 0,
	.clockevent_rating = 125,
	.clocksource_rating = 0, /* disabled due to code generation issues */
static struct sh_timer_config cmt_platform_data = {
	.channels_mask = 3,
};

static struct resource cmt0_resources[] = {
	[0] = {
		.start	= 0xfffec002,
		.end	= 0xfffec007,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= 142,
		.flags	= IORESOURCE_IRQ,
	},
static struct resource cmt_resources[] = {
	DEFINE_RES_MEM(0xfffec000, 0x10),
	DEFINE_RES_IRQ(142),
	DEFINE_RES_IRQ(143),
};

static struct platform_device cmt0_device = {
	.name		= "sh_cmt",
static struct platform_device cmt_device = {
	.name		= "sh-cmt-16",
	.id		= 0,
	.dev = {
		.platform_data	= &cmt0_platform_data,
	},
	.resource	= cmt0_resources,
	.num_resources	= ARRAY_SIZE(cmt0_resources),
};

static struct sh_timer_config cmt1_platform_data = {
	.channel_offset = 0x08,
	.timer_bit = 1,
	.clockevent_rating = 125,
	.clocksource_rating = 0, /* disabled due to code generation issues */
};

static struct resource cmt1_resources[] = {
	[0] = {
		.start	= 0xfffec008,
		.end	= 0xfffec00d,
		.flags	= IORESOURCE_MEM,
	},
	[1] = {
		.start	= 143,
		.flags	= IORESOURCE_IRQ,
	},
};

static struct platform_device cmt1_device = {
	.name		= "sh_cmt",
	.id		= 1,
	.dev = {
		.platform_data	= &cmt1_platform_data,
		.platform_data	= &cmt_platform_data,
	},
	.resource	= cmt1_resources,
	.num_resources	= ARRAY_SIZE(cmt1_resources),
	.resource	= cmt_resources,
	.num_resources	= ARRAY_SIZE(cmt_resources),
};

static struct sh_timer_config mtu2_0_platform_data = {
@@ -404,8 +366,7 @@ static struct platform_device *sh7203_devices[] __initdata = {
	&scif1_device,
	&scif2_device,
	&scif3_device,
	&cmt0_device,
	&cmt1_device,
	&cmt_device,
	&mtu2_0_device,
	&mtu2_1_device,
	&rtc_device,
@@ -428,8 +389,7 @@ static struct platform_device *sh7203_early_devices[] __initdata = {
	&scif1_device,
	&scif2_device,
	&scif3_device,
	&cmt0_device,
	&cmt1_device,
	&cmt_device,
	&mtu2_0_device,
	&mtu2_1_device,
};
Loading