diff options
author | Andrew Lunn <andrew@lunn.ch> | 2012-04-06 11:17:26 -0400 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2012-05-08 19:33:55 -0400 |
commit | 4574b886698dfad6209102fed6136622b5fe1c21 (patch) | |
tree | 2f1deee540c68261f4531d09337a19a130a7ea45 /arch/arm/plat-orion | |
parent | 2f129bf4aab684bef1e82e747b709a5025ecb698 (diff) |
ARM: Orion: SPI: Add clk/clkdev support.
Remove now redundant tclk from SPI platform data. This makes the platform
data empty, so remove it.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'arch/arm/plat-orion')
-rw-r--r-- | arch/arm/plat-orion/common.c | 38 | ||||
-rw-r--r-- | arch/arm/plat-orion/include/plat/common.h | 11 |
2 files changed, 30 insertions, 19 deletions
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c index 4fdd2e7e74a1..bbe50a948710 100644 --- a/arch/arm/plat-orion/common.c +++ b/arch/arm/plat-orion/common.c | |||
@@ -19,12 +19,32 @@ | |||
19 | #include <linux/mv643xx_eth.h> | 19 | #include <linux/mv643xx_eth.h> |
20 | #include <linux/mv643xx_i2c.h> | 20 | #include <linux/mv643xx_i2c.h> |
21 | #include <net/dsa.h> | 21 | #include <net/dsa.h> |
22 | #include <linux/spi/orion_spi.h> | ||
23 | #include <plat/orion_wdt.h> | 22 | #include <plat/orion_wdt.h> |
24 | #include <plat/mv_xor.h> | 23 | #include <plat/mv_xor.h> |
25 | #include <plat/ehci-orion.h> | 24 | #include <plat/ehci-orion.h> |
26 | #include <mach/bridge-regs.h> | 25 | #include <mach/bridge-regs.h> |
27 | 26 | ||
27 | /* Create a clkdev entry for a given device/clk */ | ||
28 | void __init orion_clkdev_add(const char *con_id, const char *dev_id, | ||
29 | struct clk *clk) | ||
30 | { | ||
31 | struct clk_lookup *cl; | ||
32 | |||
33 | cl = clkdev_alloc(clk, con_id, dev_id); | ||
34 | if (cl) | ||
35 | clkdev_add(cl); | ||
36 | } | ||
37 | |||
38 | /* Create clkdev entries for all orion platforms except kirkwood. | ||
39 | Kirkwood has gated clocks for some of its peripherals, so creates | ||
40 | its own clkdev entries. For all the other orion devices, create | ||
41 | clkdev entries to the tclk. */ | ||
42 | void __init orion_clkdev_init(struct clk *tclk) | ||
43 | { | ||
44 | orion_clkdev_add(NULL, "orion_spi.0", tclk); | ||
45 | orion_clkdev_add(NULL, "orion_spi.1", tclk); | ||
46 | } | ||
47 | |||
28 | /* Fill in the resources structure and link it into the platform | 48 | /* Fill in the resources structure and link it into the platform |
29 | device structure. There is always a memory region, and nearly | 49 | device structure. There is always a memory region, and nearly |
30 | always an interrupt.*/ | 50 | always an interrupt.*/ |
@@ -523,44 +543,32 @@ void __init orion_i2c_1_init(unsigned long mapbase, | |||
523 | /***************************************************************************** | 543 | /***************************************************************************** |
524 | * SPI | 544 | * SPI |
525 | ****************************************************************************/ | 545 | ****************************************************************************/ |
526 | static struct orion_spi_info orion_spi_plat_data; | ||
527 | static struct resource orion_spi_resources; | 546 | static struct resource orion_spi_resources; |
528 | 547 | ||
529 | static struct platform_device orion_spi = { | 548 | static struct platform_device orion_spi = { |
530 | .name = "orion_spi", | 549 | .name = "orion_spi", |
531 | .id = 0, | 550 | .id = 0, |
532 | .dev = { | ||
533 | .platform_data = &orion_spi_plat_data, | ||
534 | }, | ||
535 | }; | 551 | }; |
536 | 552 | ||
537 | static struct orion_spi_info orion_spi_1_plat_data; | ||
538 | static struct resource orion_spi_1_resources; | 553 | static struct resource orion_spi_1_resources; |
539 | 554 | ||
540 | static struct platform_device orion_spi_1 = { | 555 | static struct platform_device orion_spi_1 = { |
541 | .name = "orion_spi", | 556 | .name = "orion_spi", |
542 | .id = 1, | 557 | .id = 1, |
543 | .dev = { | ||
544 | .platform_data = &orion_spi_1_plat_data, | ||
545 | }, | ||
546 | }; | 558 | }; |
547 | 559 | ||
548 | /* Note: The SPI silicon core does have interrupts. However the | 560 | /* Note: The SPI silicon core does have interrupts. However the |
549 | * current Linux software driver does not use interrupts. */ | 561 | * current Linux software driver does not use interrupts. */ |
550 | 562 | ||
551 | void __init orion_spi_init(unsigned long mapbase, | 563 | void __init orion_spi_init(unsigned long mapbase) |
552 | unsigned long tclk) | ||
553 | { | 564 | { |
554 | orion_spi_plat_data.tclk = tclk; | ||
555 | fill_resources(&orion_spi, &orion_spi_resources, | 565 | fill_resources(&orion_spi, &orion_spi_resources, |
556 | mapbase, SZ_512 - 1, NO_IRQ); | 566 | mapbase, SZ_512 - 1, NO_IRQ); |
557 | platform_device_register(&orion_spi); | 567 | platform_device_register(&orion_spi); |
558 | } | 568 | } |
559 | 569 | ||
560 | void __init orion_spi_1_init(unsigned long mapbase, | 570 | void __init orion_spi_1_init(unsigned long mapbase) |
561 | unsigned long tclk) | ||
562 | { | 571 | { |
563 | orion_spi_1_plat_data.tclk = tclk; | ||
564 | fill_resources(&orion_spi_1, &orion_spi_1_resources, | 572 | fill_resources(&orion_spi_1, &orion_spi_1_resources, |
565 | mapbase, SZ_512 - 1, NO_IRQ); | 573 | mapbase, SZ_512 - 1, NO_IRQ); |
566 | platform_device_register(&orion_spi_1); | 574 | platform_device_register(&orion_spi_1); |
diff --git a/arch/arm/plat-orion/include/plat/common.h b/arch/arm/plat-orion/include/plat/common.h index a7fa005a5a0e..d188a1aa6f56 100644 --- a/arch/arm/plat-orion/include/plat/common.h +++ b/arch/arm/plat-orion/include/plat/common.h | |||
@@ -70,11 +70,9 @@ void __init orion_i2c_1_init(unsigned long mapbase, | |||
70 | unsigned long irq, | 70 | unsigned long irq, |
71 | unsigned long freq_m); | 71 | unsigned long freq_m); |
72 | 72 | ||
73 | void __init orion_spi_init(unsigned long mapbase, | 73 | void __init orion_spi_init(unsigned long mapbase); |
74 | unsigned long tclk); | ||
75 | 74 | ||
76 | void __init orion_spi_1_init(unsigned long mapbase, | 75 | void __init orion_spi_1_init(unsigned long mapbase); |
77 | unsigned long tclk); | ||
78 | 76 | ||
79 | void __init orion_wdt_init(unsigned long tclk); | 77 | void __init orion_wdt_init(unsigned long tclk); |
80 | 78 | ||
@@ -106,4 +104,9 @@ void __init orion_crypto_init(unsigned long mapbase, | |||
106 | unsigned long srambase, | 104 | unsigned long srambase, |
107 | unsigned long sram_size, | 105 | unsigned long sram_size, |
108 | unsigned long irq); | 106 | unsigned long irq); |
107 | |||
108 | void __init orion_clkdev_add(const char *con_id, const char *dev_id, | ||
109 | struct clk *clk); | ||
110 | |||
111 | void __init orion_clkdev_init(struct clk *tclk); | ||
109 | #endif | 112 | #endif |