diff options
| author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2014-04-23 07:15:08 -0400 |
|---|---|---|
| committer | Simon Horman <horms+renesas@verge.net.au> | 2014-05-11 06:35:26 -0400 |
| commit | 9b17e48cd4df4e129976c37660cf9ec644c66059 (patch) | |
| tree | 22f1db2ada8bb0029b7d61fb0d5609b146262055 /arch/sh/kernel | |
| parent | 1c41ecb60b3de08d341be13de1dfc3d907b82694 (diff) | |
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: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/sh/kernel')
| -rw-r--r-- | arch/sh/kernel/cpu/clock-cpg.c | 3 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh2/setup-sh7619.c | 66 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh2a/clock-sh7264.c | 2 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh2a/clock-sh7269.c | 2 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh2a/setup-sh7203.c | 66 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh2a/setup-sh7206.c | 66 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh2a/setup-sh7264.c | 69 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh2a/setup-sh7269.c | 66 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh3/setup-sh7720.c | 150 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh7343.c | 2 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh7366.c | 2 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh7722.c | 2 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh7723.c | 2 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/clock-sh7724.c | 2 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7343.c | 18 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7366.c | 18 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 18 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7723.c | 18 | ||||
| -rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 18 |
19 files changed, 106 insertions, 484 deletions
diff --git a/arch/sh/kernel/cpu/clock-cpg.c b/arch/sh/kernel/cpu/clock-cpg.c index f59b1f30d44b..8de314b8e5df 100644 --- a/arch/sh/kernel/cpu/clock-cpg.c +++ b/arch/sh/kernel/cpu/clock-cpg.c | |||
| @@ -58,7 +58,8 @@ int __init __deprecated cpg_clk_init(void) | |||
| 58 | 58 | ||
| 59 | clk_add_alias("tmu_fck", NULL, "peripheral_clk", NULL); | 59 | clk_add_alias("tmu_fck", NULL, "peripheral_clk", NULL); |
| 60 | clk_add_alias("mtu2_fck", NULL, "peripheral_clk", NULL); | 60 | clk_add_alias("mtu2_fck", NULL, "peripheral_clk", NULL); |
| 61 | clk_add_alias("cmt_fck", NULL, "peripheral_clk", NULL); | 61 | clk_add_alias("fck", "sh-cmt-16.0", "peripheral_clk", NULL); |
| 62 | clk_add_alias("fck", "sh-cmt-32.0", "peripheral_clk", NULL); | ||
| 62 | clk_add_alias("sci_ick", NULL, "peripheral_clk", NULL); | 63 | clk_add_alias("sci_ick", NULL, "peripheral_clk", NULL); |
| 63 | 64 | ||
| 64 | return ret; | 65 | return ret; |
diff --git a/arch/sh/kernel/cpu/sh2/setup-sh7619.c b/arch/sh/kernel/cpu/sh2/setup-sh7619.c index 3860b0be56c7..58c19adae900 100644 --- a/arch/sh/kernel/cpu/sh2/setup-sh7619.c +++ b/arch/sh/kernel/cpu/sh2/setup-sh7619.c | |||
| @@ -152,62 +152,24 @@ static struct platform_device eth_device = { | |||
| 152 | .resource = eth_resources, | 152 | .resource = eth_resources, |
| 153 | }; | 153 | }; |
| 154 | 154 | ||
| 155 | static struct sh_timer_config cmt0_platform_data = { | 155 | static struct sh_timer_config cmt_platform_data = { |
| 156 | .channel_offset = 0x02, | 156 | .channels_mask = 3, |
| 157 | .timer_bit = 0, | ||
| 158 | .clockevent_rating = 125, | ||
| 159 | .clocksource_rating = 0, /* disabled due to code generation issues */ | ||
| 160 | }; | 157 | }; |
| 161 | 158 | ||
| 162 | static struct resource cmt0_resources[] = { | 159 | static struct resource cmt_resources[] = { |
| 163 | [0] = { | 160 | DEFINE_RES_MEM(0xf84a0070, 0x10), |
| 164 | .start = 0xf84a0072, | 161 | DEFINE_RES_IRQ(86), |
| 165 | .end = 0xf84a0077, | 162 | DEFINE_RES_IRQ(87), |
| 166 | .flags = IORESOURCE_MEM, | ||
| 167 | }, | ||
| 168 | [1] = { | ||
| 169 | .start = 86, | ||
| 170 | .flags = IORESOURCE_IRQ, | ||
| 171 | }, | ||
| 172 | }; | 163 | }; |
| 173 | 164 | ||
| 174 | static struct platform_device cmt0_device = { | 165 | static struct platform_device cmt_device = { |
| 175 | .name = "sh_cmt", | 166 | .name = "sh-cmt-16", |
| 176 | .id = 0, | 167 | .id = 0, |
| 177 | .dev = { | 168 | .dev = { |
| 178 | .platform_data = &cmt0_platform_data, | 169 | .platform_data = &cmt_platform_data, |
| 179 | }, | ||
| 180 | .resource = cmt0_resources, | ||
| 181 | .num_resources = ARRAY_SIZE(cmt0_resources), | ||
| 182 | }; | ||
| 183 | |||
| 184 | static struct sh_timer_config cmt1_platform_data = { | ||
| 185 | .channel_offset = 0x08, | ||
| 186 | .timer_bit = 1, | ||
| 187 | .clockevent_rating = 125, | ||
| 188 | .clocksource_rating = 0, /* disabled due to code generation issues */ | ||
| 189 | }; | ||
| 190 | |||
| 191 | static struct resource cmt1_resources[] = { | ||
| 192 | [0] = { | ||
| 193 | .start = 0xf84a0078, | ||
| 194 | .end = 0xf84a007d, | ||
| 195 | .flags = IORESOURCE_MEM, | ||
| 196 | }, | ||
| 197 | [1] = { | ||
| 198 | .start = 87, | ||
| 199 | .flags = IORESOURCE_IRQ, | ||
| 200 | }, | ||
| 201 | }; | ||
| 202 | |||
| 203 | static struct platform_device cmt1_device = { | ||
| 204 | .name = "sh_cmt", | ||
| 205 | .id = 1, | ||
| 206 | .dev = { | ||
| 207 | .platform_data = &cmt1_platform_data, | ||
| 208 | }, | 170 | }, |
| 209 | .resource = cmt1_resources, | 171 | .resource = cmt_resources, |
| 210 | .num_resources = ARRAY_SIZE(cmt1_resources), | 172 | .num_resources = ARRAY_SIZE(cmt_resources), |
| 211 | }; | 173 | }; |
| 212 | 174 | ||
| 213 | static struct platform_device *sh7619_devices[] __initdata = { | 175 | static struct platform_device *sh7619_devices[] __initdata = { |
| @@ -215,8 +177,7 @@ static struct platform_device *sh7619_devices[] __initdata = { | |||
| 215 | &scif1_device, | 177 | &scif1_device, |
| 216 | &scif2_device, | 178 | &scif2_device, |
| 217 | ð_device, | 179 | ð_device, |
| 218 | &cmt0_device, | 180 | &cmt_device, |
| 219 | &cmt1_device, | ||
| 220 | }; | 181 | }; |
| 221 | 182 | ||
| 222 | static int __init sh7619_devices_setup(void) | 183 | static int __init sh7619_devices_setup(void) |
| @@ -235,8 +196,7 @@ static struct platform_device *sh7619_early_devices[] __initdata = { | |||
| 235 | &scif0_device, | 196 | &scif0_device, |
| 236 | &scif1_device, | 197 | &scif1_device, |
| 237 | &scif2_device, | 198 | &scif2_device, |
| 238 | &cmt0_device, | 199 | &cmt_device, |
| 239 | &cmt1_device, | ||
| 240 | }; | 200 | }; |
| 241 | 201 | ||
| 242 | #define STBCR3 0xf80a0000 | 202 | #define STBCR3 0xf80a0000 |
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7264.c b/arch/sh/kernel/cpu/sh2a/clock-sh7264.c index fdf585c95289..c7f3c666a0ac 100644 --- a/arch/sh/kernel/cpu/sh2a/clock-sh7264.c +++ b/arch/sh/kernel/cpu/sh2a/clock-sh7264.c | |||
| @@ -117,7 +117,7 @@ static struct clk_lookup lookups[] = { | |||
| 117 | /* MSTP clocks */ | 117 | /* MSTP clocks */ |
| 118 | CLKDEV_CON_ID("sci_ick", &mstp_clks[MSTP77]), | 118 | CLKDEV_CON_ID("sci_ick", &mstp_clks[MSTP77]), |
| 119 | CLKDEV_CON_ID("vdc3", &mstp_clks[MSTP74]), | 119 | CLKDEV_CON_ID("vdc3", &mstp_clks[MSTP74]), |
| 120 | CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP72]), | 120 | CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[MSTP72]), |
| 121 | CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]), | 121 | CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]), |
| 122 | CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]), | 122 | CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]), |
| 123 | CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP34]), | 123 | CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP34]), |
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7269.c b/arch/sh/kernel/cpu/sh2a/clock-sh7269.c index 6b787620de99..4f47464f2fb6 100644 --- a/arch/sh/kernel/cpu/sh2a/clock-sh7269.c +++ b/arch/sh/kernel/cpu/sh2a/clock-sh7269.c | |||
| @@ -158,7 +158,7 @@ static struct clk_lookup lookups[] = { | |||
| 158 | CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]), | 158 | CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]), |
| 159 | CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]), | 159 | CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]), |
| 160 | CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]), | 160 | CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]), |
| 161 | CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP72]), | 161 | CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[MSTP72]), |
| 162 | CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]), | 162 | CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]), |
| 163 | CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]), | 163 | CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]), |
| 164 | CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]), | 164 | CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]), |
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c index d55a0f30ada3..374f8c09d924 100644 --- a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c +++ b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c | |||
| @@ -265,62 +265,24 @@ static struct platform_device scif3_device = { | |||
| 265 | }, | 265 | }, |
| 266 | }; | 266 | }; |
| 267 | 267 | ||
| 268 | static struct sh_timer_config cmt0_platform_data = { | 268 | static struct sh_timer_config cmt_platform_data = { |
| 269 | .channel_offset = 0x02, | ||
