aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2014-04-23 07:15:20 -0400
committerSimon Horman <horms+renesas@verge.net.au>2014-05-11 06:35:28 -0400
commite4ae34e285b1c102686cb1c2a39ef93f930bf8f4 (patch)
treec80ea5c651b644fb1aebec8b039e61f548883d58
parent535ef0d9575b0809915341481ef3bac6bb5d0aaa (diff)
ARM: shmobile: r8a7779: Switch to new style TMU device
The TMU (Timer Unit) 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: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7779.c4
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c66
2 files changed, 14 insertions, 56 deletions
diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index 8e403ae0c7b2..a13298bd37a8 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -173,9 +173,7 @@ static struct clk_lookup lookups[] = {
173 CLKDEV_DEV_ID("ohci-platform.1", &mstp_clks[MSTP101]), /* USB OHCI port2 */ 173 CLKDEV_DEV_ID("ohci-platform.1", &mstp_clks[MSTP101]), /* USB OHCI port2 */
174 CLKDEV_DEV_ID("ehci-platform.0", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */ 174 CLKDEV_DEV_ID("ehci-platform.0", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */
175 CLKDEV_DEV_ID("ohci-platform.0", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */ 175 CLKDEV_DEV_ID("ohci-platform.0", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */
176 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */ 176 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP016]), /* TMU0 */
177 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP016]), /* TMU01 */
178 CLKDEV_DEV_ID("sh_tmu.2", &mstp_clks[MSTP016]), /* TMU02 */
179 CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */ 177 CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */
180 CLKDEV_DEV_ID("ffc70000.i2c", &mstp_clks[MSTP030]), /* I2C0 */ 178 CLKDEV_DEV_ID("ffc70000.i2c", &mstp_clks[MSTP030]), /* I2C0 */
181 CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP029]), /* I2C1 */ 179 CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP029]), /* I2C1 */
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 8e860b36997a..d197b5adc886 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -219,64 +219,25 @@ R8A7779_SCIF(4, 0xffe44000, gic_iid(0x7c));
219R8A7779_SCIF(5, 0xffe45000, gic_iid(0x7d)); 219R8A7779_SCIF(5, 0xffe45000, gic_iid(0x7d));
220 220
221/* TMU */ 221/* TMU */
222static struct sh_timer_config tmu00_platform_data = { 222static struct sh_timer_config tmu0_platform_data = {
223 .name = "TMU00", 223 .channels_mask = 7,
224 .channel_offset = 0x4,
225 .timer_bit = 0,
226 .clockevent_rating = 200,
227}; 224};
228 225
229static struct resource tmu00_resources[] = { 226static struct resource tmu0_resources[] = {
230 [0] = { 227 DEFINE_RES_MEM(0xffd80000, 0x30),
231 .name = "TMU00", 228 DEFINE_RES_IRQ(gic_iid(0x40)),
232 .start = 0xffd80008, 229 DEFINE_RES_IRQ(gic_iid(0x41)),
233 .end = 0xffd80013, 230 DEFINE_RES_IRQ(gic_iid(0x42)),
234 .flags = IORESOURCE_MEM,
235 },
236 [1] = {
237 .start = gic_iid(0x40),
238 .flags = IORESOURCE_IRQ,
239 },
240}; 231};
241 232
242static struct platform_device tmu00_device = { 233static struct platform_device tmu0_device = {
243 .name = "sh_tmu", 234 .name = "sh-tmu",
244 .id = 0, 235 .id = 0,
245 .dev = { 236 .dev = {
246 .platform_data = &tmu00_platform_data, 237 .platform_data = &tmu0_platform_data,
247 },
248 .resource = tmu00_resources,
249 .num_resources = ARRAY_SIZE(tmu00_resources),
250};
251
252static struct sh_timer_config tmu01_platform_data = {
253 .name = "TMU01",
254 .channel_offset = 0x10,
255 .timer_bit = 1,
256 .clocksource_rating = 200,
257};
258
259static struct resource tmu01_resources[] = {
260 [0] = {
261 .name = "TMU01",
262 .start = 0xffd80014,
263 .end = 0xffd8001f,
264 .flags = IORESOURCE_MEM,
265 },
266 [1] = {
267 .start = gic_iid(0x41),
268 .flags = IORESOURCE_IRQ,
269 },
270};
271
272static struct platform_device tmu01_device = {
273 .name = "sh_tmu",
274 .id = 1,
275 .dev = {
276 .platform_data = &tmu01_platform_data,
277 }, 238 },
278 .resource = tmu01_resources, 239 .resource = tmu0_resources,
279 .num_resources = ARRAY_SIZE(tmu01_resources), 240 .num_resources = ARRAY_SIZE(tmu0_resources),
280}; 241};
281 242
282/* I2C */ 243/* I2C */
@@ -685,8 +646,7 @@ static struct platform_device *r8a7779_devices_dt[] __initdata = {
685 &scif3_device, 646 &scif3_device,
686 &scif4_device, 647 &scif4_device,
687 &scif5_device, 648 &scif5_device,
688 &tmu00_device, 649 &tmu0_device,
689 &tmu01_device,
690}; 650};
691 651
692static struct platform_device *r8a7779_standard_devices[] __initdata = { 652static struct platform_device *r8a7779_standard_devices[] __initdata = {