ARM: shmobile: r8a7778: add support HSPI driver
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 4 Jun 2013 05:12:08 +0000 (22:12 -0700)
committerSimon Horman <horms+renesas@verge.net.au>
Tue, 11 Jun 2013 08:32:24 +0000 (17:32 +0900)
Add a platform device for the r8a7778 HSPI.

Signed-off-by: Yusuke Goda <yusuke.goda.sx@renesas.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
arch/arm/mach-shmobile/include/mach/r8a7778.h
arch/arm/mach-shmobile/setup-r8a7778.c

index 9e5835b326e8264416eac55c1e21cd3f194cc2b3..af668c47a3d974a1daaae461505f9a9efcc1887e 100644 (file)
@@ -25,6 +25,7 @@ extern void r8a7778_add_standard_devices(void);
 extern void r8a7778_add_standard_devices_dt(void);
 extern void r8a7778_add_ether_device(struct sh_eth_plat_data *pdata);
 extern void r8a7778_add_i2c_device(int id);
+extern void r8a7778_add_hspi_device(int id);
 
 extern void r8a7778_init_delay(void);
 extern void r8a7778_init_irq(void);
index 6625a386abaf489b5a325b20f4d099555a927ab8..a1e6930053707d2814b2f2aaa4bf7b2a4fb84d08 100644 (file)
@@ -151,6 +151,29 @@ void __init r8a7778_add_i2c_device(int id)
                i2c_resources + (2 * id), 2);
 }
 
+/* HSPI */
+static struct resource hspi_resources[] __initdata = {
+       /* HSPI0 */
+       DEFINE_RES_MEM(0xfffc7000, 0x18),
+       DEFINE_RES_IRQ(gic_iid(0x5f)),
+       /* HSPI1 */
+       DEFINE_RES_MEM(0xfffc8000, 0x18),
+       DEFINE_RES_IRQ(gic_iid(0x74)),
+       /* HSPI2 */
+       DEFINE_RES_MEM(0xfffc6000, 0x18),
+       DEFINE_RES_IRQ(gic_iid(0x75)),
+};
+
+void __init r8a7778_add_hspi_device(int id)
+{
+       BUG_ON(id < 0 || id > 2);
+
+       platform_device_register_simple(
+               "sh-hspi", id,
+               hspi_resources + (2 * id), 2);
+}
+
+
 void __init r8a7778_add_standard_devices(void)
 {
        int i;