diff options
author | Geert Uytterhoeven <geert+renesas@linux-m68k.org> | 2014-02-04 10:23:56 -0500 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2014-02-06 06:28:23 -0500 |
commit | 664517474c4993c5d560d0e394c36583b7c99535 (patch) | |
tree | da1a68178b9aaa1b5eb6ffde9c95411c2085f1d4 | |
parent | c73c7ff8d5b1f4ee0bb9cd7c57c37782954b2246 (diff) |
ARM: shmobile: genmai legacy: Add RSPI support
Add RSPI platform device, resources, platform data, and SPI child.
On this board, only rspi4 is in use. Its bus contains a single device
(a wm8978 audio codec).
Signed-off-by: Geert Uytterhoeven <geert+renesas@linux-m68k.org>
Acked-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r-- | arch/arm/mach-shmobile/board-genmai.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-genmai.c b/arch/arm/mach-shmobile/board-genmai.c index 3e92e3c62d4c..c4064610e223 100644 --- a/arch/arm/mach-shmobile/board-genmai.c +++ b/arch/arm/mach-shmobile/board-genmai.c | |||
@@ -20,15 +20,59 @@ | |||
20 | 20 | ||
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/platform_device.h> | 22 | #include <linux/platform_device.h> |
23 | #include <linux/spi/rspi.h> | ||
24 | #include <linux/spi/spi.h> | ||
23 | #include <mach/common.h> | 25 | #include <mach/common.h> |
26 | #include <mach/irqs.h> | ||
24 | #include <mach/r7s72100.h> | 27 | #include <mach/r7s72100.h> |
25 | #include <asm/mach-types.h> | 28 | #include <asm/mach-types.h> |
26 | #include <asm/mach/arch.h> | 29 | #include <asm/mach/arch.h> |
27 | 30 | ||
31 | /* RSPI */ | ||
32 | #define RSPI_RESOURCE(idx, baseaddr, irq) \ | ||
33 | static const struct resource rspi##idx##_resources[] __initconst = { \ | ||
34 | DEFINE_RES_MEM(baseaddr, 0x24), \ | ||
35 | DEFINE_RES_IRQ_NAMED(irq, "error"), \ | ||
36 | DEFINE_RES_IRQ_NAMED(irq + 1, "rx"), \ | ||
37 | DEFINE_RES_IRQ_NAMED(irq + 2, "tx"), \ | ||
38 | } | ||
39 | |||
40 | RSPI_RESOURCE(0, 0xe800c800, gic_iid(270)); | ||
41 | RSPI_RESOURCE(1, 0xe800d000, gic_iid(273)); | ||
42 | RSPI_RESOURCE(2, 0xe800d800, gic_iid(276)); | ||
43 | RSPI_RESOURCE(3, 0xe800e000, gic_iid(279)); | ||
44 | RSPI_RESOURCE(4, 0xe800e800, gic_iid(282)); | ||
45 | |||
46 | static const struct rspi_plat_data rspi_pdata __initconst = { | ||
47 | .num_chipselect = 1, | ||
48 | }; | ||
49 | |||
50 | #define r7s72100_register_rspi(idx) \ | ||
51 | platform_device_register_resndata(&platform_bus, "rspi-rz", idx, \ | ||
52 | rspi##idx##_resources, \ | ||
53 | ARRAY_SIZE(rspi##idx##_resources), \ | ||
54 | &rspi_pdata, sizeof(rspi_pdata)) | ||
55 | |||
56 | static const struct spi_board_info spi_info[] __initconst = { | ||
57 | { | ||
58 | .modalias = "wm8978", | ||
59 | .max_speed_hz = 5000000, | ||
60 | .bus_num = 4, | ||
61 | .chip_select = 0, | ||
62 | }, | ||
63 | }; | ||
64 | |||
28 | static void __init genmai_add_standard_devices(void) | 65 | static void __init genmai_add_standard_devices(void) |
29 | { | 66 | { |
30 | r7s72100_clock_init(); | 67 | r7s72100_clock_init(); |
31 | r7s72100_add_dt_devices(); | 68 | r7s72100_add_dt_devices(); |
69 | |||
70 | r7s72100_register_rspi(0); | ||
71 | r7s72100_register_rspi(1); | ||
72 | r7s72100_register_rspi(2); | ||
73 | r7s72100_register_rspi(3); | ||
74 | r7s72100_register_rspi(4); | ||
75 | spi_register_board_info(spi_info, ARRAY_SIZE(spi_info)); | ||
32 | } | 76 | } |
33 | 77 | ||
34 | static const char * const genmai_boards_compat_dt[] __initconst = { | 78 | static const char * const genmai_boards_compat_dt[] __initconst = { |