aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/boards
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /arch/sh/boards
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'arch/sh/boards')
-rw-r--r--arch/sh/boards/Kconfig27
-rw-r--r--arch/sh/boards/board-apsh4a3a.c10
-rw-r--r--arch/sh/boards/board-apsh4ad0a.c10
-rw-r--r--arch/sh/boards/board-edosk7705.c4
-rw-r--r--arch/sh/boards/board-edosk7760.c16
-rw-r--r--arch/sh/boards/board-espt.c7
-rw-r--r--arch/sh/boards/board-magicpanelr2.c71
-rw-r--r--arch/sh/boards/board-polaris.c13
-rw-r--r--arch/sh/boards/board-secureedge5410.c4
-rw-r--r--arch/sh/boards/board-sh2007.c12
-rw-r--r--arch/sh/boards/board-sh7757lcr.c102
-rw-r--r--arch/sh/boards/board-sh7785lcr.c16
-rw-r--r--arch/sh/boards/board-urquell.c3
-rw-r--r--arch/sh/boards/mach-ap325rxa/setup.c85
-rw-r--r--arch/sh/boards/mach-cayman/irq.c2
-rw-r--r--arch/sh/boards/mach-cayman/setup.c1
-rw-r--r--arch/sh/boards/mach-dreamcast/irq.c32
-rw-r--r--arch/sh/boards/mach-ecovec24/setup.c359
-rw-r--r--arch/sh/boards/mach-highlander/setup.c2
-rw-r--r--arch/sh/boards/mach-hp6xx/hp6xx_apm.c2
-rw-r--r--arch/sh/boards/mach-hp6xx/pm.c1
-rw-r--r--arch/sh/boards/mach-hp6xx/setup.c5
-rw-r--r--arch/sh/boards/mach-kfr2r09/lcd_wqvga.c22
-rw-r--r--arch/sh/boards/mach-kfr2r09/setup.c57
-rw-r--r--arch/sh/boards/mach-lboxre2/setup.c1
-rw-r--r--arch/sh/boards/mach-microdev/irq.c1
-rw-r--r--arch/sh/boards/mach-microdev/setup.c1
-rw-r--r--arch/sh/boards/mach-migor/lcd_qvga.c3
-rw-r--r--arch/sh/boards/mach-migor/setup.c65
-rw-r--r--arch/sh/boards/mach-rsk/Kconfig10
-rw-r--r--arch/sh/boards/mach-rsk/Makefile2
-rw-r--r--arch/sh/boards/mach-rsk/devices-rsk7264.c58
-rw-r--r--arch/sh/boards/mach-rsk/devices-rsk7269.c60
-rw-r--r--arch/sh/boards/mach-rsk/setup.c53
-rw-r--r--arch/sh/boards/mach-sdk7780/setup.c1
-rw-r--r--arch/sh/boards/mach-sdk7786/setup.c12
-rw-r--r--arch/sh/boards/mach-se/7206/setup.c1
-rw-r--r--arch/sh/boards/mach-se/7343/irq.c129
-rw-r--r--arch/sh/boards/mach-se/7343/setup.c10
-rw-r--r--arch/sh/boards/mach-se/770x/setup.c11
-rw-r--r--arch/sh/boards/mach-se/7721/setup.c1
-rw-r--r--arch/sh/boards/mach-se/7722/irq.c131
-rw-r--r--arch/sh/boards/mach-se/7722/setup.c12
-rw-r--r--arch/sh/boards/mach-se/7724/irq.c36
-rw-r--r--arch/sh/boards/mach-se/7724/setup.c121
-rw-r--r--arch/sh/boards/mach-se/7751/setup.c1
-rw-r--r--arch/sh/boards/mach-se/7780/setup.c1
-rw-r--r--arch/sh/boards/mach-se/board-se7619.c1
-rw-r--r--arch/sh/boards/mach-sh03/setup.c1
-rw-r--r--arch/sh/boards/mach-sh7763rdp/setup.c8
-rw-r--r--arch/sh/boards/mach-x3proto/gpio.c57
51 files changed, 642 insertions, 1009 deletions
diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig
index fb5805745ac..d893411022d 100644
--- a/arch/sh/boards/Kconfig
+++ b/arch/sh/boards/Kconfig
@@ -44,8 +44,6 @@ config SH_7721_SOLUTION_ENGINE
44config SH_7722_SOLUTION_ENGINE 44config SH_7722_SOLUTION_ENGINE
45 bool "SolutionEngine7722" 45 bool "SolutionEngine7722"
46 select SOLUTION_ENGINE 46 select SOLUTION_ENGINE
47 select GENERIC_IRQ_CHIP
48 select IRQ_DOMAIN
49 depends on CPU_SUBTYPE_SH7722 47 depends on CPU_SUBTYPE_SH7722
50 help 48 help
51 Select 7722 SolutionEngine if configuring for a Hitachi SH772 49 Select 7722 SolutionEngine if configuring for a Hitachi SH772
@@ -56,8 +54,6 @@ config SH_7724_SOLUTION_ENGINE
56 select SOLUTION_ENGINE 54 select SOLUTION_ENGINE
57 depends on CPU_SUBTYPE_SH7724 55 depends on CPU_SUBTYPE_SH7724
58 select ARCH_REQUIRE_GPIOLIB 56 select ARCH_REQUIRE_GPIOLIB
59 select SND_SOC_AK4642 if SND_SIMPLE_CARD
60 select REGULATOR_FIXED_VOLTAGE if REGULATOR
61 help 57 help
62 Select 7724 SolutionEngine if configuring for a Hitachi SH7724 58 Select 7724 SolutionEngine if configuring for a Hitachi SH7724
63 evaluation board. 59 evaluation board.
@@ -83,8 +79,6 @@ config SH_7780_SOLUTION_ENGINE
83config SH_7343_SOLUTION_ENGINE 79config SH_7343_SOLUTION_ENGINE
84 bool "SolutionEngine7343" 80 bool "SolutionEngine7343"
85 select SOLUTION_ENGINE 81 select SOLUTION_ENGINE
86 select GENERIC_IRQ_CHIP
87 select IRQ_DOMAIN
88 depends on CPU_SUBTYPE_SH7343 82 depends on CPU_SUBTYPE_SH7343
89 help 83 help
90 Select 7343 SolutionEngine if configuring for a Hitachi 84 Select 7343 SolutionEngine if configuring for a Hitachi
@@ -139,9 +133,7 @@ config SH_RTS7751R2D
139 133
140config SH_RSK 134config SH_RSK
141 bool "Renesas Starter Kit" 135 bool "Renesas Starter Kit"
142 depends on CPU_SUBTYPE_SH7201 || CPU_SUBTYPE_SH7203 || \ 136 depends on CPU_SUBTYPE_SH7201 || CPU_SUBTYPE_SH7203
143 CPU_SUBTYPE_SH7264 || CPU_SUBTYPE_SH7269
144 select REGULATOR_FIXED_VOLTAGE if REGULATOR
145 help 137 help
146 Select this option if configuring for any of the RSK+ MCU 138 Select this option if configuring for any of the RSK+ MCU
147 evaluation platforms. 139 evaluation platforms.
@@ -161,7 +153,6 @@ config SH_SDK7786
161 select NO_IOPORT if !PCI 153 select NO_IOPORT if !PCI
162 select ARCH_WANT_OPTIONAL_GPIOLIB 154 select ARCH_WANT_OPTIONAL_GPIOLIB
163 select HAVE_SRAM_POOL 155 select HAVE_SRAM_POOL
164 select REGULATOR_FIXED_VOLTAGE if REGULATOR
165 help 156 help
166 Select SDK7786 if configuring for a Renesas Technology Europe 157 Select SDK7786 if configuring for a Renesas Technology Europe
167 SH7786-65nm board. 158 SH7786-65nm board.
@@ -176,7 +167,6 @@ config SH_SH7757LCR
176 bool "SH7757LCR" 167 bool "SH7757LCR"
177 depends on CPU_SUBTYPE_SH7757 168 depends on CPU_SUBTYPE_SH7757
178 select ARCH_REQUIRE_GPIOLIB 169 select ARCH_REQUIRE_GPIOLIB
179 select REGULATOR_FIXED_VOLTAGE if REGULATOR
180 170
181config SH_SH7785LCR 171config SH_SH7785LCR
182 bool "SH7785LCR" 172 bool "SH7785LCR"
@@ -210,7 +200,6 @@ config SH_MIGOR
210 bool "Migo-R" 200 bool "Migo-R"
211 depends on CPU_SUBTYPE_SH7722 201 depends on CPU_SUBTYPE_SH7722
212 select ARCH_REQUIRE_GPIOLIB 202 select ARCH_REQUIRE_GPIOLIB
213 select REGULATOR_FIXED_VOLTAGE if REGULATOR
214 help 203 help
215 Select Migo-R if configuring for the SH7722 Migo-R platform 204 Select Migo-R if configuring for the SH7722 Migo-R platform
216 by Renesas System Solutions Asia Pte. Ltd. 205 by Renesas System Solutions Asia Pte. Ltd.
@@ -219,7 +208,6 @@ config SH_AP325RXA
219 bool "AP-325RXA" 208 bool "AP-325RXA"
220 depends on CPU_SUBTYPE_SH7723 209 depends on CPU_SUBTYPE_SH7723
221 select ARCH_REQUIRE_GPIOLIB 210 select ARCH_REQUIRE_GPIOLIB
222 select REGULATOR_FIXED_VOLTAGE if REGULATOR
223 help 211 help
224 Renesas "AP-325RXA" support. 212 Renesas "AP-325RXA" support.
225 Compatible with ALGO SYSTEM CO.,LTD. "AP-320A" 213 Compatible with ALGO SYSTEM CO.,LTD. "AP-320A"
@@ -228,7 +216,6 @@ config SH_KFR2R09
228 bool "KFR2R09" 216 bool "KFR2R09"
229 depends on CPU_SUBTYPE_SH7724 217 depends on CPU_SUBTYPE_SH7724
230 select ARCH_REQUIRE_GPIOLIB 218 select ARCH_REQUIRE_GPIOLIB
231 select REGULATOR_FIXED_VOLTAGE if REGULATOR
232 help 219 help
233 "Kit For R2R for 2009" support. 220 "Kit For R2R for 2009" support.
234 221
@@ -236,8 +223,6 @@ config SH_ECOVEC
236 bool "EcoVec" 223 bool "EcoVec"
237 depends on CPU_SUBTYPE_SH7724 224 depends on CPU_SUBTYPE_SH7724
238 select ARCH_REQUIRE_GPIOLIB 225 select ARCH_REQUIRE_GPIOLIB
239 select SND_SOC_DA7210 if SND_SIMPLE_CARD
240 select REGULATOR_FIXED_VOLTAGE if REGULATOR
241 help 226 help
242 Renesas "R0P7724LC0011/21RL (EcoVec)" support. 227 Renesas "R0P7724LC0011/21RL (EcoVec)" support.
243 228
@@ -307,13 +292,11 @@ config SH_X3PROTO
307 bool "SH-X3 Prototype board" 292 bool "SH-X3 Prototype board"
308 depends on CPU_SUBTYPE_SHX3 293 depends on CPU_SUBTYPE_SHX3
309 select NO_IOPORT if !PCI 294 select NO_IOPORT if !PCI
310 select IRQ_DOMAIN
311 295
312config SH_MAGIC_PANEL_R2 296config SH_MAGIC_PANEL_R2
313 bool "Magic Panel R2" 297 bool "Magic Panel R2"
314 depends on CPU_SUBTYPE_SH7720 298 depends on CPU_SUBTYPE_SH7720
315 select ARCH_REQUIRE_GPIOLIB 299 select ARCH_REQUIRE_GPIOLIB
316 select REGULATOR_FIXED_VOLTAGE if REGULATOR
317 help 300 help
318 Select Magic Panel R2 if configuring for Magic Panel R2. 301 Select Magic Panel R2 if configuring for Magic Panel R2.
319 302
@@ -325,7 +308,6 @@ config SH_CAYMAN
325config SH_POLARIS 308config SH_POLARIS
326 bool "SMSC Polaris" 309 bool "SMSC Polaris"
327 select CPU_HAS_IPR_IRQ 310 select CPU_HAS_IPR_IRQ
328 select REGULATOR_FIXED_VOLTAGE if REGULATOR
329 depends on CPU_SUBTYPE_SH7709 311 depends on CPU_SUBTYPE_SH7709
330 help 312 help
331 Select if configuring for an SMSC Polaris development board 313 Select if configuring for an SMSC Polaris development board
@@ -333,7 +315,6 @@ config SH_POLARIS
333config SH_SH2007 315config SH_SH2007
334 bool "SH-2007 board" 316 bool "SH-2007 board"
335 select NO_IOPORT 317 select NO_IOPORT
336 select REGULATOR_FIXED_VOLTAGE if REGULATOR
337 depends on CPU_SUBTYPE_SH7780 318 depends on CPU_SUBTYPE_SH7780
338 help 319 help
339 SH-2007 is a single-board computer based around SH7780 chip 320 SH-2007 is a single-board computer based around SH7780 chip
@@ -345,7 +326,6 @@ config SH_SH2007
345config SH_APSH4A3A 326config SH_APSH4A3A
346 bool "AP-SH4A-3A" 327 bool "AP-SH4A-3A"
347 select SH_ALPHA_BOARD 328 select SH_ALPHA_BOARD
348 select REGULATOR_FIXED_VOLTAGE if REGULATOR
349 depends on CPU_SUBTYPE_SH7785 329 depends on CPU_SUBTYPE_SH7785
350 help 330 help
351 Select AP-SH4A-3A if configuring for an ALPHAPROJECT AP-SH4A-3A. 331 Select AP-SH4A-3A if configuring for an ALPHAPROJECT AP-SH4A-3A.
@@ -354,11 +334,12 @@ config SH_APSH4AD0A
354 bool "AP-SH4AD-0A" 334 bool "AP-SH4AD-0A"
355 select SH_ALPHA_BOARD 335 select SH_ALPHA_BOARD
356 select SYS_SUPPORTS_PCI 336 select SYS_SUPPORTS_PCI
357 select REGULATOR_FIXED_VOLTAGE if REGULATOR
358 depends on CPU_SUBTYPE_SH7786 337 depends on CPU_SUBTYPE_SH7786
359 help 338 help
360 Select AP-SH4AD-0A if configuring for an ALPHAPROJECT AP-SH4AD-0A. 339 Select AP-SH4AD-0A if configuring for an ALPHAPROJECT AP-SH4AD-0A.
361 340
341endmenu
342
362source "arch/sh/boards/mach-r2d/Kconfig" 343source "arch/sh/boards/mach-r2d/Kconfig"
363source "arch/sh/boards/mach-highlander/Kconfig" 344source "arch/sh/boards/mach-highlander/Kconfig"
364source "arch/sh/boards/mach-sdk7780/Kconfig" 345source "arch/sh/boards/mach-sdk7780/Kconfig"
@@ -378,5 +359,3 @@ config SH_MAGIC_PANEL_R2_VERSION
378endmenu 359endmenu
379 360
380endif 361endif
381
382endmenu
diff --git a/arch/sh/boards/board-apsh4a3a.c b/arch/sh/boards/board-apsh4a3a.c
index 0a39c241628..2823619c600 100644
--- a/arch/sh/boards/board-apsh4a3a.c
+++ b/arch/sh/boards/board-apsh4a3a.c
@@ -13,8 +13,6 @@
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/mtd/physmap.h> 15#include <linux/mtd/physmap.h>
16#include <linux/regulator/fixed.h>
17#include <linux/regulator/machine.h>
18#include <linux/smsc911x.h> 16#include <linux/smsc911x.h>
19#include <linux/irq.h> 17#include <linux/irq.h>
20#include <linux/clk.h> 18#include <linux/clk.h>
@@ -68,12 +66,6 @@ static struct platform_device nor_flash_device = {
68 .resource = nor_flash_resources, 66 .resource = nor_flash_resources,
69}; 67};
70 68
71/* Dummy supplies, where voltage doesn't matter */
72static struct regulator_consumer_supply dummy_supplies[] = {
73 REGULATOR_SUPPLY("vddvario", "smsc911x"),
74 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
75};
76
77static struct resource smsc911x_resources[] = { 69static struct resource smsc911x_resources[] = {
78 [0] = { 70 [0] = {
79 .name = "smsc911x-memory", 71 .name = "smsc911x-memory",
@@ -113,8 +105,6 @@ static struct platform_device *apsh4a3a_devices[] __initdata = {
113 105
114static int __init apsh4a3a_devices_setup(void) 106static int __init apsh4a3a_devices_setup(void)
115{ 107{
116 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
117
118 return platform_add_devices(apsh4a3a_devices, 108 return platform_add_devices(apsh4a3a_devices,
119 ARRAY_SIZE(apsh4a3a_devices)); 109 ARRAY_SIZE(apsh4a3a_devices));
120} 110}
diff --git a/arch/sh/boards/board-apsh4ad0a.c b/arch/sh/boards/board-apsh4ad0a.c
index 92eac3a9918..b4d6292a924 100644
--- a/arch/sh/boards/board-apsh4ad0a.c
+++ b/arch/sh/boards/board-apsh4ad0a.c
@@ -12,20 +12,12 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/io.h> 14#include <linux/io.h>
15#include <linux/regulator/fixed.h>
16#include <linux/regulator/machine.h>
17#include <linux/smsc911x.h> 15#include <linux/smsc911x.h>
18#include <linux/irq.h> 16#include <linux/irq.h>
19#include <linux/clk.h> 17#include <linux/clk.h>
20#include <asm/machvec.h> 18#include <asm/machvec.h>
21#include <asm/sizes.h> 19#include <asm/sizes.h>
22 20
23/* Dummy supplies, where voltage doesn't matter */
24static struct regulator_consumer_supply dummy_supplies[] = {
25 REGULATOR_SUPPLY("vddvario", "smsc911x"),
26 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
27};
28
29static struct resource smsc911x_resources[] = { 21static struct resource smsc911x_resources[] = {
30 [0] = { 22 [0] = {
31 .name = "smsc911x-memory", 23 .name = "smsc911x-memory",
@@ -64,8 +56,6 @@ static struct platform_device *apsh4ad0a_devices[] __initdata = {
64 56
65static int __init apsh4ad0a_devices_setup(void) 57static int __init apsh4ad0a_devices_setup(void)
66{ 58{
67 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
68
69 return platform_add_devices(apsh4ad0a_devices, 59 return platform_add_devices(apsh4ad0a_devices,
70 ARRAY_SIZE(apsh4ad0a_devices)); 60 ARRAY_SIZE(apsh4ad0a_devices));
71} 61}
diff --git a/arch/sh/boards/board-edosk7705.c b/arch/sh/boards/board-edosk7705.c
index 5e24c17bbda..541d8a28103 100644
--- a/arch/sh/boards/board-edosk7705.c
+++ b/arch/sh/boards/board-edosk7705.c
@@ -13,7 +13,6 @@
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/smc91x.h> 15#include <linux/smc91x.h>
16#include <linux/sh_intc.h>
17#include <asm/machvec.h> 16#include <asm/machvec.h>
18#include <asm/sizes.h> 17#include <asm/sizes.h>
19 18
@@ -21,7 +20,7 @@
21#define SMC_IO_OFFSET 0x300 20#define SMC_IO_OFFSET 0x300
22#define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET) 21#define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET)
23 22
24#define ETHERNET_IRQ evt2irq(0x320) 23#define ETHERNET_IRQ 0x09
25 24
26static void __init sh_edosk7705_init_irq(void) 25static void __init sh_edosk7705_init_irq(void)
27{ 26{
@@ -74,5 +73,6 @@ device_initcall(init_edosk7705_devices);
74 */ 73 */
75static struct sh_machine_vector mv_edosk7705 __initmv = { 74static struct sh_machine_vector mv_edosk7705 __initmv = {
76 .mv_name = "EDOSK7705", 75 .mv_name = "EDOSK7705",
76 .mv_nr_irqs = 80,
77 .mv_init_irq = sh_edosk7705_init_irq, 77 .mv_init_irq = sh_edosk7705_init_irq,
78}; 78};
diff --git a/arch/sh/boards/board-edosk7760.c b/arch/sh/boards/board-edosk7760.c
index bab5b951390..e9656a2cc4c 100644
--- a/arch/sh/boards/board-edosk7760.c
+++ b/arch/sh/boards/board-edosk7760.c
@@ -23,7 +23,6 @@
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/smc91x.h> 24#include <linux/smc91x.h>
25#include <linux/interrupt.h> 25#include <linux/interrupt.h>
26#include <linux/sh_intc.h>
27#include <linux/i2c.h> 26#include <linux/i2c.h>
28#include <linux/mtd/physmap.h> 27#include <linux/mtd/physmap.h>
29#include <asm/machvec.h> 28#include <asm/machvec.h>
@@ -41,6 +40,8 @@
41#define SMC_IO_OFFSET 0x300 40#define SMC_IO_OFFSET 0x300
42#define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET) 41#define SMC_IOADDR (SMC_IOBASE + SMC_IO_OFFSET)
43 42
43#define ETHERNET_IRQ 5
44
44/* NOR flash */ 45/* NOR flash */
45static struct mtd_partition edosk7760_nor_flash_partitions[] = { 46static struct mtd_partition edosk7760_nor_flash_partitions[] = {
46 { 47 {
@@ -98,8 +99,8 @@ static struct resource sh7760_i2c1_res[] = {
98 .end = SH7760_I2C1_MMIOEND, 99 .end = SH7760_I2C1_MMIOEND,
99 .flags = IORESOURCE_MEM, 100 .flags = IORESOURCE_MEM,
100 },{ 101 },{
101 .start = evt2irq(0x9e0), 102 .start = SH7760_I2C1_IRQ,
102 .end = evt2irq(0x9e0), 103 .end = SH7760_I2C1_IRQ,
103 .flags = IORESOURCE_IRQ, 104 .flags = IORESOURCE_IRQ,
104 }, 105 },
105}; 106};
@@ -121,8 +122,8 @@ static struct resource sh7760_i2c0_res[] = {
121 .end = SH7760_I2C0_MMIOEND, 122 .end = SH7760_I2C0_MMIOEND,
122 .flags = IORESOURCE_MEM, 123 .flags = IORESOURCE_MEM,
123 }, { 124 }, {
124 .start = evt2irq(0x9c0), 125 .start = SH7760_I2C0_IRQ,
125 .end = evt2irq(0x9c0), 126 .end = SH7760_I2C0_IRQ,
126 .flags = IORESOURCE_IRQ, 127 .flags = IORESOURCE_IRQ,
127 }, 128 },
128}; 129};
@@ -149,8 +150,8 @@ static struct resource smc91x_res[] = {
149 .flags = IORESOURCE_MEM, 150 .flags = IORESOURCE_MEM,
150 }, 151 },
151 [1] = { 152 [1] = {
152 .start = evt2irq(0x2a0), 153 .start = ETHERNET_IRQ,
153 .end = evt2irq(0x2a0), 154 .end = ETHERNET_IRQ,
154 .flags = IORESOURCE_IRQ , 155 .flags = IORESOURCE_IRQ ,
155 } 156 }
156}; 157};
@@ -188,4 +189,5 @@ device_initcall(init_edosk7760_devices);
188 */ 189 */
189struct sh_machine_vector mv_edosk7760 __initmv = { 190struct sh_machine_vector mv_edosk7760 __initmv = {
190 .mv_name = "EDOSK7760", 191 .mv_name = "EDOSK7760",
192 .mv_nr_irqs = 128,
191}; 193};
diff --git a/arch/sh/boards/board-espt.c b/arch/sh/boards/board-espt.c
index d71a0bcf814..9da92ac3653 100644
--- a/arch/sh/boards/board-espt.c
+++ b/arch/sh/boards/board-espt.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Data Technology Inc. ESPT-GIGA board support 2 * Data Technology Inc. ESPT-GIGA board suport
3 * 3 *
4 * Copyright (C) 2008, 2009 Renesas Solutions Corp. 4 * Copyright (C) 2008, 2009 Renesas Solutions Corp.
5 * Copyright (C) 2008, 2009 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> 5 * Copyright (C) 2008, 2009 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
@@ -13,10 +13,9 @@
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/mtd/physmap.h> 14#include <linux/mtd/physmap.h>
15#include <linux/io.h> 15#include <linux/io.h>
16#include <linux/sh_eth.h>
17#include <linux/sh_intc.h>
18#include <asm/machvec.h> 16#include <asm/machvec.h>
19#include <asm/sizes.h> 17#include <asm/sizes.h>
18#include <asm/sh_eth.h>
20 19
21/* NOR Flash */ 20/* NOR Flash */
22static struct mtd_partition espt_nor_flash_partitions[] = { 21static struct mtd_partition espt_nor_flash_partitions[] = {
@@ -72,7 +71,7 @@ static struct resource sh_eth_resources[] = {
72 .flags = IORESOURCE_MEM, 71 .flags = IORESOURCE_MEM,
73 }, { 72 }, {
74 73
75 .start = evt2irq(0x920), /* irq number */ 74 .start = 57, /* irq number */
76 .flags = IORESOURCE_IRQ, 75 .flags = IORESOURCE_IRQ,
77 }, 76 },
78}; 77};
diff --git a/arch/sh/boards/board-magicpanelr2.c b/arch/sh/boards/board-magicpanelr2.c
index 20500858b56..93f5039099b 100644
--- a/arch/sh/boards/board-magicpanelr2.c
+++ b/arch/sh/boards/board-magicpanelr2.c
@@ -14,26 +14,20 @@
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/delay.h> 15#include <linux/delay.h>
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/regulator/fixed.h>
18#include <linux/regulator/machine.h>
19#include <linux/smsc911x.h> 17#include <linux/smsc911x.h>
20#include <linux/mtd/mtd.h> 18#include <linux/mtd/mtd.h>
21#include <linux/mtd/partitions.h> 19#include <linux/mtd/partitions.h>
22#include <linux/mtd/physmap.h> 20#include <linux/mtd/physmap.h>
23#include <linux/mtd/map.h> 21#include <linux/mtd/map.h>
24#include <linux/sh_intc.h>
25#include <mach/magicpanelr2.h> 22#include <mach/magicpanelr2.h>
26#include <asm/heartbeat.h> 23#include <asm/heartbeat.h>
27#include <cpu/sh7720.h> 24#include <cpu/sh7720.h>
28 25
29/* Dummy supplies, where voltage doesn't matter */
30static struct regulator_consumer_supply dummy_supplies[] = {
31 REGULATOR_SUPPLY("vddvario", "smsc911x"),
32 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
33};
34
35#define LAN9115_READY (__raw_readl(0xA8000084UL) & 0x00000001UL) 26#define LAN9115_READY (__raw_readl(0xA8000084UL) & 0x00000001UL)
36 27
28/* Prefer cmdline over RedBoot */
29static const char *probes[] = { "cmdlinepart", "RedBoot", NULL };
30
37/* Wait until reset finished. Timeout is 100ms. */ 31/* Wait until reset finished. Timeout is 100ms. */
38static int __init ethernet_reset_finished(void) 32static int __init ethernet_reset_finished(void)
39{ 33{
@@ -254,8 +248,8 @@ static struct resource smsc911x_resources[] = {
254 .flags = IORESOURCE_MEM, 248 .flags = IORESOURCE_MEM,
255 }, 249 },
256 [1] = { 250 [1] = {
257 .start = evt2irq(0x660), 251 .start = 35,
258 .end = evt2irq(0x660), 252 .end = 35,
259 .flags = IORESOURCE_IRQ, 253 .flags = IORESOURCE_IRQ,
260 }, 254 },
261}; 255};
@@ -299,6 +293,8 @@ static struct platform_device heartbeat_device = {
299 .resource = heartbeat_resources, 293 .resource = heartbeat_resources,
300}; 294};
301 295
296static struct mtd_partition *parsed_partitions;
297
302static struct mtd_partition mpr2_partitions[] = { 298static struct mtd_partition mpr2_partitions[] = {
303 /* Reserved for bootloader, read-only */ 299 /* Reserved for bootloader, read-only */
304 { 300 {
@@ -322,8 +318,6 @@ static struct mtd_partition mpr2_partitions[] = {
322}; 318};
323 319
324static struct physmap_flash_data flash_data = { 320static struct physmap_flash_data flash_data = {
325 .parts = mpr2_partitions,
326 .nr_parts = ARRAY_SIZE(mpr2_partitions),
327 .width = 2, 321 .width = 2,
328}; 322};
329 323
@@ -343,6 +337,32 @@ static struct platform_device flash_device = {
343 }, 337 },
344}; 338};
345 339
340static struct mtd_info *flash_mtd;
341
342static struct map_info mpr2_flash_map = {
343 .name = "Magic Panel R2 Flash",
344 .size = 0x2000000UL,
345 .bankwidth = 2,
346};
347
348static void __init set_mtd_partitions(void)
349{
350 int nr_parts = 0;
351
352 simple_map_init(&mpr2_flash_map);
353 flash_mtd = do_map_probe("cfi_probe", &mpr2_flash_map);
354 nr_parts = parse_mtd_partitions(flash_mtd, probes,
355 &parsed_partitions, 0);
356 /* If there is no partition table, used the hard coded table */
357 if (nr_parts <= 0) {
358 flash_data.parts = mpr2_partitions;
359 flash_data.nr_parts = ARRAY_SIZE(mpr2_partitions);
360 } else {
361 flash_data.nr_parts = nr_parts;
362 flash_data.parts = parsed_partitions;
363 }
364}
365
346/* 366/*
347 * Add all resources to the platform_device 367 * Add all resources to the platform_device
348 */ 368 */
@@ -356,8 +376,7 @@ static struct platform_device *mpr2_devices[] __initdata = {
356 376
357static int __init mpr2_devices_setup(void) 377static int __init mpr2_devices_setup(void)
358{ 378{
359 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 379 set_mtd_partitions();
360
361 return platform_add_devices(mpr2_devices, ARRAY_SIZE(mpr2_devices)); 380 return platform_add_devices(mpr2_devices, ARRAY_SIZE(mpr2_devices));
362} 381}
363device_initcall(mpr2_devices_setup); 382device_initcall(mpr2_devices_setup);
@@ -369,17 +388,17 @@ static void __init init_mpr2_IRQ(void)
369{ 388{
370 plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-5 */ 389 plat_irq_setup_pins(IRQ_MODE_IRQ); /* install handlers for IRQ0-5 */
371 390
372 irq_set_irq_type(evt2irq(0x600), IRQ_TYPE_LEVEL_LOW); /* IRQ0 CAN1 */ 391 irq_set_irq_type(32, IRQ_TYPE_LEVEL_LOW); /* IRQ0 CAN1 */
373 irq_set_irq_type(evt2irq(0x620), IRQ_TYPE_LEVEL_LOW); /* IRQ1 CAN2 */ 392 irq_set_irq_type(33, IRQ_TYPE_LEVEL_LOW); /* IRQ1 CAN2 */
374 irq_set_irq_type(evt2irq(0x640), IRQ_TYPE_LEVEL_LOW); /* IRQ2 CAN3 */ 393 irq_set_irq_type(34, IRQ_TYPE_LEVEL_LOW); /* IRQ2 CAN3 */
375 irq_set_irq_type(evt2irq(0x660), IRQ_TYPE_LEVEL_LOW); /* IRQ3 SMSC9115 */ 394 irq_set_irq_type(35, IRQ_TYPE_LEVEL_LOW); /* IRQ3 SMSC9115 */
376 irq_set_irq_type(evt2irq(0x680), IRQ_TYPE_EDGE_RISING); /* IRQ4 touchscreen */ 395 irq_set_irq_type(36, IRQ_TYPE_EDGE_RISING); /* IRQ4 touchscreen */
377 irq_set_irq_type(evt2irq(0x6a0), IRQ_TYPE_EDGE_FALLING); /* IRQ5 touchscreen */ 396 irq_set_irq_type(37, IRQ_TYPE_EDGE_FALLING); /* IRQ5 touchscreen */
378 397
379 intc_set_priority(evt2irq(0x600), 13); /* IRQ0 CAN1 */ 398 intc_set_priority(32, 13); /* IRQ0 CAN1 */
380 intc_set_priority(evt2irq(0x620), 13); /* IRQ0 CAN2 */ 399 intc_set_priority(33, 13); /* IRQ0 CAN2 */
381 intc_set_priority(evt2irq(0x640), 13); /* IRQ0 CAN3 */ 400 intc_set_priority(34, 13); /* IRQ0 CAN3 */
382 intc_set_priority(evt2irq(0x660), 6); /* IRQ3 SMSC9115 */ 401 intc_set_priority(35, 6); /* IRQ3 SMSC9115 */
383} 402}
384 403
385/* 404/*
diff --git a/arch/sh/boards/board-polaris.c b/arch/sh/boards/board-polaris.c
index 37a08d09472..594866356c2 100644
--- a/arch/sh/boards/board-polaris.c
+++ b/arch/sh/boards/board-polaris.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * June 2006 Steve Glendinning <steve.glendinning@shawell.net> 2 * June 2006 steve.glendinning@smsc.com
3 * 3 *
4 * Polaris-specific resource declaration 4 * Polaris-specific resource declaration
5 * 5 *
@@ -9,8 +9,6 @@
9#include <linux/interrupt.h> 9#include <linux/interrupt.h>
10#include <linux/irq.h> 10#include <linux/irq.h>
11#include <linux/platform_device.h> 11#include <linux/platform_device.h>
12#include <linux/regulator/fixed.h>
13#include <linux/regulator/machine.h>
14#include <linux/smsc911x.h> 12#include <linux/smsc911x.h>
15#include <linux/io.h> 13#include <linux/io.h>
16#include <asm/irq.h> 14#include <asm/irq.h>
@@ -24,12 +22,6 @@
24#define AREA5_WAIT_CTRL (0x1C00) 22#define AREA5_WAIT_CTRL (0x1C00)
25#define WAIT_STATES_10 (0x7) 23#define WAIT_STATES_10 (0x7)
26 24
27/* Dummy supplies, where voltage doesn't matter */
28static struct regulator_consumer_supply dummy_supplies[] = {
29 REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
30 REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
31};
32
33static struct resource smsc911x_resources[] = { 25static struct resource smsc911x_resources[] = {
34 [0] = { 26 [0] = {
35 .name = "smsc911x-memory", 27 .name = "smsc911x-memory",
@@ -96,8 +88,6 @@ static int __init polaris_initialise(void)
96 88
97 printk(KERN_INFO "Configuring Polaris external bus\n"); 89 printk(KERN_INFO "Configuring Polaris external bus\n");
98 90
99 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
100
101 /* Configure area 5 with 2 wait states */ 91 /* Configure area 5 with 2 wait states */
102 wcr = __raw_readw(WCR2); 92 wcr = __raw_readw(WCR2);
103 wcr &= (~AREA5_WAIT_CTRL); 93 wcr &= (~AREA5_WAIT_CTRL);
@@ -151,5 +141,6 @@ static void __init init_polaris_irq(void)
151 141
152static struct sh_machine_vector mv_polaris __initmv = { 142static struct sh_machine_vector mv_polaris __initmv = {
153 .mv_name = "Polaris", 143 .mv_name = "Polaris",
144 .mv_nr_irqs = 61,
154 .mv_init_irq = init_polaris_irq, 145 .mv_init_irq = init_polaris_irq,
155}; 146};
diff --git a/arch/sh/boards/board-secureedge5410.c b/arch/sh/boards/board-secureedge5410.c
index 98b36205aa7..f968f17891a 100644
--- a/arch/sh/boards/board-secureedge5410.c
+++ b/arch/sh/boards/board-secureedge5410.c
@@ -41,7 +41,8 @@ static int __init eraseconfig_init(void)
41 printk("SnapGear: EraseConfig init\n"); 41 printk("SnapGear: EraseConfig init\n");
42 42
43 /* Setup "EraseConfig" switch on external IRQ 0 */ 43 /* Setup "EraseConfig" switch on external IRQ 0 */
44 if (request_irq(irq, eraseconfig_interrupt, 0, "Erase Config", NULL)) 44 if (request_irq(irq, eraseconfig_interrupt, IRQF_DISABLED,
45 "Erase Config", NULL))
45 printk("SnapGear: failed to register IRQ%d for Reset witch\n", 46 printk("SnapGear: failed to register IRQ%d for Reset witch\n",
46 irq); 47 irq);
47 else 48 else
@@ -71,5 +72,6 @@ static void __init init_snapgear_IRQ(void)
71 */ 72 */
72static struct sh_machine_vector mv_snapgear __initmv = { 73static struct sh_machine_vector mv_snapgear __initmv = {
73 .mv_name = "SnapGear SecureEdge5410", 74 .mv_name = "SnapGear SecureEdge5410",
75 .mv_nr_irqs = 72,
74 .mv_init_irq = init_snapgear_IRQ, 76 .mv_init_irq = init_snapgear_IRQ,
75}; 77};
diff --git a/arch/sh/boards/board-sh2007.c b/arch/sh/boards/board-sh2007.c
index 1980bb7e578..b90b78f6a82 100644
--- a/arch/sh/boards/board-sh2007.c
+++ b/arch/sh/boards/board-sh2007.c
@@ -6,8 +6,6 @@
6 */ 6 */
7#include <linux/init.h> 7#include <linux/init.h>
8#include <linux/irq.h> 8#include <linux/irq.h>
9#include <linux/regulator/fixed.h>
10#include <linux/regulator/machine.h>
11#include <linux/smsc911x.h> 9#include <linux/smsc911x.h>
12#include <linux/platform_device.h> 10#include <linux/platform_device.h>
13#include <linux/ata_platform.h> 11#include <linux/ata_platform.h>
@@ -15,14 +13,6 @@
15#include <asm/machvec.h> 13#include <asm/machvec.h>
16#include <mach/sh2007.h> 14#include <mach/sh2007.h>
17 15
18/* Dummy supplies, where voltage doesn't matter */
19static struct regulator_consumer_supply dummy_supplies[] = {
20 REGULATOR_SUPPLY("vddvario", "smsc911x.0"),
21 REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
22 REGULATOR_SUPPLY("vddvario", "smsc911x.1"),
23 REGULATOR_SUPPLY("vdd33a", "smsc911x.1"),
24};
25
26struct smsc911x_platform_config smc911x_info = { 16struct smsc911x_platform_config smc911x_info = {
27 .flags = SMSC911X_USE_32BIT, 17 .flags = SMSC911X_USE_32BIT,
28 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, 18 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
@@ -108,8 +98,6 @@ static struct platform_device *sh2007_devices[] __initdata = {
108 98
109static int __init sh2007_io_init(void) 99static int __init sh2007_io_init(void)
110{ 100{
111 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
112
113 platform_add_devices(sh2007_devices, ARRAY_SIZE(sh2007_devices)); 101 platform_add_devices(sh2007_devices, ARRAY_SIZE(sh2007_devices));
114 return 0; 102 return 0;
115} 103}
diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c
index 41f86702eb9..fa2a208ec6c 100644
--- a/arch/sh/boards/board-sh7757lcr.c
+++ b/arch/sh/boards/board-sh7757lcr.c
@@ -12,18 +12,14 @@
12#include <linux/platform_device.h> 12#include <linux/platform_device.h>
13#include <linux/gpio.h> 13#include <linux/gpio.h>
14#include <linux/irq.h> 14#include <linux/irq.h>
15#include <linux/regulator/fixed.h>
16#include <linux/regulator/machine.h>
17#include <linux/spi/spi.h> 15#include <linux/spi/spi.h>
18#include <linux/spi/flash.h> 16#include <linux/spi/flash.h>
19#include <linux/io.h> 17#include <linux/io.h>
20#include <linux/mmc/host.h> 18#include <linux/mmc/host.h>
21#include <linux/mmc/sh_mmcif.h> 19#include <linux/mmc/sh_mmcif.h>
22#include <linux/mmc/sh_mobile_sdhi.h> 20#include <linux/mmc/sh_mobile_sdhi.h>
23#include <linux/sh_eth.h>
24#include <linux/sh_intc.h>
25#include <linux/usb/renesas_usbhs.h>
26#include <cpu/sh7757.h> 21#include <cpu/sh7757.h>
22#include <asm/sh_eth.h>
27#include <asm/heartbeat.h> 23#include <asm/heartbeat.h>
28 24
29static struct resource heartbeat_resource = { 25static struct resource heartbeat_resource = {
@@ -54,9 +50,9 @@ static struct platform_device heartbeat_device = {
54#define GBECONT 0xffc10100 50#define GBECONT 0xffc10100
55#define GBECONT_RMII1 BIT(17) 51#define GBECONT_RMII1 BIT(17)
56#define GBECONT_RMII0 BIT(16) 52#define GBECONT_RMII0 BIT(16)
57static void sh7757_eth_set_mdio_gate(void *addr) 53static void sh7757_eth_set_mdio_gate(unsigned long addr)
58{ 54{
59 if (((unsigned long)addr & 0x00000fff) < 0x0800) 55 if ((addr & 0x00000fff) < 0x0800)
60 writel(readl(GBECONT) | GBECONT_RMII0, GBECONT); 56 writel(readl(GBECONT) | GBECONT_RMII0, GBECONT);
61 else 57 else
62 writel(readl(GBECONT) | GBECONT_RMII1, GBECONT); 58 writel(readl(GBECONT) | GBECONT_RMII1, GBECONT);
@@ -68,8 +64,8 @@ static struct resource sh_eth0_resources[] = {
68 .end = 0xfef001ff, 64 .end = 0xfef001ff,
69 .flags = IORESOURCE_MEM, 65 .flags = IORESOURCE_MEM,
70 }, { 66 }, {
71 .start = evt2irq(0xc80), 67 .start = 84,
72 .end = evt2irq(0xc80), 68 .end = 84,
73 .flags = IORESOURCE_IRQ, 69 .flags = IORESOURCE_IRQ,
74 }, 70 },
75}; 71};
@@ -97,8 +93,8 @@ static struct resource sh_eth1_resources[] = {
97 .end = 0xfef009ff, 93 .end = 0xfef009ff,
98 .flags = IORESOURCE_MEM, 94 .flags = IORESOURCE_MEM,
99 }, { 95 }, {
100 .start = evt2irq(0xc80), 96 .start = 84,
101 .end = evt2irq(0xc80), 97 .end = 84,
102 .flags = IORESOURCE_IRQ, 98 .flags = IORESOURCE_IRQ,
103 }, 99 },
104}; 100};
@@ -120,9 +116,9 @@ static struct platform_device sh7757_eth1_device = {
120 }, 116 },
121}; 117};
122 118
123static void sh7757_eth_giga_set_mdio_gate(void *addr) 119static void sh7757_eth_giga_set_mdio_gate(unsigned long addr)
124{ 120{
125 if (((unsigned long)addr & 0x00000fff) < 0x0800) { 121 if ((addr & 0x00000fff) < 0x0800) {
126 gpio_set_value(GPIO_PTT4, 1); 122 gpio_set_value(GPIO_PTT4, 1);
127 writel(readl(GBECONT) & ~GBECONT_RMII0, GBECONT); 123 writel(readl(GBECONT) & ~GBECONT_RMII0, GBECONT);
128 } else { 124 } else {
@@ -142,8 +138,8 @@ static struct resource sh_eth_giga0_resources[] = {
142 .end = 0xfee01fff, 138 .end = 0xfee01fff,
143 .flags = IORESOURCE_MEM, 139 .flags = IORESOURCE_MEM,
144 }, { 140 }, {
145 .start = evt2irq(0x2960), 141 .start = 315,
146 .end = evt2irq(0x2960), 142 .end = 315,
147 .flags = IORESOURCE_IRQ, 143 .flags = IORESOURCE_IRQ,
148 }, 144 },
149}; 145};
@@ -172,13 +168,8 @@ static struct resource sh_eth_giga1_resources[] = {
172 .end = 0xfee00fff, 168 .end = 0xfee00fff,
173 .flags = IORESOURCE_MEM, 169 .flags = IORESOURCE_MEM,
174 }, { 170 }, {
175 /* TSU */ 171 .start = 316,
176 .start = 0xfee01800, 172 .end = 316,
177 .end = 0xfee01fff,
178 .flags = IORESOURCE_MEM,
179 }, {
180 .start = evt2irq(0x2980),
181 .end = evt2irq(0x2980),
182 .flags = IORESOURCE_IRQ, 173 .flags = IORESOURCE_IRQ,
183 }, 174 },
184}; 175};
@@ -201,15 +192,6 @@ static struct platform_device sh7757_eth_giga1_device = {
201 }, 192 },
202}; 193};
203 194
204/* Fixed 3.3V regulator to be used by SDHI0, MMCIF */
205static struct regulator_consumer_supply fixed3v3_power_consumers[] =
206{
207 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
208 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
209 REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
210 REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
211};
212
213/* SH_MMCIF */ 195/* SH_MMCIF */
214static struct resource sh_mmcif_resources[] = { 196static struct resource sh_mmcif_resources[] = {
215 [0] = { 197 [0] = {
@@ -218,22 +200,25 @@ static struct resource sh_mmcif_resources[] = {
218 .flags = IORESOURCE_MEM, 200 .flags = IORESOURCE_MEM,
219 }, 201 },
220 [1] = { 202 [1] = {
221 .start = evt2irq(0x1c60), 203 .start = 211,
222 .flags = IORESOURCE_IRQ, 204 .flags = IORESOURCE_IRQ,
223 }, 205 },
224 [2] = { 206 [2] = {
225 .start = evt2irq(0x1c80), 207 .start = 212,
226 .flags = IORESOURCE_IRQ, 208 .flags = IORESOURCE_IRQ,
227 }, 209 },
228}; 210};
229 211
212static struct sh_mmcif_dma sh7757lcr_mmcif_dma = {
213 .chan_priv_tx = SHDMA_SLAVE_MMCIF_TX,
214 .chan_priv_rx = SHDMA_SLAVE_MMCIF_RX,
215};
216
230static struct sh_mmcif_plat_data sh_mmcif_plat = { 217static struct sh_mmcif_plat_data sh_mmcif_plat = {
218 .dma = &sh7757lcr_mmcif_dma,
231 .sup_pclk = 0x0f, 219 .sup_pclk = 0x0f,
232 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA | 220 .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA,
233 MMC_CAP_NONREMOVABLE,
234 .ocr = MMC_VDD_32_33 | MMC_VDD_33_34, 221 .ocr = MMC_VDD_32_33 | MMC_VDD_33_34,
235 .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
236 .slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
237}; 222};
238 223
239static struct platform_device sh_mmcif_device = { 224static struct platform_device sh_mmcif_device = {
@@ -260,7 +245,7 @@ static struct resource sdhi_resources[] = {
260 .flags = IORESOURCE_MEM, 245 .flags = IORESOURCE_MEM,
261 }, 246 },
262 [1] = { 247 [1] = {
263 .start = evt2irq(0x480), 248 .start = 20,
264 .flags = IORESOURCE_IRQ, 249 .flags = IORESOURCE_IRQ,
265 }, 250 },
266}; 251};
@@ -275,43 +260,6 @@ static struct platform_device sdhi_device = {
275 }, 260 },
276}; 261};
277 262
278static int usbhs0_get_id(struct platform_device *pdev)
279{
280 return USBHS_GADGET;
281}
282
283static struct renesas_usbhs_platform_info usb0_data = {
284 .platform_callback = {
285 .get_id = usbhs0_get_id,
286 },
287 .driver_param = {
288 .buswait_bwait = 5,
289 }
290};
291
292static struct resource usb0_resources[] = {
293 [0] = {
294 .start = 0xfe450000,
295 .end = 0xfe4501ff,
296 .flags = IORESOURCE_MEM,
297 },
298 [1] = {
299 .start = evt2irq(0x840),
300 .end = evt2irq(0x840),
301 .flags = IORESOURCE_IRQ,
302 },
303};
304
305static struct platform_device usb0_device = {
306 .name = "renesas_usbhs",
307 .id = 0,
308 .dev = {
309 .platform_data = &usb0_data,
310 },
311 .num_resources = ARRAY_SIZE(usb0_resources),
312 .resource = usb0_resources,
313};
314
315static struct platform_device *sh7757lcr_devices[] __initdata = { 263static struct platform_device *sh7757lcr_devices[] __initdata = {
316 &heartbeat_device, 264 &heartbeat_device,
317 &sh7757_eth0_device, 265 &sh7757_eth0_device,
@@ -320,7 +268,6 @@ static struct platform_device *sh7757lcr_devices[] __initdata = {
320 &sh7757_eth_giga1_device, 268 &sh7757_eth_giga1_device,
321 &sh_mmcif_device, 269 &sh_mmcif_device,
322 &sdhi_device, 270 &sdhi_device,
323 &usb0_device,
324}; 271};
325 272
326static struct flash_platform_data spi_flash_data = { 273static struct flash_platform_data spi_flash_data = {
@@ -340,9 +287,6 @@ static struct spi_board_info spi_board_info[] = {
340 287
341static int __init sh7757lcr_devices_setup(void) 288static int __init sh7757lcr_devices_setup(void)
342{ 289{
343 regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
344 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
345
346 /* RGMII (PTA) */ 290 /* RGMII (PTA) */
347 gpio_request(GPIO_FN_ET0_MDC, NULL); 291 gpio_request(GPIO_FN_ET0_MDC, NULL);
348 gpio_request(GPIO_FN_ET0_MDIO, NULL); 292 gpio_request(GPIO_FN_ET0_MDIO, NULL);
diff --git a/arch/sh/boards/board-sh7785lcr.c b/arch/sh/boards/board-sh7785lcr.c
index 2c4771ee84c..d879848f3cd 100644
--- a/arch/sh/boards/board-sh7785lcr.c
+++ b/arch/sh/boards/board-sh7785lcr.c
@@ -20,7 +20,6 @@
20#include <linux/i2c-pca-platform.h> 20#include <linux/i2c-pca-platform.h>
21#include <linux/i2c-algo-pca.h> 21#include <linux/i2c-algo-pca.h>
22#include <linux/usb/r8a66597.h> 22#include <linux/usb/r8a66597.h>
23#include <linux/sh_intc.h>
24#include <linux/irq.h> 23#include <linux/irq.h>
25#include <linux/io.h> 24#include <linux/io.h>
26#include <linux/clk.h> 25#include <linux/clk.h>
@@ -29,7 +28,6 @@
29#include <cpu/sh7785.h> 28#include <cpu/sh7785.h>
30#include <asm/heartbeat.h> 29#include <asm/heartbeat.h>
31#include <asm/clock.h> 30#include <asm/clock.h>
32#include <asm/bl_bit.h>
33 31
34/* 32/*
35 * NOTE: This board has 2 physical memory maps. 33 * NOTE: This board has 2 physical memory maps.
@@ -106,8 +104,8 @@ static struct resource r8a66597_usb_host_resources[] = {
106 .flags = IORESOURCE_MEM, 104 .flags = IORESOURCE_MEM,
107 }, 105 },
108 [1] = { 106 [1] = {
109 .start = evt2irq(0x240), 107 .start = 2,
110 .end = evt2irq(0x240), 108 .end = 2,
111 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 109 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
112 }, 110 },
113}; 111};
@@ -136,7 +134,7 @@ static struct resource sm501_resources[] = {
136 .flags = IORESOURCE_MEM, 134 .flags = IORESOURCE_MEM,
137 }, 135 },
138 [2] = { 136 [2] = {
139 .start = evt2irq(0x340), 137 .start = 10,
140 .flags = IORESOURCE_IRQ, 138 .flags = IORESOURCE_IRQ,
141 }, 139 },
142}; 140};
@@ -224,8 +222,8 @@ static struct resource i2c_proto_resources[] = {
224 .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT, 222 .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
225 }, 223 },
226 [1] = { 224 [1] = {
227 .start = evt2irq(0x380), 225 .start = 12,
228 .end = evt2irq(0x380), 226 .end = 12,
229 .flags = IORESOURCE_IRQ, 227 .flags = IORESOURCE_IRQ,
230 }, 228 },
231}; 229};
@@ -237,8 +235,8 @@ static struct resource i2c_resources[] = {
237 .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT, 235 .flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
238 }, 236 },
239 [1] = { 237 [1] = {
240 .start = evt2irq(0x380), 238 .start = 12,
241 .end = evt2irq(0x380), 239 .end = 12,
242 .flags = IORESOURCE_IRQ, 240 .flags = IORESOURCE_IRQ,
243 }, 241 },
244}; 242};
diff --git a/arch/sh/boards/board-urquell.c b/arch/sh/boards/board-urquell.c
index b52abcc5259..24e3316c5c1 100644
--- a/arch/sh/boards/board-urquell.c
+++ b/arch/sh/boards/board-urquell.c
@@ -20,7 +20,6 @@
20#include <linux/gpio.h> 20#include <linux/gpio.h>
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/sh_intc.h>
24#include <mach/urquell.h> 23#include <mach/urquell.h>
25#include <cpu/sh7786.h> 24#include <cpu/sh7786.h>
26#include <asm/heartbeat.h> 25#include <asm/heartbeat.h>
@@ -79,7 +78,7 @@ static struct resource smc91x_eth_resources[] = {
79 .flags = IORESOURCE_MEM, 78 .flags = IORESOURCE_MEM,
80 }, 79 },
81 [1] = { 80 [1] = {
82 .start = evt2irq(0x360), 81 .start = 11,
83 .flags = IORESOURCE_IRQ, 82 .flags = IORESOURCE_IRQ,
84 }, 83 },
85}; 84};
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
index 5620e33c18a..d3626575891 100644
--- a/arch/sh/boards/mach-ap325rxa/setup.c
+++ b/arch/sh/boards/mach-ap325rxa/setup.c
@@ -20,12 +20,8 @@
20#include <linux/mtd/sh_flctl.h> 20#include <linux/mtd/sh_flctl.h>
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/i2c.h> 22#include <linux/i2c.h>
23#include <linux/regulator/fixed.h>
24#include <linux/regulator/machine.h>
25#include <linux/smsc911x.h> 23#include <linux/smsc911x.h>
26#include <linux/gpio.h> 24#include <linux/gpio.h>
27#include <linux/videodev2.h>
28#include <linux/sh_intc.h>
29#include <media/ov772x.h> 25#include <media/ov772x.h>
30#include <media/soc_camera.h> 26#include <media/soc_camera.h>
31#include <media/soc_camera_platform.h> 27#include <media/soc_camera_platform.h>
@@ -36,12 +32,6 @@
36#include <asm/suspend.h> 32#include <asm/suspend.h>
37#include <cpu/sh7723.h> 33#include <cpu/sh7723.h>
38 34
39/* Dummy supplies, where voltage doesn't matter */
40static struct regulator_consumer_supply dummy_supplies[] = {
41 REGULATOR_SUPPLY("vddvario", "smsc911x"),
42 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
43};
44
45static struct smsc911x_platform_config smsc911x_config = { 35static struct smsc911x_platform_config smsc911x_config = {
46 .phy_interface = PHY_INTERFACE_MODE_MII, 36 .phy_interface = PHY_INTERFACE_MODE_MII,
47 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, 37 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
@@ -56,8 +46,8 @@ static struct resource smsc9118_resources[] = {
56 .flags = IORESOURCE_MEM, 46 .flags = IORESOURCE_MEM,
57 }, 47 },
58 [1] = { 48 [1] = {
59 .start = evt2irq(0x660), 49 .start = 35,
60 .end = evt2irq(0x660), 50 .end = 35,
61 .flags = IORESOURCE_IRQ, 51 .flags = IORESOURCE_IRQ,
62 } 52 }
63}; 53};
@@ -166,7 +156,7 @@ static struct platform_device nand_flash_device = {
166#define PORT_DRVCRA 0xA405018A 156#define PORT_DRVCRA 0xA405018A
167#define PORT_DRVCRB 0xA405018C 157#define PORT_DRVCRB 0xA405018C
168 158
169static int ap320_wvga_set_brightness(int brightness) 159static int ap320_wvga_set_brightness(void *board_data, int brightness)
170{ 160{
171 if (brightness) { 161 if (brightness) {
172 gpio_set_value(GPIO_PTS3, 0); 162 gpio_set_value(GPIO_PTS3, 0);
@@ -175,11 +165,16 @@ static int ap320_wvga_set_brightness(int brightness)
175 __raw_writew(0, FPGA_BKLREG); 165 __raw_writew(0, FPGA_BKLREG);
176 gpio_set_value(GPIO_PTS3, 1); 166 gpio_set_value(GPIO_PTS3, 1);
177 } 167 }
178 168
179 return 0; 169 return 0;
180} 170}
181 171
182static void ap320_wvga_power_on(void) 172static int ap320_wvga_get_brightness(void *board_data)
173{
174 return gpio_get_value(GPIO_PTS3);
175}
176
177static void ap320_wvga_power_on(void *board_data, struct fb_info *info)
183{ 178{
184 msleep(100); 179 msleep(100);
185 180
@@ -187,7 +182,7 @@ static void ap320_wvga_power_on(void)
187 __raw_writew(FPGA_LCDREG_VAL, FPGA_LCDREG); 182 __raw_writew(FPGA_LCDREG_VAL, FPGA_LCDREG);
188} 183}
189 184
190static void ap320_wvga_power_off(void) 185static void ap320_wvga_power_off(void *board_data)
191{ 186{
192 /* ASD AP-320/325 LCD OFF */ 187 /* ASD AP-320/325 LCD OFF */
193 __raw_writew(0, FPGA_LCDREG); 188 __raw_writew(0, FPGA_LCDREG);
@@ -212,21 +207,24 @@ static struct sh_mobile_lcdc_info lcdc_info = {
212 .clock_source = LCDC_CLK_EXTERNAL, 207 .clock_source = LCDC_CLK_EXTERNAL,
213 .ch[0] = { 208 .ch[0] = {
214 .chan = LCDC_CHAN_MAINLCD, 209 .chan = LCDC_CHAN_MAINLCD,
215 .fourcc = V4L2_PIX_FMT_RGB565, 210 .bpp = 16,
216 .interface_type = RGB18, 211 .interface_type = RGB18,
217 .clock_divider = 1, 212 .clock_divider = 1,
218 .lcd_modes = ap325rxa_lcdc_modes, 213 .lcd_cfg = ap325rxa_lcdc_modes,
219 .num_modes = ARRAY_SIZE(ap325rxa_lcdc_modes), 214 .num_cfg = ARRAY_SIZE(ap325rxa_lcdc_modes),
220 .panel_cfg = { 215 .lcd_size_cfg = { /* 7.0 inch */
221 .width = 152, /* 7.0 inch */ 216 .width = 152,
222 .height = 91, 217 .height = 91,
218 },
219 .board_cfg = {
223 .display_on = ap320_wvga_power_on, 220 .display_on = ap320_wvga_power_on,
224 .display_off = ap320_wvga_power_off, 221 .display_off = ap320_wvga_power_off,
222 .set_brightness = ap320_wvga_set_brightness,
223 .get_brightness = ap320_wvga_get_brightness,
225 }, 224 },
226 .bl_info = { 225 .bl_info = {
227 .name = "sh_mobile_lcdc_bl", 226 .name = "sh_mobile_lcdc_bl",
228 .max_brightness = 1, 227 .max_brightness = 1,
229 .set_brightness = ap320_wvga_set_brightness,
230 }, 228 },
231 } 229 }
232}; 230};
@@ -239,7 +237,7 @@ static struct resource lcdc_resources[] = {
239 .flags = IORESOURCE_MEM, 237 .flags = IORESOURCE_MEM,
240 }, 238 },
241 [1] = { 239 [1] = {
242 .start = evt2irq(0x580), 240 .start = 28,
243 .flags = IORESOURCE_IRQ, 241 .flags = IORESOURCE_IRQ,
244 }, 242 },
245}; 243};
@@ -251,6 +249,9 @@ static struct platform_device lcdc_device = {
251 .dev = { 249 .dev = {
252 .platform_data = &lcdc_info, 250 .platform_data = &lcdc_info,
253 }, 251 },
252 .archdata = {
253 .hwblk_id = HWBLK_LCDC,
254 },
254}; 255};
255 256
256static void camera_power(int val) 257static void camera_power(int val)
@@ -344,10 +345,9 @@ static struct soc_camera_platform_info camera_info = {
344 .width = 640, 345 .width = 640,
345 .height = 480, 346 .height = 480,
346 }, 347 },
347 .mbus_param = V4L2_MBUS_PCLK_SAMPLE_RISING | V4L2_MBUS_MASTER | 348 .bus_param = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH |
348 V4L2_MBUS_VSYNC_ACTIVE_HIGH | V4L2_MBUS_HSYNC_ACTIVE_HIGH | 349 SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8 |
349 V4L2_MBUS_DATA_ACTIVE_HIGH, 350 SOCAM_DATA_ACTIVE_HIGH,
350 .mbus_type = V4L2_MBUS_PARALLEL,
351 .set_capture = camera_set_capture, 351 .set_capture = camera_set_capture,
352}; 352};
353 353
@@ -407,7 +407,7 @@ static struct resource ceu_resources[] = {
407 .flags = IORESOURCE_MEM, 407 .flags = IORESOURCE_MEM,
408 }, 408 },
409 [1] = { 409 [1] = {
410 .start = evt2irq(0x880), 410 .start = 52,
411 .flags = IORESOURCE_IRQ, 411 .flags = IORESOURCE_IRQ,
412 }, 412 },
413 [2] = { 413 [2] = {
@@ -423,15 +423,9 @@ static struct platform_device ceu_device = {
423 .dev = { 423 .dev = {
424 .platform_data = &sh_mobile_ceu_info, 424 .platform_data = &sh_mobile_ceu_info,
425 }, 425 },
426}; 426 .archdata = {
427 427 .hwblk_id = HWBLK_CEU,
428/* Fixed 3.3V regulators to be used by SDHI0, SDHI1 */ 428 },
429static struct regulator_consumer_supply fixed3v3_power_consumers[] =
430{
431 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
432 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
433 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
434 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
435}; 429};
436 430
437static struct resource sdhi0_cn3_resources[] = { 431static struct resource sdhi0_cn3_resources[] = {
@@ -442,7 +436,7 @@ static struct resource sdhi0_cn3_resources[] = {
442 .flags = IORESOURCE_MEM, 436 .flags = IORESOURCE_MEM,
443 }, 437 },
444 [1] = { 438 [1] = {
445 .start = evt2irq(0xe80), 439 .start = 100,
446 .flags = IORESOURCE_IRQ, 440 .flags = IORESOURCE_IRQ,
447 }, 441 },
448}; 442};
@@ -459,6 +453,9 @@ static struct platform_device sdhi0_cn3_device = {
459 .dev = { 453 .dev = {
460 .platform_data = &sdhi0_cn3_data, 454 .platform_data = &sdhi0_cn3_data,
461 }, 455 },
456 .archdata = {
457 .hwblk_id = HWBLK_SDHI0,
458 },
462}; 459};
463 460
464static struct resource sdhi1_cn7_resources[] = { 461static struct resource sdhi1_cn7_resources[] = {
@@ -469,7 +466,7 @@ static struct resource sdhi1_cn7_resources[] = {
469 .flags = IORESOURCE_MEM, 466 .flags = IORESOURCE_MEM,
470 }, 467 },
471 [1] = { 468 [1] = {
472 .start = evt2irq(0x4e0), 469 .start = 23,
473 .flags = IORESOURCE_IRQ, 470 .flags = IORESOURCE_IRQ,
474 }, 471 },
475}; 472};
@@ -486,6 +483,9 @@ static struct platform_device sdhi1_cn7_device = {
486 .dev = { 483 .dev = {
487 .platform_data = &sdhi1_cn7_data, 484 .platform_data = &sdhi1_cn7_data,
488 }, 485 },
486 .archdata = {
487 .hwblk_id = HWBLK_SDHI1,
488 },
489}; 489};
490 490
491static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { 491static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = {
@@ -501,7 +501,8 @@ static struct i2c_board_info ap325rxa_i2c_camera[] = {
501}; 501};
502 502
503static struct ov772x_camera_info ov7725_info = { 503static struct ov772x_camera_info ov7725_info = {
504 .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP, 504 .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP | \
505 OV772X_FLAG_8BIT,
505 .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0), 506 .edgectrl = OV772X_AUTO_EDGECTRL(0xf, 0),
506}; 507};
507 508
@@ -555,10 +556,6 @@ static int __init ap325rxa_devices_setup(void)
555 &ap325rxa_sdram_leave_start, 556 &ap325rxa_sdram_leave_start,
556 &ap325rxa_sdram_leave_end); 557 &ap325rxa_sdram_leave_end);
557 558
558 regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
559 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
560 regulator_register_fixed(1, dummy_supplies, ARRAY_SIZE(dummy_supplies));
561
562 /* LD3 and LD4 LEDs */ 559 /* LD3 and LD4 LEDs */
563 gpio_request(GPIO_PTX5, NULL); /* RUN */ 560 gpio_request(GPIO_PTX5, NULL); /* RUN */
564 gpio_direction_output(GPIO_PTX5, 1); 561 gpio_direction_output(GPIO_PTX5, 1);
diff --git a/arch/sh/boards/mach-cayman/irq.c b/arch/sh/boards/mach-cayman/irq.c
index 724e8b7271f..311bcebdbd0 100644
--- a/arch/sh/boards/mach-cayman/irq.c
+++ b/arch/sh/boards/mach-cayman/irq.c
@@ -46,11 +46,13 @@ static irqreturn_t cayman_interrupt_pci2(int irq, void *dev_id)
46static struct irqaction cayman_action_smsc = { 46static struct irqaction cayman_action_smsc = {
47 .name = "Cayman SMSC Mux", 47 .name = "Cayman SMSC Mux",
48 .handler = cayman_interrupt_smsc, 48 .handler = cayman_interrupt_smsc,
49 .flags = IRQF_DISABLED,
49}; 50};
50 51
51static struct irqaction cayman_action_pci2 = { 52static struct irqaction cayman_action_pci2 = {
52 .name = "Cayman PCI2 Mux", 53 .name = "Cayman PCI2 Mux",
53 .handler = cayman_interrupt_pci2, 54 .handler = cayman_interrupt_pci2,
55 .flags = IRQF_DISABLED,
54}; 56};
55 57
56static void enable_cayman_irq(struct irq_data *data) 58static void enable_cayman_irq(struct irq_data *data)
diff --git a/arch/sh/boards/mach-cayman/setup.c b/arch/sh/boards/mach-cayman/setup.c
index 340fd40b381..e89e8e122a2 100644
--- a/arch/sh/boards/mach-cayman/setup.c
+++ b/arch/sh/boards/mach-cayman/setup.c
@@ -181,6 +181,7 @@ extern void init_cayman_irq(void);
181 181
182static struct sh_machine_vector mv_cayman __initmv = { 182static struct sh_machine_vector mv_cayman __initmv = {
183 .mv_name = "Hitachi Cayman", 183 .mv_name = "Hitachi Cayman",
184 .mv_nr_irqs = 64,
184 .mv_ioport_map = cayman_ioport_map, 185 .mv_ioport_map = cayman_ioport_map,
185 .mv_init_irq = init_cayman_irq, 186 .mv_init_irq = init_cayman_irq,
186}; 187};
diff --git a/arch/sh/boards/mach-dreamcast/irq.c b/arch/sh/boards/mach-dreamcast/irq.c
index 2789647abeb..f63d323f411 100644
--- a/arch/sh/boards/mach-dreamcast/irq.c
+++ b/arch/sh/boards/mach-dreamcast/irq.c
@@ -8,11 +8,10 @@
8 * This file is part of the LinuxDC project (www.linuxdc.org) 8 * This file is part of the LinuxDC project (www.linuxdc.org)
9 * Released under the terms of the GNU GPL v2.0 9 * Released under the terms of the GNU GPL v2.0
10 */ 10 */
11
11#include <linux/irq.h> 12#include <linux/irq.h>
12#include <linux/io.h> 13#include <linux/io.h>
13#include <linux/irq.h> 14#include <asm/irq.h>
14#include <linux/export.h>
15#include <linux/err.h>
16#include <mach/sysasic.h> 15#include <mach/sysasic.h>
17 16
18/* 17/*
@@ -142,15 +141,26 @@ int systemasic_irq_demux(int irq)
142 141
143void systemasic_irq_init(void) 142void systemasic_irq_init(void)
144{ 143{
145 int irq_base, i; 144 int i, nid = cpu_to_node(boot_cpu_data);
146 145
147 irq_base = irq_alloc_descs(HW_EVENT_IRQ_BASE, HW_EVENT_IRQ_BASE, 146 /* Assign all virtual IRQs to the System ASIC int. handler */
148 HW_EVENT_IRQ_MAX - HW_EVENT_IRQ_BASE, -1); 147 for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++) {
149 if (IS_ERR_VALUE(irq_base)) { 148 unsigned int irq;
150 pr_err("%s: failed hooking irqs\n", __func__); 149
151 return; 150 irq = create_irq_nr(i, nid);
152 } 151 if (unlikely(irq == 0)) {
152 pr_err("%s: failed hooking irq %d for systemasic\n",
153 __func__, i);
154 return;
155 }
156
157 if (unlikely(irq != i)) {
158 pr_err("%s: got irq %d but wanted %d, bailing.\n",
159 __func__, irq, i);
160 destroy_irq(irq);
161 return;
162 }
153 163
154 for (i = HW_EVENT_IRQ_BASE; i < HW_EVENT_IRQ_MAX; i++)
155 irq_set_chip_and_handler(i, &systemasic_int, handle_level_irq); 164 irq_set_chip_and_handler(i, &systemasic_int, handle_level_irq);
165 }
156} 166}
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 3fede4556c9..b24d69d509e 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -19,8 +19,6 @@
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/io.h> 20#include <linux/io.h>
21#include <linux/delay.h> 21#include <linux/delay.h>
22#include <linux/regulator/fixed.h>
23#include <linux/regulator/machine.h>
24#include <linux/usb/r8a66597.h> 22#include <linux/usb/r8a66597.h>
25#include <linux/usb/renesas_usbhs.h> 23#include <linux/usb/renesas_usbhs.h>
26#include <linux/i2c.h> 24#include <linux/i2c.h>
@@ -30,17 +28,13 @@
30#include <linux/spi/mmc_spi.h> 28#include <linux/spi/mmc_spi.h>
31#include <linux/input.h> 29#include <linux/input.h>
32#include <linux/input/sh_keysc.h> 30#include <linux/input/sh_keysc.h>
33#include <linux/sh_eth.h>
34#include <linux/sh_intc.h>
35#include <linux/videodev2.h>
36#include <video/sh_mobile_lcdc.h> 31#include <video/sh_mobile_lcdc.h>
37#include <sound/sh_fsi.h> 32#include <sound/sh_fsi.h>
38#include <sound/simple_card.h>
39#include <media/sh_mobile_ceu.h> 33#include <media/sh_mobile_ceu.h>
40#include <media/soc_camera.h>
41#include <media/tw9910.h> 34#include <media/tw9910.h>
42#include <media/mt9t112.h> 35#include <media/mt9t112.h>
43#include <asm/heartbeat.h> 36#include <asm/heartbeat.h>
37#include <asm/sh_eth.h>
44#include <asm/clock.h> 38#include <asm/clock.h>
45#include <asm/suspend.h> 39#include <asm/suspend.h>
46#include <cpu/sh7724.h> 40#include <cpu/sh7724.h>
@@ -141,7 +135,7 @@ static struct resource sh_eth_resources[] = {
141 .flags = IORESOURCE_MEM, 135 .flags = IORESOURCE_MEM,
142 }, 136 },
143 [1] = { 137 [1] = {
144 .start = evt2irq(0xd60), 138 .start = 91,
145 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 139 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
146 }, 140 },
147}; 141};
@@ -162,6 +156,9 @@ static struct platform_device sh_eth_device = {
162 }, 156 },
163 .num_resources = ARRAY_SIZE(sh_eth_resources), 157 .num_resources = ARRAY_SIZE(sh_eth_resources),
164 .resource = sh_eth_resources, 158 .resource = sh_eth_resources,
159 .archdata = {
160 .hwblk_id = HWBLK_ETHER,
161 },
165}; 162};
166 163
167/* USB0 host */ 164/* USB0 host */
@@ -182,8 +179,8 @@ static struct resource usb0_host_resources[] = {
182 .flags = IORESOURCE_MEM, 179 .flags = IORESOURCE_MEM,
183 }, 180 },
184 [1] = { 181 [1] = {
185 .start = evt2irq(0xa20), 182 .start = 65,
186 .end = evt2irq(0xa20), 183 .end = 65,
187 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 184 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
188 }, 185 },
189}; 186};
@@ -218,8 +215,8 @@ static struct resource usb1_common_resources[] = {
218 .flags = IORESOURCE_MEM, 215 .flags = IORESOURCE_MEM,
219 }, 216 },
220 [1] = { 217 [1] = {
221 .start = evt2irq(0xa40), 218 .start = 66,
222 .end = evt2irq(0xa40), 219 .end = 66,
223 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 220 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
224 }, 221 },
225}; 222};
@@ -244,25 +241,13 @@ static int usbhs_get_id(struct platform_device *pdev)
244 return gpio_get_value(GPIO_PTB3); 241 return gpio_get_value(GPIO_PTB3);
245} 242}
246 243
247static void usbhs_phy_reset(struct platform_device *pdev)
248{
249 /* enable vbus if HOST */
250 if (!gpio_get_value(GPIO_PTB3))
251 gpio_set_value(GPIO_PTB5, 1);
252}
253
254static struct renesas_usbhs_platform_info usbhs_info = { 244static struct renesas_usbhs_platform_info usbhs_info = {
255 .platform_callback = { 245 .platform_callback = {
256 .get_id = usbhs_get_id, 246 .get_id = usbhs_get_id,
257 .phy_reset = usbhs_phy_reset,
258 }, 247 },
259 .driver_param = { 248 .driver_param = {
260 .buswait_bwait = 4, 249 .buswait_bwait = 4,
261 .detection_delay = 5, 250 .detection_delay = 5,
262 .d0_tx_id = SHDMA_SLAVE_USB1D0_TX,
263 .d0_rx_id = SHDMA_SLAVE_USB1D0_RX,
264 .d1_tx_id = SHDMA_SLAVE_USB1D1_TX,
265 .d1_rx_id = SHDMA_SLAVE_USB1D1_RX,
266 }, 251 },
267}; 252};
268 253
@@ -273,8 +258,8 @@ static struct resource usbhs_resources[] = {
273 .flags = IORESOURCE_MEM, 258 .flags = IORESOURCE_MEM,
274 }, 259 },
275 [1] = { 260 [1] = {
276 .start = evt2irq(0xa40), 261 .start = 66,
277 .end = evt2irq(0xa40), 262 .end = 66,
278 .flags = IORESOURCE_IRQ, 263 .flags = IORESOURCE_IRQ,
279 }, 264 },
280}; 265};
@@ -289,6 +274,9 @@ static struct platform_device usbhs_device = {
289 }, 274 },
290 .num_resources = ARRAY_SIZE(usbhs_resources), 275 .num_resources = ARRAY_SIZE(usbhs_resources),
291 .resource = usbhs_resources, 276 .resource = usbhs_resources,
277 .archdata = {
278 .hwblk_id = HWBLK_USB1,
279 },
292}; 280};
293 281
294/* LCDC */ 282/* LCDC */
@@ -322,26 +310,34 @@ static const struct fb_videomode ecovec_dvi_modes[] = {
322 }, 310 },
323}; 311};
324 312
325static int ecovec24_set_brightness(int brightness) 313static int ecovec24_set_brightness(void *board_data, int brightness)
326{ 314{
327 gpio_set_value(GPIO_PTR1, brightness); 315 gpio_set_value(GPIO_PTR1, brightness);
328 316
329 return 0; 317 return 0;
330} 318}
331 319
320static int ecovec24_get_brightness(void *board_data)
321{
322 return gpio_get_value(GPIO_PTR1);
323}
324
332static struct sh_mobile_lcdc_info lcdc_info = { 325static struct sh_mobile_lcdc_info lcdc_info = {
333 .ch[0] = { 326 .ch[0] = {
334 .interface_type = RGB18, 327 .interface_type = RGB18,
335 .chan = LCDC_CHAN_MAINLCD, 328 .chan = LCDC_CHAN_MAINLCD,
336 .fourcc = V4L2_PIX_FMT_RGB565, 329 .bpp = 16,
337 .panel_cfg = { /* 7.0 inch */ 330 .lcd_size_cfg = { /* 7.0 inch */
338 .width = 152, 331 .width = 152,
339 .height = 91, 332 .height = 91,
340 }, 333 },
334 .board_cfg = {
335 .set_brightness = ecovec24_set_brightness,
336 .get_brightness = ecovec24_get_brightness,
337 },
341 .bl_info = { 338 .bl_info = {
342 .name = "sh_mobile_lcdc_bl", 339 .name = "sh_mobile_lcdc_bl",
343 .max_brightness = 1, 340 .max_brightness = 1,
344 .set_brightness = ecovec24_set_brightness,
345 }, 341 },
346 } 342 }
347}; 343};
@@ -354,7 +350,7 @@ static struct resource lcdc_resources[] = {
354 .flags = IORESOURCE_MEM, 350 .flags = IORESOURCE_MEM,
355 }, 351 },
356 [1] = { 352 [1] = {
357 .start = evt2irq(0xf40), 353 .start = 106,
358 .flags = IORESOURCE_IRQ, 354 .flags = IORESOURCE_IRQ,
359 }, 355 },
360}; 356};
@@ -366,6 +362,9 @@ static struct platform_device lcdc_device = {
366 .dev = { 362 .dev = {
367 .platform_data = &lcdc_info, 363 .platform_data = &lcdc_info,
368 }, 364 },
365 .archdata = {
366 .hwblk_id = HWBLK_LCDC,
367 },
369}; 368};
370 369
371/* CEU0 */ 370/* CEU0 */
@@ -381,7 +380,7 @@ static struct resource ceu0_resources[] = {
381 .flags = IORESOURCE_MEM, 380 .flags = IORESOURCE_MEM,
382 }, 381 },
383 [1] = { 382 [1] = {
384 .start = evt2irq(0x880), 383 .start = 52,
385 .flags = IORESOURCE_IRQ, 384 .flags = IORESOURCE_IRQ,
386 }, 385 },
387 [2] = { 386 [2] = {
@@ -397,6 +396,9 @@ static struct platform_device ceu0_device = {
397 .dev = { 396 .dev = {
398 .platform_data = &sh_mobile_ceu0_info, 397 .platform_data = &sh_mobile_ceu0_info,
399 }, 398 },
399 .archdata = {
400 .hwblk_id = HWBLK_CEU0,
401 },
400}; 402};
401 403
402/* CEU1 */ 404/* CEU1 */
@@ -412,7 +414,7 @@ static struct resource ceu1_resources[] = {
412 .flags = IORESOURCE_MEM, 414 .flags = IORESOURCE_MEM,
413 }, 415 },
414 [1] = { 416 [1] = {
415 .start = evt2irq(0x9e0), 417 .start = 63,
416 .flags = IORESOURCE_IRQ, 418 .flags = IORESOURCE_IRQ,
417 }, 419 },
418 [2] = { 420 [2] = {
@@ -428,6 +430,9 @@ static struct platform_device ceu1_device = {
428 .dev = { 430 .dev = {
429 .platform_data = &sh_mobile_ceu1_info, 431 .platform_data = &sh_mobile_ceu1_info,
430 }, 432 },
433 .archdata = {
434 .hwblk_id = HWBLK_CEU1,
435 },
431}; 436};
432 437
433/* I2C device */ 438/* I2C device */
@@ -443,7 +448,7 @@ static struct i2c_board_info i2c1_devices[] = {
443 }, 448 },
444 { 449 {
445 I2C_BOARD_INFO("lis3lv02d", 0x1c), 450 I2C_BOARD_INFO("lis3lv02d", 0x1c),
446 .irq = evt2irq(0x620), 451 .irq = 33,
447 } 452 }
448}; 453};
449 454
@@ -469,7 +474,7 @@ static struct resource keysc_resources[] = {
469 .flags = IORESOURCE_MEM, 474 .flags = IORESOURCE_MEM,
470 }, 475 },
471 [1] = { 476 [1] = {
472 .start = evt2irq(0xbe0), 477 .start = 79,
473 .flags = IORESOURCE_IRQ, 478 .flags = IORESOURCE_IRQ,
474 }, 479 },
475}; 480};
@@ -482,11 +487,13 @@ static struct platform_device keysc_device = {
482 .dev = { 487 .dev = {
483 .platform_data = &keysc_info, 488 .platform_data = &keysc_info,
484 }, 489 },
490 .archdata = {
491 .hwblk_id = HWBLK_KEYSC,
492 },
485}; 493};
486 494
487/* TouchScreen */ 495/* TouchScreen */
488#define IRQ0 evt2irq(0x600) 496#define IRQ0 32
489
490static int ts_get_pendown_state(void) 497static int ts_get_pendown_state(void)
491{ 498{
492 int val = 0; 499 int val = 0;
@@ -522,101 +529,18 @@ static struct i2c_board_info ts_i2c_clients = {
522 .irq = IRQ0, 529 .irq = IRQ0,
523}; 530};
524 531
525static struct regulator_consumer_supply cn12_power_consumers[] =
526{
527 REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"),
528 REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"),
529 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
530 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
531};
532
533static struct regulator_init_data cn12_power_init_data = {
534 .constraints = {
535 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
536 },
537 .num_consumer_supplies = ARRAY_SIZE(cn12_power_consumers),
538 .consumer_supplies = cn12_power_consumers,
539};
540
541static struct fixed_voltage_config cn12_power_info = {
542 .supply_name = "CN12 SD/MMC Vdd",
543 .microvolts = 3300000,
544 .gpio = GPIO_PTB7,
545 .enable_high = 1,
546 .init_data = &cn12_power_init_data,
547};
548
549static struct platform_device cn12_power = {
550 .name = "reg-fixed-voltage",
551 .id = 0,
552 .dev = {
553 .platform_data = &cn12_power_info,
554 },
555};
556
557#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) 532#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
558/* SDHI0 */ 533/* SDHI0 */
559static struct regulator_consumer_supply sdhi0_power_consumers[] =
560{
561 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
562 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
563};
564
565static struct regulator_init_data sdhi0_power_init_data = {
566 .constraints = {
567 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
568 },
569 .num_consumer_supplies = ARRAY_SIZE(sdhi0_power_consumers),
570 .consumer_supplies = sdhi0_power_consumers,
571};
572
573static struct fixed_voltage_config sdhi0_power_info = {
574 .supply_name = "CN11 SD/MMC Vdd",
575 .microvolts = 3300000,
576 .gpio = GPIO_PTB6,
577 .enable_high = 1,
578 .init_data = &sdhi0_power_init_data,
579};
580
581static struct platform_device sdhi0_power = {
582 .name = "reg-fixed-voltage",
583 .id = 1,
584 .dev = {
585 .platform_data = &sdhi0_power_info,
586 },
587};
588
589static void sdhi0_set_pwr(struct platform_device *pdev, int state) 534static void sdhi0_set_pwr(struct platform_device *pdev, int state)
590{ 535{
591 static int power_gpio = -EINVAL;
592
593 if (power_gpio < 0) {
594 int ret = gpio_request(GPIO_PTB6, NULL);
595 if (!ret) {
596 power_gpio = GPIO_PTB6;
597 gpio_direction_output(power_gpio, 0);
598 }
599 }
600
601 /*
602 * Toggle the GPIO regardless, whether we managed to grab it above or
603 * the fixed regulator driver did.
604 */
605 gpio_set_value(GPIO_PTB6, state); 536 gpio_set_value(GPIO_PTB6, state);
606} 537}
607 538
608static int sdhi0_get_cd(struct platform_device *pdev)
609{
610 return !gpio_get_value(GPIO_PTY7);
611}
612
613static struct sh_mobile_sdhi_info sdhi0_info = { 539static struct sh_mobile_sdhi_info sdhi0_info = {
614 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX, 540 .dma_slave_tx = SHDMA_SLAVE_SDHI0_TX,
615 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX, 541 .dma_slave_rx = SHDMA_SLAVE_SDHI0_RX,
616 .set_pwr = sdhi0_set_pwr, 542 .set_pwr = sdhi0_set_pwr,
617 .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD | 543 .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD,
618 MMC_CAP_NEEDS_POLL,
619 .get_cd = sdhi0_get_cd,
620}; 544};
621 545
622static struct resource sdhi0_resources[] = { 546static struct resource sdhi0_resources[] = {
@@ -627,7 +551,7 @@ static struct resource sdhi0_resources[] = {
627 .flags = IORESOURCE_MEM, 551 .flags = IORESOURCE_MEM,
628 }, 552 },
629 [1] = { 553 [1] = {
630 .start = evt2irq(0xe80), 554 .start = 100,
631 .flags = IORESOURCE_IRQ, 555 .flags = IORESOURCE_IRQ,
632 }, 556 },
633}; 557};
@@ -640,41 +564,23 @@ static struct platform_device sdhi0_device = {
640 .dev = { 564 .dev = {
641 .platform_data = &sdhi0_info, 565 .platform_data = &sdhi0_info,
642 }, 566 },
567 .archdata = {
568 .hwblk_id = HWBLK_SDHI0,
569 },
643}; 570};
644 571
645static void cn12_set_pwr(struct platform_device *pdev, int state)
646{
647 static int power_gpio = -EINVAL;
648
649 if (power_gpio < 0) {
650 int ret = gpio_request(GPIO_PTB7, NULL);
651 if (!ret) {
652 power_gpio = GPIO_PTB7;
653 gpio_direction_output(power_gpio, 0);
654 }
655 }
656
657 /*
658 * Toggle the GPIO regardless, whether we managed to grab it above or
659 * the fixed regulator driver did.
660 */
661 gpio_set_value(GPIO_PTB7, state);
662}
663
664#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 572#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
665/* SDHI1 */ 573/* SDHI1 */
666static int sdhi1_get_cd(struct platform_device *pdev) 574static void sdhi1_set_pwr(struct platform_device *pdev, int state)
667{ 575{
668 return !gpio_get_value(GPIO_PTW7); 576 gpio_set_value(GPIO_PTB7, state);
669} 577}
670 578
671static struct sh_mobile_sdhi_info sdhi1_info = { 579static struct sh_mobile_sdhi_info sdhi1_info = {
672 .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX, 580 .dma_slave_tx = SHDMA_SLAVE_SDHI1_TX,
673 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX, 581 .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX,
674 .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD | 582 .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD,
675 MMC_CAP_NEEDS_POLL, 583 .set_pwr = sdhi1_set_pwr,
676 .set_pwr = cn12_set_pwr,
677 .get_cd = sdhi1_get_cd,
678}; 584};
679 585
680static struct resource sdhi1_resources[] = { 586static struct resource sdhi1_resources[] = {
@@ -685,7 +591,7 @@ static struct resource sdhi1_resources[] = {
685 .flags = IORESOURCE_MEM, 591 .flags = IORESOURCE_MEM,
686 }, 592 },
687 [1] = { 593 [1] = {
688 .start = evt2irq(0x4e0), 594 .start = 23,
689 .flags = IORESOURCE_IRQ, 595 .flags = IORESOURCE_IRQ,
690 }, 596 },
691}; 597};
@@ -698,6 +604,9 @@ static struct platform_device sdhi1_device = {
698 .dev = { 604 .dev = {
699 .platform_data = &sdhi1_info, 605 .platform_data = &sdhi1_info,
700 }, 606 },
607 .archdata = {
608 .hwblk_id = HWBLK_SDHI1,
609 },
701}; 610};
702#endif /* CONFIG_MMC_SH_MMCIF */ 611#endif /* CONFIG_MMC_SH_MMCIF */
703 612
@@ -750,7 +659,7 @@ static struct resource msiof0_resources[] = {
750 .flags = IORESOURCE_MEM, 659 .flags = IORESOURCE_MEM,
751 }, 660 },
752 [1] = { 661 [1] = {
753 .start = evt2irq(0xc80), 662 .start = 84,
754 .flags = IORESOURCE_IRQ, 663 .flags = IORESOURCE_IRQ,
755 }, 664 },
756}; 665};
@@ -763,6 +672,9 @@ static struct platform_device msiof0_device = {
763 }, 672 },
764 .num_resources = ARRAY_SIZE(msiof0_resources), 673 .num_resources = ARRAY_SIZE(msiof0_resources),
765 .resource = msiof0_resources, 674 .resource = msiof0_resources,
675 .archdata = {
676 .hwblk_id = HWBLK_MSIOF0,
677 },
766}; 678};
767 679
768#endif 680#endif
@@ -878,9 +790,7 @@ static struct platform_device camera_devices[] = {
878 790
879/* FSI */ 791/* FSI */
880static struct sh_fsi_platform_info fsi_info = { 792static struct sh_fsi_platform_info fsi_info = {
881 .port_b = { 793 .portb_flags = SH_FSI_BRS_INV,
882 .flags = SH_FSI_BRS_INV,
883 },
884}; 794};
885 795
886static struct resource fsi_resources[] = { 796static struct resource fsi_resources[] = {
@@ -891,7 +801,7 @@ static struct resource fsi_resources[] = {
891 .flags = IORESOURCE_MEM, 801 .flags = IORESOURCE_MEM,
892 }, 802 },
893 [1] = { 803 [1] = {
894 .start = evt2irq(0xf80), 804 .start = 108,
895 .flags = IORESOURCE_IRQ, 805 .flags = IORESOURCE_IRQ,
896 }, 806 },
897}; 807};
@@ -904,32 +814,11 @@ static struct platform_device fsi_device = {
904 .dev = { 814 .dev = {
905 .platform_data = &fsi_info, 815 .platform_data = &fsi_info,
906 }, 816 },
907}; 817 .archdata = {
908 818 .hwblk_id = HWBLK_SPU, /* FSI needs SPU hwblk */
909static struct asoc_simple_dai_init_info fsi_da7210_init_info = {
910 .fmt = SND_SOC_DAIFMT_I2S,
911 .codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
912 .cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
913};
914
915static struct asoc_simple_card_info fsi_da7210_info = {
916 .name = "DA7210",
917 .card = "FSIB-DA7210",
918 .cpu_dai = "fsib-dai",
919 .codec = "da7210.0-001a",
920 .platform = "sh_fsi.0",
921 .codec_dai = "da7210-hifi",
922 .init = &fsi_da7210_init_info,
923};
924
925static struct platform_device fsi_da7210_device = {
926 .name = "asoc-simple-card",
927 .dev = {
928 .platform_data = &fsi_da7210_info,
929 }, 819 },
930}; 820};
931 821
932
933/* IrDA */ 822/* IrDA */
934static struct resource irda_resources[] = { 823static struct resource irda_resources[] = {
935 [0] = { 824 [0] = {
@@ -939,7 +828,7 @@ static struct resource irda_resources[] = {
939 .flags = IORESOURCE_MEM, 828 .flags = IORESOURCE_MEM,
940 }, 829 },
941 [1] = { 830 [1] = {
942 .start = evt2irq(0x480), 831 .start = 20,
943 .flags = IORESOURCE_IRQ, 832 .flags = IORESOURCE_IRQ,
944 }, 833 },
945}; 834};
@@ -976,7 +865,7 @@ static struct resource sh_vou_resources[] = {
976 .flags = IORESOURCE_MEM, 865 .flags = IORESOURCE_MEM,
977 }, 866 },
978 [1] = { 867 [1] = {
979 .start = evt2irq(0x8e0), 868 .start = 55,
980 .flags = IORESOURCE_IRQ, 869 .flags = IORESOURCE_IRQ,
981 }, 870 },
982}; 871};
@@ -989,13 +878,21 @@ static struct platform_device vou_device = {
989 .dev = { 878 .dev = {
990 .platform_data = &sh_vou_pdata, 879 .platform_data = &sh_vou_pdata,
991 }, 880 },
881 .archdata = {
882 .hwblk_id = HWBLK_VOU,
883 },
992}; 884};
993 885
994#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE) 886#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
995/* SH_MMCIF */ 887/* SH_MMCIF */
888static void mmcif_set_pwr(struct platform_device *pdev, int state)
889{
890 gpio_set_value(GPIO_PTB7, state);
891}
892
996static void mmcif_down_pwr(struct platform_device *pdev) 893static void mmcif_down_pwr(struct platform_device *pdev)
997{ 894{
998 cn12_set_pwr(pdev, 0); 895 gpio_set_value(GPIO_PTB7, 0);
999} 896}
1000 897
1001static struct resource sh_mmcif_resources[] = { 898static struct resource sh_mmcif_resources[] = {
@@ -1007,18 +904,18 @@ static struct resource sh_mmcif_resources[] = {
1007 }, 904 },
1008 [1] = { 905 [1] = {
1009 /* MMC2I */ 906 /* MMC2I */
1010 .start = evt2irq(0x5a0), 907 .start = 29,
1011 .flags = IORESOURCE_IRQ, 908 .flags = IORESOURCE_IRQ,
1012 }, 909 },
1013 [2] = { 910 [2] = {
1014 /* MMC3I */ 911 /* MMC3I */
1015 .start = evt2irq(0x5c0), 912 .start = 30,
1016 .flags = IORESOURCE_IRQ, 913 .flags = IORESOURCE_IRQ,
1017 }, 914 },
1018}; 915};
1019 916
1020static struct sh_mmcif_plat_data sh_mmcif_plat = { 917static struct sh_mmcif_plat_data sh_mmcif_plat = {
1021 .set_pwr = cn12_set_pwr, 918 .set_pwr = mmcif_set_pwr,
1022 .down_pwr = mmcif_down_pwr, 919 .down_pwr = mmcif_down_pwr,
1023 .sup_pclk = 0, /* SH7724: Max Pclk/2 */ 920 .sup_pclk = 0, /* SH7724: Max Pclk/2 */
1024 .caps = MMC_CAP_4_BIT_DATA | 921 .caps = MMC_CAP_4_BIT_DATA |
@@ -1035,6 +932,9 @@ static struct platform_device sh_mmcif_device = {
1035 }, 932 },
1036 .num_resources = ARRAY_SIZE(sh_mmcif_resources), 933 .num_resources = ARRAY_SIZE(sh_mmcif_resources),
1037 .resource = sh_mmcif_resources, 934 .resource = sh_mmcif_resources,
935 .archdata = {
936 .hwblk_id = HWBLK_MMC,
937 },
1038}; 938};
1039#endif 939#endif
1040 940
@@ -1049,9 +949,7 @@ static struct platform_device *ecovec_devices[] __initdata = {
1049 &ceu0_device, 949 &ceu0_device,
1050 &ceu1_device, 950 &ceu1_device,
1051 &keysc_device, 951 &keysc_device,
1052 &cn12_power,
1053#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) 952#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
1054 &sdhi0_power,
1055 &sdhi0_device, 953 &sdhi0_device,
1056#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) 954#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1057 &sdhi1_device, 955 &sdhi1_device,
@@ -1063,7 +961,6 @@ static struct platform_device *ecovec_devices[] __initdata = {
1063 &camera_devices[1], 961 &camera_devices[1],
1064 &camera_devices[2], 962 &camera_devices[2],
1065 &fsi_device, 963 &fsi_device,
1066 &fsi_da7210_device,
1067 &irda_device, 964 &irda_device,
1068 &vou_device, 965 &vou_device,
1069#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE) 966#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
@@ -1134,7 +1031,6 @@ extern char ecovec24_sdram_leave_end;
1134static int __init arch_setup(void) 1031static int __init arch_setup(void)
1135{ 1032{
1136 struct clk *clk; 1033 struct clk *clk;
1137 bool cn12_enabled = false;
1138 1034
1139 /* register board specific self-refresh code */ 1035 /* register board specific self-refresh code */
1140 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF | 1036 sh_mobile_register_self_refresh(SUSP_SH_STANDBY | SUSP_SH_SF |
@@ -1250,8 +1146,8 @@ static int __init arch_setup(void)
1250 /* DVI */ 1146 /* DVI */
1251 lcdc_info.clock_source = LCDC_CLK_EXTERNAL; 1147 lcdc_info.clock_source = LCDC_CLK_EXTERNAL;
1252 lcdc_info.ch[0].clock_divider = 1; 1148 lcdc_info.ch[0].clock_divider = 1;
1253 lcdc_info.ch[0].lcd_modes = ecovec_dvi_modes; 1149 lcdc_info.ch[0].lcd_cfg = ecovec_dvi_modes;
1254 lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_dvi_modes); 1150 lcdc_info.ch[0].num_cfg = ARRAY_SIZE(ecovec_dvi_modes);
1255 1151
1256 gpio_set_value(GPIO_PTA2, 1); 1152 gpio_set_value(GPIO_PTA2, 1);
1257 gpio_set_value(GPIO_PTU1, 1); 1153 gpio_set_value(GPIO_PTU1, 1);
@@ -1259,8 +1155,8 @@ static int __init arch_setup(void)
1259 /* Panel */ 1155 /* Panel */
1260 lcdc_info.clock_source = LCDC_CLK_PERIPHERAL; 1156 lcdc_info.clock_source = LCDC_CLK_PERIPHERAL;
1261 lcdc_info.ch[0].clock_divider = 2; 1157 lcdc_info.ch[0].clock_divider = 2;
1262 lcdc_info.ch[0].lcd_modes = ecovec_lcd_modes; 1158 lcdc_info.ch[0].lcd_cfg = ecovec_lcd_modes;
1263 lcdc_info.ch[0].num_modes = ARRAY_SIZE(ecovec_lcd_modes); 1159 lcdc_info.ch[0].num_cfg = ARRAY_SIZE(ecovec_lcd_modes);
1264 1160
1265 gpio_set_value(GPIO_PTR1, 1); 1161 gpio_set_value(GPIO_PTR1, 1);
1266 1162
@@ -1335,13 +1231,9 @@ static int __init arch_setup(void)
1335 gpio_direction_input(GPIO_PTR5); 1231 gpio_direction_input(GPIO_PTR5);
1336 gpio_direction_input(GPIO_PTR6); 1232 gpio_direction_input(GPIO_PTR6);
1337 1233
1338 /* SD-card slot CN11 */
1339 /* Card-detect, used on CN11, either with SDHI0 or with SPI */
1340 gpio_request(GPIO_PTY7, NULL);
1341 gpio_direction_input(GPIO_PTY7);
1342
1343#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) 1234#if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
1344 /* enable SDHI0 on CN11 (needs DS2.4 set to ON) */ 1235 /* enable SDHI0 on CN11 (needs DS2.4 set to ON) */
1236 gpio_request(GPIO_FN_SDHI0CD, NULL);
1345 gpio_request(GPIO_FN_SDHI0WP, NULL); 1237 gpio_request(GPIO_FN_SDHI0WP, NULL);
1346 gpio_request(GPIO_FN_SDHI0CMD, NULL); 1238 gpio_request(GPIO_FN_SDHI0CMD, NULL);
1347 gpio_request(GPIO_FN_SDHI0CLK, NULL); 1239 gpio_request(GPIO_FN_SDHI0CLK, NULL);
@@ -1349,6 +1241,25 @@ static int __init arch_setup(void)
1349 gpio_request(GPIO_FN_SDHI0D2, NULL); 1241 gpio_request(GPIO_FN_SDHI0D2, NULL);
1350 gpio_request(GPIO_FN_SDHI0D1, NULL); 1242 gpio_request(GPIO_FN_SDHI0D1, NULL);
1351 gpio_request(GPIO_FN_SDHI0D0, NULL); 1243 gpio_request(GPIO_FN_SDHI0D0, NULL);
1244 gpio_request(GPIO_PTB6, NULL);
1245 gpio_direction_output(GPIO_PTB6, 0);
1246
1247#if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE)
1248 /* enable SDHI1 on CN12 (needs DS2.6,7 set to ON,OFF) */
1249 gpio_request(GPIO_FN_SDHI1CD, NULL);
1250 gpio_request(GPIO_FN_SDHI1WP, NULL);
1251 gpio_request(GPIO_FN_SDHI1CMD, NULL);
1252 gpio_request(GPIO_FN_SDHI1CLK, NULL);
1253 gpio_request(GPIO_FN_SDHI1D3, NULL);
1254 gpio_request(GPIO_FN_SDHI1D2, NULL);
1255 gpio_request(GPIO_FN_SDHI1D1, NULL);
1256 gpio_request(GPIO_FN_SDHI1D0, NULL);
1257 gpio_request(GPIO_PTB7, NULL);
1258 gpio_direction_output(GPIO_PTB7, 0);
1259
1260 /* I/O buffer drive ability is high for SDHI1 */
1261 __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA);
1262#endif /* CONFIG_MMC_SH_MMCIF */
1352#else 1263#else
1353 /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */ 1264 /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */
1354 gpio_request(GPIO_FN_MSIOF0_TXD, NULL); 1265 gpio_request(GPIO_FN_MSIOF0_TXD, NULL);
@@ -1360,47 +1271,12 @@ static int __init arch_setup(void)
1360 gpio_direction_output(GPIO_PTB6, 0); /* disable power by default */ 1271 gpio_direction_output(GPIO_PTB6, 0); /* disable power by default */
1361 gpio_request(GPIO_PTY6, NULL); /* write protect */ 1272 gpio_request(GPIO_PTY6, NULL); /* write protect */
1362 gpio_direction_input(GPIO_PTY6); 1273 gpio_direction_input(GPIO_PTY6);
1274 gpio_request(GPIO_PTY7, NULL); /* card detect */
1275 gpio_direction_input(GPIO_PTY7);
1363 1276
1364 spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus)); 1277 spi_register_board_info(spi_bus, ARRAY_SIZE(spi_bus));
1365#endif 1278#endif
1366 1279
1367 /* MMC/SD-card slot CN12 */
1368#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
1369 /* enable MMCIF (needs DS2.6,7 set to OFF,ON) */
1370 gpio_request(GPIO_FN_MMC_D7, NULL);
1371 gpio_request(GPIO_FN_MMC_D6, NULL);
1372 gpio_request(GPIO_FN_MMC_D5, NULL);
1373 gpio_request(GPIO_FN_MMC_D4, NULL);
1374 gpio_request(GPIO_FN_MMC_D3, NULL);
1375 gpio_request(GPIO_FN_MMC_D2, NULL);
1376 gpio_request(GPIO_FN_MMC_D1, NULL);
1377 gpio_request(GPIO_FN_MMC_D0, NULL);
1378 gpio_request(GPIO_FN_MMC_CLK, NULL);
1379 gpio_request(GPIO_FN_MMC_CMD, NULL);
1380
1381 cn12_enabled = true;
1382#elif defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE)
1383 /* enable SDHI1 on CN12 (needs DS2.6,7 set to ON,OFF) */
1384 gpio_request(GPIO_FN_SDHI1WP, NULL);
1385 gpio_request(GPIO_FN_SDHI1CMD, NULL);
1386 gpio_request(GPIO_FN_SDHI1CLK, NULL);
1387 gpio_request(GPIO_FN_SDHI1D3, NULL);
1388 gpio_request(GPIO_FN_SDHI1D2, NULL);
1389 gpio_request(GPIO_FN_SDHI1D1, NULL);
1390 gpio_request(GPIO_FN_SDHI1D0, NULL);
1391
1392 /* Card-detect, used on CN12 with SDHI1 */
1393 gpio_request(GPIO_PTW7, NULL);
1394 gpio_direction_input(GPIO_PTW7);
1395
1396 cn12_enabled = true;
1397#endif
1398
1399 if (cn12_enabled)
1400 /* I/O buffer drive ability is high for CN12 */
1401 __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000,
1402 IODRIVEA);
1403
1404 /* enable Video */ 1280 /* enable Video */
1405 gpio_request(GPIO_PTU2, NULL); 1281 gpio_request(GPIO_PTU2, NULL);
1406 gpio_direction_output(GPIO_PTU2, 1); 1282 gpio_direction_output(GPIO_PTU2, 1);
@@ -1459,6 +1335,25 @@ static int __init arch_setup(void)
1459 gpio_request(GPIO_PTU5, NULL); 1335 gpio_request(GPIO_PTU5, NULL);
1460 gpio_direction_output(GPIO_PTU5, 0); 1336 gpio_direction_output(GPIO_PTU5, 0);
1461 1337
1338#if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE)
1339 /* enable MMCIF (needs DS2.6,7 set to OFF,ON) */
1340 gpio_request(GPIO_FN_MMC_D7, NULL);
1341 gpio_request(GPIO_FN_MMC_D6, NULL);
1342 gpio_request(GPIO_FN_MMC_D5, NULL);
1343 gpio_request(GPIO_FN_MMC_D4, NULL);
1344 gpio_request(GPIO_FN_MMC_D3, NULL);
1345 gpio_request(GPIO_FN_MMC_D2, NULL);
1346 gpio_request(GPIO_FN_MMC_D1, NULL);
1347 gpio_request(GPIO_FN_MMC_D0, NULL);
1348 gpio_request(GPIO_FN_MMC_CLK, NULL);
1349 gpio_request(GPIO_FN_MMC_CMD, NULL);
1350 gpio_request(GPIO_PTB7, NULL);
1351 gpio_direction_output(GPIO_PTB7, 0);
1352
1353 /* I/O buffer drive ability is high for MMCIF */
1354 __raw_writew((__raw_readw(IODRIVEA) & ~0x3000) | 0x2000 , IODRIVEA);
1355#endif
1356
1462 /* enable I2C device */ 1357 /* enable I2C device */
1463 i2c_register_board_info(0, i2c0_devices, 1358 i2c_register_board_info(0, i2c0_devices,
1464 ARRAY_SIZE(i2c0_devices)); 1359 ARRAY_SIZE(i2c0_devices));
diff --git a/arch/sh/boards/mach-highlander/setup.c b/arch/sh/boards/mach-highlander/setup.c
index 4a52590fe3d..74b8db1b74a 100644
--- a/arch/sh/boards/mach-highlander/setup.c
+++ b/arch/sh/boards/mach-highlander/setup.c
@@ -322,7 +322,7 @@ static void ivdr_clk_disable(struct clk *clk)
322 __raw_writew(__raw_readw(PA_IVDRCTL) & ~(1 << IVDR_CK_ON), PA_IVDRCTL); 322 __raw_writew(__raw_readw(PA_IVDRCTL) & ~(1 << IVDR_CK_ON), PA_IVDRCTL);
323} 323}
324 324
325static struct sh_clk_ops ivdr_clk_ops = { 325static struct clk_ops ivdr_clk_ops = {
326 .enable = ivdr_clk_enable, 326 .enable = ivdr_clk_enable,
327 .disable = ivdr_clk_disable, 327 .disable = ivdr_clk_disable,
328}; 328};
diff --git a/arch/sh/boards/mach-hp6xx/hp6xx_apm.c b/arch/sh/boards/mach-hp6xx/hp6xx_apm.c
index 865d8d6e823..b49535c0ddd 100644
--- a/arch/sh/boards/mach-hp6xx/hp6xx_apm.c
+++ b/arch/sh/boards/mach-hp6xx/hp6xx_apm.c
@@ -86,7 +86,7 @@ static int __init hp6x0_apm_init(void)
86 int ret; 86 int ret;
87 87
88 ret = request_irq(HP680_BTN_IRQ, hp6x0_apm_interrupt, 88 ret = request_irq(HP680_BTN_IRQ, hp6x0_apm_interrupt,
89 0, MODNAME, NULL); 89 IRQF_DISABLED, MODNAME, NULL);
90 if (unlikely(ret < 0)) { 90 if (unlikely(ret < 0)) {
91 printk(KERN_ERR MODNAME ": IRQ %d request failed\n", 91 printk(KERN_ERR MODNAME ": IRQ %d request failed\n",
92 HP680_BTN_IRQ); 92 HP680_BTN_IRQ);
diff --git a/arch/sh/boards/mach-hp6xx/pm.c b/arch/sh/boards/mach-hp6xx/pm.c
index 8b50cf763c0..adc9b4bba82 100644
--- a/arch/sh/boards/mach-hp6xx/pm.c
+++ b/arch/sh/boards/mach-hp6xx/pm.c
@@ -14,7 +14,6 @@
14#include <linux/gfp.h> 14#include <linux/gfp.h>
15#include <asm/io.h> 15#include <asm/io.h>
16#include <asm/hd64461.h> 16#include <asm/hd64461.h>
17#include <asm/bl_bit.h>
18#include <mach/hp6xx.h> 17#include <mach/hp6xx.h>
19#include <cpu/dac.h> 18#include <cpu/dac.h>
20#include <asm/freq.h> 19#include <asm/freq.h>
diff --git a/arch/sh/boards/mach-hp6xx/setup.c b/arch/sh/boards/mach-hp6xx/setup.c
index 05797b33f68..8c9add5f4cf 100644
--- a/arch/sh/boards/mach-hp6xx/setup.c
+++ b/arch/sh/boards/mach-hp6xx/setup.c
@@ -13,7 +13,6 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/irq.h> 15#include <linux/irq.h>
16#include <linux/sh_intc.h>
17#include <sound/sh_dac_audio.h> 16#include <sound/sh_dac_audio.h>
18#include <asm/hd64461.h> 17#include <asm/hd64461.h>
19#include <asm/io.h> 18#include <asm/io.h>
@@ -36,7 +35,7 @@ static struct resource cf_ide_resources[] = {
36 .flags = IORESOURCE_MEM, 35 .flags = IORESOURCE_MEM,
37 }, 36 },
38 [2] = { 37 [2] = {
39 .start = evt2irq(0xba0), 38 .start = 77,
40 .flags = IORESOURCE_IRQ, 39 .flags = IORESOURCE_IRQ,
41 }, 40 },
42}; 41};
@@ -169,6 +168,8 @@ device_initcall(hp6xx_devices_setup);
169static struct sh_machine_vector mv_hp6xx __initmv = { 168static struct sh_machine_vector mv_hp6xx __initmv = {
170 .mv_name = "hp6xx", 169 .mv_name = "hp6xx",
171 .mv_setup = hp6xx_setup, 170 .mv_setup = hp6xx_setup,
171 /* IRQ's : CPU(64) + CCHIP(16) + FREE_TO_USE(6) */
172 .mv_nr_irqs = HD64461_IRQBASE + HD64461_IRQ_NUM + 6,
172 /* Enable IRQ0 -> IRQ3 in IRQ_MODE */ 173 /* Enable IRQ0 -> IRQ3 in IRQ_MODE */
173 .mv_init_irq = hp6xx_init_irq, 174 .mv_init_irq = hp6xx_init_irq,
174}; 175};
diff --git a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
index c6205033262..25e145fb708 100644
--- a/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
+++ b/arch/sh/boards/mach-kfr2r09/lcd_wqvga.c
@@ -251,7 +251,8 @@ static void display_on(void *sohandle,
251 write_memory_start(sohandle, so); 251 write_memory_start(sohandle, so);
252} 252}
253 253
254int kfr2r09_lcd_setup(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so) 254int kfr2r09_lcd_setup(void *board_data, void *sohandle,
255 struct sh_mobile_lcdc_sys_bus_ops *so)
255{ 256{
256 /* power on */ 257 /* power on */
257 gpio_set_value(GPIO_PTF4, 0); /* PROTECT/ -> L */ 258 gpio_set_value(GPIO_PTF4, 0); /* PROTECT/ -> L */
@@ -272,7 +273,8 @@ int kfr2r09_lcd_setup(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
272 return 0; 273 return 0;
273} 274}
274 275
275void kfr2r09_lcd_start(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so) 276void kfr2r09_lcd_start(void *board_data, void *sohandle,
277 struct sh_mobile_lcdc_sys_bus_ops *so)
276{ 278{
277 write_memory_start(sohandle, so); 279 write_memory_start(sohandle, so);
278} 280}
@@ -283,7 +285,7 @@ void kfr2r09_lcd_start(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so)
283#define MAIN_MLED4 0x40 285#define MAIN_MLED4 0x40
284#define MAIN_MSW 0x80 286#define MAIN_MSW 0x80
285 287
286int kfr2r09_lcd_set_brightness(int brightness) 288static int kfr2r09_lcd_backlight(int on)
287{ 289{
288 struct i2c_adapter *a; 290 struct i2c_adapter *a;
289 struct i2c_msg msg; 291 struct i2c_msg msg;
@@ -295,7 +297,7 @@ int kfr2r09_lcd_set_brightness(int brightness)
295 return -ENODEV; 297 return -ENODEV;
296 298
297 buf[0] = 0x00; 299 buf[0] = 0x00;
298 if (brightness) 300 if (on)
299 buf[1] = CTRL_CPSW | CTRL_C10 | CTRL_CKSW; 301 buf[1] = CTRL_CPSW | CTRL_C10 | CTRL_CKSW;
300 else 302 else
301 buf[1] = 0; 303 buf[1] = 0;
@@ -309,7 +311,7 @@ int kfr2r09_lcd_set_brightness(int brightness)
309 return -ENODEV; 311 return -ENODEV;
310 312
311 buf[0] = 0x01; 313 buf[0] = 0x01;
312 if (brightness) 314 if (on)
313 buf[1] = MAIN_MSW | MAIN_MLED4 | 0x0c; 315 buf[1] = MAIN_MSW | MAIN_MLED4 | 0x0c;
314 else 316 else
315 buf[1] = 0; 317 buf[1] = 0;
@@ -324,3 +326,13 @@ int kfr2r09_lcd_set_brightness(int brightness)
324 326
325 return 0; 327 return 0;
326} 328}
329
330void kfr2r09_lcd_on(void *board_data, struct fb_info *info)
331{
332 kfr2r09_lcd_backlight(1);
333}
334
335void kfr2r09_lcd_off(void *board_data)
336{
337 kfr2r09_lcd_backlight(0);
338}
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
index ab502f12ef5..f65271a8d07 100644
--- a/arch/sh/boards/mach-kfr2r09/setup.c
+++ b/arch/sh/boards/mach-kfr2r09/setup.c
@@ -21,11 +21,7 @@
21#include <linux/input.h> 21#include <linux/input.h>
22#include <linux/input/sh_keysc.h> 22#include <linux/input/sh_keysc.h>
23#include <linux/i2c.h> 23#include <linux/i2c.h>
24#include <linux/regulator/fixed.h>
25#include <linux/regulator/machine.h>
26#include <linux/usb/r8a66597.h> 24#include <linux/usb/r8a66597.h>
27#include <linux/videodev2.h>
28#include <linux/sh_intc.h>
29#include <media/rj54n1cb0c.h> 25#include <media/rj54n1cb0c.h>
30#include <media/soc_camera.h> 26#include <media/soc_camera.h>
31#include <media/sh_mobile_ceu.h> 27#include <media/sh_mobile_ceu.h>
@@ -113,7 +109,7 @@ static struct resource kfr2r09_sh_keysc_resources[] = {
113 .flags = IORESOURCE_MEM, 109 .flags = IORESOURCE_MEM,
114 }, 110 },
115 [1] = { 111 [1] = {
116 .start = evt2irq(0xbe0), 112 .start = 79,
117 .flags = IORESOURCE_IRQ, 113 .flags = IORESOURCE_IRQ,
118 }, 114 },
119}; 115};
@@ -126,6 +122,9 @@ static struct platform_device kfr2r09_sh_keysc_device = {
126 .dev = { 122 .dev = {
127 .platform_data = &kfr2r09_sh_keysc_info, 123 .platform_data = &kfr2r09_sh_keysc_info,
128 }, 124 },
125 .archdata = {
126 .hwblk_id = HWBLK_KEYSC,
127 },
129}; 128};
130 129
131static const struct fb_videomode kfr2r09_lcdc_modes[] = { 130static const struct fb_videomode kfr2r09_lcdc_modes[] = {
@@ -147,22 +146,21 @@ static struct sh_mobile_lcdc_info kfr2r09_sh_lcdc_info = {
147 .clock_source = LCDC_CLK_BUS, 146 .clock_source = LCDC_CLK_BUS,
148 .ch[0] = { 147 .ch[0] = {
149 .chan = LCDC_CHAN_MAINLCD, 148 .chan = LCDC_CHAN_MAINLCD,
150 .fourcc = V4L2_PIX_FMT_RGB565, 149 .bpp = 16,
151 .interface_type = SYS18, 150 .interface_type = SYS18,
152 .clock_divider = 6, 151 .clock_divider = 6,
153 .flags = LCDC_FLAGS_DWPOL, 152 .flags = LCDC_FLAGS_DWPOL,
154 .lcd_modes = kfr2r09_lcdc_modes, 153 .lcd_cfg = kfr2r09_lcdc_modes,
155 .num_modes = ARRAY_SIZE(kfr2r09_lcdc_modes), 154 .num_cfg = ARRAY_SIZE(kfr2r09_lcdc_modes),
156 .panel_cfg = { 155 .lcd_size_cfg = {
157 .width = 35, 156 .width = 35,
158 .height = 58, 157 .height = 58,
158 },
159 .board_cfg = {
159 .setup_sys = kfr2r09_lcd_setup, 160 .setup_sys = kfr2r09_lcd_setup,
160 .start_transfer = kfr2r09_lcd_start, 161 .start_transfer = kfr2r09_lcd_start,
161 }, 162 .display_on = kfr2r09_lcd_on,
162 .bl_info = { 163 .display_off = kfr2r09_lcd_off,
163 .name = "sh_mobile_lcdc_bl",
164 .max_brightness = 1,
165 .set_brightness = kfr2r09_lcd_set_brightness,
166 }, 164 },
167 .sys_bus_cfg = { 165 .sys_bus_cfg = {
168 .ldmt2r = 0x07010904, 166 .ldmt2r = 0x07010904,
@@ -181,7 +179,7 @@ static struct resource kfr2r09_sh_lcdc_resources[] = {
181 .flags = IORESOURCE_MEM, 179 .flags = IORESOURCE_MEM,
182 }, 180 },
183 [1] = { 181 [1] = {
184 .start = evt2irq(0xf40), 182 .start = 106,
185 .flags = IORESOURCE_IRQ, 183 .flags = IORESOURCE_IRQ,
186 }, 184 },
187}; 185};
@@ -193,6 +191,9 @@ static struct platform_device kfr2r09_sh_lcdc_device = {
193 .dev = { 191 .dev = {
194 .platform_data = &kfr2r09_sh_lcdc_info, 192 .platform_data = &kfr2r09_sh_lcdc_info,
195 }, 193 },
194 .archdata = {
195 .hwblk_id = HWBLK_LCDC,
196 },
196}; 197};
197 198
198static struct r8a66597_platdata kfr2r09_usb0_gadget_data = { 199static struct r8a66597_platdata kfr2r09_usb0_gadget_data = {
@@ -206,8 +207,8 @@ static struct resource kfr2r09_usb0_gadget_resources[] = {
206 .flags = IORESOURCE_MEM, 207 .flags = IORESOURCE_MEM,
207 }, 208 },
208 [1] = { 209 [1] = {
209 .start = evt2irq(0xa20), 210 .start = 65,
210 .end = evt2irq(0xa20), 211 .end = 65,
211 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 212 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
212 }, 213 },
213}; 214};
@@ -236,8 +237,8 @@ static struct resource kfr2r09_ceu_resources[] = {
236 .flags = IORESOURCE_MEM, 237 .flags = IORESOURCE_MEM,
237 }, 238 },
238 [1] = { 239 [1] = {
239 .start = evt2irq(0x880), 240 .start = 52,
240 .end = evt2irq(0x880), 241 .end = 52,
241 .flags = IORESOURCE_IRQ, 242 .flags = IORESOURCE_IRQ,
242 }, 243 },
243 [2] = { 244 [2] = {
@@ -253,6 +254,9 @@ static struct platform_device kfr2r09_ceu_device = {
253 .dev = { 254 .dev = {
254 .platform_data = &sh_mobile_ceu_info, 255 .platform_data = &sh_mobile_ceu_info,
255 }, 256 },
257 .archdata = {
258 .hwblk_id = HWBLK_CEU0,
259 },
256}; 260};
257 261
258static struct i2c_board_info kfr2r09_i2c_camera = { 262static struct i2c_board_info kfr2r09_i2c_camera = {
@@ -346,13 +350,6 @@ static struct platform_device kfr2r09_camera = {
346 }, 350 },
347}; 351};
348 352
349/* Fixed 3.3V regulator to be used by SDHI0 */
350static struct regulator_consumer_supply fixed3v3_power_consumers[] =
351{
352 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
353 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
354};
355
356static struct resource kfr2r09_sh_sdhi0_resources[] = { 353static struct resource kfr2r09_sh_sdhi0_resources[] = {
357 [0] = { 354 [0] = {
358 .name = "SDHI0", 355 .name = "SDHI0",
@@ -361,7 +358,7 @@ static struct resource kfr2r09_sh_sdhi0_resources[] = {
361 .flags = IORESOURCE_MEM, 358 .flags = IORESOURCE_MEM,
362 }, 359 },
363 [1] = { 360 [1] = {
364 .start = evt2irq(0xe80), 361 .start = 100,
365 .flags = IORESOURCE_IRQ, 362 .flags = IORESOURCE_IRQ,
366 }, 363 },
367}; 364};
@@ -380,6 +377,9 @@ static struct platform_device kfr2r09_sh_sdhi0_device = {
380 .dev = { 377 .dev = {
381 .platform_data = &sh7724_sdhi0_data, 378 .platform_data = &sh7724_sdhi0_data,
382 }, 379 },
380 .archdata = {
381 .hwblk_id = HWBLK_SDHI0,
382 },
383}; 383};
384 384
385static struct platform_device *kfr2r09_devices[] __initdata = { 385static struct platform_device *kfr2r09_devices[] __initdata = {
@@ -535,9 +535,6 @@ static int __init kfr2r09_devices_setup(void)
535 &kfr2r09_sdram_leave_start, 535 &kfr2r09_sdram_leave_start,
536 &kfr2r09_sdram_leave_end); 536 &kfr2r09_sdram_leave_end);
537 537
538 regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
539 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
540
541 /* enable SCIF1 serial port for YC401 console support */ 538 /* enable SCIF1 serial port for YC401 console support */
542 gpio_request(GPIO_FN_SCIF1_RXD, NULL); 539 gpio_request(GPIO_FN_SCIF1_RXD, NULL);
543 gpio_request(GPIO_FN_SCIF1_TXD, NULL); 540 gpio_request(GPIO_FN_SCIF1_TXD, NULL);
diff --git a/arch/sh/boards/mach-lboxre2/setup.c b/arch/sh/boards/mach-lboxre2/setup.c
index 6660622aa45..79b4e0d77b7 100644
--- a/arch/sh/boards/mach-lboxre2/setup.c
+++ b/arch/sh/boards/mach-lboxre2/setup.c
@@ -79,5 +79,6 @@ device_initcall(lboxre2_devices_setup);
79 */ 79 */
80static struct sh_machine_vector mv_lboxre2 __initmv = { 80static struct sh_machine_vector mv_lboxre2 __initmv = {
81 .mv_name = "L-BOX RE2", 81 .mv_name = "L-BOX RE2",
82 .mv_nr_irqs = 72,
82 .mv_init_irq = init_lboxre2_IRQ, 83 .mv_init_irq = init_lboxre2_IRQ,
83}; 84};
diff --git a/arch/sh/boards/mach-microdev/irq.c b/arch/sh/boards/mach-microdev/irq.c
index 9a8aff33961..4fb00369f0e 100644
--- a/arch/sh/boards/mach-microdev/irq.c
+++ b/arch/sh/boards/mach-microdev/irq.c
@@ -12,6 +12,7 @@
12#include <linux/init.h> 12#include <linux/init.h>
13#include <linux/irq.h> 13#include <linux/irq.h>
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <asm/system.h>
15#include <asm/io.h> 16#include <asm/io.h>
16#include <mach/microdev.h> 17#include <mach/microdev.h>
17 18
diff --git a/arch/sh/boards/mach-microdev/setup.c b/arch/sh/boards/mach-microdev/setup.c
index 6c66ee4d842..d8a747291e0 100644
--- a/arch/sh/boards/mach-microdev/setup.c
+++ b/arch/sh/boards/mach-microdev/setup.c
@@ -194,6 +194,7 @@ device_initcall(microdev_devices_setup);
194 */ 194 */
195static struct sh_machine_vector mv_sh4202_microdev __initmv = { 195static struct sh_machine_vector mv_sh4202_microdev __initmv = {
196 .mv_name = "SH4-202 MicroDev", 196 .mv_name = "SH4-202 MicroDev",
197 .mv_nr_irqs = 72,
197 .mv_ioport_map = microdev_ioport_map, 198 .mv_ioport_map = microdev_ioport_map,
198 .mv_init_irq = init_microdev_irq, 199 .mv_init_irq = init_microdev_irq,
199}; 200};
diff --git a/arch/sh/boards/mach-migor/lcd_qvga.c b/arch/sh/boards/mach-migor/lcd_qvga.c
index 8bccd345b69..de9014a8a93 100644
--- a/arch/sh/boards/mach-migor/lcd_qvga.c
+++ b/arch/sh/boards/mach-migor/lcd_qvga.c
@@ -113,7 +113,8 @@ static const unsigned short magic3_data[] = {
113 0x0010, 0x16B0, 0x0011, 0x0111, 0x0007, 0x0061, 113 0x0010, 0x16B0, 0x0011, 0x0111, 0x0007, 0x0061,
114}; 114};
115 115
116int migor_lcd_qvga_setup(void *sohandle, struct sh_mobile_lcdc_sys_bus_ops *so) 116int migor_lcd_qvga_setup(void *board_data, void *sohandle,
117 struct sh_mobile_lcdc_sys_bus_ops *so)
117{ 118{
118 unsigned long xres = 320; 119 unsigned long xres = 320;
119 unsigned long yres = 240; 120 unsigned long yres = 240;
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index 8b73194ed2c..2d4c9c8c666 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -17,18 +17,13 @@
17#include <linux/mtd/physmap.h> 17#include <linux/mtd/physmap.h>
18#include <linux/mtd/nand.h> 18#include <linux/mtd/nand.h>
19#include <linux/i2c.h> 19#include <linux/i2c.h>
20#include <linux/regulator/fixed.h>
21#include <linux/regulator/machine.h>
22#include <linux/smc91x.h> 20#include <linux/smc91x.h>
23#include <linux/delay.h> 21#include <linux/delay.h>
24#include <linux/clk.h> 22#include <linux/clk.h>
25#include <linux/gpio.h> 23#include <linux/gpio.h>
26#include <linux/videodev2.h>
27#include <linux/sh_intc.h>
28#include <video/sh_mobile_lcdc.h> 24#include <video/sh_mobile_lcdc.h>
29#include <media/sh_mobile_ceu.h> 25#include <media/sh_mobile_ceu.h>
30#include <media/ov772x.h> 26#include <media/ov772x.h>
31#include <media/soc_camera.h>
32#include <media/tw9910.h> 27#include <media/tw9910.h>
33#include <asm/clock.h> 28#include <asm/clock.h>
34#include <asm/machvec.h> 29#include <asm/machvec.h>
@@ -57,7 +52,7 @@ static struct resource smc91x_eth_resources[] = {
57 .flags = IORESOURCE_MEM, 52 .flags = IORESOURCE_MEM,
58 }, 53 },
59 [1] = { 54 [1] = {
60 .start = evt2irq(0x600), /* IRQ0 */ 55 .start = 32, /* IRQ0 */
61 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 56 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
62 }, 57 },
63}; 58};
@@ -91,7 +86,7 @@ static struct resource sh_keysc_resources[] = {
91 .flags = IORESOURCE_MEM, 86 .flags = IORESOURCE_MEM,
92 }, 87 },
93 [1] = { 88 [1] = {
94 .start = evt2irq(0xbe0), 89 .start = 79,
95 .flags = IORESOURCE_IRQ, 90 .flags = IORESOURCE_IRQ,
96 }, 91 },
97}; 92};
@@ -104,6 +99,9 @@ static struct platform_device sh_keysc_device = {
104 .dev = { 99 .dev = {
105 .platform_data = &sh_keysc_info, 100 .platform_data = &sh_keysc_info,
106 }, 101 },
102 .archdata = {
103 .hwblk_id = HWBLK_KEYSC,
104 },
107}; 105};
108 106
109static struct mtd_partition migor_nor_flash_partitions[] = 107static struct mtd_partition migor_nor_flash_partitions[] =
@@ -190,6 +188,7 @@ static struct platform_nand_data migor_nand_flash_data = {
190 .partitions = migor_nand_flash_partitions, 188 .partitions = migor_nand_flash_partitions,
191 .nr_partitions = ARRAY_SIZE(migor_nand_flash_partitions), 189 .nr_partitions = ARRAY_SIZE(migor_nand_flash_partitions),
192 .chip_delay = 20, 190 .chip_delay = 20,
191 .part_probe_types = (const char *[]) { "cmdlinepart", NULL },
193 }, 192 },
194 .ctrl = { 193 .ctrl = {
195 .dev_ready = migor_nand_flash_ready, 194 .dev_ready = migor_nand_flash_ready,
@@ -245,12 +244,12 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
245 .clock_source = LCDC_CLK_BUS, 244 .clock_source = LCDC_CLK_BUS,
246 .ch[0] = { 245 .ch[0] = {
247 .chan = LCDC_CHAN_MAINLCD, 246 .chan = LCDC_CHAN_MAINLCD,
248 .fourcc = V4L2_PIX_FMT_RGB565, 247 .bpp = 16,
249 .interface_type = RGB16, 248 .interface_type = RGB16,
250 .clock_divider = 2, 249 .clock_divider = 2,
251 .lcd_modes = migor_lcd_modes, 250 .lcd_cfg = migor_lcd_modes,
252 .num_modes = ARRAY_SIZE(migor_lcd_modes), 251 .num_cfg = ARRAY_SIZE(migor_lcd_modes),
253 .panel_cfg = { /* 7.0 inch */ 252 .lcd_size_cfg = { /* 7.0 inch */
254 .width = 152, 253 .width = 152,
255 .height = 91, 254 .height = 91,
256 }, 255 },
@@ -259,14 +258,16 @@ static struct sh_mobile_lcdc_info sh_mobile_lcdc_info = {
259 .clock_source = LCDC_CLK_PERIPHERAL, 258 .clock_source = LCDC_CLK_PERIPHERAL,
260 .ch[0] = { 259 .ch[0] = {
261 .chan = LCDC_CHAN_MAINLCD, 260 .chan = LCDC_CHAN_MAINLCD,
262 .fourcc = V4L2_PIX_FMT_RGB565, 261 .bpp = 16,
263 .interface_type = SYS16A, 262 .interface_type = SYS16A,
264 .clock_divider = 10, 263 .clock_divider = 10,
265 .lcd_modes = migor_lcd_modes, 264 .lcd_cfg = migor_lcd_modes,
266 .num_modes = ARRAY_SIZE(migor_lcd_modes), 265 .num_cfg = ARRAY_SIZE(migor_lcd_modes),
267 .panel_cfg = { 266 .lcd_size_cfg = { /* 2.4 inch */
268 .width = 49, /* 2.4 inch */ 267 .width = 49,
269 .height = 37, 268 .height = 37,
269 },
270 .board_cfg = {
270 .setup_sys = migor_lcd_qvga_setup, 271 .setup_sys = migor_lcd_qvga_setup,
271 }, 272 },
272 .sys_bus_cfg = { 273 .sys_bus_cfg = {
@@ -287,7 +288,7 @@ static struct resource migor_lcdc_resources[] = {
287 .flags = IORESOURCE_MEM, 288 .flags = IORESOURCE_MEM,
288 }, 289 },
289 [1] = { 290 [1] = {
290 .start = evt2irq(0x580), 291 .start = 28,
291 .flags = IORESOURCE_IRQ, 292 .flags = IORESOURCE_IRQ,
292 }, 293 },
293}; 294};
@@ -299,6 +300,9 @@ static struct platform_device migor_lcdc_device = {
299 .dev = { 300 .dev = {
300 .platform_data = &sh_mobile_lcdc_info, 301 .platform_data = &sh_mobile_lcdc_info,
301 }, 302 },
303 .archdata = {
304 .hwblk_id = HWBLK_LCDC,
305 },
302}; 306};
303 307
304static struct clk *camera_clk; 308static struct clk *camera_clk;
@@ -370,7 +374,7 @@ static struct resource migor_ceu_resources[] = {
370 .flags = IORESOURCE_MEM, 374 .flags = IORESOURCE_MEM,
371 }, 375 },
372 [1] = { 376 [1] = {
373 .start = evt2irq(0x880), 377 .start = 52,
374 .flags = IORESOURCE_IRQ, 378 .flags = IORESOURCE_IRQ,
375 }, 379 },
376 [2] = { 380 [2] = {
@@ -386,13 +390,9 @@ static struct platform_device migor_ceu_device = {
386 .dev = { 390 .dev = {
387 .platform_data = &sh_mobile_ceu_info, 391 .platform_data = &sh_mobile_ceu_info,
388 }, 392 },
389}; 393 .archdata = {
390 394 .hwblk_id = HWBLK_CEU,
391/* Fixed 3.3V regulator to be used by SDHI0 */ 395 },
392static struct regulator_consumer_supply fixed3v3_power_consumers[] =
393{
394 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
395 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
396}; 396};
397 397
398static struct resource sdhi_cn9_resources[] = { 398static struct resource sdhi_cn9_resources[] = {
@@ -403,7 +403,7 @@ static struct resource sdhi_cn9_resources[] = {
403 .flags = IORESOURCE_MEM, 403 .flags = IORESOURCE_MEM,
404 }, 404 },
405 [1] = { 405 [1] = {
406 .start = evt2irq(0xe80), 406 .start = 100,
407 .flags = IORESOURCE_IRQ, 407 .flags = IORESOURCE_IRQ,
408 }, 408 },
409}; 409};
@@ -421,6 +421,9 @@ static struct platform_device sdhi_cn9_device = {
421 .dev = { 421 .dev = {
422 .platform_data = &sh7724_sdhi_data, 422 .platform_data = &sh7724_sdhi_data,
423 }, 423 },
424 .archdata = {
425 .hwblk_id = HWBLK_SDHI,
426 },
424}; 427};
425 428
426static struct i2c_board_info migor_i2c_devices[] = { 429static struct i2c_board_info migor_i2c_devices[] = {
@@ -429,7 +432,7 @@ static struct i2c_board_info migor_i2c_devices[] = {
429 }, 432 },
430 { 433 {
431 I2C_BOARD_INFO("migor_ts", 0x51), 434 I2C_BOARD_INFO("migor_ts", 0x51),
432 .irq = evt2irq(0x6c0), /* IRQ6 */ 435 .irq = 38, /* IRQ6 */
433 }, 436 },
434 { 437 {
435 I2C_BOARD_INFO("wm8978", 0x1a), 438 I2C_BOARD_INFO("wm8978", 0x1a),
@@ -445,7 +448,9 @@ static struct i2c_board_info migor_i2c_camera[] = {
445 }, 448 },
446}; 449};
447 450
448static struct ov772x_camera_info ov7725_info; 451static struct ov772x_camera_info ov7725_info = {
452 .flags = OV772X_FLAG_8BIT,
453};
449 454
450static struct soc_camera_link ov7725_link = { 455static struct soc_camera_link ov7725_link = {
451 .power = ov7725_power, 456 .power = ov7725_power,
@@ -507,10 +512,6 @@ static int __init migor_devices_setup(void)
507 &migor_sdram_enter_end, 512 &migor_sdram_enter_end,
508 &migor_sdram_leave_start, 513 &migor_sdram_leave_start,
509 &migor_sdram_leave_end); 514 &migor_sdram_leave_end);
510
511 regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
512 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
513
514 /* Let D11 LED show STATUS0 */ 515 /* Let D11 LED show STATUS0 */
515 gpio_request(GPIO_FN_STATUS0, NULL); 516 gpio_request(GPIO_FN_STATUS0, NULL);
516 517
diff --git a/arch/sh/boards/mach-rsk/Kconfig b/arch/sh/boards/mach-rsk/Kconfig
index 458a11ffd02..aeff3b04220 100644
--- a/arch/sh/boards/mach-rsk/Kconfig
+++ b/arch/sh/boards/mach-rsk/Kconfig
@@ -13,16 +13,6 @@ config SH_RSK7203
13 select ARCH_REQUIRE_GPIOLIB 13 select ARCH_REQUIRE_GPIOLIB
14 depends on CPU_SUBTYPE_SH7203 14 depends on CPU_SUBTYPE_SH7203
15 15
16config SH_RSK7264
17 bool "RSK2+SH7264"
18 select ARCH_REQUIRE_GPIOLIB
19 depends on CPU_SUBTYPE_SH7264
20
21config SH_RSK7269
22 bool "RSK2+SH7269"
23 select ARCH_REQUIRE_GPIOLIB
24 depends on CPU_SUBTYPE_SH7269
25
26endchoice 16endchoice
27 17
28endif 18endif
diff --git a/arch/sh/boards/mach-rsk/Makefile b/arch/sh/boards/mach-rsk/Makefile
index 6a4e1b538a6..498da75ce38 100644
--- a/arch/sh/boards/mach-rsk/Makefile
+++ b/arch/sh/boards/mach-rsk/Makefile
@@ -1,4 +1,2 @@
1obj-y := setup.o 1obj-y := setup.o
2obj-$(CONFIG_SH_RSK7203) += devices-rsk7203.o 2obj-$(CONFIG_SH_RSK7203) += devices-rsk7203.o
3obj-$(CONFIG_SH_RSK7264) += devices-rsk7264.o
4obj-$(CONFIG_SH_RSK7269) += devices-rsk7269.o
diff --git a/arch/sh/boards/mach-rsk/devices-rsk7264.c b/arch/sh/boards/mach-rsk/devices-rsk7264.c
deleted file mode 100644
index 7251e37a842..00000000000
--- a/arch/sh/boards/mach-rsk/devices-rsk7264.c
+++ /dev/null
@@ -1,58 +0,0 @@
1/*
2 * RSK+SH7264 Support.
3 *
4 * Copyright (C) 2012 Renesas Electronics Europe
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10#include <linux/init.h>
11#include <linux/types.h>
12#include <linux/platform_device.h>
13#include <linux/interrupt.h>
14#include <linux/input.h>
15#include <linux/smsc911x.h>
16#include <asm/machvec.h>
17#include <asm/io.h>
18
19static struct smsc911x_platform_config smsc911x_config = {
20 .phy_interface = PHY_INTERFACE_MODE_MII,
21 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
22 .irq_type = SMSC911X_IRQ_TYPE_OPEN_DRAIN,
23 .flags = SMSC911X_USE_16BIT | SMSC911X_SWAP_FIFO,
24};
25
26static struct resource smsc911x_resources[] = {
27 [0] = {
28 .start = 0x28000000,
29 .end = 0x280000ff,
30 .flags = IORESOURCE_MEM,
31 },
32 [1] = {
33 .start = 65,
34 .end = 65,
35 .flags = IORESOURCE_IRQ,
36 },
37};
38
39static struct platform_device smsc911x_device = {
40 .name = "smsc911x",
41 .id = -1,
42 .num_resources = ARRAY_SIZE(smsc911x_resources),
43 .resource = smsc911x_resources,
44 .dev = {
45 .platform_data = &smsc911x_config,
46 },
47};
48
49static struct platform_device *rsk7264_devices[] __initdata = {
50 &smsc911x_device,
51};
52
53static int __init rsk7264_devices_setup(void)
54{
55 return platform_add_devices(rsk7264_devices,
56 ARRAY_SIZE(rsk7264_devices));
57}
58device_initcall(rsk7264_devices_setup);
diff --git a/arch/sh/boards/mach-rsk/devices-rsk7269.c b/arch/sh/boards/mach-rsk/devices-rsk7269.c
deleted file mode 100644
index 4a544591d6f..00000000000
--- a/arch/sh/boards/mach-rsk/devices-rsk7269.c
+++ /dev/null
@@ -1,60 +0,0 @@
1/*
2 * RSK+SH7269 Support
3 *
4 * Copyright (C) 2012 Renesas Electronics Europe Ltd
5 * Copyright (C) 2012 Phil Edworthy
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11#include <linux/init.h>
12#include <linux/types.h>
13#include <linux/platform_device.h>
14#include <linux/interrupt.h>
15#include <linux/input.h>
16#include <linux/smsc911x.h>
17#include <linux/gpio.h>
18#include <asm/machvec.h>
19#include <asm/io.h>
20
21static struct smsc911x_platform_config smsc911x_config = {
22 .phy_interface = PHY_INTERFACE_MODE_MII,
23 .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW,
24 .irq_type = SMSC911X_IRQ_TYPE_PUSH_PULL,
25 .flags = SMSC911X_USE_16BIT | SMSC911X_SWAP_FIFO,
26};
27
28static struct resource smsc911x_resources[] = {
29 [0] = {
30 .start = 0x24000000,
31 .end = 0x240000ff,
32 .flags = IORESOURCE_MEM,
33 },
34 [1] = {
35 .start = 85,
36 .end = 85,
37 .flags = IORESOURCE_IRQ,
38 },
39};
40
41static struct platform_device smsc911x_device = {
42 .name = "smsc911x",
43 .id = -1,
44 .num_resources = ARRAY_SIZE(smsc911x_resources),
45 .resource = smsc911x_resources,
46 .dev = {
47 .platform_data = &smsc911x_config,
48 },
49};
50
51static struct platform_device *rsk7269_devices[] __initdata = {
52 &smsc911x_device,
53};
54
55static int __init rsk7269_devices_setup(void)
56{
57 return platform_add_devices(rsk7269_devices,
58 ARRAY_SIZE(rsk7269_devices));
59}
60device_initcall(rsk7269_devices_setup);
diff --git a/arch/sh/boards/mach-rsk/setup.c b/arch/sh/boards/mach-rsk/setup.c
index 2685ea03b06..a5c0df785bf 100644
--- a/arch/sh/boards/mach-rsk/setup.c
+++ b/arch/sh/boards/mach-rsk/setup.c
@@ -15,20 +15,12 @@
15#include <linux/mtd/mtd.h> 15#include <linux/mtd/mtd.h>
16#include <linux/mtd/partitions.h> 16#include <linux/mtd/partitions.h>
17#include <linux/mtd/physmap.h> 17#include <linux/mtd/physmap.h>
18#ifdef CONFIG_MTD
18#include <linux/mtd/map.h> 19#include <linux/mtd/map.h>
19#include <linux/regulator/fixed.h> 20#endif
20#include <linux/regulator/machine.h>
21#include <asm/machvec.h> 21#include <asm/machvec.h>
22#include <asm/io.h> 22#include <asm/io.h>
23 23
24/* Dummy supplies, where voltage doesn't matter */
25static struct regulator_consumer_supply dummy_supplies[] = {
26 REGULATOR_SUPPLY("vddvario", "smsc911x"),
27 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
28};
29
30static const char *part_probes[] = { "cmdlinepart", NULL };
31
32static struct mtd_partition rsk_partitions[] = { 24static struct mtd_partition rsk_partitions[] = {
33 { 25 {
34 .name = "Bootloader", 26 .name = "Bootloader",
@@ -47,10 +39,9 @@ static struct mtd_partition rsk_partitions[] = {
47}; 39};
48 40
49static struct physmap_flash_data flash_data = { 41static struct physmap_flash_data flash_data = {
50 .parts = rsk_partitions, 42 .parts = rsk_partitions,
51 .nr_parts = ARRAY_SIZE(rsk_partitions), 43 .nr_parts = ARRAY_SIZE(rsk_partitions),
52 .width = 2, 44 .width = 2,
53 .part_probe_types = part_probes,
54}; 45};
55 46
56static struct resource flash_resource = { 47static struct resource flash_resource = {
@@ -69,14 +60,44 @@ static struct platform_device flash_device = {
69 }, 60 },
70}; 61};
71 62
63#ifdef CONFIG_MTD
64static const char *probes[] = { "cmdlinepart", NULL };
65
66static struct map_info rsk_flash_map = {
67 .name = "RSK+ Flash",
68 .size = 0x400000,
69 .bankwidth = 2,
70};
71
72static struct mtd_info *flash_mtd;
73
74static struct mtd_partition *parsed_partitions;
75
76static void __init set_mtd_partitions(void)
77{
78 int nr_parts = 0;
79
80 simple_map_init(&rsk_flash_map);
81 flash_mtd = do_map_probe("cfi_probe", &rsk_flash_map);
82 nr_parts = parse_mtd_partitions(flash_mtd, probes,
83 &parsed_partitions, 0);
84 /* If there is no partition table, used the hard coded table */
85 if (nr_parts > 0) {
86 flash_data.nr_parts = nr_parts;
87 flash_data.parts = parsed_partitions;
88 }
89}
90#else
91static inline void set_mtd_partitions(void) {}
92#endif
93
72static struct platform_device *rsk_devices[] __initdata = { 94static struct platform_device *rsk_devices[] __initdata = {
73 &flash_device, 95 &flash_device,
74}; 96};
75 97
76static int __init rsk_devices_setup(void) 98static int __init rsk_devices_setup(void)
77{ 99{
78 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 100 set_mtd_partitions();
79
80 return platform_add_devices(rsk_devices, 101 return platform_add_devices(rsk_devices,
81 ARRAY_SIZE(rsk_devices)); 102 ARRAY_SIZE(rsk_devices));
82} 103}
diff --git a/arch/sh/boards/mach-sdk7780/setup.c b/arch/sh/boards/mach-sdk7780/setup.c
index 2241659c329..4da38db4b5f 100644
--- a/arch/sh/boards/mach-sdk7780/setup.c
+++ b/arch/sh/boards/mach-sdk7780/setup.c
@@ -94,6 +94,7 @@ static void __init sdk7780_setup(char **cmdline_p)
94static struct sh_machine_vector mv_se7780 __initmv = { 94static struct sh_machine_vector mv_se7780 __initmv = {
95 .mv_name = "Renesas SDK7780-R3" , 95 .mv_name = "Renesas SDK7780-R3" ,
96 .mv_setup = sdk7780_setup, 96 .mv_setup = sdk7780_setup,
97 .mv_nr_irqs = 111,
97 .mv_init_irq = init_sdk7780_IRQ, 98 .mv_init_irq = init_sdk7780_IRQ,
98}; 99};
99 100
diff --git a/arch/sh/boards/mach-sdk7786/setup.c b/arch/sh/boards/mach-sdk7786/setup.c
index c29268bfd34..486d1ac3694 100644
--- a/arch/sh/boards/mach-sdk7786/setup.c
+++ b/arch/sh/boards/mach-sdk7786/setup.c
@@ -11,8 +11,6 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/platform_device.h> 12#include <linux/platform_device.h>
13#include <linux/io.h> 13#include <linux/io.h>
14#include <linux/regulator/fixed.h>
15#include <linux/regulator/machine.h>
16#include <linux/smsc911x.h> 14#include <linux/smsc911x.h>
17#include <linux/i2c.h> 15#include <linux/i2c.h>
18#include <linux/irq.h> 16#include <linux/irq.h>
@@ -40,12 +38,6 @@ static struct platform_device heartbeat_device = {
40 .resource = &heartbeat_resource, 38 .resource = &heartbeat_resource,
41}; 39};
42 40
43/* Dummy supplies, where voltage doesn't matter */
44static struct regulator_consumer_supply dummy_supplies[] = {
45 REGULATOR_SUPPLY("vddvario", "smsc911x"),
46 REGULATOR_SUPPLY("vdd33a", "smsc911x"),
47};
48
49static struct resource smsc911x_resources[] = { 41static struct resource smsc911x_resources[] = {
50 [0] = { 42 [0] = {
51 .name = "smsc911x-memory", 43 .name = "smsc911x-memory",
@@ -175,7 +167,7 @@ static void sdk7786_pcie_clk_disable(struct clk *clk)
175 fpga_write_reg(fpga_read_reg(PCIECR) & ~PCIECR_CLKEN, PCIECR); 167 fpga_write_reg(fpga_read_reg(PCIECR) & ~PCIECR_CLKEN, PCIECR);
176} 168}
177 169
178static struct sh_clk_ops sdk7786_pcie_clk_ops = { 170static struct clk_ops sdk7786_pcie_clk_ops = {
179 .enable = sdk7786_pcie_clk_enable, 171 .enable = sdk7786_pcie_clk_enable,
180 .disable = sdk7786_pcie_clk_disable, 172 .disable = sdk7786_pcie_clk_disable,
181}; 173};
@@ -244,8 +236,6 @@ static void __init sdk7786_setup(char **cmdline_p)
244{ 236{
245 pr_info("Renesas Technology Europe SDK7786 support:\n"); 237 pr_info("Renesas Technology Europe SDK7786 support:\n");
246 238
247 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));
248
249 sdk7786_fpga_init(); 239 sdk7786_fpga_init();
250 sdk7786_nmi_init(); 240 sdk7786_nmi_init();
251 241
diff --git a/arch/sh/boards/mach-se/7206/setup.c b/arch/sh/boards/mach-se/7206/setup.c
index 68883ec9568..8ab8330e3fd 100644
--- a/arch/sh/boards/mach-se/7206/setup.c
+++ b/arch/sh/boards/mach-se/7206/setup.c
@@ -90,6 +90,7 @@ static int se7206_mode_pins(void)
90 90
91static struct sh_machine_vector mv_se __initmv = { 91static struct sh_machine_vector mv_se __initmv = {
92 .mv_name = "SolutionEngine", 92 .mv_name = "SolutionEngine",
93 .mv_nr_irqs = 256,
93 .mv_init_irq = init_se7206_IRQ, 94 .mv_init_irq = init_se7206_IRQ,
94 .mv_mode_pins = se7206_mode_pins, 95 .mv_mode_pins = se7206_mode_pins,
95}; 96};
diff --git a/arch/sh/boards/mach-se/7343/irq.c b/arch/sh/boards/mach-se/7343/irq.c
index 7646bf0486c..fd45ffc4834 100644
--- a/arch/sh/boards/mach-se/7343/irq.c
+++ b/arch/sh/boards/mach-se/7343/irq.c
@@ -1,129 +1,86 @@
1/* 1/*
2 * Hitachi UL SolutionEngine 7343 FPGA IRQ Support. 2 * linux/arch/sh/boards/se/7343/irq.c
3 * 3 *
4 * Copyright (C) 2008 Yoshihiro Shimoda 4 * Copyright (C) 2008 Yoshihiro Shimoda
5 * Copyright (C) 2012 Paul Mundt
6 * 5 *
7 * Based on linux/arch/sh/boards/se/7343/irq.c 6 * Based on linux/arch/sh/boards/se/7722/irq.c
8 * Copyright (C) 2007 Nobuhiro Iwamatsu 7 * Copyright (C) 2007 Nobuhiro Iwamatsu
9 * 8 *
10 * This file is subject to the terms and conditions of the GNU General Public 9 * This file is subject to the terms and conditions of the GNU General Public
11 * License. See the file "COPYING" in the main directory of this archive 10 * License. See the file "COPYING" in the main directory of this archive
12 * for more details. 11 * for more details.
13 */ 12 */
14#define DRV_NAME "SE7343-FPGA"
15#define pr_fmt(fmt) DRV_NAME ": " fmt
16
17#define irq_reg_readl ioread16
18#define irq_reg_writel iowrite16
19
20#include <linux/init.h> 13#include <linux/init.h>
21#include <linux/irq.h> 14#include <linux/irq.h>
22#include <linux/interrupt.h> 15#include <linux/interrupt.h>
23#include <linux/irqdomain.h>
24#include <linux/io.h> 16#include <linux/io.h>
25#include <asm/sizes.h>
26#include <mach-se/mach/se7343.h> 17#include <mach-se/mach/se7343.h>
27 18
28#define PA_CPLD_BASE_ADDR 0x11400000 19unsigned int se7343_fpga_irq[SE7343_FPGA_IRQ_NR] = { 0, };
29#define PA_CPLD_ST_REG 0x08 /* CPLD Interrupt status register */
30#define PA_CPLD_IMSK_REG 0x0a /* CPLD Interrupt mask register */
31
32static void __iomem *se7343_irq_regs;
33struct irq_domain *se7343_irq_domain;
34 20
35static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc) 21static void disable_se7343_irq(struct irq_data *data)
36{ 22{
37 struct irq_data *data = irq_get_irq_data(irq); 23 unsigned int bit = (unsigned int)irq_data_get_irq_chip_data(data);
38 struct irq_chip *chip = irq_data_get_irq_chip(data); 24 __raw_writew(__raw_readw(PA_CPLD_IMSK) | 1 << bit, PA_CPLD_IMSK);
39 unsigned long mask; 25}
40 int bit;
41
42 chip->irq_mask_ack(data);
43
44 mask = ioread16(se7343_irq_regs + PA_CPLD_ST_REG);
45
46 for_each_set_bit(bit, &mask, SE7343_FPGA_IRQ_NR)
47 generic_handle_irq(irq_linear_revmap(se7343_irq_domain, bit));
48 26
49 chip->irq_unmask(data); 27static void enable_se7343_irq(struct irq_data *data)
28{
29 unsigned int bit = (unsigned int)irq_data_get_irq_chip_data(data);
30 __raw_writew(__raw_readw(PA_CPLD_IMSK) & ~(1 << bit), PA_CPLD_IMSK);
50} 31}
51 32
52static void __init se7343_domain_init(void) 33static struct irq_chip se7343_irq_chip __read_mostly = {
34 .name = "SE7343-FPGA",
35 .irq_mask = disable_se7343_irq,
36 .irq_unmask = enable_se7343_irq,
37};
38
39static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc)
53{ 40{
54 int i; 41 unsigned short intv = __raw_readw(PA_CPLD_ST);
42 unsigned int ext_irq = 0;
55 43
56 se7343_irq_domain = irq_domain_add_linear(NULL, SE7343_FPGA_IRQ_NR, 44 intv &= (1 << SE7343_FPGA_IRQ_NR) - 1;
57 &irq_domain_simple_ops, NULL);
58 if (unlikely(!se7343_irq_domain)) {
59 printk("Failed to get IRQ domain\n");
60 return;
61 }
62 45
63 for (i = 0; i < SE7343_FPGA_IRQ_NR; i++) { 46 for (; intv; intv >>= 1, ext_irq++) {
64 int irq = irq_create_mapping(se7343_irq_domain, i); 47 if (!(intv & 1))
48 continue;
65 49
66 if (unlikely(irq == 0)) { 50 generic_handle_irq(se7343_fpga_irq[ext_irq]);
67 printk("Failed to allocate IRQ %d\n", i);
68 return;
69 }
70 } 51 }
71} 52}
72 53
73static void __init se7343_gc_init(void) 54/*
55 * Initialize IRQ setting
56 */
57void __init init_7343se_IRQ(void)
74{ 58{
75 struct irq_chip_generic *gc; 59 int i, irq;
76 struct irq_chip_type *ct;
77 unsigned int irq_base;
78
79 irq_base = irq_linear_revmap(se7343_irq_domain, 0);
80 60
81 gc = irq_alloc_generic_chip(DRV_NAME, 1, irq_base, se7343_irq_regs, 61 __raw_writew(0, PA_CPLD_IMSK); /* disable all irqs */
82 handle_level_irq); 62 __raw_writew(0x2000, 0xb03fffec); /* mrshpc irq enable */
83 if (unlikely(!gc))
84 return;
85 63
86 ct = gc->chip_types; 64 for (i = 0; i < SE7343_FPGA_IRQ_NR; i++) {
87 ct->chip.irq_mask = irq_gc_mask_set_bit; 65 irq = create_irq();
88 ct->chip.irq_unmask = irq_gc_mask_clr_bit; 66 if (irq < 0)
67 return;
68 se7343_fpga_irq[i] = irq;
89 69
90 ct->regs.mask = PA_CPLD_IMSK_REG; 70 irq_set_chip_and_handler_name(se7343_fpga_irq[i],
71 &se7343_irq_chip,
72 handle_level_irq,
73 "level");
91 74
92 irq_setup_generic_chip(gc, IRQ_MSK(SE7343_FPGA_IRQ_NR), 75 irq_set_chip_data(se7343_fpga_irq[i], (void *)i);
93 IRQ_GC_INIT_MASK_CACHE, 76 }
94 IRQ_NOREQUEST | IRQ_NOPROBE, 0);
95 77
96 irq_set_chained_handler(IRQ0_IRQ, se7343_irq_demux); 78 irq_set_chained_handler(IRQ0_IRQ, se7343_irq_demux);
97 irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW); 79 irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
98
99 irq_set_chained_handler(IRQ1_IRQ, se7343_irq_demux); 80 irq_set_chained_handler(IRQ1_IRQ, se7343_irq_demux);
100 irq_set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW); 81 irq_set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW);
101
102 irq_set_chained_handler(IRQ4_IRQ, se7343_irq_demux); 82 irq_set_chained_handler(IRQ4_IRQ, se7343_irq_demux);
103 irq_set_irq_type(IRQ4_IRQ, IRQ_TYPE_LEVEL_LOW); 83 irq_set_irq_type(IRQ4_IRQ, IRQ_TYPE_LEVEL_LOW);
104
105 irq_set_chained_handler(IRQ5_IRQ, se7343_irq_demux); 84 irq_set_chained_handler(IRQ5_IRQ, se7343_irq_demux);
106 irq_set_irq_type(IRQ5_IRQ, IRQ_TYPE_LEVEL_LOW); 85 irq_set_irq_type(IRQ5_IRQ, IRQ_TYPE_LEVEL_LOW);
107} 86}
108
109/*
110 * Initialize IRQ setting
111 */
112void __init init_7343se_IRQ(void)
113{
114 se7343_irq_regs = ioremap(PA_CPLD_BASE_ADDR, SZ_16);
115 if (unlikely(!se7343_irq_regs)) {
116 pr_err("Failed to remap CPLD\n");
117 return;
118 }
119
120 /*
121 * All FPGA IRQs disabled by default
122 */
123 iowrite16(0, se7343_irq_regs + PA_CPLD_IMSK_REG);
124
125 __raw_writew(0x2000, 0xb03fffec); /* mrshpc irq enable */
126
127 se7343_domain_init();
128 se7343_gc_init();
129}
diff --git a/arch/sh/boards/mach-se/7343/setup.c b/arch/sh/boards/mach-se/7343/setup.c
index 8ce4f2a202a..d2370af56d7 100644
--- a/arch/sh/boards/mach-se/7343/setup.c
+++ b/arch/sh/boards/mach-se/7343/setup.c
@@ -5,7 +5,6 @@
5#include <linux/serial_reg.h> 5#include <linux/serial_reg.h>
6#include <linux/usb/isp116x.h> 6#include <linux/usb/isp116x.h>
7#include <linux/delay.h> 7#include <linux/delay.h>
8#include <linux/irqdomain.h>
9#include <asm/machvec.h> 8#include <asm/machvec.h>
10#include <mach-se/mach/se7343.h> 9#include <mach-se/mach/se7343.h>
11#include <asm/heartbeat.h> 10#include <asm/heartbeat.h>
@@ -146,12 +145,11 @@ static struct platform_device *sh7343se_platform_devices[] __initdata = {
146static int __init sh7343se_devices_setup(void) 145static int __init sh7343se_devices_setup(void)
147{ 146{
148 /* Wire-up dynamic vectors */ 147 /* Wire-up dynamic vectors */
149 serial_platform_data[0].irq = irq_find_mapping(se7343_irq_domain, 148 serial_platform_data[0].irq = se7343_fpga_irq[SE7343_FPGA_IRQ_UARTA];
150 SE7343_FPGA_IRQ_UARTA); 149 serial_platform_data[1].irq = se7343_fpga_irq[SE7343_FPGA_IRQ_UARTB];
151 serial_platform_data[1].irq = irq_find_mapping(se7343_irq_domain, 150
152 SE7343_FPGA_IRQ_UARTB);
153 usb_resources[2].start = usb_resources[2].end = 151 usb_resources[2].start = usb_resources[2].end =
154 irq_find_mapping(se7343_irq_domain, SE7343_FPGA_IRQ_USB); 152 se7343_fpga_irq[SE7343_FPGA_IRQ_USB];
155 153
156 return platform_add_devices(sh7343se_platform_devices, 154 return platform_add_devices(sh7343se_platform_devices,
157 ARRAY_SIZE(sh7343se_platform_devices)); 155 ARRAY_SIZE(sh7343se_platform_devices));
diff --git a/arch/sh/boards/mach-se/770x/setup.c b/arch/sh/boards/mach-se/770x/setup.c
index 9759d6ba7ff..31330c65c0c 100644
--- a/arch/sh/boards/mach-se/770x/setup.c
+++ b/arch/sh/boards/mach-se/770x/setup.c
@@ -184,5 +184,16 @@ device_initcall(se_devices_setup);
184static struct sh_machine_vector mv_se __initmv = { 184static struct sh_machine_vector mv_se __initmv = {
185 .mv_name = "SolutionEngine", 185 .mv_name = "SolutionEngine",
186 .mv_setup = smsc_setup, 186 .mv_setup = smsc_setup,
187#if defined(CONFIG_CPU_SH4)
188 .mv_nr_irqs = 48,
189#elif defined(CONFIG_CPU_SUBTYPE_SH7708)
190 .mv_nr_irqs = 32,
191#elif defined(CONFIG_CPU_SUBTYPE_SH7709)
192 .mv_nr_irqs = 61,
193#elif defined(CONFIG_CPU_SUBTYPE_SH7705)
194 .mv_nr_irqs = 86,
195#elif defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712)
196 .mv_nr_irqs = 104,
197#endif
187 .mv_init_irq = init_se_IRQ, 198 .mv_init_irq = init_se_IRQ,
188}; 199};
diff --git a/arch/sh/boards/mach-se/7721/setup.c b/arch/sh/boards/mach-se/7721/setup.c
index a0b3dba34eb..7416ad7ee53 100644
--- a/arch/sh/boards/mach-se/7721/setup.c
+++ b/arch/sh/boards/mach-se/7721/setup.c
@@ -92,5 +92,6 @@ static void __init se7721_setup(char **cmdline_p)
92struct sh_machine_vector mv_se7721 __initmv = { 92struct sh_machine_vector mv_se7721 __initmv = {
93 .mv_name = "Solution Engine 7721", 93 .mv_name = "Solution Engine 7721",
94 .mv_setup = se7721_setup, 94 .mv_setup = se7721_setup,
95 .mv_nr_irqs = 109,
95 .mv_init_irq = init_se7721_IRQ, 96 .mv_init_irq = init_se7721_IRQ,
96}; 97};
diff --git a/arch/sh/boards/mach-se/7722/irq.c b/arch/sh/boards/mach-se/7722/irq.c
index f5e2af1bf04..aac92f21ebd 100644
--- a/arch/sh/boards/mach-se/7722/irq.c
+++ b/arch/sh/boards/mach-se/7722/irq.c
@@ -1,96 +1,79 @@
1/* 1/*
2 * Hitachi UL SolutionEngine 7722 FPGA IRQ Support. 2 * linux/arch/sh/boards/se/7722/irq.c
3 * 3 *
4 * Copyright (C) 2007 Nobuhiro Iwamatsu 4 * Copyright (C) 2007 Nobuhiro Iwamatsu
5 * Copyright (C) 2012 Paul Mundt 5 *
6 * Hitachi UL SolutionEngine 7722 Support.
6 * 7 *
7 * This file is subject to the terms and conditions of the GNU General Public 8 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive 9 * License. See the file "COPYING" in the main directory of this archive
9 * for more details. 10 * for more details.
10 */ 11 */
11#define DRV_NAME "SE7722-FPGA"
12#define pr_fmt(fmt) DRV_NAME ": " fmt
13
14#define irq_reg_readl ioread16
15#define irq_reg_writel iowrite16
16
17#include <linux/init.h> 12#include <linux/init.h>
18#include <linux/irq.h> 13#include <linux/irq.h>
19#include <linux/interrupt.h> 14#include <linux/interrupt.h>
20#include <linux/irqdomain.h> 15#include <asm/irq.h>
21#include <linux/io.h> 16#include <asm/io.h>
22#include <linux/err.h>
23#include <asm/sizes.h>
24#include <mach-se/mach/se7722.h> 17#include <mach-se/mach/se7722.h>
25 18
26#define IRQ01_BASE_ADDR 0x11800000 19unsigned int se7722_fpga_irq[SE7722_FPGA_IRQ_NR] = { 0, };
27#define IRQ01_MODE_REG 0
28#define IRQ01_STS_REG 4
29#define IRQ01_MASK_REG 8
30 20
31static void __iomem *se7722_irq_regs; 21static void disable_se7722_irq(struct irq_data *data)
32struct irq_domain *se7722_irq_domain;
33
34static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc)
35{ 22{
36 struct irq_data *data = irq_get_irq_data(irq); 23 unsigned int bit = (unsigned int)irq_data_get_irq_chip_data(data);
37 struct irq_chip *chip = irq_data_get_irq_chip(data); 24 __raw_writew(__raw_readw(IRQ01_MASK) | 1 << bit, IRQ01_MASK);
38 unsigned long mask; 25}
39 int bit;
40
41 chip->irq_mask_ack(data);
42
43 mask = ioread16(se7722_irq_regs + IRQ01_STS_REG);
44
45 for_each_set_bit(bit, &mask, SE7722_FPGA_IRQ_NR)
46 generic_handle_irq(irq_linear_revmap(se7722_irq_domain, bit));
47 26
48 chip->irq_unmask(data); 27static void enable_se7722_irq(struct irq_data *data)
28{
29 unsigned int bit = (unsigned int)irq_data_get_irq_chip_data(data);
30 __raw_writew(__raw_readw(IRQ01_MASK) & ~(1 << bit), IRQ01_MASK);
49} 31}
50 32
51static void __init se7722_domain_init(void) 33static struct irq_chip se7722_irq_chip __read_mostly = {
34 .name = "SE7722-FPGA",
35 .irq_mask = disable_se7722_irq,
36 .irq_unmask = enable_se7722_irq,
37};
38
39static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc)
52{ 40{
53 int i; 41 unsigned short intv = __raw_readw(IRQ01_STS);
42 unsigned int ext_irq = 0;
54 43
55 se7722_irq_domain = irq_domain_add_linear(NULL, SE7722_FPGA_IRQ_NR, 44 intv &= (1 << SE7722_FPGA_IRQ_NR) - 1;
56 &irq_domain_simple_ops, NULL);
57 if (unlikely(!se7722_irq_domain)) {
58 printk("Failed to get IRQ domain\n");
59 return;
60 }
61 45
62 for (i = 0; i < SE7722_FPGA_IRQ_NR; i++) { 46 for (; intv; intv >>= 1, ext_irq++) {
63 int irq = irq_create_mapping(se7722_irq_domain, i); 47 if (!(intv & 1))
48 continue;
64 49
65 if (unlikely(irq == 0)) { 50 generic_handle_irq(se7722_fpga_irq[ext_irq]);
66 printk("Failed to allocate IRQ %d\n", i);
67 return;
68 }
69 } 51 }
70} 52}
71 53
72static void __init se7722_gc_init(void) 54/*
55 * Initialize IRQ setting
56 */
57void __init init_se7722_IRQ(void)
73{ 58{
74 struct irq_chip_generic *gc; 59 int i, irq;
75 struct irq_chip_type *ct;
76 unsigned int irq_base;
77
78 irq_base = irq_linear_revmap(se7722_irq_domain, 0);
79 60
80 gc = irq_alloc_generic_chip(DRV_NAME, 1, irq_base, se7722_irq_regs, 61 __raw_writew(0, IRQ01_MASK); /* disable all irqs */
81 handle_level_irq); 62 __raw_writew(0x2000, 0xb03fffec); /* mrshpc irq enable */
82 if (unlikely(!gc))
83 return;
84 63
85 ct = gc->chip_types; 64 for (i = 0; i < SE7722_FPGA_IRQ_NR; i++) {
86 ct->chip.irq_mask = irq_gc_mask_set_bit; 65 irq = create_irq();
87 ct->chip.irq_unmask = irq_gc_mask_clr_bit; 66 if (irq < 0)
67 return;
68 se7722_fpga_irq[i] = irq;
88 69
89 ct->regs.mask = IRQ01_MASK_REG; 70 irq_set_chip_and_handler_name(se7722_fpga_irq[i],
71 &se7722_irq_chip,
72 handle_level_irq,
73 "level");
90 74
91 irq_setup_generic_chip(gc, IRQ_MSK(SE7722_FPGA_IRQ_NR), 75 irq_set_chip_data(se7722_fpga_irq[i], (void *)i);
92 IRQ_GC_INIT_MASK_CACHE, 76 }
93 IRQ_NOREQUEST | IRQ_NOPROBE, 0);
94 77
95 irq_set_chained_handler(IRQ0_IRQ, se7722_irq_demux); 78 irq_set_chained_handler(IRQ0_IRQ, se7722_irq_demux);
96 irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW); 79 irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
@@ -98,25 +81,3 @@ static void __init se7722_gc_init(void)
98 irq_set_chained_handler(IRQ1_IRQ, se7722_irq_demux); 81 irq_set_chained_handler(IRQ1_IRQ, se7722_irq_demux);
99 irq_set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW); 82 irq_set_irq_type(IRQ1_IRQ, IRQ_TYPE_LEVEL_LOW);
100} 83}
101
102/*
103 * Initialize FPGA IRQs
104 */
105void __init init_se7722_IRQ(void)
106{
107 se7722_irq_regs = ioremap(IRQ01_BASE_ADDR, SZ_16);
108 if (unlikely(!se7722_irq_regs)) {
109 printk("Failed to remap IRQ01 regs\n");
110 return;
111 }
112
113 /*
114 * All FPGA IRQs disabled by default
115 */
116 iowrite16(0, se7722_irq_regs + IRQ01_MASK_REG);
117
118 __raw_writew(0x2000, 0xb03fffec); /* mrshpc irq enable */
119
120 se7722_domain_init();
121 se7722_gc_init();
122}
diff --git a/arch/sh/boards/mach-se/7722/setup.c b/arch/sh/boards/mach-se/7722/setup.c
index e04e2bc4698..80a4e571b31 100644
--- a/arch/sh/boards/mach-se/7722/setup.c
+++ b/arch/sh/boards/mach-se/7722/setup.c
@@ -2,7 +2,6 @@
2 * linux/arch/sh/boards/se/7722/setup.c 2 * linux/arch/sh/boards/se/7722/setup.c
3 * 3 *
4 * Copyright (C) 2007 Nobuhiro Iwamatsu 4 * Copyright (C) 2007 Nobuhiro Iwamatsu
5 * Copyright (C) 2012 Paul Mundt
6 * 5 *
7 * Hitachi UL SolutionEngine 7722 Support. 6 * Hitachi UL SolutionEngine 7722 Support.
8 * 7 *
@@ -16,9 +15,7 @@
16#include <linux/ata_platform.h> 15#include <linux/ata_platform.h>
17#include <linux/input.h> 16#include <linux/input.h>
18#include <linux/input/sh_keysc.h> 17#include <linux/input/sh_keysc.h>
19#include <linux/irqdomain.h>
20#include <linux/smc91x.h> 18#include <linux/smc91x.h>
21#include <linux/sh_intc.h>
22#include <mach-se/mach/se7722.h> 19#include <mach-se/mach/se7722.h>
23#include <mach-se/mach/mrshpc.h> 20#include <mach-se/mach/mrshpc.h>
24#include <asm/machvec.h> 21#include <asm/machvec.h>
@@ -117,7 +114,7 @@ static struct resource sh_keysc_resources[] = {
117 .flags = IORESOURCE_MEM, 114 .flags = IORESOURCE_MEM,
118 }, 115 },
119 [1] = { 116 [1] = {
120 .start = evt2irq(0xbe0), 117 .start = 79,
121 .flags = IORESOURCE_IRQ, 118 .flags = IORESOURCE_IRQ,
122 }, 119 },
123}; 120};
@@ -130,6 +127,9 @@ static struct platform_device sh_keysc_device = {
130 .dev = { 127 .dev = {
131 .platform_data = &sh_keysc_info, 128 .platform_data = &sh_keysc_info,
132 }, 129 },
130 .archdata = {
131 .hwblk_id = HWBLK_KEYSC,
132 },
133}; 133};
134 134
135static struct platform_device *se7722_devices[] __initdata = { 135static struct platform_device *se7722_devices[] __initdata = {
@@ -145,10 +145,10 @@ static int __init se7722_devices_setup(void)
145 145
146 /* Wire-up dynamic vectors */ 146 /* Wire-up dynamic vectors */
147 cf_ide_resources[2].start = cf_ide_resources[2].end = 147 cf_ide_resources[2].start = cf_ide_resources[2].end =
148 irq_find_mapping(se7722_irq_domain, SE7722_FPGA_IRQ_MRSHPC0); 148 se7722_fpga_irq[SE7722_FPGA_IRQ_MRSHPC0];
149 149
150 smc91x_eth_resources[1].start = smc91x_eth_resources[1].end = 150 smc91x_eth_resources[1].start = smc91x_eth_resources[1].end =
151 irq_find_mapping(se7722_irq_domain, SE7722_FPGA_IRQ_SMC); 151 se7722_fpga_irq[SE7722_FPGA_IRQ_SMC];
152 152
153 return platform_add_devices(se7722_devices, ARRAY_SIZE(se7722_devices)); 153 return platform_add_devices(se7722_devices, ARRAY_SIZE(se7722_devices));
154} 154}
diff --git a/arch/sh/boards/mach-se/7724/irq.c b/arch/sh/boards/mach-se/7724/irq.c
index 5d1d3ec9a6c..c6342ce7768 100644
--- a/arch/sh/boards/mach-se/7724/irq.c
+++ b/arch/sh/boards/mach-se/7724/irq.c
@@ -17,10 +17,8 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/irq.h> 18#include <linux/irq.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/export.h> 20#include <asm/irq.h>
21#include <linux/topology.h> 21#include <asm/io.h>
22#include <linux/io.h>
23#include <linux/err.h>
24#include <mach-se/mach/se7724.h> 22#include <mach-se/mach/se7724.h>
25 23
26struct fpga_irq { 24struct fpga_irq {
@@ -113,7 +111,7 @@ static void se7724_irq_demux(unsigned int irq, struct irq_desc *desc)
113 */ 111 */
114void __init init_se7724_IRQ(void) 112void __init init_se7724_IRQ(void)
115{ 113{
116 int irq_base, i; 114 int i, nid = cpu_to_node(boot_cpu_data);
117 115
118 __raw_writew(0xffff, IRQ0_MR); /* mask all */ 116 __raw_writew(0xffff, IRQ0_MR); /* mask all */
119 __raw_writew(0xffff, IRQ1_MR); /* mask all */ 117 __raw_writew(0xffff, IRQ1_MR); /* mask all */
@@ -123,16 +121,28 @@ void __init init_se7724_IRQ(void)
123 __raw_writew(0x0000, IRQ2_SR); /* clear irq */ 121 __raw_writew(0x0000, IRQ2_SR); /* clear irq */
124 __raw_writew(0x002a, IRQ_MODE); /* set irq type */ 122 __raw_writew(0x002a, IRQ_MODE); /* set irq type */
125 123
126 irq_base = irq_alloc_descs(SE7724_FPGA_IRQ_BASE, SE7724_FPGA_IRQ_BASE, 124 for (i = 0; i < SE7724_FPGA_IRQ_NR; i++) {
127 SE7724_FPGA_IRQ_NR, numa_node_id()); 125 int irq, wanted;
128 if (IS_ERR_VALUE(irq_base)) { 126
129 pr_err("%s: failed hooking irqs for FPGA\n", __func__); 127 wanted = SE7724_FPGA_IRQ_BASE + i;
130 return; 128
131 } 129 irq = create_irq_nr(wanted, nid);
130 if (unlikely(irq == 0)) {
131 pr_err("%s: failed hooking irq %d for FPGA\n",
132 __func__, wanted);
133 return;
134 }
132 135
133 for (i = 0; i < SE7724_FPGA_IRQ_NR; i++) 136 if (unlikely(irq != wanted)) {
134 irq_set_chip_and_handler_name(irq_base + i, &se7724_irq_chip, 137 pr_err("%s: got irq %d but wanted %d, bailing.\n",
138 __func__, irq, wanted);
139 destroy_irq(irq);
140 return;
141 }
142
143 irq_set_chip_and_handler_name(irq, &se7724_irq_chip,
135 handle_level_irq, "level"); 144 handle_level_irq, "level");
145 }
136 146
137 irq_set_chained_handler(IRQ0_IRQ, se7724_irq_demux); 147 irq_set_chained_handler(IRQ0_IRQ, se7724_irq_demux);
138 irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW); 148 irq_set_irq_type(IRQ0_IRQ, IRQ_TYPE_LEVEL_LOW);
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index 35f6efa3ac0..d00756728bd 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -18,22 +18,17 @@
18#include <linux/mmc/sh_mobile_sdhi.h> 18#include <linux/mmc/sh_mobile_sdhi.h>
19#include <linux/mtd/physmap.h> 19#include <linux/mtd/physmap.h>
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/regulator/fixed.h>
22#include <linux/regulator/machine.h>
23#include <linux/smc91x.h> 21#include <linux/smc91x.h>
24#include <linux/gpio.h> 22#include <linux/gpio.h>
25#include <linux/input.h> 23#include <linux/input.h>
26#include <linux/input/sh_keysc.h> 24#include <linux/input/sh_keysc.h>
27#include <linux/usb/r8a66597.h> 25#include <linux/usb/r8a66597.h>
28#include <linux/sh_eth.h>
29#include <linux/sh_intc.h>
30#include <linux/videodev2.h>
31#include <video/sh_mobile_lcdc.h> 26#include <video/sh_mobile_lcdc.h>
32#include <media/sh_mobile_ceu.h> 27#include <media/sh_mobile_ceu.h>
33#include <sound/sh_fsi.h> 28#include <sound/sh_fsi.h>
34#include <sound/simple_card.h>
35#include <asm/io.h> 29#include <asm/io.h>
36#include <asm/heartbeat.h> 30#include <asm/heartbeat.h>
31#include <asm/sh_eth.h>
37#include <asm/clock.h> 32#include <asm/clock.h>
38#include <asm/suspend.h> 33#include <asm/suspend.h>
39#include <cpu/sh7724.h> 34#include <cpu/sh7724.h>
@@ -184,12 +179,14 @@ static struct sh_mobile_lcdc_info lcdc_info = {
184 .clock_source = LCDC_CLK_EXTERNAL, 179 .clock_source = LCDC_CLK_EXTERNAL,
185 .ch[0] = { 180 .ch[0] = {
186 .chan = LCDC_CHAN_MAINLCD, 181 .chan = LCDC_CHAN_MAINLCD,
187 .fourcc = V4L2_PIX_FMT_RGB565, 182 .bpp = 16,
188 .clock_divider = 1, 183 .clock_divider = 1,
189 .panel_cfg = { /* 7.0 inch */ 184 .lcd_size_cfg = { /* 7.0 inch */
190 .width = 152, 185 .width = 152,
191 .height = 91, 186 .height = 91,
192 }, 187 },
188 .board_cfg = {
189 },
193 } 190 }
194}; 191};
195 192
@@ -201,7 +198,7 @@ static struct resource lcdc_resources[] = {
201 .flags = IORESOURCE_MEM, 198 .flags = IORESOURCE_MEM,
202 }, 199 },
203 [1] = { 200 [1] = {
204 .start = evt2irq(0xf40), 201 .start = 106,
205 .flags = IORESOURCE_IRQ, 202 .flags = IORESOURCE_IRQ,
206 }, 203 },
207}; 204};
@@ -213,6 +210,9 @@ static struct platform_device lcdc_device = {
213 .dev = { 210 .dev = {
214 .platform_data = &lcdc_info, 211 .platform_data = &lcdc_info,
215 }, 212 },
213 .archdata = {
214 .hwblk_id = HWBLK_LCDC,
215 },
216}; 216};
217 217
218/* CEU0 */ 218/* CEU0 */
@@ -228,7 +228,7 @@ static struct resource ceu0_resources[] = {
228 .flags = IORESOURCE_MEM, 228 .flags = IORESOURCE_MEM,
229 }, 229 },
230 [1] = { 230 [1] = {
231 .start = evt2irq(0x880), 231 .start = 52,
232 .flags = IORESOURCE_IRQ, 232 .flags = IORESOURCE_IRQ,
233 }, 233 },
234 [2] = { 234 [2] = {
@@ -244,6 +244,9 @@ static struct platform_device ceu0_device = {
244 .dev = { 244 .dev = {
245 .platform_data = &sh_mobile_ceu0_info, 245 .platform_data = &sh_mobile_ceu0_info,
246 }, 246 },
247 .archdata = {
248 .hwblk_id = HWBLK_CEU0,
249 },
247}; 250};
248 251
249/* CEU1 */ 252/* CEU1 */
@@ -259,7 +262,7 @@ static struct resource ceu1_resources[] = {
259 .flags = IORESOURCE_MEM, 262 .flags = IORESOURCE_MEM,
260 }, 263 },
261 [1] = { 264 [1] = {
262 .start = evt2irq(0x9e0), 265 .start = 63,
263 .flags = IORESOURCE_IRQ, 266 .flags = IORESOURCE_IRQ,
264 }, 267 },
265 [2] = { 268 [2] = {
@@ -275,14 +278,15 @@ static struct platform_device ceu1_device = {
275 .dev = { 278 .dev = {
276 .platform_data = &sh_mobile_ceu1_info, 279 .platform_data = &sh_mobile_ceu1_info,
277 }, 280 },
281 .archdata = {
282 .hwblk_id = HWBLK_CEU1,
283 },
278}; 284};
279 285
280/* FSI */ 286/* FSI */
281/* change J20, J21, J22 pin to 1-2 connection to use slave mode */ 287/* change J20, J21, J22 pin to 1-2 connection to use slave mode */
282static struct sh_fsi_platform_info fsi_info = { 288static struct sh_fsi_platform_info fsi_info = {
283 .port_a = { 289 .porta_flags = SH_FSI_BRS_INV,
284 .flags = SH_FSI_BRS_INV,
285 },
286}; 290};
287 291
288static struct resource fsi_resources[] = { 292static struct resource fsi_resources[] = {
@@ -293,7 +297,7 @@ static struct resource fsi_resources[] = {
293 .flags = IORESOURCE_MEM, 297 .flags = IORESOURCE_MEM,
294 }, 298 },
295 [1] = { 299 [1] = {
296 .start = evt2irq(0xf80), 300 .start = 108,
297 .flags = IORESOURCE_IRQ, 301 .flags = IORESOURCE_IRQ,
298 }, 302 },
299}; 303};
@@ -306,30 +310,13 @@ static struct platform_device fsi_device = {
306 .dev = { 310 .dev = {
307 .platform_data = &fsi_info, 311 .platform_data = &fsi_info,
308 }, 312 },
309}; 313 .archdata = {
310 314 .hwblk_id = HWBLK_SPU, /* FSI needs SPU hwblk */
311static struct asoc_simple_dai_init_info fsi2_ak4642_init_info = { 315 },
312 .fmt = SND_SOC_DAIFMT_LEFT_J,
313 .codec_daifmt = SND_SOC_DAIFMT_CBM_CFM,
314 .cpu_daifmt = SND_SOC_DAIFMT_CBS_CFS,
315 .sysclk = 11289600,
316};
317
318static struct asoc_simple_card_info fsi_ak4642_info = {
319 .name = "AK4642",
320 .card = "FSIA-AK4642",
321 .cpu_dai = "fsia-dai",
322 .codec = "ak4642-codec.0-0012",
323 .platform = "sh_fsi.0",
324 .codec_dai = "ak4642-hifi",
325 .init = &fsi2_ak4642_init_info,
326}; 316};
327 317
328static struct platform_device fsi_ak4642_device = { 318static struct platform_device fsi_ak4642_device = {
329 .name = "asoc-simple-card", 319 .name = "sh_fsi_a_ak4642",
330 .dev = {
331 .platform_data = &fsi_ak4642_info,
332 },
333}; 320};
334 321
335/* KEYSC in SoC (Needs SW33-2 set to ON) */ 322/* KEYSC in SoC (Needs SW33-2 set to ON) */
@@ -355,7 +342,7 @@ static struct resource keysc_resources[] = {
355 .flags = IORESOURCE_MEM, 342 .flags = IORESOURCE_MEM,
356 }, 343 },
357 [1] = { 344 [1] = {
358 .start = evt2irq(0xbe0), 345 .start = 79,
359 .flags = IORESOURCE_IRQ, 346 .flags = IORESOURCE_IRQ,
360 }, 347 },
361}; 348};
@@ -368,6 +355,9 @@ static struct platform_device keysc_device = {
368 .dev = { 355 .dev = {
369 .platform_data = &keysc_info, 356 .platform_data = &keysc_info,
370 }, 357 },
358 .archdata = {
359 .hwblk_id = HWBLK_KEYSC,
360 },
371}; 361};
372 362
373/* SH Eth */ 363/* SH Eth */
@@ -378,7 +368,7 @@ static struct resource sh_eth_resources[] = {
378 .flags = IORESOURCE_MEM, 368 .flags = IORESOURCE_MEM,
379 }, 369 },
380 [1] = { 370 [1] = {
381 .start = evt2irq(0xd60), 371 .start = 91,
382 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL, 372 .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
383 }, 373 },
384}; 374};
@@ -396,6 +386,9 @@ static struct platform_device sh_eth_device = {
396 }, 386 },
397 .num_resources = ARRAY_SIZE(sh_eth_resources), 387 .num_resources = ARRAY_SIZE(sh_eth_resources),
398 .resource = sh_eth_resources, 388 .resource = sh_eth_resources,
389 .archdata = {
390 .hwblk_id = HWBLK_ETHER,
391 },
399}; 392};
400 393
401static struct r8a66597_platdata sh7724_usb0_host_data = { 394static struct r8a66597_platdata sh7724_usb0_host_data = {
@@ -409,8 +402,8 @@ static struct resource sh7724_usb0_host_resources[] = {
409 .flags = IORESOURCE_MEM, 402 .flags = IORESOURCE_MEM,
410 }, 403 },
411 [1] = { 404 [1] = {
412 .start = evt2irq(0xa20), 405 .start = 65,
413 .end = evt2irq(0xa20), 406 .end = 65,
414 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 407 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
415 }, 408 },
416}; 409};
@@ -425,6 +418,9 @@ static struct platform_device sh7724_usb0_host_device = {
425 }, 418 },
426 .num_resources = ARRAY_SIZE(sh7724_usb0_host_resources), 419 .num_resources = ARRAY_SIZE(sh7724_usb0_host_resources),
427 .resource = sh7724_usb0_host_resources, 420 .resource = sh7724_usb0_host_resources,
421 .archdata = {
422 .hwblk_id = HWBLK_USB0,
423 },
428}; 424};
429 425
430static struct r8a66597_platdata sh7724_usb1_gadget_data = { 426static struct r8a66597_platdata sh7724_usb1_gadget_data = {
@@ -438,8 +434,8 @@ static struct resource sh7724_usb1_gadget_resources[] = {
438 .flags = IORESOURCE_MEM, 434 .flags = IORESOURCE_MEM,
439 }, 435 },
440 [1] = { 436 [1] = {
441 .start = evt2irq(0xa40), 437 .start = 66,
442 .end = evt2irq(0xa40), 438 .end = 66,
443 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, 439 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW,
444 }, 440 },
445}; 441};
@@ -456,15 +452,6 @@ static struct platform_device sh7724_usb1_gadget_device = {
456 .resource = sh7724_usb1_gadget_resources, 452 .resource = sh7724_usb1_gadget_resources,
457}; 453};
458 454
459/* Fixed 3.3V regulator to be used by SDHI0, SDHI1 */
460static struct regulator_consumer_supply fixed3v3_power_consumers[] =
461{
462 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"),
463 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"),
464 REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"),
465 REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"),
466};
467
468static struct resource sdhi0_cn7_resources[] = { 455static struct resource sdhi0_cn7_resources[] = {
469 [0] = { 456 [0] = {
470 .name = "SDHI0", 457 .name = "SDHI0",
@@ -473,7 +460,7 @@ static struct resource sdhi0_cn7_resources[] = {
473 .flags = IORESOURCE_MEM, 460 .flags = IORESOURCE_MEM,
474 }, 461 },
475 [1] = { 462 [1] = {
476 .start = evt2irq(0xe80), 463 .start = 100,
477 .flags = IORESOURCE_IRQ, 464 .flags = IORESOURCE_IRQ,
478 }, 465 },
479}; 466};
@@ -492,6 +479,9 @@ static struct platform_device sdhi0_cn7_device = {
492 .dev = { 479 .dev = {
493 .platform_data = &sh7724_sdhi0_data, 480 .platform_data = &sh7724_sdhi0_data,
494 }, 481 },
482 .archdata = {
483 .hwblk_id = HWBLK_SDHI0,
484 },
495}; 485};
496 486
497static struct resource sdhi1_cn8_resources[] = { 487static struct resource sdhi1_cn8_resources[] = {
@@ -502,7 +492,7 @@ static struct resource sdhi1_cn8_resources[] = {
502 .flags = IORESOURCE_MEM, 492 .flags = IORESOURCE_MEM,
503 }, 493 },
504 [1] = { 494 [1] = {
505 .start = evt2irq(0x4e0), 495 .start = 23,
506 .flags = IORESOURCE_IRQ, 496 .flags = IORESOURCE_IRQ,
507 }, 497 },
508}; 498};
@@ -521,6 +511,9 @@ static struct platform_device sdhi1_cn8_device = {
521 .dev = { 511 .dev = {
522 .platform_data = &sh7724_sdhi1_data, 512 .platform_data = &sh7724_sdhi1_data,
523 }, 513 },
514 .archdata = {
515 .hwblk_id = HWBLK_SDHI1,
516 },
524}; 517};
525 518
526/* IrDA */ 519/* IrDA */
@@ -532,7 +525,7 @@ static struct resource irda_resources[] = {
532 .flags = IORESOURCE_MEM, 525 .flags = IORESOURCE_MEM,
533 }, 526 },
534 [1] = { 527 [1] = {
535 .start = evt2irq(0x480), 528 .start = 20,
536 .flags = IORESOURCE_IRQ, 529 .flags = IORESOURCE_IRQ,
537 }, 530 },
538}; 531};
@@ -570,7 +563,7 @@ static struct resource sh_vou_resources[] = {
570 .flags = IORESOURCE_MEM, 563 .flags = IORESOURCE_MEM,
571 }, 564 },
572 [1] = { 565 [1] = {
573 .start = evt2irq(0x8e0), 566 .start = 55,
574 .flags = IORESOURCE_IRQ, 567 .flags = IORESOURCE_IRQ,
575 }, 568 },
576}; 569};
@@ -583,6 +576,9 @@ static struct platform_device vou_device = {
583 .dev = { 576 .dev = {
584 .platform_data = &sh_vou_pdata, 577 .platform_data = &sh_vou_pdata,
585 }, 578 },
579 .archdata = {
580 .hwblk_id = HWBLK_VOU,
581 },
586}; 582};
587 583
588static struct platform_device *ms7724se_devices[] __initdata = { 584static struct platform_device *ms7724se_devices[] __initdata = {
@@ -616,7 +612,6 @@ static struct i2c_board_info i2c0_devices[] = {
616#define EEPROM_DATA 0xBA20600C 612#define EEPROM_DATA 0xBA20600C
617#define EEPROM_STAT 0xBA206010 613#define EEPROM_STAT 0xBA206010
618#define EEPROM_STRT 0xBA206014 614#define EEPROM_STRT 0xBA206014
619
620static int __init sh_eth_is_eeprom_ready(void) 615static int __init sh_eth_is_eeprom_ready(void)
621{ 616{
622 int t = 10000; 617 int t = 10000;
@@ -673,6 +668,7 @@ extern char ms7724se_sdram_enter_end;
673extern char ms7724se_sdram_leave_start; 668extern char ms7724se_sdram_leave_start;
674extern char ms7724se_sdram_leave_end; 669extern char ms7724se_sdram_leave_end;
675 670
671
676static int __init arch_setup(void) 672static int __init arch_setup(void)
677{ 673{
678 /* enable I2C device */ 674 /* enable I2C device */
@@ -695,10 +691,6 @@ static int __init devices_setup(void)
695 &ms7724se_sdram_enter_end, 691 &ms7724se_sdram_enter_end,
696 &ms7724se_sdram_leave_start, 692 &ms7724se_sdram_leave_start,
697 &ms7724se_sdram_leave_end); 693 &ms7724se_sdram_leave_end);
698
699 regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers,
700 ARRAY_SIZE(fixed3v3_power_consumers), 3300000);
701
702 /* Reset Release */ 694 /* Reset Release */
703 fpga_out = __raw_readw(FPGA_OUT); 695 fpga_out = __raw_readw(FPGA_OUT);
704 /* bit4: NTSC_PDN, bit5: NTSC_RESET */ 696 /* bit4: NTSC_PDN, bit5: NTSC_RESET */
@@ -913,12 +905,12 @@ static int __init devices_setup(void)
913 905
914 if (sw & SW41_B) { 906 if (sw & SW41_B) {
915 /* 720p */ 907 /* 720p */
916 lcdc_info.ch[0].lcd_modes = lcdc_720p_modes; 908 lcdc_info.ch[0].lcd_cfg = lcdc_720p_modes;
917 lcdc_info.ch[0].num_modes = ARRAY_SIZE(lcdc_720p_modes); 909 lcdc_info.ch[0].num_cfg = ARRAY_SIZE(lcdc_720p_modes);
918 } else { 910 } else {
919 /* VGA */ 911 /* VGA */
920 lcdc_info.ch[0].lcd_modes = lcdc_vga_modes; 912 lcdc_info.ch[0].lcd_cfg = lcdc_vga_modes;
921 lcdc_info.ch[0].num_modes = ARRAY_SIZE(lcdc_vga_modes); 913 lcdc_info.ch[0].num_cfg = ARRAY_SIZE(lcdc_vga_modes);
922 } 914 }
923 915
924 if (sw & SW41_A) { 916 if (sw & SW41_A) {
@@ -953,4 +945,5 @@ device_initcall(devices_setup);
953static struct sh_machine_vector mv_ms7724se __initmv = { 945static struct sh_machine_vector mv_ms7724se __initmv = {
954 .mv_name = "ms7724se", 946 .mv_name = "ms7724se",
955 .mv_init_irq = init_se7724_IRQ, 947 .mv_init_irq = init_se7724_IRQ,
948 .mv_nr_irqs = SE7724_FPGA_IRQ_BASE + SE7724_FPGA_IRQ_NR,
956}; 949};
diff --git a/arch/sh/boards/mach-se/7751/setup.c b/arch/sh/boards/mach-se/7751/setup.c
index 820f4e7ba0d..4ed60c5e221 100644
--- a/arch/sh/boards/mach-se/7751/setup.c
+++ b/arch/sh/boards/mach-se/7751/setup.c
@@ -55,5 +55,6 @@ device_initcall(se7751_devices_setup);
55 */ 55 */
56static struct sh_machine_vector mv_7751se __initmv = { 56static struct sh_machine_vector mv_7751se __initmv = {
57 .mv_name = "7751 SolutionEngine", 57 .mv_name = "7751 SolutionEngine",
58 .mv_nr_irqs = 72,
58 .mv_init_irq = init_7751se_IRQ, 59 .mv_init_irq = init_7751se_IRQ,
59}; 60};
diff --git a/arch/sh/boards/mach-se/7780/setup.c b/arch/sh/boards/mach-se/7780/setup.c
index ae5a1d84fdf..6f7c207138e 100644
--- a/arch/sh/boards/mach-se/7780/setup.c
+++ b/arch/sh/boards/mach-se/7780/setup.c
@@ -110,5 +110,6 @@ static void __init se7780_setup(char **cmdline_p)
110static struct sh_machine_vector mv_se7780 __initmv = { 110static struct sh_machine_vector mv_se7780 __initmv = {
111 .mv_name = "Solution Engine 7780" , 111 .mv_name = "Solution Engine 7780" ,
112 .mv_setup = se7780_setup , 112 .mv_setup = se7780_setup ,
113 .mv_nr_irqs = 111 ,
113 .mv_init_irq = init_se7780_IRQ, 114 .mv_init_irq = init_se7780_IRQ,
114}; 115};
diff --git a/arch/sh/boards/mach-se/board-se7619.c b/arch/sh/boards/mach-se/board-se7619.c
index 958bcd7aacc..82b6d4a5dc0 100644
--- a/arch/sh/boards/mach-se/board-se7619.c
+++ b/arch/sh/boards/mach-se/board-se7619.c
@@ -22,5 +22,6 @@ static int se7619_mode_pins(void)
22 22
23static struct sh_machine_vector mv_se __initmv = { 23static struct sh_machine_vector mv_se __initmv = {
24 .mv_name = "SolutionEngine", 24 .mv_name = "SolutionEngine",
25 .mv_nr_irqs = 108,
25 .mv_mode_pins = se7619_mode_pins, 26 .mv_mode_pins = se7619_mode_pins,
26}; 27};
diff --git a/arch/sh/boards/mach-sh03/setup.c b/arch/sh/boards/mach-sh03/setup.c
index f582dab5934..d4f79b2a651 100644
--- a/arch/sh/boards/mach-sh03/setup.c
+++ b/arch/sh/boards/mach-sh03/setup.c
@@ -101,5 +101,6 @@ device_initcall(sh03_devices_setup);
101static struct sh_machine_vector mv_sh03 __initmv = { 101static struct sh_machine_vector mv_sh03 __initmv = {
102 .mv_name = "Interface (CTP/PCI-SH03)", 102 .mv_name = "Interface (CTP/PCI-SH03)",
103 .mv_setup = sh03_setup, 103 .mv_setup = sh03_setup,
104 .mv_nr_irqs = 48,
104 .mv_init_irq = init_sh03_IRQ, 105 .mv_init_irq = init_sh03_IRQ,
105}; 106};
diff --git a/arch/sh/boards/mach-sh7763rdp/setup.c b/arch/sh/boards/mach-sh7763rdp/setup.c
index b7c75298dfb..f3d828f133e 100644
--- a/arch/sh/boards/mach-sh7763rdp/setup.c
+++ b/arch/sh/boards/mach-sh7763rdp/setup.c
@@ -17,9 +17,8 @@
17#include <linux/mtd/physmap.h> 17#include <linux/mtd/physmap.h>
18#include <linux/fb.h> 18#include <linux/fb.h>
19#include <linux/io.h> 19#include <linux/io.h>
20#include <linux/sh_eth.h>
21#include <linux/sh_intc.h>
22#include <mach/sh7763rdp.h> 20#include <mach/sh7763rdp.h>
21#include <asm/sh_eth.h>
23#include <asm/sh7760fb.h> 22#include <asm/sh7760fb.h>
24 23
25/* NOR Flash */ 24/* NOR Flash */
@@ -68,7 +67,7 @@ static struct platform_device sh7763rdp_nor_flash_device = {
68 * SH-Ether 67 * SH-Ether
69 * 68 *
70 * SH Ether of SH7763 has multi IRQ handling. 69 * SH Ether of SH7763 has multi IRQ handling.
71 * (0x920,0x940,0x960 -> 0x920) 70 * (57,58,59 -> 57)
72 */ 71 */
73static struct resource sh_eth_resources[] = { 72static struct resource sh_eth_resources[] = {
74 { 73 {
@@ -80,7 +79,7 @@ static struct resource sh_eth_resources[] = {
80 .end = 0xFEE01FFF, 79 .end = 0xFEE01FFF,
81 .flags = IORESOURCE_MEM, 80 .flags = IORESOURCE_MEM,
82 }, { 81 }, {
83 .start = evt2irq(0x920), /* irq number */ 82 .start = 57, /* irq number */
84 .flags = IORESOURCE_IRQ, 83 .flags = IORESOURCE_IRQ,
85 }, 84 },
86}; 85};
@@ -214,5 +213,6 @@ static void __init sh7763rdp_setup(char **cmdline_p)
214static struct sh_machine_vector mv_sh7763rdp __initmv = { 213static struct sh_machine_vector mv_sh7763rdp __initmv = {
215 .mv_name = "sh7763drp", 214 .mv_name = "sh7763drp",
216 .mv_setup = sh7763rdp_setup, 215 .mv_setup = sh7763rdp_setup,
216 .mv_nr_irqs = 112,
217 .mv_init_irq = init_sh7763rdp_IRQ, 217 .mv_init_irq = init_sh7763rdp_IRQ,
218}; 218};
diff --git a/arch/sh/boards/mach-x3proto/gpio.c b/arch/sh/boards/mach-x3proto/gpio.c
index 3ea65e9b56e..f33b2b57019 100644
--- a/arch/sh/boards/mach-x3proto/gpio.c
+++ b/arch/sh/boards/mach-x3proto/gpio.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Renesas SH-X3 Prototype Baseboard GPIO Support. 4 * Renesas SH-X3 Prototype Baseboard GPIO Support.
5 * 5 *
6 * Copyright (C) 2010 - 2012 Paul Mundt 6 * Copyright (C) 2010 Paul Mundt
7 * 7 *
8 * This file is subject to the terms and conditions of the GNU General Public 8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive 9 * License. See the file "COPYING" in the main directory of this archive
@@ -17,7 +17,6 @@
17#include <linux/irq.h> 17#include <linux/irq.h>
18#include <linux/kernel.h> 18#include <linux/kernel.h>
19#include <linux/spinlock.h> 19#include <linux/spinlock.h>
20#include <linux/irqdomain.h>
21#include <linux/io.h> 20#include <linux/io.h>
22#include <mach/ilsel.h> 21#include <mach/ilsel.h>
23#include <mach/hardware.h> 22#include <mach/hardware.h>
@@ -27,7 +26,7 @@
27#define KEYDETR 0xb81c0004 26#define KEYDETR 0xb81c0004
28 27
29static DEFINE_SPINLOCK(x3proto_gpio_lock); 28static DEFINE_SPINLOCK(x3proto_gpio_lock);
30static struct irq_domain *x3proto_irq_domain; 29static unsigned int x3proto_gpio_irq_map[NR_BASEBOARD_GPIOS] = { 0, };
31 30
32static int x3proto_gpio_direction_input(struct gpio_chip *chip, unsigned gpio) 31static int x3proto_gpio_direction_input(struct gpio_chip *chip, unsigned gpio)
33{ 32{
@@ -50,14 +49,7 @@ static int x3proto_gpio_get(struct gpio_chip *chip, unsigned gpio)
50 49
51static int x3proto_gpio_to_irq(struct gpio_chip *chip, unsigned gpio) 50static int x3proto_gpio_to_irq(struct gpio_chip *chip, unsigned gpio)
52{ 51{
53 int virq; 52 return x3proto_gpio_irq_map[gpio];
54
55 if (gpio < chip->ngpio)
56 virq = irq_create_mapping(x3proto_irq_domain, gpio);
57 else
58 virq = -ENXIO;
59
60 return virq;
61} 53}
62 54
63static void x3proto_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) 55static void x3proto_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
@@ -70,8 +62,9 @@ static void x3proto_gpio_irq_handler(unsigned int irq, struct irq_desc *desc)
70 chip->irq_mask_ack(data); 62 chip->irq_mask_ack(data);
71 63
72 mask = __raw_readw(KEYDETR); 64 mask = __raw_readw(KEYDETR);
65
73 for_each_set_bit(pin, &mask, NR_BASEBOARD_GPIOS) 66 for_each_set_bit(pin, &mask, NR_BASEBOARD_GPIOS)
74 generic_handle_irq(irq_linear_revmap(x3proto_irq_domain, pin)); 67 generic_handle_irq(x3proto_gpio_to_irq(NULL, pin));
75 68
76 chip->irq_unmask(data); 69 chip->irq_unmask(data);
77} 70}
@@ -85,23 +78,10 @@ struct gpio_chip x3proto_gpio_chip = {
85 .ngpio = NR_BASEBOARD_GPIOS, 78 .ngpio = NR_BASEBOARD_GPIOS,
86}; 79};
87 80
88static int x3proto_gpio_irq_map(struct irq_domain *domain, unsigned int virq,
89 irq_hw_number_t hwirq)
90{
91 irq_set_chip_and_handler_name(virq, &dummy_irq_chip, handle_simple_irq,
92 "gpio");
93
94 return 0;
95}
96
97static struct irq_domain_ops x3proto_gpio_irq_ops = {
98 .map = x3proto_gpio_irq_map,
99 .xlate = irq_domain_xlate_twocell,
100};
101
102int __init x3proto_gpio_setup(void) 81int __init x3proto_gpio_setup(void)
103{ 82{
104 int ilsel, ret; 83 int ilsel;
84 int ret, i;
105 85
106 ilsel = ilsel_enable(ILSEL_KEY); 86 ilsel = ilsel_enable(ILSEL_KEY);
107 if (unlikely(ilsel < 0)) 87 if (unlikely(ilsel < 0))
@@ -111,10 +91,21 @@ int __init x3proto_gpio_setup(void)
111 if (unlikely(ret)) 91 if (unlikely(ret))
112 goto err_gpio; 92 goto err_gpio;
113 93
114 x3proto_irq_domain = irq_domain_add_linear(NULL, NR_BASEBOARD_GPIOS, 94 for (i = 0; i < NR_BASEBOARD_GPIOS; i++) {
115 &x3proto_gpio_irq_ops, NULL); 95 unsigned long flags;
116 if (unlikely(!x3proto_irq_domain)) 96 int irq = create_irq();
117 goto err_irq; 97
98 if (unlikely(irq < 0)) {
99 ret = -EINVAL;
100 goto err_irq;
101 }
102
103 spin_lock_irqsave(&x3proto_gpio_lock, flags);
104 x3proto_gpio_irq_map[i] = irq;
105 irq_set_chip_and_handler_name(irq, &dummy_irq_chip,
106 handle_simple_irq, "gpio");
107 spin_unlock_irqrestore(&x3proto_gpio_lock, flags);
108 }
118 109
119 pr_info("registering '%s' support, handling GPIOs %u -> %u, " 110 pr_info("registering '%s' support, handling GPIOs %u -> %u, "
120 "bound to IRQ %u\n", 111 "bound to IRQ %u\n",
@@ -128,6 +119,10 @@ int __init x3proto_gpio_setup(void)
128 return 0; 119 return 0;
129 120
130err_irq: 121err_irq:
122 for (; i >= 0; --i)
123 if (x3proto_gpio_irq_map[i])
124 destroy_irq(x3proto_gpio_irq_map[i]);
125
131 ret = gpiochip_remove(&x3proto_gpio_chip); 126 ret = gpiochip_remove(&x3proto_gpio_chip);
132 if (unlikely(ret)) 127 if (unlikely(ret))
133 pr_err("Failed deregistering GPIO\n"); 128 pr_err("Failed deregistering GPIO\n");