Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branches 'sh/intc-extension', 'sh/dmaengine', 'sh/serial-dma' and 'sh/clkfwk'

Conflicts:
arch/sh/kernel/cpu/clock.c

Signed-off-by: Paul Mundt <lethal@linux-sh.org>

+863 -697
+35
arch/sh/include/asm/clkdev.h
··· 1 + /* 2 + * arch/sh/include/asm/clkdev.h 3 + * 4 + * Cloned from arch/arm/include/asm/clkdev.h: 5 + * 6 + * Copyright (C) 2008 Russell King. 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + * 12 + * Helper for the clk API to assist looking up a struct clk. 13 + */ 14 + #ifndef __ASM_CLKDEV_H 15 + #define __ASM_CLKDEV_H 16 + 17 + struct clk; 18 + 19 + struct clk_lookup { 20 + struct list_head node; 21 + const char *dev_id; 22 + const char *con_id; 23 + struct clk *clk; 24 + }; 25 + 26 + struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id, 27 + const char *dev_fmt, ...); 28 + 29 + void clkdev_add(struct clk_lookup *cl); 30 + void clkdev_drop(struct clk_lookup *cl); 31 + 32 + void clkdev_add_table(struct clk_lookup *, size_t); 33 + int clk_add_alias(const char *, const char *, char *, struct device *); 34 + 35 + #endif
-7
arch/sh/include/asm/clock.h
··· 45 45 struct cpufreq_frequency_table *freq_table; 46 46 }; 47 47 48 - struct clk_lookup { 49 - struct list_head node; 50 - const char *dev_id; 51 - const char *con_id; 52 - struct clk *clk; 53 - }; 54 - 55 48 #define CLK_ENABLE_ON_INIT (1 << 0) 56 49 57 50 /* Should be defined by processor-specific code */
+2 -61
arch/sh/include/asm/dmaengine.h
··· 10 10 #ifndef ASM_DMAENGINE_H 11 11 #define ASM_DMAENGINE_H 12 12 13 - #include <linux/dmaengine.h> 14 - #include <linux/list.h> 13 + #include <linux/sh_dma.h> 15 14 16 - #include <asm/dma-register.h> 17 - 18 - #define SH_DMAC_MAX_CHANNELS 6 19 - 20 - enum sh_dmae_slave_chan_id { 15 + enum { 21 16 SHDMA_SLAVE_SCIF0_TX, 22 17 SHDMA_SLAVE_SCIF0_RX, 23 18 SHDMA_SLAVE_SCIF1_TX, ··· 29 34 SHDMA_SLAVE_SIUA_RX, 30 35 SHDMA_SLAVE_SIUB_TX, 31 36 SHDMA_SLAVE_SIUB_RX, 32 - SHDMA_SLAVE_NUMBER, /* Must stay last */ 33 - }; 34 - 35 - struct sh_dmae_slave_config { 36 - enum sh_dmae_slave_chan_id slave_id; 37 - dma_addr_t addr; 38 - u32 chcr; 39 - char mid_rid; 40 - }; 41 - 42 - struct sh_dmae_channel { 43 - unsigned int offset; 44 - unsigned int dmars; 45 - unsigned int dmars_bit; 46 - }; 47 - 48 - struct sh_dmae_pdata { 49 - struct sh_dmae_slave_config *slave; 50 - int slave_num; 51 - struct sh_dmae_channel *channel; 52 - int channel_num; 53 - unsigned int ts_low_shift; 54 - unsigned int ts_low_mask; 55 - unsigned int ts_high_shift; 56 - unsigned int ts_high_mask; 57 - unsigned int *ts_shift; 58 - int ts_shift_num; 59 - u16 dmaor_init; 60 - }; 61 - 62 - struct device; 63 - 64 - /* Used by slave DMA clients to request DMA to/from a specific peripheral */ 65 - struct sh_dmae_slave { 66 - enum sh_dmae_slave_chan_id slave_id; /* Set by the platform */ 67 - struct device *dma_dev; /* Set by the platform */ 68 - struct sh_dmae_slave_config *config; /* Set by the driver */ 69 - }; 70 - 71 - struct sh_dmae_regs { 72 - u32 sar; /* SAR / source address */ 73 - u32 dar; /* DAR / destination address */ 74 - u32 tcr; /* TCR / transfer count */ 75 - }; 76 - 77 - struct sh_desc { 78 - struct sh_dmae_regs hw; 79 - struct list_head node; 80 - struct dma_async_tx_descriptor async_tx; 81 - enum dma_data_direction direction; 82 - dma_cookie_t cookie; 83 - size_t partial; 84 - int chunks; 85 - int mark; 86 37 }; 87 38 88 39 #endif
+4 -4
arch/sh/include/asm/siu.h
··· 17 17 18 18 struct siu_platform { 19 19 struct device *dma_dev; 20 - enum sh_dmae_slave_chan_id dma_slave_tx_a; 21 - enum sh_dmae_slave_chan_id dma_slave_rx_a; 22 - enum sh_dmae_slave_chan_id dma_slave_tx_b; 23 - enum sh_dmae_slave_chan_id dma_slave_rx_b; 20 + unsigned int dma_slave_tx_a; 21 + unsigned int dma_slave_rx_a; 22 + unsigned int dma_slave_tx_b; 23 + unsigned int dma_slave_rx_b; 24 24 }; 25 25 26 26 #endif /* ASM_SIU_H */
+1 -1
arch/sh/kernel/Makefile
··· 11 11 12 12 CFLAGS_REMOVE_return_address.o = -pg 13 13 14 - obj-y := debugtraps.o dma-nommu.o dumpstack.o \ 14 + obj-y := clkdev.o debugtraps.o dma-nommu.o dumpstack.o \ 15 15 idle.o io.o io_generic.o irq.o \ 16 16 irq_$(BITS).o machvec.o nmi_debug.o process.o \ 17 17 process_$(BITS).o ptrace_$(BITS).o \
+169
arch/sh/kernel/clkdev.c
··· 1 + /* 2 + * arch/sh/kernel/clkdev.c 3 + * 4 + * Cloned from arch/arm/common/clkdev.c: 5 + * 6 + * Copyright (C) 2008 Russell King. 7 + * 8 + * This program is free software; you can redistribute it and/or modify 9 + * it under the terms of the GNU General Public License version 2 as 10 + * published by the Free Software Foundation. 11 + * 12 + * Helper for the clk API to assist looking up a struct clk. 13 + */ 14 + #include <linux/module.h> 15 + #include <linux/kernel.h> 16 + #include <linux/device.h> 17 + #include <linux/list.h> 18 + #include <linux/errno.h> 19 + #include <linux/err.h> 20 + #include <linux/string.h> 21 + #include <linux/mutex.h> 22 + #include <linux/clk.h> 23 + #include <linux/slab.h> 24 + #include <linux/bootmem.h> 25 + #include <linux/mm.h> 26 + #include <asm/clock.h> 27 + #include <asm/clkdev.h> 28 + 29 + static LIST_HEAD(clocks); 30 + static DEFINE_MUTEX(clocks_mutex); 31 + 32 + /* 33 + * Find the correct struct clk for the device and connection ID. 34 + * We do slightly fuzzy matching here: 35 + * An entry with a NULL ID is assumed to be a wildcard. 36 + * If an entry has a device ID, it must match 37 + * If an entry has a connection ID, it must match 38 + * Then we take the most specific entry - with the following 39 + * order of precidence: dev+con > dev only > con only. 40 + */ 41 + static struct clk *clk_find(const char *dev_id, const char *con_id) 42 + { 43 + struct clk_lookup *p; 44 + struct clk *clk = NULL; 45 + int match, best = 0; 46 + 47 + list_for_each_entry(p, &clocks, node) { 48 + match = 0; 49 + if (p->dev_id) { 50 + if (!dev_id || strcmp(p->dev_id, dev_id)) 51 + continue; 52 + match += 2; 53 + } 54 + if (p->con_id) { 55 + if (!con_id || strcmp(p->con_id, con_id)) 56 + continue; 57 + match += 1; 58 + } 59 + if (match == 0) 60 + continue; 61 + 62 + if (match > best) { 63 + clk = p->clk; 64 + best = match; 65 + } 66 + } 67 + return clk; 68 + } 69 + 70 + struct clk *clk_get_sys(const char *dev_id, const char *con_id) 71 + { 72 + struct clk *clk; 73 + 74 + mutex_lock(&clocks_mutex); 75 + clk = clk_find(dev_id, con_id); 76 + mutex_unlock(&clocks_mutex); 77 + 78 + return clk ? clk : ERR_PTR(-ENOENT); 79 + } 80 + EXPORT_SYMBOL(clk_get_sys); 81 + 82 + void clkdev_add(struct clk_lookup *cl) 83 + { 84 + mutex_lock(&clocks_mutex); 85 + list_add_tail(&cl->node, &clocks); 86 + mutex_unlock(&clocks_mutex); 87 + } 88 + EXPORT_SYMBOL(clkdev_add); 89 + 90 + void __init clkdev_add_table(struct clk_lookup *cl, size_t num) 91 + { 92 + mutex_lock(&clocks_mutex); 93 + while (num--) { 94 + list_add_tail(&cl->node, &clocks); 95 + cl++; 96 + } 97 + mutex_unlock(&clocks_mutex); 98 + } 99 + 100 + #define MAX_DEV_ID 20 101 + #define MAX_CON_ID 16 102 + 103 + struct clk_lookup_alloc { 104 + struct clk_lookup cl; 105 + char dev_id[MAX_DEV_ID]; 106 + char con_id[MAX_CON_ID]; 107 + }; 108 + 109 + struct clk_lookup * __init_refok 110 + clkdev_alloc(struct clk *clk, const char *con_id, const char *dev_fmt, ...) 111 + { 112 + struct clk_lookup_alloc *cla; 113 + 114 + if (!slab_is_available()) 115 + cla = alloc_bootmem_low_pages(sizeof(*cla)); 116 + else 117 + cla = kzalloc(sizeof(*cla), GFP_KERNEL); 118 + 119 + if (!cla) 120 + return NULL; 121 + 122 + cla->cl.clk = clk; 123 + if (con_id) { 124 + strlcpy(cla->con_id, con_id, sizeof(cla->con_id)); 125 + cla->cl.con_id = cla->con_id; 126 + } 127 + 128 + if (dev_fmt) { 129 + va_list ap; 130 + 131 + va_start(ap, dev_fmt); 132 + vscnprintf(cla->dev_id, sizeof(cla->dev_id), dev_fmt, ap); 133 + cla->cl.dev_id = cla->dev_id; 134 + va_end(ap); 135 + } 136 + 137 + return &cla->cl; 138 + } 139 + EXPORT_SYMBOL(clkdev_alloc); 140 + 141 + int clk_add_alias(const char *alias, const char *alias_dev_name, char *id, 142 + struct device *dev) 143 + { 144 + struct clk *r = clk_get(dev, id); 145 + struct clk_lookup *l; 146 + 147 + if (IS_ERR(r)) 148 + return PTR_ERR(r); 149 + 150 + l = clkdev_alloc(r, alias, alias_dev_name); 151 + clk_put(r); 152 + if (!l) 153 + return -ENODEV; 154 + clkdev_add(l); 155 + return 0; 156 + } 157 + EXPORT_SYMBOL(clk_add_alias); 158 + 159 + /* 160 + * clkdev_drop - remove a clock dynamically allocated 161 + */ 162 + void clkdev_drop(struct clk_lookup *cl) 163 + { 164 + mutex_lock(&clocks_mutex); 165 + list_del(&cl->node); 166 + mutex_unlock(&clocks_mutex); 167 + kfree(cl); 168 + } 169 + EXPORT_SYMBOL(clkdev_drop);
+5
arch/sh/kernel/cpu/clock-cpg.c
··· 338 338 ret |= clk_register(clk); 339 339 } 340 340 341 + clk_add_alias("tmu_fck", NULL, "peripheral_clk", NULL); 342 + clk_add_alias("mtu2_fck", NULL, "peripheral_clk", NULL); 343 + clk_add_alias("cmt_fck", NULL, "peripheral_clk", NULL); 344 + clk_add_alias("sci_ick", NULL, "peripheral_clk", NULL); 345 + 341 346 return ret; 342 347 } 343 348
+1 -54
arch/sh/kernel/cpu/clock.c
··· 10 10 * 11 11 * Modified for omap shared clock framework by Tony Lindgren <tony@atomide.com> 12 12 * 13 - * With clkdev bits: 14 - * 15 - * Copyright (C) 2008 Russell King. 16 - * 17 13 * This file is subject to the terms and conditions of the GNU General Public 18 14 * License. See the file "COPYING" in the main directory of this archive 19 15 * for more details. ··· 26 30 #include <linux/platform_device.h> 27 31 #include <linux/debugfs.h> 28 32 #include <linux/cpufreq.h> 33 + #include <linux/clk.h> 29 34 #include <asm/clock.h> 30 35 #include <asm/machvec.h> 31 36 ··· 393 396 return clk_get_rate(clk); 394 397 } 395 398 EXPORT_SYMBOL_GPL(clk_round_rate); 396 - 397 - /* 398 - * Find the correct struct clk for the device and connection ID. 399 - * We do slightly fuzzy matching here: 400 - * An entry with a NULL ID is assumed to be a wildcard. 401 - * If an entry has a device ID, it must match 402 - * If an entry has a connection ID, it must match 403 - * Then we take the most specific entry - with the following 404 - * order of precedence: dev+con > dev only > con only. 405 - */ 406 - static struct clk *clk_find(const char *dev_id, const char *con_id) 407 - { 408 - struct clk_lookup *p; 409 - struct clk *clk = NULL; 410 - int match, best = 0; 411 - 412 - list_for_each_entry(p, &clock_list, node) { 413 - match = 0; 414 - if (p->dev_id) { 415 - if (!dev_id || strcmp(p->dev_id, dev_id)) 416 - continue; 417 - match += 2; 418 - } 419 - if (p->con_id) { 420 - if (!con_id || strcmp(p->con_id, con_id)) 421 - continue; 422 - match += 1; 423 - } 424 - if (match == 0) 425 - continue; 426 - 427 - if (match > best) { 428 - clk = p->clk; 429 - best = match; 430 - } 431 - } 432 - return clk; 433 - } 434 - 435 - struct clk *clk_get_sys(const char *dev_id, const char *con_id) 436 - { 437 - struct clk *clk; 438 - 439 - mutex_lock(&clock_list_sem); 440 - clk = clk_find(dev_id, con_id); 441 - mutex_unlock(&clock_list_sem); 442 - 443 - return clk ? clk : ERR_PTR(-ENOENT); 444 - } 445 - EXPORT_SYMBOL_GPL(clk_get_sys); 446 399 447 400 /* 448 401 * Returns a clock. Note that we first try to use device id on the bus
-6
arch/sh/kernel/cpu/sh2/setup-sh7619.c
··· 128 128 }; 129 129 130 130 static struct sh_timer_config cmt0_platform_data = { 131 - .name = "CMT0", 132 131 .channel_offset = 0x02, 133 132 .timer_bit = 0, 134 - .clk = "peripheral_clk", 135 133 .clockevent_rating = 125, 136 134 .clocksource_rating = 0, /* disabled due to code generation issues */ 137 135 }; 138 136 139 137 static struct resource cmt0_resources[] = { 140 138 [0] = { 141 - .name = "CMT0", 142 139 .start = 0xf84a0072, 143 140 .end = 0xf84a0077, 144 141 .flags = IORESOURCE_MEM, ··· 157 160 }; 158 161 159 162 static struct sh_timer_config cmt1_platform_data = { 160 - .name = "CMT1", 161 163 .channel_offset = 0x08, 162 164 .timer_bit = 1, 163 - .clk = "peripheral_clk", 164 165 .clockevent_rating = 125, 165 166 .clocksource_rating = 0, /* disabled due to code generation issues */ 166 167 }; 167 168 168 169 static struct resource cmt1_resources[] = { 169 170 [0] = { 170 - .name = "CMT1", 171 171 .start = 0xf84a0078, 172 172 .end = 0xf84a007d, 173 173 .flags = IORESOURCE_MEM,
-9
arch/sh/kernel/cpu/sh2a/setup-mxg.c
··· 115 115 mask_registers, prio_registers, NULL); 116 116 117 117 static struct sh_timer_config mtu2_0_platform_data = { 118 - .name = "MTU2_0", 119 118 .channel_offset = -0x80, 120 119 .timer_bit = 0, 121 - .clk = "peripheral_clk", 122 120 .clockevent_rating = 200, 123 121 }; 124 122 125 123 static struct resource mtu2_0_resources[] = { 126 124 [0] = { 127 - .name = "MTU2_0", 128 125 .start = 0xff801300, 129 126 .end = 0xff801326, 130 127 .flags = IORESOURCE_MEM, ··· 143 146 }; 144 147 145 148 static struct sh_timer_config mtu2_1_platform_data = { 146 - .name = "MTU2_1", 147 149 .channel_offset = -0x100, 148 150 .timer_bit = 1, 149 - .clk = "peripheral_clk", 150 151 .clockevent_rating = 200, 151 152 }; 152 153 153 154 static struct resource mtu2_1_resources[] = { 154 155 [0] = { 155 - .name = "MTU2_1", 156 156 .start = 0xff801380, 157 157 .end = 0xff801390, 158 158 .flags = IORESOURCE_MEM, ··· 171 177 }; 172 178 173 179 static struct sh_timer_config mtu2_2_platform_data = { 174 - .name = "MTU2_2", 175 180 .channel_offset = 0x80, 176 181 .timer_bit = 2, 177 - .clk = "peripheral_clk", 178 182 .clockevent_rating = 200, 179 183 }; 180 184 181 185 static struct resource mtu2_2_resources[] = { 182 186 [0] = { 183 - .name = "MTU2_2", 184 187 .start = 0xff801000, 185 188 .end = 0xff80100a, 186 189 .flags = IORESOURCE_MEM,
-9
arch/sh/kernel/cpu/sh2a/setup-sh7201.c
··· 318 318 }; 319 319 320 320 static struct sh_timer_config mtu2_0_platform_data = { 321 - .name = "MTU2_0", 322 321 .channel_offset = -0x80, 323 322 .timer_bit = 0, 324 - .clk = "peripheral_clk", 325 323 .clockevent_rating = 200, 326 324 }; 327 325 328 326 static struct resource mtu2_0_resources[] = { 329 327 [0] = { 330 - .name = "MTU2_0", 331 328 .start = 0xfffe4300, 332 329 .end = 0xfffe4326, 333 330 .flags = IORESOURCE_MEM, ··· 346 349 }; 347 350 348 351 static struct sh_timer_config mtu2_1_platform_data = { 349 - .name = "MTU2_1", 350 352 .channel_offset = -0x100, 351 353 .timer_bit = 1, 352 - .clk = "peripheral_clk", 353 354 .clockevent_rating = 200, 354 355 }; 355 356 356 357 static struct resource mtu2_1_resources[] = { 357 358 [0] = { 358 - .name = "MTU2_1", 359 359 .start = 0xfffe4380, 360 360 .end = 0xfffe4390, 361 361 .flags = IORESOURCE_MEM, ··· 374 380 }; 375 381 376 382 static struct sh_timer_config mtu2_2_platform_data = { 377 - .name = "MTU2_2", 378 383 .channel_offset = 0x80, 379 384 .timer_bit = 2, 380 - .clk = "peripheral_clk", 381 385 .clockevent_rating = 200, 382 386 }; 383 387 384 388 static struct resource mtu2_2_resources[] = { 385 389 [0] = { 386 - .name = "MTU2_2", 387 390 .start = 0xfffe4000, 388 391 .end = 0xfffe400a, 389 392 .flags = IORESOURCE_MEM,
-12
arch/sh/kernel/cpu/sh2a/setup-sh7203.c
··· 234 234 }; 235 235 236 236 static struct sh_timer_config cmt0_platform_data = { 237 - .name = "CMT0", 238 237 .channel_offset = 0x02, 239 238 .timer_bit = 0, 240 - .clk = "peripheral_clk", 241 239 .clockevent_rating = 125, 242 240 .clocksource_rating = 0, /* disabled due to code generation issues */ 243 241 }; 244 242 245 243 static struct resource cmt0_resources[] = { 246 244 [0] = { 247 - .name = "CMT0", 248 245 .start = 0xfffec002, 249 246 .end = 0xfffec007, 250 247 .flags = IORESOURCE_MEM, ··· 263 266 }; 264 267 265 268 static struct sh_timer_config cmt1_platform_data = { 266 - .name = "CMT1", 267 269 .channel_offset = 0x08, 268 270 .timer_bit = 1, 269 - .clk = "peripheral_clk", 270 271 .clockevent_rating = 125, 271 272 .clocksource_rating = 0, /* disabled due to code generation issues */ 272 273 }; 273 274 274 275 static struct resource cmt1_resources[] = { 275 276 [0] = { 276 - .name = "CMT1", 277 277 .start = 0xfffec008, 278 278 .end = 0xfffec00d, 279 279 .flags = IORESOURCE_MEM, ··· 292 298 }; 293 299 294 300 static struct sh_timer_config mtu2_0_platform_data = { 295 - .name = "MTU2_0", 296 301 .channel_offset = -0x80, 297 302 .timer_bit = 0, 298 - .clk = "peripheral_clk", 299 303 .clockevent_rating = 200, 300 304 }; 301 305 302 306 static struct resource mtu2_0_resources[] = { 303 307 [0] = { 304 - .name = "MTU2_0", 305 308 .start = 0xfffe4300, 306 309 .end = 0xfffe4326, 307 310 .flags = IORESOURCE_MEM, ··· 320 329 }; 321 330 322 331 static struct sh_timer_config mtu2_1_platform_data = { 323 - .name = "MTU2_1", 324 332 .channel_offset = -0x100, 325 333 .timer_bit = 1, 326 - .clk = "peripheral_clk", 327 334 .clockevent_rating = 200, 328 335 }; 329 336 330 337 static struct resource mtu2_1_resources[] = { 331 338 [0] = { 332 - .name = "MTU2_1", 333 339 .start = 0xfffe4380, 334 340 .end = 0xfffe4390, 335 341 .flags = IORESOURCE_MEM,
-15
arch/sh/kernel/cpu/sh2a/setup-sh7206.c
··· 194 194 }; 195 195 196 196 static struct sh_timer_config cmt0_platform_data = { 197 - .name = "CMT0", 198 197 .channel_offset = 0x02, 199 198 .timer_bit = 0, 200 - .clk = "peripheral_clk", 201 199 .clockevent_rating = 125, 202 200 .clocksource_rating = 0, /* disabled due to code generation issues */ 203 201 }; 204 202 205 203 static struct resource cmt0_resources[] = { 206 204 [0] = { 207 - .name = "CMT0", 208 205 .start = 0xfffec002, 209 206 .end = 0xfffec007, 210 207 .flags = IORESOURCE_MEM, ··· 223 226 }; 224 227 225 228 static struct sh_timer_config cmt1_platform_data = { 226 - .name = "CMT1", 227 229 .channel_offset = 0x08, 228 230 .timer_bit = 1, 229 - .clk = "peripheral_clk", 230 231 .clockevent_rating = 125, 231 232 .clocksource_rating = 0, /* disabled due to code generation issues */ 232 233 }; 233 234 234 235 static struct resource cmt1_resources[] = { 235 236 [0] = { 236 - .name = "CMT1", 237 237 .start = 0xfffec008, 238 238 .end = 0xfffec00d, 239 239 .flags = IORESOURCE_MEM, ··· 252 258 }; 253 259 254 260 static struct sh_timer_config mtu2_0_platform_data = { 255 - .name = "MTU2_0", 256 261 .channel_offset = -0x80, 257 262 .timer_bit = 0, 258 - .clk = "peripheral_clk", 259 263 .clockevent_rating = 200, 260 264 }; 261 265 262 266 static struct resource mtu2_0_resources[] = { 263 267 [0] = { 264 - .name = "MTU2_0", 265 268 .start = 0xfffe4300, 266 269 .end = 0xfffe4326, 267 270 .flags = IORESOURCE_MEM, ··· 280 289 }; 281 290 282 291 static struct sh_timer_config mtu2_1_platform_data = { 283 - .name = "MTU2_1", 284 292 .channel_offset = -0x100, 285 293 .timer_bit = 1, 286 - .clk = "peripheral_clk", 287 294 .clockevent_rating = 200, 288 295 }; 289 296 290 297 static struct resource mtu2_1_resources[] = { 291 298 [0] = { 292 - .name = "MTU2_1", 293 299 .start = 0xfffe4380, 294 300 .end = 0xfffe4390, 295 301 .flags = IORESOURCE_MEM, ··· 308 320 }; 309 321 310 322 static struct sh_timer_config mtu2_2_platform_data = { 311 - .name = "MTU2_2", 312 323 .channel_offset = 0x80, 313 324 .timer_bit = 2, 314 - .clk = "peripheral_clk", 315 325 .clockevent_rating = 200, 316 326 }; 317 327 318 328 static struct resource mtu2_2_resources[] = { 319 329 [0] = { 320 - .name = "MTU2_2", 321 330 .start = 0xfffe4000, 322 331 .end = 0xfffe400a, 323 332 .flags = IORESOURCE_MEM,
-9
arch/sh/kernel/cpu/sh3/setup-sh7705.c
··· 124 124 }; 125 125 126 126 static struct sh_timer_config tmu0_platform_data = { 127 - .name = "TMU0", 128 127 .channel_offset = 0x02, 129 128 .timer_bit = 0, 130 - .clk = "peripheral_clk", 131 129 .clockevent_rating = 200, 132 130 }; 133 131 134 132 static struct resource tmu0_resources[] = { 135 133 [0] = { 136 - .name = "TMU0", 137 134 .start = 0xfffffe94, 138 135 .end = 0xfffffe9f, 139 136 .flags = IORESOURCE_MEM, ··· 152 155 }; 153 156 154 157 static struct sh_timer_config tmu1_platform_data = { 155 - .name = "TMU1", 156 158 .channel_offset = 0xe, 157 159 .timer_bit = 1, 158 - .clk = "peripheral_clk", 159 160 .clocksource_rating = 200, 160 161 }; 161 162 162 163 static struct resource tmu1_resources[] = { 163 164 [0] = { 164 - .name = "TMU1", 165 165 .start = 0xfffffea0, 166 166 .end = 0xfffffeab, 167 167 .flags = IORESOURCE_MEM, ··· 180 186 }; 181 187 182 188 static struct sh_timer_config tmu2_platform_data = { 183 - .name = "TMU2", 184 189 .channel_offset = 0x1a, 185 190 .timer_bit = 2, 186 - .clk = "peripheral_clk", 187 191 }; 188 192 189 193 static struct resource tmu2_resources[] = { 190 194 [0] = { 191 - .name = "TMU2", 192 195 .start = 0xfffffeac, 193 196 .end = 0xfffffebb, 194 197 .flags = IORESOURCE_MEM,
-9
arch/sh/kernel/cpu/sh3/setup-sh770x.c
··· 157 157 #endif 158 158 159 159 static struct sh_timer_config tmu0_platform_data = { 160 - .name = "TMU0", 161 160 .channel_offset = 0x02, 162 161 .timer_bit = 0, 163 - .clk = "peripheral_clk", 164 162 .clockevent_rating = 200, 165 163 }; 166 164 167 165 static struct resource tmu0_resources[] = { 168 166 [0] = { 169 - .name = "TMU0", 170 167 .start = 0xfffffe94, 171 168 .end = 0xfffffe9f, 172 169 .flags = IORESOURCE_MEM, ··· 185 188 }; 186 189 187 190 static struct sh_timer_config tmu1_platform_data = { 188 - .name = "TMU1", 189 191 .channel_offset = 0xe, 190 192 .timer_bit = 1, 191 - .clk = "peripheral_clk", 192 193 .clocksource_rating = 200, 193 194 }; 194 195 195 196 static struct resource tmu1_resources[] = { 196 197 [0] = { 197 - .name = "TMU1", 198 198 .start = 0xfffffea0, 199 199 .end = 0xfffffeab, 200 200 .flags = IORESOURCE_MEM, ··· 213 219 }; 214 220 215 221 static struct sh_timer_config tmu2_platform_data = { 216 - .name = "TMU2", 217 222 .channel_offset = 0x1a, 218 223 .timer_bit = 2, 219 - .clk = "peripheral_clk", 220 224 }; 221 225 222 226 static struct resource tmu2_resources[] = { 223 227 [0] = { 224 - .name = "TMU2", 225 228 .start = 0xfffffeac, 226 229 .end = 0xfffffebb, 227 230 .flags = IORESOURCE_MEM,
-9
arch/sh/kernel/cpu/sh3/setup-sh7710.c
··· 127 127 }; 128 128 129 129 static struct sh_timer_config tmu0_platform_data = { 130 - .name = "TMU0", 131 130 .channel_offset = 0x02, 132 131 .timer_bit = 0, 133 - .clk = "peripheral_clk", 134 132 .clockevent_rating = 200, 135 133 }; 136 134 137 135 static struct resource tmu0_resources[] = { 138 136 [0] = { 139 - .name = "TMU0", 140 137 .start = 0xa412fe94, 141 138 .end = 0xa412fe9f, 142 139 .flags = IORESOURCE_MEM, ··· 155 158 }; 156 159 157 160 static struct sh_timer_config tmu1_platform_data = { 158 - .name = "TMU1", 159 161 .channel_offset = 0xe, 160 162 .timer_bit = 1, 161 - .clk = "peripheral_clk", 162 163 .clocksource_rating = 200, 163 164 }; 164 165 165 166 static struct resource tmu1_resources[] = { 166 167 [0] = { 167 - .name = "TMU1", 168 168 .start = 0xa412fea0, 169 169 .end = 0xa412feab, 170 170 .flags = IORESOURCE_MEM, ··· 183 189 }; 184 190 185 191 static struct sh_timer_config tmu2_platform_data = { 186 - .name = "TMU2", 187 192 .channel_offset = 0x1a, 188 193 .timer_bit = 2, 189 - .clk = "peripheral_clk", 190 194 }; 191 195 192 196 static struct resource tmu2_resources[] = { 193 197 [0] = { 194 - .name = "TMU2", 195 198 .start = 0xa412feac, 196 199 .end = 0xa412feb5, 197 200 .flags = IORESOURCE_MEM,
-24
arch/sh/kernel/cpu/sh3/setup-sh7720.c
··· 130 130 }; 131 131 132 132 static struct sh_timer_config cmt0_platform_data = { 133 - .name = "CMT0", 134 133 .channel_offset = 0x10, 135 134 .timer_bit = 0, 136 - .clk = "peripheral_clk", 137 135 .clockevent_rating = 125, 138 136 .clocksource_rating = 125, 139 137 }; 140 138 141 139 static struct resource cmt0_resources[] = { 142 140 [0] = { 143 - .name = "CMT0", 144 141 .start = 0x044a0010, 145 142 .end = 0x044a001b, 146 143 .flags = IORESOURCE_MEM, ··· 159 162 }; 160 163 161 164 static struct sh_timer_config cmt1_platform_data = { 162 - .name = "CMT1", 163 165 .channel_offset = 0x20, 164 166 .timer_bit = 1, 165 - .clk = "peripheral_clk", 166 167 }; 167 168 168 169 static struct resource cmt1_resources[] = { 169 170 [0] = { 170 - .name = "CMT1", 171 171 .start = 0x044a0020, 172 172 .end = 0x044a002b, 173 173 .flags = IORESOURCE_MEM, ··· 186 192 }; 187 193 188 194 static struct sh_timer_config cmt2_platform_data = { 189 - .name = "CMT2", 190 195 .channel_offset = 0x30, 191 196 .timer_bit = 2, 192 - .clk = "peripheral_clk", 193 197 }; 194 198 195 199 static struct resource cmt2_resources[] = { 196 200 [0] = { 197 - .name = "CMT2", 198 201 .start = 0x044a0030, 199 202 .end = 0x044a003b, 200 203 .flags = IORESOURCE_MEM, ··· 213 222 }; 214 223 215 224 static struct sh_timer_config cmt3_platform_data = { 216 - .name = "CMT3", 217 225 .channel_offset = 0x40, 218 226 .timer_bit = 3, 219 - .clk = "peripheral_clk", 220 227 }; 221 228 222 229 static struct resource cmt3_resources[] = { 223 230 [0] = { 224 - .name = "CMT3", 225 231 .start = 0x044a0040, 226 232 .end = 0x044a004b, 227 233 .flags = IORESOURCE_MEM, ··· 240 252 }; 241 253 242 254 static struct sh_timer_config cmt4_platform_data = { 243 - .name = "CMT4", 244 255 .channel_offset = 0x50, 245 256 .timer_bit = 4, 246 - .clk = "peripheral_clk", 247 257 }; 248 258 249 259 static struct resource cmt4_resources[] = { 250 260 [0] = { 251 - .name = "CMT4", 252 261 .start = 0x044a0050, 253 262 .end = 0x044a005b, 254 263 .flags = IORESOURCE_MEM, ··· 267 282 }; 268 283 269 284 static struct sh_timer_config tmu0_platform_data = { 270 - .name = "TMU0", 271 285 .channel_offset = 0x02, 272 286 .timer_bit = 0, 273 - .clk = "peripheral_clk", 274 287 .clockevent_rating = 200, 275 288 }; 276 289 277 290 static struct resource tmu0_resources[] = { 278 291 [0] = { 279 - .name = "TMU0", 280 292 .start = 0xa412fe94, 281 293 .end = 0xa412fe9f, 282 294 .flags = IORESOURCE_MEM, ··· 295 313 }; 296 314 297 315 static struct sh_timer_config tmu1_platform_data = { 298 - .name = "TMU1", 299 316 .channel_offset = 0xe, 300 317 .timer_bit = 1, 301 - .clk = "peripheral_clk", 302 318 .clocksource_rating = 200, 303 319 }; 304 320 305 321 static struct resource tmu1_resources[] = { 306 322 [0] = { 307 - .name = "TMU1", 308 323 .start = 0xa412fea0, 309 324 .end = 0xa412feab, 310 325 .flags = IORESOURCE_MEM, ··· 323 344 }; 324 345 325 346 static struct sh_timer_config tmu2_platform_data = { 326 - .name = "TMU2", 327 347 .channel_offset = 0x1a, 328 348 .timer_bit = 2, 329 - .clk = "peripheral_clk", 330 349 }; 331 350 332 351 static struct resource tmu2_resources[] = { 333 352 [0] = { 334 - .name = "TMU2", 335 353 .start = 0xa412feac, 336 354 .end = 0xa412feb5, 337 355 .flags = IORESOURCE_MEM,
-9
arch/sh/kernel/cpu/sh4/setup-sh4-202.c
··· 31 31 }; 32 32 33 33 static struct sh_timer_config tmu0_platform_data = { 34 - .name = "TMU0", 35 34 .channel_offset = 0x04, 36 35 .timer_bit = 0, 37 - .clk = "peripheral_clk", 38 36 .clockevent_rating = 200, 39 37 }; 40 38 41 39 static struct resource tmu0_resources[] = { 42 40 [0] = { 43 - .name = "TMU0", 44 41 .start = 0xffd80008, 45 42 .end = 0xffd80013, 46 43 .flags = IORESOURCE_MEM, ··· 59 62 }; 60 63 61 64 static struct sh_timer_config tmu1_platform_data = { 62 - .name = "TMU1", 63 65 .channel_offset = 0x10, 64 66 .timer_bit = 1, 65 - .clk = "peripheral_clk", 66 67 .clocksource_rating = 200, 67 68 }; 68 69 69 70 static struct resource tmu1_resources[] = { 70 71 [0] = { 71 - .name = "TMU1", 72 72 .start = 0xffd80014, 73 73 .end = 0xffd8001f, 74 74 .flags = IORESOURCE_MEM, ··· 87 93 }; 88 94 89 95 static struct sh_timer_config tmu2_platform_data = { 90 - .name = "TMU2", 91 96 .channel_offset = 0x1c, 92 97 .timer_bit = 2, 93 - .clk = "peripheral_clk", 94 98 }; 95 99 96 100 static struct resource tmu2_resources[] = { 97 101 [0] = { 98 - .name = "TMU2", 99 102 .start = 0xffd80020, 100 103 .end = 0xffd8002f, 101 104 .flags = IORESOURCE_MEM,
-15
arch/sh/kernel/cpu/sh4/setup-sh7750.c
··· 66 66 }; 67 67 68 68 static struct sh_timer_config tmu0_platform_data = { 69 - .name = "TMU0", 70 69 .channel_offset = 0x04, 71 70 .timer_bit = 0, 72 - .clk = "peripheral_clk", 73 71 .clockevent_rating = 200, 74 72 }; 75 73 76 74 static struct resource tmu0_resources[] = { 77 75 [0] = { 78 - .name = "TMU0", 79 76 .start = 0xffd80008, 80 77 .end = 0xffd80013, 81 78 .flags = IORESOURCE_MEM, ··· 94 97 }; 95 98 96 99 static struct sh_timer_config tmu1_platform_data = { 97 - .name = "TMU1", 98 100 .channel_offset = 0x10, 99 101 .timer_bit = 1, 100 - .clk = "peripheral_clk", 101 102 .clocksource_rating = 200, 102 103 }; 103 104 104 105 static struct resource tmu1_resources[] = { 105 106 [0] = { 106 - .name = "TMU1", 107 107 .start = 0xffd80014, 108 108 .end = 0xffd8001f, 109 109 .flags = IORESOURCE_MEM, ··· 122 128 }; 123 129 124 130 static struct sh_timer_config tmu2_platform_data = { 125 - .name = "TMU2", 126 131 .channel_offset = 0x1c, 127 132 .timer_bit = 2, 128 - .clk = "peripheral_clk", 129 133 }; 130 134 131 135 static struct resource tmu2_resources[] = { 132 136 [0] = { 133 - .name = "TMU2", 134 137 .start = 0xffd80020, 135 138 .end = 0xffd8002f, 136 139 .flags = IORESOURCE_MEM, ··· 154 163 defined(CONFIG_CPU_SUBTYPE_SH7751R) 155 164 156 165 static struct sh_timer_config tmu3_platform_data = { 157 - .name = "TMU3", 158 166 .channel_offset = 0x04, 159 167 .timer_bit = 0, 160 - .clk = "peripheral_clk", 161 168 }; 162 169 163 170 static struct resource tmu3_resources[] = { 164 171 [0] = { 165 - .name = "TMU3", 166 172 .start = 0xfe100008, 167 173 .end = 0xfe100013, 168 174 .flags = IORESOURCE_MEM, ··· 181 193 }; 182 194 183 195 static struct sh_timer_config tmu4_platform_data = { 184 - .name = "TMU4", 185 196 .channel_offset = 0x10, 186 197 .timer_bit = 1, 187 - .clk = "peripheral_clk", 188 198 }; 189 199 190 200 static struct resource tmu4_resources[] = { 191 201 [0] = { 192 - .name = "TMU4", 193 202 .start = 0xfe100014, 194 203 .end = 0xfe10001f, 195 204 .flags = IORESOURCE_MEM,
-9
arch/sh/kernel/cpu/sh4/setup-sh7760.c
··· 187 187 }; 188 188 189 189 static struct sh_timer_config tmu0_platform_data = { 190 - .name = "TMU0", 191 190 .channel_offset = 0x04, 192 191 .timer_bit = 0, 193 - .clk = "peripheral_clk", 194 192 .clockevent_rating = 200, 195 193 }; 196 194 197 195 static struct resource tmu0_resources[] = { 198 196 [0] = { 199 - .name = "TMU0", 200 197 .start = 0xffd80008, 201 198 .end = 0xffd80013, 202 199 .flags = IORESOURCE_MEM, ··· 215 218 }; 216 219 217 220 static struct sh_timer_config tmu1_platform_data = { 218 - .name = "TMU1", 219 221 .channel_offset = 0x10, 220 222 .timer_bit = 1, 221 - .clk = "peripheral_clk", 222 223 .clocksource_rating = 200, 223 224 }; 224 225 225 226 static struct resource tmu1_resources[] = { 226 227 [0] = { 227 - .name = "TMU1", 228 228 .start = 0xffd80014, 229 229 .end = 0xffd8001f, 230 230 .flags = IORESOURCE_MEM, ··· 243 249 }; 244 250 245 251 static struct sh_timer_config tmu2_platform_data = { 246 - .name = "TMU2", 247 252 .channel_offset = 0x1c, 248 253 .timer_bit = 2, 249 - .clk = "peripheral_clk", 250 254 }; 251 255 252 256 static struct resource tmu2_resources[] = { 253 257 [0] = { 254 - .name = "TMU2", 255 258 .start = 0xffd80020, 256 259 .end = 0xffd8002f, 257 260 .flags = IORESOURCE_MEM,
+6 -6
arch/sh/kernel/cpu/sh4a/clock-sh7343.c
··· 154 154 MSTP("sh0", &div4_clks[DIV4_P], MSTPCR0, 20, 0), 155 155 MSTP("hudi0", &div4_clks[DIV4_P], MSTPCR0, 19, 0), 156 156 MSTP("ubc0", &div4_clks[DIV4_P], MSTPCR0, 17, 0), 157 - MSTP("tmu0", &div4_clks[DIV4_P], MSTPCR0, 15, 0), 158 - MSTP("cmt0", &r_clk, MSTPCR0, 14, 0), 157 + MSTP("tmu_fck", &div4_clks[DIV4_P], MSTPCR0, 15, 0), 158 + MSTP("cmt_fck", &r_clk, MSTPCR0, 14, 0), 159 159 MSTP("rwdt0", &r_clk, MSTPCR0, 13, 0), 160 160 MSTP("mfi0", &div4_clks[DIV4_P], MSTPCR0, 11, 0), 161 161 MSTP("flctl0", &div4_clks[DIV4_P], MSTPCR0, 10, 0), 162 - MSTP("scif0", &div4_clks[DIV4_P], MSTPCR0, 7, 0), 163 - MSTP("scif1", &div4_clks[DIV4_P], MSTPCR0, 6, 0), 164 - MSTP("scif2", &div4_clks[DIV4_P], MSTPCR0, 5, 0), 165 - MSTP("scif3", &div4_clks[DIV4_P], MSTPCR0, 4, 0), 162 + SH_CLK_MSTP32("sci_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 7, 0), 163 + SH_CLK_MSTP32("sci_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 6, 0), 164 + SH_CLK_MSTP32("sci_fck", 2, &div4_clks[DIV4_P], MSTPCR0, 5, 0), 165 + SH_CLK_MSTP32("sci_fck", 3, &div4_clks[DIV4_P], MSTPCR0, 4, 0), 166 166 MSTP("sio0", &div4_clks[DIV4_P], MSTPCR0, 3, 0), 167 167 MSTP("siof0", &div4_clks[DIV4_P], MSTPCR0, 2, 0), 168 168 MSTP("siof1", &div4_clks[DIV4_P], MSTPCR0, 1, 0),
+5 -5
arch/sh/kernel/cpu/sh4a/clock-sh7366.c
··· 158 158 MSTP("sh0", &div4_clks[DIV4_P], MSTPCR0, 20, 0), 159 159 MSTP("hudi0", &div4_clks[DIV4_P], MSTPCR0, 19, 0), 160 160 MSTP("ubc0", &div4_clks[DIV4_P], MSTPCR0, 17, 0), 161 - MSTP("tmu0", &div4_clks[DIV4_P], MSTPCR0, 15, 0), 162 - MSTP("cmt0", &r_clk, MSTPCR0, 14, 0), 161 + MSTP("tmu_fck", &div4_clks[DIV4_P], MSTPCR0, 15, 0), 162 + MSTP("cmt_fck", &r_clk, MSTPCR0, 14, 0), 163 163 MSTP("rwdt0", &r_clk, MSTPCR0, 13, 0), 164 164 MSTP("mfi0", &div4_clks[DIV4_P], MSTPCR0, 11, 0), 165 165 MSTP("flctl0", &div4_clks[DIV4_P], MSTPCR0, 10, 0), 166 - MSTP("scif0", &div4_clks[DIV4_P], MSTPCR0, 7, 0), 167 - MSTP("scif1", &div4_clks[DIV4_P], MSTPCR0, 6, 0), 168 - MSTP("scif2", &div4_clks[DIV4_P], MSTPCR0, 5, 0), 166 + SH_CLK_MSTP32("sci_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 7, 0), 167 + SH_CLK_MSTP32("sci_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 6, 0), 168 + SH_CLK_MSTP32("sci_fck", 2, &div4_clks[DIV4_P], MSTPCR0, 5, 0), 169 169 MSTP("msiof0", &div4_clks[DIV4_P], MSTPCR0, 2, 0), 170 170 MSTP("sbr0", &div4_clks[DIV4_P], MSTPCR0, 1, 0), 171 171
+5 -5
arch/sh/kernel/cpu/sh4a/clock-sh7722.c
··· 160 160 static struct clk mstp_clks[] = { 161 161 SH_HWBLK_CLK("uram0", -1, U_CLK, HWBLK_URAM, CLK_ENABLE_ON_INIT), 162 162 SH_HWBLK_CLK("xymem0", -1, B_CLK, HWBLK_XYMEM, CLK_ENABLE_ON_INIT), 163 - SH_HWBLK_CLK("tmu0", -1, P_CLK, HWBLK_TMU, 0), 164 - SH_HWBLK_CLK("cmt0", -1, R_CLK, HWBLK_CMT, 0), 163 + SH_HWBLK_CLK("tmu_fck", -1, P_CLK, HWBLK_TMU, 0), 164 + SH_HWBLK_CLK("cmt_fck", -1, R_CLK, HWBLK_CMT, 0), 165 165 SH_HWBLK_CLK("rwdt0", -1, R_CLK, HWBLK_RWDT, 0), 166 166 SH_HWBLK_CLK("flctl0", -1, P_CLK, HWBLK_FLCTL, 0), 167 - SH_HWBLK_CLK("scif0", -1, P_CLK, HWBLK_SCIF0, 0), 168 - SH_HWBLK_CLK("scif1", -1, P_CLK, HWBLK_SCIF1, 0), 169 - SH_HWBLK_CLK("scif2", -1, P_CLK, HWBLK_SCIF2, 0), 167 + SH_HWBLK_CLK("sci_fck", 0, P_CLK, HWBLK_SCIF0, 0), 168 + SH_HWBLK_CLK("sci_fck", 1, P_CLK, HWBLK_SCIF1, 0), 169 + SH_HWBLK_CLK("sci_fck", 2, P_CLK, HWBLK_SCIF2, 0), 170 170 171 171 SH_HWBLK_CLK("i2c0", -1, P_CLK, HWBLK_IIC, 0), 172 172 SH_HWBLK_CLK("rtc0", -1, R_CLK, HWBLK_RTC, 0),
+48 -10
arch/sh/kernel/cpu/sh4a/clock-sh7723.c
··· 21 21 #include <linux/init.h> 22 22 #include <linux/kernel.h> 23 23 #include <linux/io.h> 24 + #include <linux/clk.h> 25 + #include <asm/clkdev.h> 24 26 #include <asm/clock.h> 25 27 #include <asm/hwblk.h> 26 28 #include <cpu/sh7723.h> ··· 173 171 SH_HWBLK_CLK("sh0", -1, SH_CLK, HWBLK_SHYWAY, CLK_ENABLE_ON_INIT), 174 172 SH_HWBLK_CLK("hudi0", -1, P_CLK, HWBLK_HUDI, 0), 175 173 SH_HWBLK_CLK("ubc0", -1, I_CLK, HWBLK_UBC, 0), 176 - SH_HWBLK_CLK("tmu0", -1, P_CLK, HWBLK_TMU0, 0), 177 - SH_HWBLK_CLK("cmt0", -1, R_CLK, HWBLK_CMT, 0), 174 + SH_HWBLK_CLK("tmu012_fck", -1, P_CLK, HWBLK_TMU0, 0), 175 + SH_HWBLK_CLK("cmt_fck", -1, R_CLK, HWBLK_CMT, 0), 178 176 SH_HWBLK_CLK("rwdt0", -1, R_CLK, HWBLK_RWDT, 0), 179 177 SH_HWBLK_CLK("dmac1", -1, B_CLK, HWBLK_DMAC1, 0), 180 - SH_HWBLK_CLK("tmu1", -1, P_CLK, HWBLK_TMU1, 0), 178 + SH_HWBLK_CLK("tmu345_fck", -1, P_CLK, HWBLK_TMU1, 0), 181 179 SH_HWBLK_CLK("flctl0", -1, P_CLK, HWBLK_FLCTL, 0), 182 - SH_HWBLK_CLK("scif0", -1, P_CLK, HWBLK_SCIF0, 0), 183 - SH_HWBLK_CLK("scif1", -1, P_CLK, HWBLK_SCIF1, 0), 184 - SH_HWBLK_CLK("scif2", -1, P_CLK, HWBLK_SCIF2, 0), 185 - SH_HWBLK_CLK("scif3", -1, B_CLK, HWBLK_SCIF3, 0), 186 - SH_HWBLK_CLK("scif4", -1, B_CLK, HWBLK_SCIF4, 0), 187 - SH_HWBLK_CLK("scif5", -1, B_CLK, HWBLK_SCIF5, 0), 180 + SH_HWBLK_CLK("sci_fck", 0, P_CLK, HWBLK_SCIF0, 0), 181 + SH_HWBLK_CLK("sci_fck", 1, P_CLK, HWBLK_SCIF1, 0), 182 + SH_HWBLK_CLK("sci_fck", 2, P_CLK, HWBLK_SCIF2, 0), 183 + SH_HWBLK_CLK("sci_fck", 3, B_CLK, HWBLK_SCIF3, 0), 184 + SH_HWBLK_CLK("sci_fck", 4, B_CLK, HWBLK_SCIF4, 0), 185 + SH_HWBLK_CLK("sci_fck", 5, B_CLK, HWBLK_SCIF5, 0), 188 186 SH_HWBLK_CLK("msiof0", -1, B_CLK, HWBLK_MSIOF0, 0), 189 187 SH_HWBLK_CLK("msiof1", -1, B_CLK, HWBLK_MSIOF1, 0), 190 188 SH_HWBLK_CLK("meram0", -1, SH_CLK, HWBLK_MERAM, 0), ··· 213 211 SH_HWBLK_CLK("lcdc0", -1, B_CLK, HWBLK_LCDC, 0), 214 212 }; 215 213 214 + static struct clk_lookup lookups[] = { 215 + { 216 + /* TMU0 */ 217 + .dev_id = "sh_tmu.0", 218 + .con_id = "tmu_fck", 219 + .clk = &mstp_clks[11], /* tmu012_fck */ 220 + }, { 221 + /* TMU1 */ 222 + .dev_id = "sh_tmu.1", 223 + .con_id = "tmu_fck", 224 + .clk = &mstp_clks[11], 225 + }, { 226 + /* TMU2 */ 227 + .dev_id = "sh_tmu.2", 228 + .con_id = "tmu_fck", 229 + .clk = &mstp_clks[11], 230 + }, { 231 + /* TMU3 */ 232 + .dev_id = "sh_tmu.3", 233 + .con_id = "tmu_fck", 234 + .clk = &mstp_clks[15], /* tmu345_fck */ 235 + }, { 236 + /* TMU4 */ 237 + .dev_id = "sh_tmu.4", 238 + .con_id = "tmu_fck", 239 + .clk = &mstp_clks[15], 240 + }, { 241 + /* TMU5 */ 242 + .dev_id = "sh_tmu.5", 243 + .con_id = "tmu_fck", 244 + .clk = &mstp_clks[15], 245 + }, 246 + }; 247 + 216 248 int __init arch_clk_init(void) 217 249 { 218 250 int k, ret = 0; ··· 258 222 pll_clk.parent = &extal_clk; 259 223 260 224 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) 261 - ret = clk_register(main_clks[k]); 225 + ret |= clk_register(main_clks[k]); 226 + 227 + clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 262 228 263 229 if (!ret) 264 230 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
+47 -9
arch/sh/kernel/cpu/sh4a/clock-sh7724.c
··· 21 21 #include <linux/init.h> 22 22 #include <linux/kernel.h> 23 23 #include <linux/io.h> 24 + #include <linux/clk.h> 25 + #include <asm/clkdev.h> 24 26 #include <asm/clock.h> 25 27 #include <asm/hwblk.h> 26 28 #include <cpu/sh7724.h> ··· 191 189 SH_HWBLK_CLK("sh0", -1, SH_CLK, HWBLK_SHYWAY, CLK_ENABLE_ON_INIT), 192 190 SH_HWBLK_CLK("hudi0", -1, P_CLK, HWBLK_HUDI, 0), 193 191 SH_HWBLK_CLK("ubc0", -1, I_CLK, HWBLK_UBC, 0), 194 - SH_HWBLK_CLK("tmu0", -1, P_CLK, HWBLK_TMU0, 0), 195 - SH_HWBLK_CLK("cmt0", -1, R_CLK, HWBLK_CMT, 0), 192 + SH_HWBLK_CLK("tmu012_fck", -1, P_CLK, HWBLK_TMU0, 0), 193 + SH_HWBLK_CLK("cmt_fck", -1, R_CLK, HWBLK_CMT, 0), 196 194 SH_HWBLK_CLK("rwdt0", -1, R_CLK, HWBLK_RWDT, 0), 197 195 SH_HWBLK_CLK("dmac1", -1, B_CLK, HWBLK_DMAC1, 0), 198 - SH_HWBLK_CLK("tmu1", -1, P_CLK, HWBLK_TMU1, 0), 199 - SH_HWBLK_CLK("scif0", -1, P_CLK, HWBLK_SCIF0, 0), 200 - SH_HWBLK_CLK("scif1", -1, P_CLK, HWBLK_SCIF1, 0), 201 - SH_HWBLK_CLK("scif2", -1, P_CLK, HWBLK_SCIF2, 0), 202 - SH_HWBLK_CLK("scif3", -1, B_CLK, HWBLK_SCIF3, 0), 203 - SH_HWBLK_CLK("scif4", -1, B_CLK, HWBLK_SCIF4, 0), 204 - SH_HWBLK_CLK("scif5", -1, B_CLK, HWBLK_SCIF5, 0), 196 + SH_HWBLK_CLK("tmu345_fck", -1, P_CLK, HWBLK_TMU1, 0), 197 + SH_HWBLK_CLK("sci_fck", 0, P_CLK, HWBLK_SCIF0, 0), 198 + SH_HWBLK_CLK("sci_fck", 1, P_CLK, HWBLK_SCIF1, 0), 199 + SH_HWBLK_CLK("sci_fck", 2, P_CLK, HWBLK_SCIF2, 0), 200 + SH_HWBLK_CLK("sci_fck", 3, B_CLK, HWBLK_SCIF3, 0), 201 + SH_HWBLK_CLK("sci_fck", 4, B_CLK, HWBLK_SCIF4, 0), 202 + SH_HWBLK_CLK("sci_fck", 5, B_CLK, HWBLK_SCIF5, 0), 205 203 SH_HWBLK_CLK("msiof0", -1, B_CLK, HWBLK_MSIOF0, 0), 206 204 SH_HWBLK_CLK("msiof1", -1, B_CLK, HWBLK_MSIOF1, 0), 207 205 ··· 235 233 SH_HWBLK_CLK("lcdc0", -1, B_CLK, HWBLK_LCDC, 0), 236 234 }; 237 235 236 + static struct clk_lookup lookups[] = { 237 + { 238 + /* TMU0 */ 239 + .dev_id = "sh_tmu.0", 240 + .con_id = "tmu_fck", 241 + .clk = &mstp_clks[12], /* tmu012_fck */ 242 + }, { 243 + /* TMU1 */ 244 + .dev_id = "sh_tmu.1", 245 + .con_id = "tmu_fck", 246 + .clk = &mstp_clks[12], 247 + }, { 248 + /* TMU2 */ 249 + .dev_id = "sh_tmu.2", 250 + .con_id = "tmu_fck", 251 + .clk = &mstp_clks[12], 252 + }, { 253 + /* TMU3 */ 254 + .dev_id = "sh_tmu.3", 255 + .con_id = "tmu_fck", 256 + .clk = &mstp_clks[16], /* tmu345_fck */ 257 + }, { 258 + /* TMU4 */ 259 + .dev_id = "sh_tmu.4", 260 + .con_id = "tmu_fck", 261 + .clk = &mstp_clks[16], 262 + }, { 263 + /* TMU5 */ 264 + .dev_id = "sh_tmu.5", 265 + .con_id = "tmu_fck", 266 + .clk = &mstp_clks[16], 267 + }, 268 + }; 269 + 238 270 int __init arch_clk_init(void) 239 271 { 240 272 int k, ret = 0; ··· 281 245 282 246 for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) 283 247 ret = clk_register(main_clks[k]); 248 + 249 + clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 284 250 285 251 if (!ret) 286 252 ret = sh_clk_div4_register(div4_clks, DIV4_NR, &div4_table);
+44 -7
arch/sh/kernel/cpu/sh4a/clock-sh7785.c
··· 3 3 * 4 4 * SH7785 support for the clock framework 5 5 * 6 - * Copyright (C) 2007 - 2009 Paul Mundt 6 + * Copyright (C) 2007 - 2010 Paul Mundt 7 7 * 8 8 * This file is subject to the terms and conditions of the GNU General Public 9 9 * License. See the file "COPYING" in the main directory of this archive ··· 14 14 #include <linux/clk.h> 15 15 #include <linux/io.h> 16 16 #include <linux/cpufreq.h> 17 + #include <asm/clkdev.h> 17 18 #include <asm/clock.h> 18 19 #include <asm/freq.h> 19 20 #include <cpu/sh7785.h> ··· 89 88 90 89 static struct clk mstp_clks[] = { 91 90 /* MSTPCR0 */ 92 - SH_CLK_MSTP32("scif_fck", 5, &div4_clks[DIV4_P], MSTPCR0, 29, 0), 93 - SH_CLK_MSTP32("scif_fck", 4, &div4_clks[DIV4_P], MSTPCR0, 28, 0), 94 - SH_CLK_MSTP32("scif_fck", 3, &div4_clks[DIV4_P], MSTPCR0, 27, 0), 95 - SH_CLK_MSTP32("scif_fck", 2, &div4_clks[DIV4_P], MSTPCR0, 26, 0), 96 - SH_CLK_MSTP32("scif_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 25, 0), 97 - SH_CLK_MSTP32("scif_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 24, 0), 91 + SH_CLK_MSTP32("sci_fck", 5, &div4_clks[DIV4_P], MSTPCR0, 29, 0), 92 + SH_CLK_MSTP32("sci_fck", 4, &div4_clks[DIV4_P], MSTPCR0, 28, 0), 93 + SH_CLK_MSTP32("sci_fck", 3, &div4_clks[DIV4_P], MSTPCR0, 27, 0), 94 + SH_CLK_MSTP32("sci_fck", 2, &div4_clks[DIV4_P], MSTPCR0, 26, 0), 95 + SH_CLK_MSTP32("sci_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 25, 0), 96 + SH_CLK_MSTP32("sci_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 24, 0), 98 97 SH_CLK_MSTP32("ssi_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 21, 0), 99 98 SH_CLK_MSTP32("ssi_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 20, 0), 100 99 SH_CLK_MSTP32("hac_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 17, 0), ··· 114 113 SH_CLK_MSTP32("gdta_fck", -1, NULL, MSTPCR1, 0, 0), 115 114 }; 116 115 116 + static struct clk_lookup lookups[] = { 117 + { 118 + /* TMU0 */ 119 + .dev_id = "sh_tmu.0", 120 + .con_id = "tmu_fck", 121 + .clk = &mstp_clks[13], /* tmu012_fck */ 122 + }, { 123 + /* TMU1 */ 124 + .dev_id = "sh_tmu.1", 125 + .con_id = "tmu_fck", 126 + .clk = &mstp_clks[13], 127 + }, { 128 + /* TMU2 */ 129 + .dev_id = "sh_tmu.2", 130 + .con_id = "tmu_fck", 131 + .clk = &mstp_clks[13], 132 + }, { 133 + /* TMU3 */ 134 + .dev_id = "sh_tmu.3", 135 + .con_id = "tmu_fck", 136 + .clk = &mstp_clks[12], /* tmu345_fck */ 137 + }, { 138 + /* TMU4 */ 139 + .dev_id = "sh_tmu.4", 140 + .con_id = "tmu_fck", 141 + .clk = &mstp_clks[12], 142 + }, { 143 + /* TMU5 */ 144 + .dev_id = "sh_tmu.5", 145 + .con_id = "tmu_fck", 146 + .clk = &mstp_clks[12], 147 + }, 148 + }; 149 + 117 150 int __init arch_clk_init(void) 118 151 { 119 152 int i, ret = 0; 120 153 121 154 for (i = 0; i < ARRAY_SIZE(clks); i++) 122 155 ret |= clk_register(clks[i]); 156 + for (i = 0; i < ARRAY_SIZE(lookups); i++) 157 + clkdev_add(&lookups[i]); 123 158 124 159 if (!ret) 125 160 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
+74 -6
arch/sh/kernel/cpu/sh4a/clock-sh7786.c
··· 13 13 #include <linux/kernel.h> 14 14 #include <linux/clk.h> 15 15 #include <linux/io.h> 16 + #include <linux/clk.h> 17 + #include <asm/clkdev.h> 16 18 #include <asm/clock.h> 17 19 #include <asm/freq.h> 18 20 ··· 89 87 90 88 static struct clk mstp_clks[] = { 91 89 /* MSTPCR0 */ 92 - SH_CLK_MSTP32("scif_fck", 5, &div4_clks[DIV4_P], MSTPCR0, 29, 0), 93 - SH_CLK_MSTP32("scif_fck", 4, &div4_clks[DIV4_P], MSTPCR0, 28, 0), 94 - SH_CLK_MSTP32("scif_fck", 3, &div4_clks[DIV4_P], MSTPCR0, 27, 0), 95 - SH_CLK_MSTP32("scif_fck", 2, &div4_clks[DIV4_P], MSTPCR0, 26, 0), 96 - SH_CLK_MSTP32("scif_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 25, 0), 97 - SH_CLK_MSTP32("scif_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 24, 0), 90 + SH_CLK_MSTP32("sci_fck", 5, &div4_clks[DIV4_P], MSTPCR0, 29, 0), 91 + SH_CLK_MSTP32("sci_fck", 4, &div4_clks[DIV4_P], MSTPCR0, 28, 0), 92 + SH_CLK_MSTP32("sci_fck", 3, &div4_clks[DIV4_P], MSTPCR0, 27, 0), 93 + SH_CLK_MSTP32("sci_fck", 2, &div4_clks[DIV4_P], MSTPCR0, 26, 0), 94 + SH_CLK_MSTP32("sci_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 25, 0), 95 + SH_CLK_MSTP32("sci_fck", 0, &div4_clks[DIV4_P], MSTPCR0, 24, 0), 98 96 SH_CLK_MSTP32("ssi_fck", 3, &div4_clks[DIV4_P], MSTPCR0, 23, 0), 99 97 SH_CLK_MSTP32("ssi_fck", 2, &div4_clks[DIV4_P], MSTPCR0, 22, 0), 100 98 SH_CLK_MSTP32("ssi_fck", 1, &div4_clks[DIV4_P], MSTPCR0, 21, 0), ··· 122 120 SH_CLK_MSTP32("ether_fck", -1, NULL, MSTPCR1, 2, 0), 123 121 }; 124 122 123 + static struct clk_lookup lookups[] = { 124 + { 125 + /* TMU0 */ 126 + .dev_id = "sh_tmu.0", 127 + .con_id = "tmu_fck", 128 + .clk = &mstp_clks[17], /* tmu012_fck */ 129 + }, { 130 + /* TMU1 */ 131 + .dev_id = "sh_tmu.1", 132 + .con_id = "tmu_fck", 133 + .clk = &mstp_clks[17], 134 + }, { 135 + /* TMU2 */ 136 + .dev_id = "sh_tmu.2", 137 + .con_id = "tmu_fck", 138 + .clk = &mstp_clks[17], 139 + }, { 140 + /* TMU3 */ 141 + .dev_id = "sh_tmu.3", 142 + .con_id = "tmu_fck", 143 + .clk = &mstp_clks[16], /* tmu345_fck */ 144 + }, { 145 + /* TMU4 */ 146 + .dev_id = "sh_tmu.4", 147 + .con_id = "tmu_fck", 148 + .clk = &mstp_clks[16], 149 + }, { 150 + /* TMU5 */ 151 + .dev_id = "sh_tmu.5", 152 + .con_id = "tmu_fck", 153 + .clk = &mstp_clks[16], 154 + }, { 155 + /* TMU6 */ 156 + .dev_id = "sh_tmu.6", 157 + .con_id = "tmu_fck", 158 + .clk = &mstp_clks[15], /* tmu678_fck */ 159 + }, { 160 + /* TMU7 */ 161 + .dev_id = "sh_tmu.7", 162 + .con_id = "tmu_fck", 163 + .clk = &mstp_clks[15], 164 + }, { 165 + /* TMU8 */ 166 + .dev_id = "sh_tmu.8", 167 + .con_id = "tmu_fck", 168 + .clk = &mstp_clks[15], 169 + }, { 170 + /* TMU9 */ 171 + .dev_id = "sh_tmu.9", 172 + .con_id = "tmu_fck", 173 + .clk = &mstp_clks[14], /* tmu9_11_fck */ 174 + }, { 175 + /* TMU10 */ 176 + .dev_id = "sh_tmu.10", 177 + .con_id = "tmu_fck", 178 + .clk = &mstp_clks[14], 179 + }, { 180 + /* TMU11 */ 181 + .dev_id = "sh_tmu.11", 182 + .con_id = "tmu_fck", 183 + .clk = &mstp_clks[14], 184 + } 185 + }; 186 + 125 187 int __init arch_clk_init(void) 126 188 { 127 189 int i, ret = 0; 128 190 129 191 for (i = 0; i < ARRAY_SIZE(clks); i++) 130 192 ret |= clk_register(clks[i]); 193 + for (i = 0; i < ARRAY_SIZE(lookups); i++) 194 + clkdev_add(&lookups[i]); 131 195 132 196 if (!ret) 133 197 ret = sh_clk_div4_register(div4_clks, ARRAY_SIZE(div4_clks),
-16
arch/sh/kernel/cpu/sh4a/setup-sh7343.c
··· 21 21 .flags = UPF_BOOT_AUTOCONF, 22 22 .type = PORT_SCIF, 23 23 .irqs = { 80, 80, 80, 80 }, 24 - .clk = "scif0", 25 24 }; 26 25 27 26 static struct platform_device scif0_device = { ··· 36 37 .flags = UPF_BOOT_AUTOCONF, 37 38 .type = PORT_SCIF, 38 39 .irqs = { 81, 81, 81, 81 }, 39 - .clk = "scif1", 40 40 }; 41 41 42 42 static struct platform_device scif1_device = { ··· 51 53 .flags = UPF_BOOT_AUTOCONF, 52 54 .type = PORT_SCIF, 53 55 .irqs = { 82, 82, 82, 82 }, 54 - .clk = "scif2", 55 56 }; 56 57 57 58 static struct platform_device scif2_device = { ··· 66 69 .flags = UPF_BOOT_AUTOCONF, 67 70 .type = PORT_SCIF, 68 71 .irqs = { 83, 83, 83, 83 }, 69 - .clk = "scif3", 70 72 }; 71 73 72 74 static struct platform_device scif3_device = { ··· 203 207 }; 204 208 205 209 static struct sh_timer_config cmt_platform_data = { 206 - .name = "CMT", 207 210 .channel_offset = 0x60, 208 211 .timer_bit = 5, 209 - .clk = "cmt0", 210 212 .clockevent_rating = 125, 211 213 .clocksource_rating = 200, 212 214 }; 213 215 214 216 static struct resource cmt_resources[] = { 215 217 [0] = { 216 - .name = "CMT", 217 218 .start = 0x044a0060, 218 219 .end = 0x044a006b, 219 220 .flags = IORESOURCE_MEM, ··· 232 239 }; 233 240 234 241 static struct sh_timer_config tmu0_platform_data = { 235 - .name = "TMU0", 236 242 .channel_offset = 0x04, 237 243 .timer_bit = 0, 238 - .clk = "tmu0", 239 244 .clockevent_rating = 200, 240 245 }; 241 246 242 247 static struct resource tmu0_resources[] = { 243 248 [0] = { 244 - .name = "TMU0", 245 249 .start = 0xffd80008, 246 250 .end = 0xffd80013, 247 251 .flags = IORESOURCE_MEM, ··· 260 270 }; 261 271 262 272 static struct sh_timer_config tmu1_platform_data = { 263 - .name = "TMU1", 264 273 .channel_offset = 0x10, 265 274 .timer_bit = 1, 266 - .clk = "tmu0", 267 275 .clocksource_rating = 200, 268 276 }; 269 277 270 278 static struct resource tmu1_resources[] = { 271 279 [0] = { 272 - .name = "TMU1", 273 280 .start = 0xffd80014, 274 281 .end = 0xffd8001f, 275 282 .flags = IORESOURCE_MEM, ··· 288 301 }; 289 302 290 303 static struct sh_timer_config tmu2_platform_data = { 291 - .name = "TMU2", 292 304 .channel_offset = 0x1c, 293 305 .timer_bit = 2, 294 - .clk = "tmu0", 295 306 }; 296 307 297 308 static struct resource tmu2_resources[] = { 298 309 [0] = { 299 - .name = "TMU2", 300 310 .start = 0xffd80020, 301 311 .end = 0xffd8002b, 302 312 .flags = IORESOURCE_MEM,
-13
arch/sh/kernel/cpu/sh4a/setup-sh7366.c
··· 23 23 .flags = UPF_BOOT_AUTOCONF, 24 24 .type = PORT_SCIF, 25 25 .irqs = { 80, 80, 80, 80 }, 26 - .clk = "scif0", 27 26 }; 28 27 29 28 static struct platform_device scif0_device = { ··· 168 169 }; 169 170 170 171 static struct sh_timer_config cmt_platform_data = { 171 - .name = "CMT", 172 172 .channel_offset = 0x60, 173 173 .timer_bit = 5, 174 - .clk = "cmt0", 175 174 .clockevent_rating = 125, 176 175 .clocksource_rating = 200, 177 176 }; 178 177 179 178 static struct resource cmt_resources[] = { 180 179 [0] = { 181 - .name = "CMT", 182 180 .start = 0x044a0060, 183 181 .end = 0x044a006b, 184 182 .flags = IORESOURCE_MEM, ··· 197 201 }; 198 202 199 203 static struct sh_timer_config tmu0_platform_data = { 200 - .name = "TMU0", 201 204 .channel_offset = 0x04, 202 205 .timer_bit = 0, 203 - .clk = "tmu0", 204 206 .clockevent_rating = 200, 205 207 }; 206 208 207 209 static struct resource tmu0_resources[] = { 208 210 [0] = { 209 - .name = "TMU0", 210 211 .start = 0xffd80008, 211 212 .end = 0xffd80013, 212 213 .flags = IORESOURCE_MEM, ··· 225 232 }; 226 233 227 234 static struct sh_timer_config tmu1_platform_data = { 228 - .name = "TMU1", 229 235 .channel_offset = 0x10, 230 236 .timer_bit = 1, 231 - .clk = "tmu0", 232 237 .clocksource_rating = 200, 233 238 }; 234 239 235 240 static struct resource tmu1_resources[] = { 236 241 [0] = { 237 - .name = "TMU1", 238 242 .start = 0xffd80014, 239 243 .end = 0xffd8001f, 240 244 .flags = IORESOURCE_MEM, ··· 253 263 }; 254 264 255 265 static struct sh_timer_config tmu2_platform_data = { 256 - .name = "TMU2", 257 266 .channel_offset = 0x1c, 258 267 .timer_bit = 2, 259 - .clk = "tmu0", 260 268 }; 261 269 262 270 static struct resource tmu2_resources[] = { 263 271 [0] = { 264 - .name = "TMU2", 265 272 .start = 0xffd80020, 266 273 .end = 0xffd8002b, 267 274 .flags = IORESOURCE_MEM,
-15
arch/sh/kernel/cpu/sh4a/setup-sh7722.c
··· 174 174 .flags = UPF_BOOT_AUTOCONF, 175 175 .type = PORT_SCIF, 176 176 .irqs = { 80, 80, 80, 80 }, 177 - .clk = "scif0", 178 177 }; 179 178 180 179 static struct platform_device scif0_device = { ··· 189 190 .flags = UPF_BOOT_AUTOCONF, 190 191 .type = PORT_SCIF, 191 192 .irqs = { 81, 81, 81, 81 }, 192 - .clk = "scif1", 193 193 }; 194 194 195 195 static struct platform_device scif1_device = { ··· 204 206 .flags = UPF_BOOT_AUTOCONF, 205 207 .type = PORT_SCIF, 206 208 .irqs = { 82, 82, 82, 82 }, 207 - .clk = "scif2", 208 209 }; 209 210 210 211 static struct platform_device scif2_device = { ··· 398 401 }; 399 402 400 403 static struct sh_timer_config cmt_platform_data = { 401 - .name = "CMT", 402 404 .channel_offset = 0x60, 403 405 .timer_bit = 5, 404 - .clk = "cmt0", 405 406 .clockevent_rating = 125, 406 407 .clocksource_rating = 125, 407 408 }; 408 409 409 410 static struct resource cmt_resources[] = { 410 411 [0] = { 411 - .name = "CMT", 412 412 .start = 0x044a0060, 413 413 .end = 0x044a006b, 414 414 .flags = IORESOURCE_MEM, ··· 430 436 }; 431 437 432 438 static struct sh_timer_config tmu0_platform_data = { 433 - .name = "TMU0", 434 439 .channel_offset = 0x04, 435 440 .timer_bit = 0, 436 - .clk = "tmu0", 437 441 .clockevent_rating = 200, 438 442 }; 439 443 440 444 static struct resource tmu0_resources[] = { 441 445 [0] = { 442 - .name = "TMU0", 443 446 .start = 0xffd80008, 444 447 .end = 0xffd80013, 445 448 .flags = IORESOURCE_MEM, ··· 461 470 }; 462 471 463 472 static struct sh_timer_config tmu1_platform_data = { 464 - .name = "TMU1", 465 473 .channel_offset = 0x10, 466 474 .timer_bit = 1, 467 - .clk = "tmu0", 468 475 .clocksource_rating = 200, 469 476 }; 470 477 471 478 static struct resource tmu1_resources[] = { 472 479 [0] = { 473 - .name = "TMU1", 474 480 .start = 0xffd80014, 475 481 .end = 0xffd8001f, 476 482 .flags = IORESOURCE_MEM, ··· 492 504 }; 493 505 494 506 static struct sh_timer_config tmu2_platform_data = { 495 - .name = "TMU2", 496 507 .channel_offset = 0x1c, 497 508 .timer_bit = 2, 498 - .clk = "tmu0", 499 509 }; 500 510 501 511 static struct resource tmu2_resources[] = { 502 512 [0] = { 503 - .name = "TMU2", 504 513 .start = 0xffd80020, 505 514 .end = 0xffd8002b, 506 515 .flags = IORESOURCE_MEM,
-27
arch/sh/kernel/cpu/sh4a/setup-sh7723.c
··· 26 26 .flags = UPF_BOOT_AUTOCONF, 27 27 .type = PORT_SCIF, 28 28 .irqs = { 80, 80, 80, 80 }, 29 - .clk = "scif0", 30 29 }; 31 30 32 31 static struct platform_device scif0_device = { ··· 41 42 .flags = UPF_BOOT_AUTOCONF, 42 43 .type = PORT_SCIF, 43 44 .irqs = { 81, 81, 81, 81 }, 44 - .clk = "scif1", 45 45 }; 46 46 47 47 static struct platform_device scif1_device = { ··· 56 58 .flags = UPF_BOOT_AUTOCONF, 57 59 .type = PORT_SCIF, 58 60 .irqs = { 82, 82, 82, 82 }, 59 - .clk = "scif2", 60 61 }; 61 62 62 63 static struct platform_device scif2_device = { ··· 71 74 .flags = UPF_BOOT_AUTOCONF, 72 75 .type = PORT_SCIFA, 73 76 .irqs = { 56, 56, 56, 56 }, 74 - .clk = "scif3", 75 77 }; 76 78 77 79 static struct platform_device scif3_device = { ··· 86 90 .flags = UPF_BOOT_AUTOCONF, 87 91 .type = PORT_SCIFA, 88 92 .irqs = { 88, 88, 88, 88 }, 89 - .clk = "scif4", 90 93 }; 91 94 92 95 static struct platform_device scif4_device = { ··· 101 106 .flags = UPF_BOOT_AUTOCONF, 102 107 .type = PORT_SCIFA, 103 108 .irqs = { 109, 109, 109, 109 }, 104 - .clk = "scif5", 105 109 }; 106 110 107 111 static struct platform_device scif5_device = { ··· 205 211 }; 206 212 207 213 static struct sh_timer_config cmt_platform_data = { 208 - .name = "CMT", 209 214 .channel_offset = 0x60, 210 215 .timer_bit = 5, 211 - .clk = "cmt0", 212 216 .clockevent_rating = 125, 213 217 .clocksource_rating = 125, 214 218 }; 215 219 216 220 static struct resource cmt_resources[] = { 217 221 [0] = { 218 - .name = "CMT", 219 222 .start = 0x044a0060, 220 223 .end = 0x044a006b, 221 224 .flags = IORESOURCE_MEM, ··· 237 246 }; 238 247 239 248 static struct sh_timer_config tmu0_platform_data = { 240 - .name = "TMU0", 241 249 .channel_offset = 0x04, 242 250 .timer_bit = 0, 243 - .clk = "tmu0", 244 251 .clockevent_rating = 200, 245 252 }; 246 253 247 254 static struct resource tmu0_resources[] = { 248 255 [0] = { 249 - .name = "TMU0", 250 256 .start = 0xffd80008, 251 257 .end = 0xffd80013, 252 258 .flags = IORESOURCE_MEM, ··· 268 280 }; 269 281 270 282 static struct sh_timer_config tmu1_platform_data = { 271 - .name = "TMU1", 272 283 .channel_offset = 0x10, 273 284 .timer_bit = 1, 274 - .clk = "tmu0", 275 285 .clocksource_rating = 200, 276 286 }; 277 287 278 288 static struct resource tmu1_resources[] = { 279 289 [0] = { 280 - .name = "TMU1", 281 290 .start = 0xffd80014, 282 291 .end = 0xffd8001f, 283 292 .flags = IORESOURCE_MEM, ··· 299 314 }; 300 315 301 316 static struct sh_timer_config tmu2_platform_data = { 302 - .name = "TMU2", 303 317 .channel_offset = 0x1c, 304 318 .timer_bit = 2, 305 - .clk = "tmu0", 306 319 }; 307 320 308 321 static struct resource tmu2_resources[] = { 309 322 [0] = { 310 - .name = "TMU2", 311 323 .start = 0xffd80020, 312 324 .end = 0xffd8002b, 313 325 .flags = IORESOURCE_MEM, ··· 329 347 }; 330 348 331 349 static struct sh_timer_config tmu3_platform_data = { 332 - .name = "TMU3", 333 350 .channel_offset = 0x04, 334 351 .timer_bit = 0, 335 - .clk = "tmu1", 336 352 }; 337 353 338 354 static struct resource tmu3_resources[] = { 339 355 [0] = { 340 - .name = "TMU3", 341 356 .start = 0xffd90008, 342 357 .end = 0xffd90013, 343 358 .flags = IORESOURCE_MEM, ··· 359 380 }; 360 381 361 382 static struct sh_timer_config tmu4_platform_data = { 362 - .name = "TMU4", 363 383 .channel_offset = 0x10, 364 384 .timer_bit = 1, 365 - .clk = "tmu1", 366 385 }; 367 386 368 387 static struct resource tmu4_resources[] = { 369 388 [0] = { 370 - .name = "TMU4", 371 389 .start = 0xffd90014, 372 390 .end = 0xffd9001f, 373 391 .flags = IORESOURCE_MEM, ··· 389 413 }; 390 414 391 415 static struct sh_timer_config tmu5_platform_data = { 392 - .name = "TMU5", 393 416 .channel_offset = 0x1c, 394 417 .timer_bit = 2, 395 - .clk = "tmu1", 396 418 }; 397 419 398 420 static struct resource tmu5_resources[] = { 399 421 [0] = { 400 - .name = "TMU5", 401 422 .start = 0xffd90020, 402 423 .end = 0xffd9002b, 403 424 .flags = IORESOURCE_MEM,
-27
arch/sh/kernel/cpu/sh4a/setup-sh7724.c
··· 213 213 .flags = UPF_BOOT_AUTOCONF, 214 214 .type = PORT_SCIF, 215 215 .irqs = { 80, 80, 80, 80 }, 216 - .clk = "scif0", 217 216 }; 218 217 219 218 static struct platform_device scif0_device = { ··· 228 229 .flags = UPF_BOOT_AUTOCONF, 229 230 .type = PORT_SCIF, 230 231 .irqs = { 81, 81, 81, 81 }, 231 - .clk = "scif1", 232 232 }; 233 233 234 234 static struct platform_device scif1_device = { ··· 243 245 .flags = UPF_BOOT_AUTOCONF, 244 246 .type = PORT_SCIF, 245 247 .irqs = { 82, 82, 82, 82 }, 246 - .clk = "scif2", 247 248 }; 248 249 249 250 static struct platform_device scif2_device = { ··· 258 261 .flags = UPF_BOOT_AUTOCONF, 259 262 .type = PORT_SCIFA, 260 263 .irqs = { 56, 56, 56, 56 }, 261 - .clk = "scif3", 262 264 }; 263 265 264 266 static struct platform_device scif3_device = { ··· 273 277 .flags = UPF_BOOT_AUTOCONF, 274 278 .type = PORT_SCIFA, 275 279 .irqs = { 88, 88, 88, 88 }, 276 - .clk = "scif4", 277 280 }; 278 281 279 282 static struct platform_device scif4_device = { ··· 288 293 .flags = UPF_BOOT_AUTOCONF, 289 294 .type = PORT_SCIFA, 290 295 .irqs = { 109, 109, 109, 109 }, 291 - .clk = "scif5", 292 296 }; 293 297 294 298 static struct platform_device scif5_device = { ··· 479 485 }; 480 486 481 487 static struct sh_timer_config cmt_platform_data = { 482 - .name = "CMT", 483 488 .channel_offset = 0x60, 484 489 .timer_bit = 5, 485 - .clk = "cmt0", 486 490 .clockevent_rating = 125, 487 491 .clocksource_rating = 200, 488 492 }; 489 493 490 494 static struct resource cmt_resources[] = { 491 495 [0] = { 492 - .name = "CMT", 493 496 .start = 0x044a0060, 494 497 .end = 0x044a006b, 495 498 .flags = IORESOURCE_MEM, ··· 511 520 }; 512 521 513 522 static struct sh_timer_config tmu0_platform_data = { 514 - .name = "TMU0", 515 523 .channel_offset = 0x04, 516 524 .timer_bit = 0, 517 - .clk = "tmu0", 518 525 .clockevent_rating = 200, 519 526 }; 520 527 521 528 static struct resource tmu0_resources[] = { 522 529 [0] = { 523 - .name = "TMU0", 524 530 .start = 0xffd80008, 525 531 .end = 0xffd80013, 526 532 .flags = IORESOURCE_MEM, ··· 542 554 }; 543 555 544 556 static struct sh_timer_config tmu1_platform_data = { 545 - .name = "TMU1", 546 557 .channel_offset = 0x10, 547 558 .timer_bit = 1, 548 - .clk = "tmu0", 549 559 .clocksource_rating = 200, 550 560 }; 551 561 552 562 static struct resource tmu1_resources[] = { 553 563 [0] = { 554 - .name = "TMU1", 555 564 .start = 0xffd80014, 556 565 .end = 0xffd8001f, 557 566 .flags = IORESOURCE_MEM, ··· 573 588 }; 574 589 575 590 static struct sh_timer_config tmu2_platform_data = { 576 - .name = "TMU2", 577 591 .channel_offset = 0x1c, 578 592 .timer_bit = 2, 579 - .clk = "tmu0", 580 593 }; 581 594 582 595 static struct resource tmu2_resources[] = { 583 596 [0] = { 584 - .name = "TMU2", 585 597 .start = 0xffd80020, 586 598 .end = 0xffd8002b, 587 599 .flags = IORESOURCE_MEM, ··· 604 622 605 623 606 624 static struct sh_timer_config tmu3_platform_data = { 607 - .name = "TMU3", 608 625 .channel_offset = 0x04, 609 626 .timer_bit = 0, 610 - .clk = "tmu1", 611 627 }; 612 628 613 629 static struct resource tmu3_resources[] = { 614 630 [0] = { 615 - .name = "TMU3", 616 631 .start = 0xffd90008, 617 632 .end = 0xffd90013, 618 633 .flags = IORESOURCE_MEM, ··· 634 655 }; 635 656 636 657 static struct sh_timer_config tmu4_platform_data = { 637 - .name = "TMU4", 638 658 .channel_offset = 0x10, 639 659 .timer_bit = 1, 640 - .clk = "tmu1", 641 660 }; 642 661 643 662 static struct resource tmu4_resources[] = { 644 663 [0] = { 645 - .name = "TMU4", 646 664 .start = 0xffd90014, 647 665 .end = 0xffd9001f, 648 666 .flags = IORESOURCE_MEM, ··· 664 688 }; 665 689 666 690 static struct sh_timer_config tmu5_platform_data = { 667 - .name = "TMU5", 668 691 .channel_offset = 0x1c, 669 692 .timer_bit = 2, 670 - .clk = "tmu1", 671 693 }; 672 694 673 695 static struct resource tmu5_resources[] = { 674 696 [0] = { 675 - .name = "TMU5", 676 697 .start = 0xffd90020, 677 698 .end = 0xffd9002b, 678 699 .flags = IORESOURCE_MEM,
-6
arch/sh/kernel/cpu/sh4a/setup-sh7757.c
··· 63 63 }; 64 64 65 65 static struct sh_timer_config tmu0_platform_data = { 66 - .name = "TMU0", 67 66 .channel_offset = 0x04, 68 67 .timer_bit = 0, 69 - .clk = "peripheral_clk", 70 68 .clockevent_rating = 200, 71 69 }; 72 70 73 71 static struct resource tmu0_resources[] = { 74 72 [0] = { 75 - .name = "TMU0", 76 73 .start = 0xfe430008, 77 74 .end = 0xfe430013, 78 75 .flags = IORESOURCE_MEM, ··· 91 94 }; 92 95 93 96 static struct sh_timer_config tmu1_platform_data = { 94 - .name = "TMU1", 95 97 .channel_offset = 0x10, 96 98 .timer_bit = 1, 97 - .clk = "peripheral_clk", 98 99 .clocksource_rating = 200, 99 100 }; 100 101 101 102 static struct resource tmu1_resources[] = { 102 103 [0] = { 103 - .name = "TMU1", 104 104 .start = 0xfe430014, 105 105 .end = 0xfe43001f, 106 106 .flags = IORESOURCE_MEM,
-18
arch/sh/kernel/cpu/sh4a/setup-sh7763.c
··· 131 131 }; 132 132 133 133 static struct sh_timer_config tmu0_platform_data = { 134 - .name = "TMU0", 135 134 .channel_offset = 0x04, 136 135 .timer_bit = 0, 137 - .clk = "peripheral_clk", 138 136 .clockevent_rating = 200, 139 137 }; 140 138 141 139 static struct resource tmu0_resources[] = { 142 140 [0] = { 143 - .name = "TMU0", 144 141 .start = 0xffd80008, 145 142 .end = 0xffd80013, 146 143 .flags = IORESOURCE_MEM, ··· 159 162 }; 160 163 161 164 static struct sh_timer_config tmu1_platform_data = { 162 - .name = "TMU1", 163 165 .channel_offset = 0x10, 164 166 .timer_bit = 1, 165 - .clk = "peripheral_clk", 166 167 .clocksource_rating = 200, 167 168 }; 168 169 169 170 static struct resource tmu1_resources[] = { 170 171 [0] = { 171 - .name = "TMU1", 172 172 .start = 0xffd80014, 173 173 .end = 0xffd8001f, 174 174 .flags = IORESOURCE_MEM, ··· 187 193 }; 188 194 189 195 static struct sh_timer_config tmu2_platform_data = { 190 - .name = "TMU2", 191 196 .channel_offset = 0x1c, 192 197 .timer_bit = 2, 193 - .clk = "peripheral_clk", 194 198 }; 195 199 196 200 static struct resource tmu2_resources[] = { 197 201 [0] = { 198 - .name = "TMU2", 199 202 .start = 0xffd80020, 200 203 .end = 0xffd8002f, 201 204 .flags = IORESOURCE_MEM, ··· 214 223 }; 215 224 216 225 static struct sh_timer_config tmu3_platform_data = { 217 - .name = "TMU3", 218 226 .channel_offset = 0x04, 219 227 .timer_bit = 0, 220 - .clk = "peripheral_clk", 221 228 }; 222 229 223 230 static struct resource tmu3_resources[] = { 224 231 [0] = { 225 - .name = "TMU3", 226 232 .start = 0xffd88008, 227 233 .end = 0xffd88013, 228 234 .flags = IORESOURCE_MEM, ··· 241 253 }; 242 254 243 255 static struct sh_timer_config tmu4_platform_data = { 244 - .name = "TMU4", 245 256 .channel_offset = 0x10, 246 257 .timer_bit = 1, 247 - .clk = "peripheral_clk", 248 258 }; 249 259 250 260 static struct resource tmu4_resources[] = { 251 261 [0] = { 252 - .name = "TMU4", 253 262 .start = 0xffd88014, 254 263 .end = 0xffd8801f, 255 264 .flags = IORESOURCE_MEM, ··· 268 283 }; 269 284 270 285 static struct sh_timer_config tmu5_platform_data = { 271 - .name = "TMU5", 272 286 .channel_offset = 0x1c, 273 287 .timer_bit = 2, 274 - .clk = "peripheral_clk", 275 288 }; 276 289 277 290 static struct resource tmu5_resources[] = { 278 291 [0] = { 279 - .name = "TMU5", 280 292 .start = 0xffd88020, 281 293 .end = 0xffd8802b, 282 294 .flags = IORESOURCE_MEM,
-27
arch/sh/kernel/cpu/sh4a/setup-sh7770.c
··· 165 165 }; 166 166 167 167 static struct sh_timer_config tmu0_platform_data = { 168 - .name = "TMU0", 169 168 .channel_offset = 0x04, 170 169 .timer_bit = 0, 171 - .clk = "peripheral_clk", 172 170 .clockevent_rating = 200, 173 171 }; 174 172 175 173 static struct resource tmu0_resources[] = { 176 174 [0] = { 177 - .name = "TMU0", 178 175 .start = 0xffd80008, 179 176 .end = 0xffd80013, 180 177 .flags = IORESOURCE_MEM, ··· 193 196 }; 194 197 195 198 static struct sh_timer_config tmu1_platform_data = { 196 - .name = "TMU1", 197 199 .channel_offset = 0x10, 198 200 .timer_bit = 1, 199 - .clk = "peripheral_clk", 200 201 .clocksource_rating = 200, 201 202 }; 202 203 203 204 static struct resource tmu1_resources[] = { 204 205 [0] = { 205 - .name = "TMU1", 206 206 .start = 0xffd80014, 207 207 .end = 0xffd8001f, 208 208 .flags = IORESOURCE_MEM, ··· 221 227 }; 222 228 223 229 static struct sh_timer_config tmu2_platform_data = { 224 - .name = "TMU2", 225 230 .channel_offset = 0x1c, 226 231 .timer_bit = 2, 227 - .clk = "peripheral_clk", 228 232 }; 229 233 230 234 static struct resource tmu2_resources[] = { 231 235 [0] = { 232 - .name = "TMU2", 233 236 .start = 0xffd80020, 234 237 .end = 0xffd8002f, 235 238 .flags = IORESOURCE_MEM, ··· 248 257 }; 249 258 250 259 static struct sh_timer_config tmu3_platform_data = { 251 - .name = "TMU3", 252 260 .channel_offset = 0x04, 253 261 .timer_bit = 0, 254 - .clk = "peripheral_clk", 255 262 }; 256 263 257 264 static struct resource tmu3_resources[] = { 258 265 [0] = { 259 - .name = "TMU3", 260 266 .start = 0xffd81008, 261 267 .end = 0xffd81013, 262 268 .flags = IORESOURCE_MEM, ··· 275 287 }; 276 288 277 289 static struct sh_timer_config tmu4_platform_data = { 278 - .name = "TMU4", 279 290 .channel_offset = 0x10, 280 291 .timer_bit = 1, 281 - .clk = "peripheral_clk", 282 292 }; 283 293 284 294 static struct resource tmu4_resources[] = { 285 295 [0] = { 286 - .name = "TMU4", 287 296 .start = 0xffd81014, 288 297 .end = 0xffd8101f, 289 298 .flags = IORESOURCE_MEM, ··· 302 317 }; 303 318 304 319 static struct sh_timer_config tmu5_platform_data = { 305 - .name = "TMU5", 306 320 .channel_offset = 0x1c, 307 321 .timer_bit = 2, 308 - .clk = "peripheral_clk", 309 322 }; 310 323 311 324 static struct resource tmu5_resources[] = { 312 325 [0] = { 313 - .name = "TMU5", 314 326 .start = 0xffd81020, 315 327 .end = 0xffd8102f, 316 328 .flags = IORESOURCE_MEM, ··· 329 347 }; 330 348 331 349 static struct sh_timer_config tmu6_platform_data = { 332 - .name = "TMU6", 333 350 .channel_offset = 0x04, 334 351 .timer_bit = 0, 335 - .clk = "peripheral_clk", 336 352 }; 337 353 338 354 static struct resource tmu6_resources[] = { 339 355 [0] = { 340 - .name = "TMU6", 341 356 .start = 0xffd82008, 342 357 .end = 0xffd82013, 343 358 .flags = IORESOURCE_MEM, ··· 356 377 }; 357 378 358 379 static struct sh_timer_config tmu7_platform_data = { 359 - .name = "TMU7", 360 380 .channel_offset = 0x10, 361 381 .timer_bit = 1, 362 - .clk = "peripheral_clk", 363 382 }; 364 383 365 384 static struct resource tmu7_resources[] = { 366 385 [0] = { 367 - .name = "TMU7", 368 386 .start = 0xffd82014, 369 387 .end = 0xffd8201f, 370 388 .flags = IORESOURCE_MEM, ··· 383 407 }; 384 408 385 409 static struct sh_timer_config tmu8_platform_data = { 386 - .name = "TMU8", 387 410 .channel_offset = 0x1c, 388 411 .timer_bit = 2, 389 - .clk = "peripheral_clk", 390 412 }; 391 413 392 414 static struct resource tmu8_resources[] = { 393 415 [0] = { 394 - .name = "TMU8", 395 416 .start = 0xffd82020, 396 417 .end = 0xffd8202b, 397 418 .flags = IORESOURCE_MEM,
-18
arch/sh/kernel/cpu/sh4a/setup-sh7780.c
··· 49 49 }; 50 50 51 51 static struct sh_timer_config tmu0_platform_data = { 52 - .name = "TMU0", 53 52 .channel_offset = 0x04, 54 53 .timer_bit = 0, 55 - .clk = "peripheral_clk", 56 54 .clockevent_rating = 200, 57 55 }; 58 56 59 57 static struct resource tmu0_resources[] = { 60 58 [0] = { 61 - .name = "TMU0", 62 59 .start = 0xffd80008, 63 60 .end = 0xffd80013, 64 61 .flags = IORESOURCE_MEM, ··· 77 80 }; 78 81 79 82 static struct sh_timer_config tmu1_platform_data = { 80 - .name = "TMU1", 81 83 .channel_offset = 0x10, 82 84 .timer_bit = 1, 83 - .clk = "peripheral_clk", 84 85 .clocksource_rating = 200, 85 86 }; 86 87 87 88 static struct resource tmu1_resources[] = { 88 89 [0] = { 89 - .name = "TMU1", 90 90 .start = 0xffd80014, 91 91 .end = 0xffd8001f, 92 92 .flags = IORESOURCE_MEM, ··· 105 111 }; 106 112 107 113 static struct sh_timer_config tmu2_platform_data = { 108 - .name = "TMU2", 109 114 .channel_offset = 0x1c, 110 115 .timer_bit = 2, 111 - .clk = "peripheral_clk", 112 116 }; 113 117 114 118 static struct resource tmu2_resources[] = { 115 119 [0] = { 116 - .name = "TMU2", 117 120 .start = 0xffd80020, 118 121 .end = 0xffd8002f, 119 122 .flags = IORESOURCE_MEM, ··· 132 141 }; 133 142 134 143 static struct sh_timer_config tmu3_platform_data = { 135 - .name = "TMU3", 136 144 .channel_offset = 0x04, 137 145 .timer_bit = 0, 138 - .clk = "peripheral_clk", 139 146 }; 140 147 141 148 static struct resource tmu3_resources[] = { 142 149 [0] = { 143 - .name = "TMU3", 144 150 .start = 0xffdc0008, 145 151 .end = 0xffdc0013, 146 152 .flags = IORESOURCE_MEM, ··· 159 171 }; 160 172 161 173 static struct sh_timer_config tmu4_platform_data = { 162 - .name = "TMU4", 163 174 .channel_offset = 0x10, 164 175 .timer_bit = 1, 165 - .clk = "peripheral_clk", 166 176 }; 167 177 168 178 static struct resource tmu4_resources[] = { 169 179 [0] = { 170 - .name = "TMU4", 171 180 .start = 0xffdc0014, 172 181 .end = 0xffdc001f, 173 182 .flags = IORESOURCE_MEM, ··· 186 201 }; 187 202 188 203 static struct sh_timer_config tmu5_platform_data = { 189 - .name = "TMU5", 190 204 .channel_offset = 0x1c, 191 205 .timer_bit = 2, 192 - .clk = "peripheral_clk", 193 206 }; 194 207 195 208 static struct resource tmu5_resources[] = { 196 209 [0] = { 197 - .name = "TMU5", 198 210 .start = 0xffdc0020, 199 211 .end = 0xffdc002b, 200 212 .flags = IORESOURCE_MEM,
-24
arch/sh/kernel/cpu/sh4a/setup-sh7785.c
··· 25 25 .flags = UPF_BOOT_AUTOCONF, 26 26 .type = PORT_SCIF, 27 27 .irqs = { 40, 40, 40, 40 }, 28 - .clk = "scif_fck", 29 28 }; 30 29 31 30 static struct platform_device scif0_device = { ··· 40 41 .flags = UPF_BOOT_AUTOCONF, 41 42 .type = PORT_SCIF, 42 43 .irqs = { 44, 44, 44, 44 }, 43 - .clk = "scif_fck", 44 44 }; 45 45 46 46 static struct platform_device scif1_device = { ··· 55 57 .flags = UPF_BOOT_AUTOCONF, 56 58 .type = PORT_SCIF, 57 59 .irqs = { 60, 60, 60, 60 }, 58 - .clk = "scif_fck", 59 60 }; 60 61 61 62 static struct platform_device scif2_device = { ··· 70 73 .flags = UPF_BOOT_AUTOCONF, 71 74 .type = PORT_SCIF, 72 75 .irqs = { 61, 61, 61, 61 }, 73 - .clk = "scif_fck", 74 76 }; 75 77 76 78 static struct platform_device scif3_device = { ··· 85 89 .flags = UPF_BOOT_AUTOCONF, 86 90 .type = PORT_SCIF, 87 91 .irqs = { 62, 62, 62, 62 }, 88 - .clk = "scif_fck", 89 92 }; 90 93 91 94 static struct platform_device scif4_device = { ··· 100 105 .flags = UPF_BOOT_AUTOCONF, 101 106 .type = PORT_SCIF, 102 107 .irqs = { 63, 63, 63, 63 }, 103 - .clk = "scif_fck", 104 108 }; 105 109 106 110 static struct platform_device scif5_device = { ··· 111 117 }; 112 118 113 119 static struct sh_timer_config tmu0_platform_data = { 114 - .name = "TMU0", 115 120 .channel_offset = 0x04, 116 121 .timer_bit = 0, 117 - .clk = "tmu012_fck", 118 122 .clockevent_rating = 200, 119 123 }; 120 124 121 125 static struct resource tmu0_resources[] = { 122 126 [0] = { 123 - .name = "TMU0", 124 127 .start = 0xffd80008, 125 128 .end = 0xffd80013, 126 129 .flags = IORESOURCE_MEM, ··· 139 148 }; 140 149 141 150 static struct sh_timer_config tmu1_platform_data = { 142 - .name = "TMU1", 143 151 .channel_offset = 0x10, 144 152 .timer_bit = 1, 145 - .clk = "tmu012_fck", 146 153 .clocksource_rating = 200, 147 154 }; 148 155 149 156 static struct resource tmu1_resources[] = { 150 157 [0] = { 151 - .name = "TMU1", 152 158 .start = 0xffd80014, 153 159 .end = 0xffd8001f, 154 160 .flags = IORESOURCE_MEM, ··· 167 179 }; 168 180 169 181 static struct sh_timer_config tmu2_platform_data = { 170 - .name = "TMU2", 171 182 .channel_offset = 0x1c, 172 183 .timer_bit = 2, 173 - .clk = "tmu012_fck", 174 184 }; 175 185 176 186 static struct resource tmu2_resources[] = { 177 187 [0] = { 178 - .name = "TMU2", 179 188 .start = 0xffd80020, 180 189 .end = 0xffd8002f, 181 190 .flags = IORESOURCE_MEM, ··· 194 209 }; 195 210 196 211 static struct sh_timer_config tmu3_platform_data = { 197 - .name = "TMU3", 198 212 .channel_offset = 0x04, 199 213 .timer_bit = 0, 200 - .clk = "tmu345_fck", 201 214 }; 202 215 203 216 static struct resource tmu3_resources[] = { 204 217 [0] = { 205 - .name = "TMU3", 206 218 .start = 0xffdc0008, 207 219 .end = 0xffdc0013, 208 220 .flags = IORESOURCE_MEM, ··· 221 239 }; 222 240 223 241 static struct sh_timer_config tmu4_platform_data = { 224 - .name = "TMU4", 225 242 .channel_offset = 0x10, 226 243 .timer_bit = 1, 227 - .clk = "tmu345_fck", 228 244 }; 229 245 230 246 static struct resource tmu4_resources[] = { 231 247 [0] = { 232 - .name = "TMU4", 233 248 .start = 0xffdc0014, 234 249 .end = 0xffdc001f, 235 250 .flags = IORESOURCE_MEM, ··· 248 269 }; 249 270 250 271 static struct sh_timer_config tmu5_platform_data = { 251 - .name = "TMU5", 252 272 .channel_offset = 0x1c, 253 273 .timer_bit = 2, 254 - .clk = "tmu345_fck", 255 274 }; 256 275 257 276 static struct resource tmu5_resources[] = { 258 277 [0] = { 259 - .name = "TMU5", 260 278 .start = 0xffdc0020, 261 279 .end = 0xffdc002b, 262 280 .flags = IORESOURCE_MEM,
-36
arch/sh/kernel/cpu/sh4a/setup-sh7786.c
··· 117 117 }; 118 118 119 119 static struct sh_timer_config tmu0_platform_data = { 120 - .name = "TMU0", 121 120 .channel_offset = 0x04, 122 121 .timer_bit = 0, 123 - .clk = "peripheral_clk", 124 122 .clockevent_rating = 200, 125 123 }; 126 124 127 125 static struct resource tmu0_resources[] = { 128 126 [0] = { 129 - .name = "TMU0", 130 127 .start = 0xffd80008, 131 128 .end = 0xffd80013, 132 129 .flags = IORESOURCE_MEM, ··· 145 148 }; 146 149 147 150 static struct sh_timer_config tmu1_platform_data = { 148 - .name = "TMU1", 149 151 .channel_offset = 0x10, 150 152 .timer_bit = 1, 151 - .clk = "peripheral_clk", 152 153 .clocksource_rating = 200, 153 154 }; 154 155 155 156 static struct resource tmu1_resources[] = { 156 157 [0] = { 157 - .name = "TMU1", 158 158 .start = 0xffd80014, 159 159 .end = 0xffd8001f, 160 160 .flags = IORESOURCE_MEM, ··· 173 179 }; 174 180 175 181 static struct sh_timer_config tmu2_platform_data = { 176 - .name = "TMU2", 177 182 .channel_offset = 0x1c, 178 183 .timer_bit = 2, 179 - .clk = "peripheral_clk", 180 184 }; 181 185 182 186 static struct resource tmu2_resources[] = { 183 187 [0] = { 184 - .name = "TMU2", 185 188 .start = 0xffd80020, 186 189 .end = 0xffd8002f, 187 190 .flags = IORESOURCE_MEM, ··· 200 209 }; 201 210 202 211 static struct sh_timer_config tmu3_platform_data = { 203 - .name = "TMU3", 204 212 .channel_offset = 0x04, 205 213 .timer_bit = 0, 206 - .clk = "peripheral_clk", 207 214 }; 208 215 209 216 static struct resource tmu3_resources[] = { 210 217 [0] = { 211 - .name = "TMU3", 212 218 .start = 0xffda0008, 213 219 .end = 0xffda0013, 214 220 .flags = IORESOURCE_MEM, ··· 227 239 }; 228 240 229 241 static struct sh_timer_config tmu4_platform_data = { 230 - .name = "TMU4", 231 242 .channel_offset = 0x10, 232 243 .timer_bit = 1, 233 - .clk = "peripheral_clk", 234 244 }; 235 245 236 246 static struct resource tmu4_resources[] = { 237 247 [0] = { 238 - .name = "TMU4", 239 248 .start = 0xffda0014, 240 249 .end = 0xffda001f, 241 250 .flags = IORESOURCE_MEM, ··· 254 269 }; 255 270 256 271 static struct sh_timer_config tmu5_platform_data = { 257 - .name = "TMU5", 258 272 .channel_offset = 0x1c, 259 273 .timer_bit = 2, 260 - .clk = "peripheral_clk", 261 274 }; 262 275 263 276 static struct resource tmu5_resources[] = { 264 277 [0] = { 265 - .name = "TMU5", 266 278 .start = 0xffda0020, 267 279 .end = 0xffda002b, 268 280 .flags = IORESOURCE_MEM, ··· 281 299 }; 282 300 283 301 static struct sh_timer_config tmu6_platform_data = { 284 - .name = "TMU6", 285 302 .channel_offset = 0x04, 286 303 .timer_bit = 0, 287 - .clk = "peripheral_clk", 288 304 }; 289 305 290 306 static struct resource tmu6_resources[] = { 291 307 [0] = { 292 - .name = "TMU6", 293 308 .start = 0xffdc0008, 294 309 .end = 0xffdc0013, 295 310 .flags = IORESOURCE_MEM, ··· 308 329 }; 309 330 310 331 static struct sh_timer_config tmu7_platform_data = { 311 - .name = "TMU7", 312 332 .channel_offset = 0x10, 313 333 .timer_bit = 1, 314 - .clk = "peripheral_clk", 315 334 }; 316 335 317 336 static struct resource tmu7_resources[] = { 318 337 [0] = { 319 - .name = "TMU7", 320 338 .start = 0xffdc0014, 321 339 .end = 0xffdc001f, 322 340 .flags = IORESOURCE_MEM, ··· 335 359 }; 336 360 337 361 static struct sh_timer_config tmu8_platform_data = { 338 - .name = "TMU8", 339 362 .channel_offset = 0x1c, 340 363 .timer_bit = 2, 341 - .clk = "peripheral_clk", 342 364 }; 343 365 344 366 static struct resource tmu8_resources[] = { 345 367 [0] = { 346 - .name = "TMU8", 347 368 .start = 0xffdc0020, 348 369 .end = 0xffdc002b, 349 370 .flags = IORESOURCE_MEM, ··· 362 389 }; 363 390 364 391 static struct sh_timer_config tmu9_platform_data = { 365 - .name = "TMU9", 366 392 .channel_offset = 0x04, 367 393 .timer_bit = 0, 368 - .clk = "peripheral_clk", 369 394 }; 370 395 371 396 static struct resource tmu9_resources[] = { 372 397 [0] = { 373 - .name = "TMU9", 374 398 .start = 0xffde0008, 375 399 .end = 0xffde0013, 376 400 .flags = IORESOURCE_MEM, ··· 389 419 }; 390 420 391 421 static struct sh_timer_config tmu10_platform_data = { 392 - .name = "TMU10", 393 422 .channel_offset = 0x10, 394 423 .timer_bit = 1, 395 - .clk = "peripheral_clk", 396 424 }; 397 425 398 426 static struct resource tmu10_resources[] = { 399 427 [0] = { 400 - .name = "TMU10", 401 428 .start = 0xffde0014, 402 429 .end = 0xffde001f, 403 430 .flags = IORESOURCE_MEM, ··· 416 449 }; 417 450 418 451 static struct sh_timer_config tmu11_platform_data = { 419 - .name = "TMU11", 420 452 .channel_offset = 0x1c, 421 453 .timer_bit = 2, 422 - .clk = "peripheral_clk", 423 454 }; 424 455 425 456 static struct resource tmu11_resources[] = { 426 457 [0] = { 427 - .name = "TMU11", 428 458 .start = 0xffde0020, 429 459 .end = 0xffde002b, 430 460 .flags = IORESOURCE_MEM,
-18
arch/sh/kernel/cpu/sh4a/setup-shx3.c
··· 70 70 }; 71 71 72 72 static struct sh_timer_config tmu0_platform_data = { 73 - .name = "TMU0", 74 73 .channel_offset = 0x04, 75 74 .timer_bit = 0, 76 - .clk = "peripheral_clk", 77 75 .clockevent_rating = 200, 78 76 }; 79 77 80 78 static struct resource tmu0_resources[] = { 81 79 [0] = { 82 - .name = "TMU0", 83 80 .start = 0xffc10008, 84 81 .end = 0xffc10013, 85 82 .flags = IORESOURCE_MEM, ··· 98 101 }; 99 102 100 103 static struct sh_timer_config tmu1_platform_data = { 101 - .name = "TMU1", 102 104 .channel_offset = 0x10, 103 105 .timer_bit = 1, 104 - .clk = "peripheral_clk", 105 106 .clocksource_rating = 200, 106 107 }; 107 108 108 109 static struct resource tmu1_resources[] = { 109 110 [0] = { 110 - .name = "TMU1", 111 111 .start = 0xffc10014, 112 112 .end = 0xffc1001f, 113 113 .flags = IORESOURCE_MEM, ··· 126 132 }; 127 133 128 134 static struct sh_timer_config tmu2_platform_data = { 129 - .name = "TMU2", 130 135 .channel_offset = 0x1c, 131 136 .timer_bit = 2, 132 - .clk = "peripheral_clk", 133 137 }; 134 138 135 139 static struct resource tmu2_resources[] = { 136 140 [0] = { 137 - .name = "TMU2", 138 141 .start = 0xffc10020, 139 142 .end = 0xffc1002f, 140 143 .flags = IORESOURCE_MEM, ··· 153 162 }; 154 163 155 164 static struct sh_timer_config tmu3_platform_data = { 156 - .name = "TMU3", 157 165 .channel_offset = 0x04, 158 166 .timer_bit = 0, 159 - .clk = "peripheral_clk", 160 167 }; 161 168 162 169 static struct resource tmu3_resources[] = { 163 170 [0] = { 164 - .name = "TMU3", 165 171 .start = 0xffc20008, 166 172 .end = 0xffc20013, 167 173 .flags = IORESOURCE_MEM, ··· 180 192 }; 181 193 182 194 static struct sh_timer_config tmu4_platform_data = { 183 - .name = "TMU4", 184 195 .channel_offset = 0x10, 185 196 .timer_bit = 1, 186 - .clk = "peripheral_clk", 187 197 }; 188 198 189 199 static struct resource tmu4_resources[] = { 190 200 [0] = { 191 - .name = "TMU4", 192 201 .start = 0xffc20014, 193 202 .end = 0xffc2001f, 194 203 .flags = IORESOURCE_MEM, ··· 207 222 }; 208 223 209 224 static struct sh_timer_config tmu5_platform_data = { 210 - .name = "TMU5", 211 225 .channel_offset = 0x1c, 212 226 .timer_bit = 2, 213 - .clk = "peripheral_clk", 214 227 }; 215 228 216 229 static struct resource tmu5_resources[] = { 217 230 [0] = { 218 - .name = "TMU5", 219 231 .start = 0xffc20020, 220 232 .end = 0xffc2002b, 221 233 .flags = IORESOURCE_MEM,
-9
arch/sh/kernel/cpu/sh5/setup-sh5.c
··· 68 68 #define TMU2_BASE (TMU_BASE + 0x8 + (0xc * 0x2)) 69 69 70 70 static struct sh_timer_config tmu0_platform_data = { 71 - .name = "TMU0", 72 71 .channel_offset = 0x04, 73 72 .timer_bit = 0, 74 - .clk = "peripheral_clk", 75 73 .clockevent_rating = 200, 76 74 }; 77 75 78 76 static struct resource tmu0_resources[] = { 79 77 [0] = { 80 - .name = "TMU0", 81 78 .start = TMU0_BASE, 82 79 .end = TMU0_BASE + 0xc - 1, 83 80 .flags = IORESOURCE_MEM, ··· 96 99 }; 97 100 98 101 static struct sh_timer_config tmu1_platform_data = { 99 - .name = "TMU1", 100 102 .channel_offset = 0x10, 101 103 .timer_bit = 1, 102 - .clk = "peripheral_clk", 103 104 .clocksource_rating = 200, 104 105 }; 105 106 106 107 static struct resource tmu1_resources[] = { 107 108 [0] = { 108 - .name = "TMU1", 109 109 .start = TMU1_BASE, 110 110 .end = TMU1_BASE + 0xc - 1, 111 111 .flags = IORESOURCE_MEM, ··· 124 130 }; 125 131 126 132 static struct sh_timer_config tmu2_platform_data = { 127 - .name = "TMU2", 128 133 .channel_offset = 0x1c, 129 134 .timer_bit = 2, 130 - .clk = "peripheral_clk", 131 135 }; 132 136 133 137 static struct resource tmu2_resources[] = { 134 138 [0] = { 135 - .name = "TMU2", 136 139 .start = TMU2_BASE, 137 140 .end = TMU2_BASE + 0xc - 1, 138 141 .flags = IORESOURCE_MEM,
+20
drivers/base/platform.c
··· 1254 1254 } 1255 1255 1256 1256 if (match) { 1257 + /* 1258 + * Set up a sensible init_name to enable 1259 + * dev_name() and others to be used before the 1260 + * rest of the driver core is initialized. 1261 + */ 1262 + if (!match->dev.init_name) { 1263 + if (match->id != -1) 1264 + match->dev.init_name = 1265 + kasprintf(GFP_KERNEL, "%s.%d", 1266 + match->name, 1267 + match->id); 1268 + else 1269 + match->dev.init_name = 1270 + kasprintf(GFP_KERNEL, "%s", 1271 + match->name); 1272 + 1273 + if (!match->dev.init_name) 1274 + return -ENOMEM; 1275 + } 1276 + 1257 1277 if (epdrv->pdrv->probe(match)) 1258 1278 pr_warning("%s: unable to probe %s early.\n", 1259 1279 class_str, match->name);
+21 -21
drivers/clocksource/sh_cmt.c
··· 149 149 150 150 static int sh_cmt_enable(struct sh_cmt_priv *p, unsigned long *rate) 151 151 { 152 - struct sh_timer_config *cfg = p->pdev->dev.platform_data; 153 152 int ret; 154 153 155 154 /* enable clock */ 156 155 ret = clk_enable(p->clk); 157 156 if (ret) { 158 - pr_err("sh_cmt: cannot enable clock \"%s\"\n", cfg->clk); 157 + dev_err(&p->pdev->dev, "cannot enable clock\n"); 159 158 return ret; 160 159 } 161 160 ··· 277 278 delay = 1; 278 279 279 280 if (!delay) 280 - pr_warning("sh_cmt: too long delay\n"); 281 + dev_warn(&p->pdev->dev, "too long delay\n"); 281 282 282 283 } while (delay); 283 284 } ··· 287 288 unsigned long flags; 288 289 289 290 if (delta > p->max_match_value) 290 - pr_warning("sh_cmt: delta out of range\n"); 291 + dev_warn(&p->pdev->dev, "delta out of range\n"); 291 292 292 293 spin_lock_irqsave(&p->lock, flags); 293 294 p->next_match_value = delta; ··· 449 450 cs->resume = sh_cmt_clocksource_resume; 450 451 cs->mask = CLOCKSOURCE_MASK(sizeof(unsigned long) * 8); 451 452 cs->flags = CLOCK_SOURCE_IS_CONTINUOUS; 452 - pr_info("sh_cmt: %s used as clock source\n", cs->name); 453 + dev_info(&p->pdev->dev, "used as clock source\n"); 453 454 clocksource_register(cs); 454 455 return 0; 455 456 } ··· 495 496 496 497 switch (mode) { 497 498 case CLOCK_EVT_MODE_PERIODIC: 498 - pr_info("sh_cmt: %s used for periodic clock events\n", 499 - ced->name); 499 + dev_info(&p->pdev->dev, "used for periodic clock events\n"); 500 500 sh_cmt_clock_event_start(p, 1); 501 501 break; 502 502 case CLOCK_EVT_MODE_ONESHOT: 503 - pr_info("sh_cmt: %s used for oneshot clock events\n", 504 - ced->name); 503 + dev_info(&p->pdev->dev, "used for oneshot clock events\n"); 505 504 sh_cmt_clock_event_start(p, 0); 506 505 break; 507 506 case CLOCK_EVT_MODE_SHUTDOWN: ··· 540 543 ced->set_next_event = sh_cmt_clock_event_next; 541 544 ced->set_mode = sh_cmt_clock_event_mode; 542 545 543 - pr_info("sh_cmt: %s used for clock events\n", ced->name); 546 + dev_info(&p->pdev->dev, "used for clock events\n"); 544 547 clockevents_register_device(ced); 545 548 } 546 549 ··· 597 600 /* map memory, let mapbase point to our channel */ 598 601 p->mapbase = ioremap_nocache(res->start, resource_size(res)); 599 602 if (p->mapbase == NULL) { 600 - pr_err("sh_cmt: failed to remap I/O memory\n"); 603 + dev_err(&p->pdev->dev, "failed to remap I/O memory\n"); 601 604 goto err0; 602 605 } 603 606 604 607 /* request irq using setup_irq() (too early for request_irq()) */ 605 - p->irqaction.name = cfg->name; 608 + p->irqaction.name = dev_name(&p->pdev->dev); 606 609 p->irqaction.handler = sh_cmt_interrupt; 607 610 p->irqaction.dev_id = p; 608 611 p->irqaction.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL; 609 612 610 613 /* get hold of clock */ 611 - p->clk = clk_get(&p->pdev->dev, cfg->clk); 614 + p->clk = clk_get(&p->pdev->dev, "cmt_fck"); 612 615 if (IS_ERR(p->clk)) { 613 - pr_err("sh_cmt: cannot get clock \"%s\"\n", cfg->clk); 614 - ret = PTR_ERR(p->clk); 615 - goto err1; 616 + dev_warn(&p->pdev->dev, "using deprecated clock lookup\n"); 617 + p->clk = clk_get(&p->pdev->dev, cfg->clk); 618 + if (IS_ERR(p->clk)) { 619 + dev_err(&p->pdev->dev, "cannot get clock\n"); 620 + ret = PTR_ERR(p->clk); 621 + goto err1; 622 + } 616 623 } 617 624 618 625 if (resource_size(res) == 6) { ··· 629 628 p->clear_bits = ~0xc000; 630 629 } 631 630 632 - ret = sh_cmt_register(p, cfg->name, 631 + ret = sh_cmt_register(p, (char *)dev_name(&p->pdev->dev), 633 632 cfg->clockevent_rating, 634 633 cfg->clocksource_rating); 635 634 if (ret) { 636 - pr_err("sh_cmt: registration failed\n"); 635 + dev_err(&p->pdev->dev, "registration failed\n"); 637 636 goto err1; 638 637 } 639 638 640 639 ret = setup_irq(irq, &p->irqaction); 641 640 if (ret) { 642 - pr_err("sh_cmt: failed to request irq %d\n", irq); 641 + dev_err(&p->pdev->dev, "failed to request irq %d\n", irq); 643 642 goto err1; 644 643 } 645 644 ··· 654 653 static int __devinit sh_cmt_probe(struct platform_device *pdev) 655 654 { 656 655 struct sh_cmt_priv *p = platform_get_drvdata(pdev); 657 - struct sh_timer_config *cfg = pdev->dev.platform_data; 658 656 int ret; 659 657 660 658 if (p) { 661 - pr_info("sh_cmt: %s kept as earlytimer\n", cfg->name); 659 + dev_info(&pdev->dev, "kept as earlytimer\n"); 662 660 return 0; 663 661 } 664 662
+18 -16
drivers/clocksource/sh_mtu2.c
··· 118 118 119 119 static int sh_mtu2_enable(struct sh_mtu2_priv *p) 120 120 { 121 - struct sh_timer_config *cfg = p->pdev->dev.platform_data; 122 121 int ret; 123 122 124 123 /* enable clock */ 125 124 ret = clk_enable(p->clk); 126 125 if (ret) { 127 - pr_err("sh_mtu2: cannot enable clock \"%s\"\n", cfg->clk); 126 + dev_err(&p->pdev->dev, "cannot enable clock\n"); 128 127 return ret; 129 128 } 130 129 ··· 192 193 193 194 switch (mode) { 194 195 case CLOCK_EVT_MODE_PERIODIC: 195 - pr_info("sh_mtu2: %s used for periodic clock events\n", 196 - ced->name); 196 + dev_info(&p->pdev->dev, "used for periodic clock events\n"); 197 197 sh_mtu2_enable(p); 198 198 break; 199 199 case CLOCK_EVT_MODE_UNUSED: ··· 219 221 ced->cpumask = cpumask_of(0); 220 222 ced->set_mode = sh_mtu2_clock_event_mode; 221 223 222 - pr_info("sh_mtu2: %s used for clock events\n", ced->name); 224 + dev_info(&p->pdev->dev, "used for clock events\n"); 223 225 clockevents_register_device(ced); 224 226 225 227 ret = setup_irq(p->irqaction.irq, &p->irqaction); 226 228 if (ret) { 227 - pr_err("sh_mtu2: failed to request irq %d\n", 228 - p->irqaction.irq); 229 + dev_err(&p->pdev->dev, "failed to request irq %d\n", 230 + p->irqaction.irq); 229 231 return; 230 232 } 231 233 } ··· 271 273 /* map memory, let mapbase point to our channel */ 272 274 p->mapbase = ioremap_nocache(res->start, resource_size(res)); 273 275 if (p->mapbase == NULL) { 274 - pr_err("sh_mtu2: failed to remap I/O memory\n"); 276 + dev_err(&p->pdev->dev, "failed to remap I/O memory\n"); 275 277 goto err0; 276 278 } 277 279 278 280 /* setup data for setup_irq() (too early for request_irq()) */ 279 - p->irqaction.name = cfg->name; 281 + p->irqaction.name = dev_name(&p->pdev->dev); 280 282 p->irqaction.handler = sh_mtu2_interrupt; 281 283 p->irqaction.dev_id = p; 282 284 p->irqaction.irq = irq; 283 285 p->irqaction.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL; 284 286 285 287 /* get hold of clock */ 286 - p->clk = clk_get(&p->pdev->dev, cfg->clk); 288 + p->clk = clk_get(&p->pdev->dev, "mtu2_fck"); 287 289 if (IS_ERR(p->clk)) { 288 - pr_err("sh_mtu2: cannot get clock \"%s\"\n", cfg->clk); 289 - ret = PTR_ERR(p->clk); 290 - goto err1; 290 + dev_warn(&p->pdev->dev, "using deprecated clock lookup\n"); 291 + p->clk = clk_get(&p->pdev->dev, cfg->clk); 292 + if (IS_ERR(p->clk)) { 293 + dev_err(&p->pdev->dev, "cannot get clock\n"); 294 + ret = PTR_ERR(p->clk); 295 + goto err1; 296 + } 291 297 } 292 298 293 - return sh_mtu2_register(p, cfg->name, cfg->clockevent_rating); 299 + return sh_mtu2_register(p, (char *)dev_name(&p->pdev->dev), 300 + cfg->clockevent_rating); 294 301 err1: 295 302 iounmap(p->mapbase); 296 303 err0: ··· 305 302 static int __devinit sh_mtu2_probe(struct platform_device *pdev) 306 303 { 307 304 struct sh_mtu2_priv *p = platform_get_drvdata(pdev); 308 - struct sh_timer_config *cfg = pdev->dev.platform_data; 309 305 int ret; 310 306 311 307 if (p) { 312 - pr_info("sh_mtu2: %s kept as earlytimer\n", cfg->name); 308 + dev_info(&pdev->dev, "kept as earlytimer\n"); 313 309 return 0; 314 310 } 315 311
+19 -19
drivers/clocksource/sh_tmu.c
··· 106 106 107 107 static int sh_tmu_enable(struct sh_tmu_priv *p) 108 108 { 109 - struct sh_timer_config *cfg = p->pdev->dev.platform_data; 110 109 int ret; 111 110 112 111 /* enable clock */ 113 112 ret = clk_enable(p->clk); 114 113 if (ret) { 115 - pr_err("sh_tmu: cannot enable clock \"%s\"\n", cfg->clk); 114 + dev_err(&p->pdev->dev, "cannot enable clock\n"); 116 115 return ret; 117 116 } 118 117 ··· 227 228 cs->disable = sh_tmu_clocksource_disable; 228 229 cs->mask = CLOCKSOURCE_MASK(32); 229 230 cs->flags = CLOCK_SOURCE_IS_CONTINUOUS; 230 - pr_info("sh_tmu: %s used as clock source\n", cs->name); 231 + dev_info(&p->pdev->dev, "used as clock source\n"); 231 232 clocksource_register(cs); 232 233 return 0; 233 234 } ··· 275 276 276 277 switch (mode) { 277 278 case CLOCK_EVT_MODE_PERIODIC: 278 - pr_info("sh_tmu: %s used for periodic clock events\n", 279 - ced->name); 279 + dev_info(&p->pdev->dev, "used for periodic clock events\n"); 280 280 sh_tmu_clock_event_start(p, 1); 281 281 break; 282 282 case CLOCK_EVT_MODE_ONESHOT: 283 - pr_info("sh_tmu: %s used for oneshot clock events\n", 284 - ced->name); 283 + dev_info(&p->pdev->dev, "used for oneshot clock events\n"); 285 284 sh_tmu_clock_event_start(p, 0); 286 285 break; 287 286 case CLOCK_EVT_MODE_UNUSED: ··· 320 323 ced->set_next_event = sh_tmu_clock_event_next; 321 324 ced->set_mode = sh_tmu_clock_event_mode; 322 325 323 - pr_info("sh_tmu: %s used for clock events\n", ced->name); 326 + dev_info(&p->pdev->dev, "used for clock events\n"); 324 327 clockevents_register_device(ced); 325 328 326 329 ret = setup_irq(p->irqaction.irq, &p->irqaction); 327 330 if (ret) { 328 - pr_err("sh_tmu: failed to request irq %d\n", 329 - p->irqaction.irq); 331 + dev_err(&p->pdev->dev, "failed to request irq %d\n", 332 + p->irqaction.irq); 330 333 return; 331 334 } 332 335 } ··· 375 378 /* map memory, let mapbase point to our channel */ 376 379 p->mapbase = ioremap_nocache(res->start, resource_size(res)); 377 380 if (p->mapbase == NULL) { 378 - pr_err("sh_tmu: failed to remap I/O memory\n"); 381 + dev_err(&p->pdev->dev, "failed to remap I/O memory\n"); 379 382 goto err0; 380 383 } 381 384 382 385 /* setup data for setup_irq() (too early for request_irq()) */ 383 - p->irqaction.name = cfg->name; 386 + p->irqaction.name = dev_name(&p->pdev->dev); 384 387 p->irqaction.handler = sh_tmu_interrupt; 385 388 p->irqaction.dev_id = p; 386 389 p->irqaction.irq = irq; 387 390 p->irqaction.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL; 388 391 389 392 /* get hold of clock */ 390 - p->clk = clk_get(&p->pdev->dev, cfg->clk); 393 + p->clk = clk_get(&p->pdev->dev, "tmu_fck"); 391 394 if (IS_ERR(p->clk)) { 392 - pr_err("sh_tmu: cannot get clock \"%s\"\n", cfg->clk); 393 - ret = PTR_ERR(p->clk); 394 - goto err1; 395 + dev_warn(&p->pdev->dev, "using deprecated clock lookup\n"); 396 + p->clk = clk_get(&p->pdev->dev, cfg->clk); 397 + if (IS_ERR(p->clk)) { 398 + dev_err(&p->pdev->dev, "cannot get clock\n"); 399 + ret = PTR_ERR(p->clk); 400 + goto err1; 401 + } 395 402 } 396 403 397 - return sh_tmu_register(p, cfg->name, 404 + return sh_tmu_register(p, (char *)dev_name(&p->pdev->dev), 398 405 cfg->clockevent_rating, 399 406 cfg->clocksource_rating); 400 407 err1: ··· 410 409 static int __devinit sh_tmu_probe(struct platform_device *pdev) 411 410 { 412 411 struct sh_tmu_priv *p = platform_get_drvdata(pdev); 413 - struct sh_timer_config *cfg = pdev->dev.platform_data; 414 412 int ret; 415 413 416 414 if (p) { 417 - pr_info("sh_tmu: %s kept as earlytimer\n", cfg->name); 415 + dev_info(&pdev->dev, "kept as earlytimer\n"); 418 416 return 0; 419 417 } 420 418
+6 -7
drivers/dma/shdma.c
··· 25 25 #include <linux/dma-mapping.h> 26 26 #include <linux/platform_device.h> 27 27 #include <linux/pm_runtime.h> 28 - 29 - #include <asm/dmaengine.h> 28 + #include <linux/sh_dma.h> 30 29 31 30 #include "shdma.h" 32 31 ··· 43 44 #define LOG2_DEFAULT_XFER_SIZE 2 44 45 45 46 /* A bitmask with bits enough for enum sh_dmae_slave_chan_id */ 46 - static unsigned long sh_dmae_slave_used[BITS_TO_LONGS(SHDMA_SLAVE_NUMBER)]; 47 + static unsigned long sh_dmae_slave_used[BITS_TO_LONGS(SH_DMA_SLAVE_NUMBER)]; 47 48 48 49 static void sh_dmae_chan_ld_cleanup(struct sh_dmae_chan *sh_chan, bool all); 49 50 ··· 265 266 } 266 267 267 268 static struct sh_dmae_slave_config *sh_dmae_find_slave( 268 - struct sh_dmae_chan *sh_chan, enum sh_dmae_slave_chan_id slave_id) 269 + struct sh_dmae_chan *sh_chan, struct sh_dmae_slave *param) 269 270 { 270 271 struct dma_device *dma_dev = sh_chan->common.device; 271 272 struct sh_dmae_device *shdev = container_of(dma_dev, ··· 273 274 struct sh_dmae_pdata *pdata = shdev->pdata; 274 275 int i; 275 276 276 - if ((unsigned)slave_id >= SHDMA_SLAVE_NUMBER) 277 + if (param->slave_id >= SH_DMA_SLAVE_NUMBER) 277 278 return NULL; 278 279 279 280 for (i = 0; i < pdata->slave_num; i++) 280 - if (pdata->slave[i].slave_id == slave_id) 281 + if (pdata->slave[i].slave_id == param->slave_id) 281 282 return pdata->slave + i; 282 283 283 284 return NULL; ··· 298 299 if (param) { 299 300 struct sh_dmae_slave_config *cfg; 300 301 301 - cfg = sh_dmae_find_slave(sh_chan, param->slave_id); 302 + cfg = sh_dmae_find_slave(sh_chan, param); 302 303 if (!cfg) 303 304 return -EINVAL; 304 305
+2 -2
drivers/dma/shdma.h
··· 17 17 #include <linux/interrupt.h> 18 18 #include <linux/list.h> 19 19 20 - #include <asm/dmaengine.h> 21 - 20 + #define SH_DMAC_MAX_CHANNELS 6 21 + #define SH_DMA_SLAVE_NUMBER 256 22 22 #define SH_DMA_TCR_MAX 0x00FFFFFF /* 16MB */ 23 23 24 24 struct device;
+126 -63
drivers/serial/sh-sci.c
··· 82 82 83 83 /* Interface clock */ 84 84 struct clk *iclk; 85 - /* Data clock */ 86 - struct clk *dclk; 85 + /* Function clock */ 86 + struct clk *fclk; 87 87 88 88 struct list_head node; 89 89 struct dma_chan *chan_tx; 90 90 struct dma_chan *chan_rx; 91 91 #ifdef CONFIG_SERIAL_SH_SCI_DMA 92 92 struct device *dma_dev; 93 - enum sh_dmae_slave_chan_id slave_tx; 94 - enum sh_dmae_slave_chan_id slave_rx; 93 + unsigned int slave_tx; 94 + unsigned int slave_rx; 95 95 struct dma_async_tx_descriptor *desc_tx; 96 96 struct dma_async_tx_descriptor *desc_rx[2]; 97 97 dma_cookie_t cookie_tx; ··· 106 106 struct work_struct work_tx; 107 107 struct work_struct work_rx; 108 108 struct timer_list rx_timer; 109 + unsigned int rx_timeout; 109 110 #endif 110 111 }; 111 112 ··· 674 673 struct sci_port *s = to_sci_port(port); 675 674 676 675 if (s->chan_rx) { 677 - unsigned long tout; 678 676 u16 scr = sci_in(port, SCSCR); 679 677 u16 ssr = sci_in(port, SCxSR); 680 678 681 679 /* Disable future Rx interrupts */ 682 - sci_out(port, SCSCR, scr & ~SCI_CTRL_FLAGS_RIE); 680 + if (port->type == PORT_SCIFA) { 681 + disable_irq_nosync(irq); 682 + scr |= 0x4000; 683 + } else { 684 + scr &= ~SCI_CTRL_FLAGS_RIE; 685 + } 686 + sci_out(port, SCSCR, scr); 683 687 /* Clear current interrupt */ 684 688 sci_out(port, SCxSR, ssr & ~(1 | SCxSR_RDxF(port))); 685 - /* Calculate delay for 1.5 DMA buffers */ 686 - tout = (port->timeout - HZ / 50) * s->buf_len_rx * 3 / 687 - port->fifosize / 2; 688 - dev_dbg(port->dev, "Rx IRQ: setup timeout in %lu ms\n", 689 - tout * 1000 / HZ); 690 - if (tout < 2) 691 - tout = 2; 692 - mod_timer(&s->rx_timer, jiffies + tout); 689 + dev_dbg(port->dev, "Rx IRQ %lu: setup t-out in %u jiffies\n", 690 + jiffies, s->rx_timeout); 691 + mod_timer(&s->rx_timer, jiffies + s->rx_timeout); 693 692 694 693 return IRQ_HANDLED; 695 694 } ··· 799 798 (phase == CPUFREQ_RESUMECHANGE)) { 800 799 spin_lock_irqsave(&priv->lock, flags); 801 800 list_for_each_entry(sci_port, &priv->ports, node) 802 - sci_port->port.uartclk = clk_get_rate(sci_port->dclk); 801 + sci_port->port.uartclk = clk_get_rate(sci_port->iclk); 803 802 spin_unlock_irqrestore(&priv->lock, flags); 804 803 } 805 804 ··· 810 809 { 811 810 struct sci_port *sci_port = to_sci_port(port); 812 811 813 - clk_enable(sci_port->dclk); 814 - sci_port->port.uartclk = clk_get_rate(sci_port->dclk); 815 - 816 - if (sci_port->iclk) 817 - clk_enable(sci_port->iclk); 812 + clk_enable(sci_port->iclk); 813 + sci_port->port.uartclk = clk_get_rate(sci_port->iclk); 814 + clk_enable(sci_port->fclk); 818 815 } 819 816 820 817 static void sci_clk_disable(struct uart_port *port) 821 818 { 822 819 struct sci_port *sci_port = to_sci_port(port); 823 820 824 - if (sci_port->iclk) 825 - clk_disable(sci_port->iclk); 826 - 827 - clk_disable(sci_port->dclk); 821 + clk_disable(sci_port->fclk); 822 + clk_disable(sci_port->iclk); 828 823 } 829 824 830 825 static int sci_request_irq(struct sci_port *port) ··· 909 912 910 913 spin_lock_irqsave(&port->lock, flags); 911 914 912 - xmit->tail += s->sg_tx.length; 915 + xmit->tail += sg_dma_len(&s->sg_tx); 913 916 xmit->tail &= UART_XMIT_SIZE - 1; 914 917 915 - port->icount.tx += s->sg_tx.length; 918 + port->icount.tx += sg_dma_len(&s->sg_tx); 916 919 917 920 async_tx_ack(s->desc_tx); 918 921 s->cookie_tx = -EINVAL; 919 922 s->desc_tx = NULL; 920 923 921 - spin_unlock_irqrestore(&port->lock, flags); 922 - 923 924 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) 924 925 uart_write_wakeup(port); 925 926 926 - if (uart_circ_chars_pending(xmit)) 927 + if (!uart_circ_empty(xmit)) { 927 928 schedule_work(&s->work_tx); 929 + } else if (port->type == PORT_SCIFA) { 930 + u16 ctrl = sci_in(port, SCSCR); 931 + sci_out(port, SCSCR, ctrl & ~SCI_CTRL_FLAGS_TIE); 932 + } 933 + 934 + spin_unlock_irqrestore(&port->lock, flags); 928 935 } 929 936 930 937 /* Locking: called with port lock held */ ··· 972 971 unsigned long flags; 973 972 int count; 974 973 975 - dev_dbg(port->dev, "%s(%d)\n", __func__, port->line); 974 + dev_dbg(port->dev, "%s(%d) active #%d\n", __func__, port->line, s->active_rx); 976 975 977 976 spin_lock_irqsave(&port->lock, flags); 978 977 979 978 count = sci_dma_rx_push(s, tty, s->buf_len_rx); 980 979 981 - mod_timer(&s->rx_timer, jiffies + msecs_to_jiffies(5)); 980 + mod_timer(&s->rx_timer, jiffies + s->rx_timeout); 982 981 983 982 spin_unlock_irqrestore(&port->lock, flags); 984 983 ··· 1050 1049 sci_rx_dma_release(s, true); 1051 1050 return; 1052 1051 } 1052 + dev_dbg(s->port.dev, "%s(): cookie %d to #%d\n", __func__, 1053 + s->cookie_rx[i], i); 1053 1054 } 1054 1055 1055 1056 s->active_rx = s->cookie_rx[0]; ··· 1109 1106 return; 1110 1107 } 1111 1108 1112 - dev_dbg(port->dev, "%s: cookie %d #%d\n", __func__, 1113 - s->cookie_rx[new], new); 1114 - 1115 1109 s->active_rx = s->cookie_rx[!new]; 1110 + 1111 + dev_dbg(port->dev, "%s: cookie %d #%d, new active #%d\n", __func__, 1112 + s->cookie_rx[new], new, s->active_rx); 1116 1113 } 1117 1114 1118 1115 static void work_fn_tx(struct work_struct *work) ··· 1133 1130 */ 1134 1131 spin_lock_irq(&port->lock); 1135 1132 sg->offset = xmit->tail & (UART_XMIT_SIZE - 1); 1136 - sg->dma_address = (sg_dma_address(sg) & ~(UART_XMIT_SIZE - 1)) + 1133 + sg_dma_address(sg) = (sg_dma_address(sg) & ~(UART_XMIT_SIZE - 1)) + 1137 1134 sg->offset; 1138 - sg->length = min((int)CIRC_CNT(xmit->head, xmit->tail, UART_XMIT_SIZE), 1135 + sg_dma_len(sg) = min((int)CIRC_CNT(xmit->head, xmit->tail, UART_XMIT_SIZE), 1139 1136 CIRC_CNT_TO_END(xmit->head, xmit->tail, UART_XMIT_SIZE)); 1140 - sg->dma_length = sg->length; 1141 1137 spin_unlock_irq(&port->lock); 1142 1138 1143 - BUG_ON(!sg->length); 1139 + BUG_ON(!sg_dma_len(sg)); 1144 1140 1145 1141 desc = chan->device->device_prep_slave_sg(chan, 1146 1142 sg, s->sg_len_tx, DMA_TO_DEVICE, ··· 1174 1172 1175 1173 static void sci_start_tx(struct uart_port *port) 1176 1174 { 1175 + struct sci_port *s = to_sci_port(port); 1177 1176 unsigned short ctrl; 1178 1177 1179 1178 #ifdef CONFIG_SERIAL_SH_SCI_DMA 1180 - struct sci_port *s = to_sci_port(port); 1181 - 1182 - if (s->chan_tx) { 1183 - if (!uart_circ_empty(&s->port.state->xmit) && s->cookie_tx < 0) 1184 - schedule_work(&s->work_tx); 1185 - 1186 - return; 1179 + if (port->type == PORT_SCIFA) { 1180 + u16 new, scr = sci_in(port, SCSCR); 1181 + if (s->chan_tx) 1182 + new = scr | 0x8000; 1183 + else 1184 + new = scr & ~0x8000; 1185 + if (new != scr) 1186 + sci_out(port, SCSCR, new); 1187 1187 } 1188 + if (s->chan_tx && !uart_circ_empty(&s->port.state->xmit) && 1189 + s->cookie_tx < 0) 1190 + schedule_work(&s->work_tx); 1188 1191 #endif 1189 - 1190 - /* Set TIE (Transmit Interrupt Enable) bit in SCSCR */ 1191 - ctrl = sci_in(port, SCSCR); 1192 - ctrl |= SCI_CTRL_FLAGS_TIE; 1193 - sci_out(port, SCSCR, ctrl); 1192 + if (!s->chan_tx || port->type == PORT_SCIFA) { 1193 + /* Set TIE (Transmit Interrupt Enable) bit in SCSCR */ 1194 + ctrl = sci_in(port, SCSCR); 1195 + sci_out(port, SCSCR, ctrl | SCI_CTRL_FLAGS_TIE); 1196 + } 1194 1197 } 1195 1198 1196 1199 static void sci_stop_tx(struct uart_port *port) ··· 1204 1197 1205 1198 /* Clear TIE (Transmit Interrupt Enable) bit in SCSCR */ 1206 1199 ctrl = sci_in(port, SCSCR); 1200 + if (port->type == PORT_SCIFA) 1201 + ctrl &= ~0x8000; 1207 1202 ctrl &= ~SCI_CTRL_FLAGS_TIE; 1208 1203 sci_out(port, SCSCR, ctrl); 1209 1204 } ··· 1216 1207 1217 1208 /* Set RIE (Receive Interrupt Enable) bit in SCSCR */ 1218 1209 ctrl |= sci_in(port, SCSCR); 1210 + if (port->type == PORT_SCIFA) 1211 + ctrl &= ~0x4000; 1219 1212 sci_out(port, SCSCR, ctrl); 1220 1213 } 1221 1214 ··· 1227 1216 1228 1217 /* Clear RIE (Receive Interrupt Enable) bit in SCSCR */ 1229 1218 ctrl = sci_in(port, SCSCR); 1219 + if (port->type == PORT_SCIFA) 1220 + ctrl &= ~0x4000; 1230 1221 ctrl &= ~(SCI_CTRL_FLAGS_RIE | SCI_CTRL_FLAGS_REIE); 1231 1222 sci_out(port, SCSCR, ctrl); 1232 1223 } ··· 1263 1250 { 1264 1251 struct sci_port *s = (struct sci_port *)arg; 1265 1252 struct uart_port *port = &s->port; 1266 - 1267 1253 u16 scr = sci_in(port, SCSCR); 1254 + 1255 + if (port->type == PORT_SCIFA) { 1256 + scr &= ~0x4000; 1257 + enable_irq(s->irqs[1]); 1258 + } 1268 1259 sci_out(port, SCSCR, scr | SCI_CTRL_FLAGS_RIE); 1269 1260 dev_dbg(port->dev, "DMA Rx timed out\n"); 1270 1261 schedule_work(&s->work_rx); ··· 1355 1338 sg_init_table(sg, 1); 1356 1339 sg_set_page(sg, virt_to_page(buf[i]), s->buf_len_rx, 1357 1340 (int)buf[i] & ~PAGE_MASK); 1358 - sg->dma_address = dma[i]; 1359 - sg->dma_length = sg->length; 1341 + sg_dma_address(sg) = dma[i]; 1360 1342 } 1361 1343 1362 1344 INIT_WORK(&s->work_rx, work_fn_rx); ··· 1418 1402 static void sci_set_termios(struct uart_port *port, struct ktermios *termios, 1419 1403 struct ktermios *old) 1420 1404 { 1405 + #ifdef CONFIG_SERIAL_SH_SCI_DMA 1406 + struct sci_port *s = to_sci_port(port); 1407 + #endif 1421 1408 unsigned int status, baud, smr_val, max_baud; 1422 1409 int t = -1; 1410 + u16 scfcr = 0; 1423 1411 1424 1412 /* 1425 1413 * earlyprintk comes here early on with port->uartclk set to zero. ··· 1446 1426 sci_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */ 1447 1427 1448 1428 if (port->type != PORT_SCI) 1449 - sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST); 1429 + sci_out(port, SCFCR, scfcr | SCFCR_RFRST | SCFCR_TFRST); 1450 1430 1451 1431 smr_val = sci_in(port, SCSMR) & 3; 1452 1432 if ((termios->c_cflag & CSIZE) == CS7) ··· 1477 1457 } 1478 1458 1479 1459 sci_init_pins(port, termios->c_cflag); 1480 - sci_out(port, SCFCR, (termios->c_cflag & CRTSCTS) ? SCFCR_MCE : 0); 1460 + sci_out(port, SCFCR, scfcr | ((termios->c_cflag & CRTSCTS) ? SCFCR_MCE : 0)); 1481 1461 1482 1462 sci_out(port, SCSCR, SCSCR_INIT(port)); 1463 + 1464 + #ifdef CONFIG_SERIAL_SH_SCI_DMA 1465 + /* 1466 + * Calculate delay for 1.5 DMA buffers: see 1467 + * drivers/serial/serial_core.c::uart_update_timeout(). With 10 bits 1468 + * (CS8), 250Hz, 115200 baud and 64 bytes FIFO, the above function 1469 + * calculates 1 jiffie for the data plus 5 jiffies for the "slop(e)." 1470 + * Then below we calculate 3 jiffies (12ms) for 1.5 DMA buffers (3 FIFO 1471 + * sizes), but it has been found out experimentally, that this is not 1472 + * enough: the driver too often needlessly runs on a DMA timeout. 20ms 1473 + * as a minimum seem to work perfectly. 1474 + */ 1475 + if (s->chan_rx) { 1476 + s->rx_timeout = (port->timeout - HZ / 50) * s->buf_len_rx * 3 / 1477 + port->fifosize / 2; 1478 + dev_dbg(port->dev, 1479 + "DMA Rx t-out %ums, tty t-out %u jiffies\n", 1480 + s->rx_timeout * 1000 / HZ, port->timeout); 1481 + if (s->rx_timeout < msecs_to_jiffies(20)) 1482 + s->rx_timeout = msecs_to_jiffies(20); 1483 + } 1484 + #endif 1483 1485 1484 1486 if ((termios->c_cflag & CREAD) != 0) 1485 1487 sci_start_rx(port); ··· 1594 1552 #endif 1595 1553 }; 1596 1554 1597 - static void __devinit sci_init_single(struct platform_device *dev, 1598 - struct sci_port *sci_port, 1599 - unsigned int index, 1600 - struct plat_sci_port *p) 1555 + static int __devinit sci_init_single(struct platform_device *dev, 1556 + struct sci_port *sci_port, 1557 + unsigned int index, 1558 + struct plat_sci_port *p) 1601 1559 { 1602 1560 struct uart_port *port = &sci_port->port; 1603 1561 ··· 1618 1576 } 1619 1577 1620 1578 if (dev) { 1621 - sci_port->iclk = p->clk ? clk_get(&dev->dev, p->clk) : NULL; 1622 - sci_port->dclk = clk_get(&dev->dev, "peripheral_clk"); 1579 + sci_port->iclk = clk_get(&dev->dev, "sci_ick"); 1580 + if (IS_ERR(sci_port->iclk)) { 1581 + sci_port->iclk = clk_get(&dev->dev, "peripheral_clk"); 1582 + if (IS_ERR(sci_port->iclk)) { 1583 + dev_err(&dev->dev, "can't get iclk\n"); 1584 + return PTR_ERR(sci_port->iclk); 1585 + } 1586 + } 1587 + 1588 + /* 1589 + * The function clock is optional, ignore it if we can't 1590 + * find it. 1591 + */ 1592 + sci_port->fclk = clk_get(&dev->dev, "sci_fck"); 1593 + if (IS_ERR(sci_port->fclk)) 1594 + sci_port->fclk = NULL; 1595 + 1623 1596 sci_port->enable = sci_clk_enable; 1624 1597 sci_port->disable = sci_clk_disable; 1625 1598 port->dev = &dev->dev; ··· 1661 1604 #endif 1662 1605 1663 1606 memcpy(&sci_port->irqs, &p->irqs, sizeof(p->irqs)); 1607 + return 0; 1664 1608 } 1665 1609 1666 1610 #ifdef CONFIG_SERIAL_SH_SCI_CONSOLE ··· 1811 1753 cpufreq_unregister_notifier(&priv->clk_nb, CPUFREQ_TRANSITION_NOTIFIER); 1812 1754 1813 1755 spin_lock_irqsave(&priv->lock, flags); 1814 - list_for_each_entry(p, &priv->ports, node) 1756 + list_for_each_entry(p, &priv->ports, node) { 1815 1757 uart_remove_one_port(&sci_uart_driver, &p->port); 1758 + clk_put(p->iclk); 1759 + clk_put(p->fclk); 1760 + } 1816 1761 spin_unlock_irqrestore(&priv->lock, flags); 1817 1762 1818 1763 kfree(priv); ··· 1841 1780 return 0; 1842 1781 } 1843 1782 1844 - sci_init_single(dev, sciport, index, p); 1783 + ret = sci_init_single(dev, sciport, index, p); 1784 + if (ret) 1785 + return ret; 1845 1786 1846 1787 ret = uart_add_one_port(&sci_uart_driver, &sciport->port); 1847 1788 if (ret)
+93 -2
drivers/sh/intc.c
··· 44 44 unsigned long handle; 45 45 }; 46 46 47 + struct intc_window { 48 + phys_addr_t phys; 49 + void __iomem *virt; 50 + unsigned long size; 51 + }; 52 + 47 53 struct intc_desc_int { 48 54 struct list_head list; 49 55 struct sys_device sysdev; ··· 63 57 unsigned int nr_prio; 64 58 struct intc_handle_int *sense; 65 59 unsigned int nr_sense; 60 + struct intc_window *window; 61 + unsigned int nr_windows; 66 62 struct irq_chip chip; 67 63 }; 68 64 ··· 454 446 return 0; 455 447 } 456 448 449 + static unsigned long intc_phys_to_virt(struct intc_desc_int *d, 450 + unsigned long address) 451 + { 452 + struct intc_window *window; 453 + int k; 454 + 455 + /* scan through physical windows and convert address */ 456 + for (k = 0; k < d->nr_windows; k++) { 457 + window = d->window + k; 458 + 459 + if (address < window->phys) 460 + continue; 461 + 462 + if (address >= (window->phys + window->size)) 463 + continue; 464 + 465 + address -= window->phys; 466 + address += (unsigned long)window->virt; 467 + 468 + return address; 469 + } 470 + 471 + /* no windows defined, register must be 1:1 mapped virt:phys */ 472 + return address; 473 + } 474 + 457 475 static unsigned int __init intc_get_reg(struct intc_desc_int *d, 458 - unsigned long address) 476 + unsigned long address) 459 477 { 460 478 unsigned int k; 479 + 480 + address = intc_phys_to_virt(d, address); 461 481 462 482 for (k = 0; k < d->nr_reg; k++) { 463 483 if (d->reg[k] == address) ··· 836 800 unsigned int smp) 837 801 { 838 802 if (value) { 803 + value = intc_phys_to_virt(d, value); 804 + 839 805 d->reg[cnt] = value; 840 806 #ifdef CONFIG_SMP 841 807 d->smp[cnt] = smp; ··· 853 815 generic_handle_irq((unsigned int)get_irq_data(irq)); 854 816 } 855 817 856 - void __init register_intc_controller(struct intc_desc *desc) 818 + int __init register_intc_controller(struct intc_desc *desc) 857 819 { 858 820 unsigned int i, k, smp; 859 821 struct intc_hw_desc *hw = &desc->hw; 860 822 struct intc_desc_int *d; 823 + struct resource *res; 861 824 862 825 d = kzalloc(sizeof(*d), GFP_NOWAIT); 826 + if (!d) 827 + goto err0; 863 828 864 829 INIT_LIST_HEAD(&d->list); 865 830 list_add(&d->list, &intc_list); 831 + 832 + if (desc->num_resources) { 833 + d->nr_windows = desc->num_resources; 834 + d->window = kzalloc(d->nr_windows * sizeof(*d->window), 835 + GFP_NOWAIT); 836 + if (!d->window) 837 + goto err1; 838 + 839 + for (k = 0; k < d->nr_windows; k++) { 840 + res = desc->resource + k; 841 + WARN_ON(resource_type(res) != IORESOURCE_MEM); 842 + d->window[k].phys = res->start; 843 + d->window[k].size = resource_size(res); 844 + d->window[k].virt = ioremap_nocache(res->start, 845 + resource_size(res)); 846 + if (!d->window[k].virt) 847 + goto err2; 848 + } 849 + } 866 850 867 851 d->nr_reg = hw->mask_regs ? hw->nr_mask_regs * 2 : 0; 868 852 d->nr_reg += hw->prio_regs ? hw->nr_prio_regs * 2 : 0; ··· 892 832 d->nr_reg += hw->ack_regs ? hw->nr_ack_regs : 0; 893 833 894 834 d->reg = kzalloc(d->nr_reg * sizeof(*d->reg), GFP_NOWAIT); 835 + if (!d->reg) 836 + goto err2; 837 + 895 838 #ifdef CONFIG_SMP 896 839 d->smp = kzalloc(d->nr_reg * sizeof(*d->smp), GFP_NOWAIT); 840 + if (!d->smp) 841 + goto err3; 897 842 #endif 898 843 k = 0; 899 844 ··· 913 848 if (hw->prio_regs) { 914 849 d->prio = kzalloc(hw->nr_vectors * sizeof(*d->prio), 915 850 GFP_NOWAIT); 851 + if (!d->prio) 852 + goto err4; 916 853 917 854 for (i = 0; i < hw->nr_prio_regs; i++) { 918 855 smp = IS_SMP(hw->prio_regs[i]); ··· 926 859 if (hw->sense_regs) { 927 860 d->sense = kzalloc(hw->nr_vectors * sizeof(*d->sense), 928 861 GFP_NOWAIT); 862 + if (!d->sense) 863 + goto err5; 929 864 930 865 for (i = 0; i < hw->nr_sense_regs; i++) 931 866 k += save_reg(d, k, hw->sense_regs[i].reg, 0); ··· 1010 941 /* enable bits matching force_enable after registering irqs */ 1011 942 if (desc->force_enable) 1012 943 intc_enable_disable_enum(desc, d, desc->force_enable, 1); 944 + 945 + return 0; 946 + err5: 947 + kfree(d->prio); 948 + err4: 949 + #ifdef CONFIG_SMP 950 + kfree(d->smp); 951 + err3: 952 + #endif 953 + kfree(d->reg); 954 + err2: 955 + for (k = 0; k < d->nr_windows; k++) 956 + if (d->window[k].virt) 957 + iounmap(d->window[k].virt); 958 + 959 + kfree(d->window); 960 + err1: 961 + kfree(d); 962 + err0: 963 + pr_err("unable to allocate INTC memory\n"); 964 + 965 + return -ENOMEM; 1013 966 } 1014 967 1015 968 static int intc_suspend(struct sys_device *dev, pm_message_t state)
+4
include/linux/device.h
··· 451 451 452 452 static inline const char *dev_name(const struct device *dev) 453 453 { 454 + /* Use the init name until the kobject becomes available */ 455 + if (dev->init_name) 456 + return dev->init_name; 457 + 454 458 return kobject_name(&dev->kobj); 455 459 } 456 460
+2 -2
include/linux/serial_sci.h
··· 33 33 char *clk; /* clock string */ 34 34 struct device *dma_dev; 35 35 #ifdef CONFIG_SERIAL_SH_SCI_DMA 36 - enum sh_dmae_slave_chan_id dma_slave_tx; 37 - enum sh_dmae_slave_chan_id dma_slave_rx; 36 + unsigned int dma_slave_tx; 37 + unsigned int dma_slave_rx; 38 38 #endif 39 39 }; 40 40
+101
include/linux/sh_dma.h
··· 1 + /* 2 + * Header for the new SH dmaengine driver 3 + * 4 + * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de> 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + #ifndef SH_DMA_H 11 + #define SH_DMA_H 12 + 13 + #include <linux/list.h> 14 + #include <linux/dmaengine.h> 15 + 16 + /* Used by slave DMA clients to request DMA to/from a specific peripheral */ 17 + struct sh_dmae_slave { 18 + unsigned int slave_id; /* Set by the platform */ 19 + struct device *dma_dev; /* Set by the platform */ 20 + struct sh_dmae_slave_config *config; /* Set by the driver */ 21 + }; 22 + 23 + struct sh_dmae_regs { 24 + u32 sar; /* SAR / source address */ 25 + u32 dar; /* DAR / destination address */ 26 + u32 tcr; /* TCR / transfer count */ 27 + }; 28 + 29 + struct sh_desc { 30 + struct sh_dmae_regs hw; 31 + struct list_head node; 32 + struct dma_async_tx_descriptor async_tx; 33 + enum dma_data_direction direction; 34 + dma_cookie_t cookie; 35 + size_t partial; 36 + int chunks; 37 + int mark; 38 + }; 39 + struct sh_dmae_slave_config { 40 + unsigned int slave_id; 41 + dma_addr_t addr; 42 + u32 chcr; 43 + char mid_rid; 44 + }; 45 + 46 + struct sh_dmae_channel { 47 + unsigned int offset; 48 + unsigned int dmars; 49 + unsigned int dmars_bit; 50 + }; 51 + 52 + struct sh_dmae_pdata { 53 + struct sh_dmae_slave_config *slave; 54 + int slave_num; 55 + struct sh_dmae_channel *channel; 56 + int channel_num; 57 + unsigned int ts_low_shift; 58 + unsigned int ts_low_mask; 59 + unsigned int ts_high_shift; 60 + unsigned int ts_high_mask; 61 + unsigned int *ts_shift; 62 + int ts_shift_num; 63 + u16 dmaor_init; 64 + }; 65 + 66 + /* DMA register */ 67 + #define SAR 0x00 68 + #define DAR 0x04 69 + #define TCR 0x08 70 + #define CHCR 0x0C 71 + #define DMAOR 0x40 72 + 73 + /* DMAOR definitions */ 74 + #define DMAOR_AE 0x00000004 75 + #define DMAOR_NMIF 0x00000002 76 + #define DMAOR_DME 0x00000001 77 + 78 + /* Definitions for the SuperH DMAC */ 79 + #define REQ_L 0x00000000 80 + #define REQ_E 0x00080000 81 + #define RACK_H 0x00000000 82 + #define RACK_L 0x00040000 83 + #define ACK_R 0x00000000 84 + #define ACK_W 0x00020000 85 + #define ACK_H 0x00000000 86 + #define ACK_L 0x00010000 87 + #define DM_INC 0x00004000 88 + #define DM_DEC 0x00008000 89 + #define DM_FIX 0x0000c000 90 + #define SM_INC 0x00001000 91 + #define SM_DEC 0x00002000 92 + #define SM_FIX 0x00003000 93 + #define RS_IN 0x00000200 94 + #define RS_OUT 0x00000300 95 + #define TS_BLK 0x00000040 96 + #define TM_BUR 0x00000020 97 + #define CHCR_DE 0x00000001 98 + #define CHCR_TE 0x00000002 99 + #define CHCR_IE 0x00000004 100 + 101 + #endif
+5 -1
include/linux/sh_intc.h
··· 1 1 #ifndef __SH_INTC_H 2 2 #define __SH_INTC_H 3 3 4 + #include <linux/ioport.h> 5 + 4 6 typedef unsigned char intc_enum; 5 7 6 8 struct intc_vect { ··· 73 71 74 72 struct intc_desc { 75 73 char *name; 74 + struct resource *resource; 75 + unsigned int num_resources; 76 76 intc_enum force_enable; 77 77 intc_enum force_disable; 78 78 struct intc_hw_desc hw; ··· 96 92 prio_regs, sense_regs, ack_regs), \ 97 93 } 98 94 99 - void __init register_intc_controller(struct intc_desc *desc); 95 + int __init register_intc_controller(struct intc_desc *desc); 100 96 int intc_set_priority(unsigned int irq, unsigned int prio); 101 97 102 98 int reserve_irq_vector(unsigned int irq);