diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-02 14:45:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-02 14:45:42 -0400 |
commit | 0a276d1675bc1b8de3ba269ba64b8f3e288d8309 (patch) | |
tree | ff552f58874b245f5962487ef53ce27ebcda5857 | |
parent | 25aa6a7ae46c6a041c46a2d314b9ab7c4f2baa41 (diff) | |
parent | 08298f0612e5e369d1da89b92cac5d2c71ddb9af (diff) |
Merge tag 'sh-for-linus' of git://github.com/pmundt/linux-sh
Pull SuperH fixes from Paul Mundt.
* tag 'sh-for-linus' of git://github.com/pmundt/linux-sh: (24 commits)
sh: explicitly include sh_dma.h in setup-sh7722.c
sh: ecovec: care CN5 VBUS if USB host mode
sh: sh7724: fixup renesas_usbhs clock settings
sh: intc: initial irqdomain support.
sh: pfc: Fix up init ordering mess.
serial: sh-sci: fix compilation breakage, when DMA is enabled
dmaengine: shdma: restore partial transfer calculation
sh: modify the sh_dmae_slave_config for RSPI in setup-sh7757
sh: Fix up recursive fault in oops with unset TTB.
sh: pfc: Build fix for pinctrl_remove_gpio_range() changes.
sh: select the fixed regulator driver on several boards
sh: ecovec: switch MMC power control to regulators
sh: add fixed voltage regulators to se7724
sh: add fixed voltage regulators to sdk7786
sh: add fixed voltage regulators to rsk
sh: add fixed voltage regulators to migor
sh: add fixed voltage regulators to kfr2r09
sh: add fixed voltage regulators to ap325rxa
sh: add fixed voltage regulators to sh7757lcr
sh: add fixed voltage regulators to sh2007
...
29 files changed, 419 insertions, 47 deletions
diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig index 7048c03490d9..fb5805745ace 100644 --- a/arch/sh/boards/Kconfig +++ b/arch/sh/boards/Kconfig | |||
@@ -57,6 +57,7 @@ config SH_7724_SOLUTION_ENGINE | |||
57 | depends on CPU_SUBTYPE_SH7724 | 57 | depends on CPU_SUBTYPE_SH7724 |
58 | select ARCH_REQUIRE_GPIOLIB | 58 | select ARCH_REQUIRE_GPIOLIB |
59 | select SND_SOC_AK4642 if SND_SIMPLE_CARD | 59 | select SND_SOC_AK4642 if SND_SIMPLE_CARD |
60 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | ||
60 | help | 61 | help |
61 | Select 7724 SolutionEngine if configuring for a Hitachi SH7724 | 62 | Select 7724 SolutionEngine if configuring for a Hitachi SH7724 |
62 | evaluation board. | 63 | evaluation board. |
@@ -140,6 +141,7 @@ config SH_RSK | |||
140 | bool "Renesas Starter Kit" | 141 | bool "Renesas Starter Kit" |
141 | depends on CPU_SUBTYPE_SH7201 || CPU_SUBTYPE_SH7203 || \ | 142 | depends on CPU_SUBTYPE_SH7201 || CPU_SUBTYPE_SH7203 || \ |
142 | CPU_SUBTYPE_SH7264 || CPU_SUBTYPE_SH7269 | 143 | CPU_SUBTYPE_SH7264 || CPU_SUBTYPE_SH7269 |
144 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | ||
143 | help | 145 | help |
144 | Select this option if configuring for any of the RSK+ MCU | 146 | Select this option if configuring for any of the RSK+ MCU |
145 | evaluation platforms. | 147 | evaluation platforms. |
@@ -159,6 +161,7 @@ config SH_SDK7786 | |||
159 | select NO_IOPORT if !PCI | 161 | select NO_IOPORT if !PCI |
160 | select ARCH_WANT_OPTIONAL_GPIOLIB | 162 | select ARCH_WANT_OPTIONAL_GPIOLIB |
161 | select HAVE_SRAM_POOL | 163 | select HAVE_SRAM_POOL |
164 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | ||
162 | help | 165 | help |
163 | Select SDK7786 if configuring for a Renesas Technology Europe | 166 | Select SDK7786 if configuring for a Renesas Technology Europe |
164 | SH7786-65nm board. | 167 | SH7786-65nm board. |
@@ -173,6 +176,7 @@ config SH_SH7757LCR | |||
173 | bool "SH7757LCR" | 176 | bool "SH7757LCR" |
174 | depends on CPU_SUBTYPE_SH7757 | 177 | depends on CPU_SUBTYPE_SH7757 |
175 | select ARCH_REQUIRE_GPIOLIB | 178 | select ARCH_REQUIRE_GPIOLIB |
179 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | ||
176 | 180 | ||
177 | config SH_SH7785LCR | 181 | config SH_SH7785LCR |
178 | bool "SH7785LCR" | 182 | bool "SH7785LCR" |
@@ -206,6 +210,7 @@ config SH_MIGOR | |||
206 | bool "Migo-R" | 210 | bool "Migo-R" |
207 | depends on CPU_SUBTYPE_SH7722 | 211 | depends on CPU_SUBTYPE_SH7722 |
208 | select ARCH_REQUIRE_GPIOLIB | 212 | select ARCH_REQUIRE_GPIOLIB |
213 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | ||
209 | help | 214 | help |
210 | Select Migo-R if configuring for the SH7722 Migo-R platform | 215 | Select Migo-R if configuring for the SH7722 Migo-R platform |
211 | by Renesas System Solutions Asia Pte. Ltd. | 216 | by Renesas System Solutions Asia Pte. Ltd. |
@@ -214,6 +219,7 @@ config SH_AP325RXA | |||
214 | bool "AP-325RXA" | 219 | bool "AP-325RXA" |
215 | depends on CPU_SUBTYPE_SH7723 | 220 | depends on CPU_SUBTYPE_SH7723 |
216 | select ARCH_REQUIRE_GPIOLIB | 221 | select ARCH_REQUIRE_GPIOLIB |
222 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | ||
217 | help | 223 | help |
218 | Renesas "AP-325RXA" support. | 224 | Renesas "AP-325RXA" support. |
219 | Compatible with ALGO SYSTEM CO.,LTD. "AP-320A" | 225 | Compatible with ALGO SYSTEM CO.,LTD. "AP-320A" |
@@ -222,6 +228,7 @@ config SH_KFR2R09 | |||
222 | bool "KFR2R09" | 228 | bool "KFR2R09" |
223 | depends on CPU_SUBTYPE_SH7724 | 229 | depends on CPU_SUBTYPE_SH7724 |
224 | select ARCH_REQUIRE_GPIOLIB | 230 | select ARCH_REQUIRE_GPIOLIB |
231 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | ||
225 | help | 232 | help |
226 | "Kit For R2R for 2009" support. | 233 | "Kit For R2R for 2009" support. |
227 | 234 | ||
@@ -230,6 +237,7 @@ config SH_ECOVEC | |||
230 | depends on CPU_SUBTYPE_SH7724 | 237 | depends on CPU_SUBTYPE_SH7724 |
231 | select ARCH_REQUIRE_GPIOLIB | 238 | select ARCH_REQUIRE_GPIOLIB |
232 | select SND_SOC_DA7210 if SND_SIMPLE_CARD | 239 | select SND_SOC_DA7210 if SND_SIMPLE_CARD |
240 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | ||
233 | help | 241 | help |
234 | Renesas "R0P7724LC0011/21RL (EcoVec)" support. | 242 | Renesas "R0P7724LC0011/21RL (EcoVec)" support. |
235 | 243 | ||
@@ -305,6 +313,7 @@ config SH_MAGIC_PANEL_R2 | |||
305 | bool "Magic Panel R2" | 313 | bool "Magic Panel R2" |
306 | depends on CPU_SUBTYPE_SH7720 | 314 | depends on CPU_SUBTYPE_SH7720 |
307 | select ARCH_REQUIRE_GPIOLIB | 315 | select ARCH_REQUIRE_GPIOLIB |
316 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | ||
308 | help | 317 | help |
309 | Select Magic Panel R2 if configuring for Magic Panel R2. | 318 | Select Magic Panel R2 if configuring for Magic Panel R2. |
310 | 319 | ||
@@ -316,6 +325,7 @@ config SH_CAYMAN | |||
316 | config SH_POLARIS | 325 | config SH_POLARIS |
317 | bool "SMSC Polaris" | 326 | bool "SMSC Polaris" |
318 | select CPU_HAS_IPR_IRQ | 327 | select CPU_HAS_IPR_IRQ |
328 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | ||
319 | depends on CPU_SUBTYPE_SH7709 | 329 | depends on CPU_SUBTYPE_SH7709 |
320 | help | 330 | help |
321 | Select if configuring for an SMSC Polaris development board | 331 | Select if configuring for an SMSC Polaris development board |
@@ -323,6 +333,7 @@ config SH_POLARIS | |||
323 | config SH_SH2007 | 333 | config SH_SH2007 |
324 | bool "SH-2007 board" | 334 | bool "SH-2007 board" |
325 | select NO_IOPORT | 335 | select NO_IOPORT |
336 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | ||
326 | depends on CPU_SUBTYPE_SH7780 | 337 | depends on CPU_SUBTYPE_SH7780 |
327 | help | 338 | help |
328 | SH-2007 is a single-board computer based around SH7780 chip | 339 | SH-2007 is a single-board computer based around SH7780 chip |
@@ -334,6 +345,7 @@ config SH_SH2007 | |||
334 | config SH_APSH4A3A | 345 | config SH_APSH4A3A |
335 | bool "AP-SH4A-3A" | 346 | bool "AP-SH4A-3A" |
336 | select SH_ALPHA_BOARD | 347 | select SH_ALPHA_BOARD |
348 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | ||
337 | depends on CPU_SUBTYPE_SH7785 | 349 | depends on CPU_SUBTYPE_SH7785 |
338 | help | 350 | help |
339 | Select AP-SH4A-3A if configuring for an ALPHAPROJECT AP-SH4A-3A. | 351 | Select AP-SH4A-3A if configuring for an ALPHAPROJECT AP-SH4A-3A. |
@@ -342,6 +354,7 @@ config SH_APSH4AD0A | |||
342 | bool "AP-SH4AD-0A" | 354 | bool "AP-SH4AD-0A" |
343 | select SH_ALPHA_BOARD | 355 | select SH_ALPHA_BOARD |
344 | select SYS_SUPPORTS_PCI | 356 | select SYS_SUPPORTS_PCI |
357 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | ||
345 | depends on CPU_SUBTYPE_SH7786 | 358 | depends on CPU_SUBTYPE_SH7786 |
346 | help | 359 | help |
347 | Select AP-SH4AD-0A if configuring for an ALPHAPROJECT AP-SH4AD-0A. | 360 | Select AP-SH4AD-0A if configuring for an ALPHAPROJECT AP-SH4AD-0A. |
diff --git a/arch/sh/boards/board-apsh4a3a.c b/arch/sh/boards/board-apsh4a3a.c index 2823619c6006..0a39c241628a 100644 --- a/arch/sh/boards/board-apsh4a3a.c +++ b/arch/sh/boards/board-apsh4a3a.c | |||
@@ -13,6 +13,8 @@ | |||
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> | ||
16 | #include <linux/smsc911x.h> | 18 | #include <linux/smsc911x.h> |
17 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
18 | #include <linux/clk.h> | 20 | #include <linux/clk.h> |
@@ -66,6 +68,12 @@ static struct platform_device nor_flash_device = { | |||
66 | .resource = nor_flash_resources, | 68 | .resource = nor_flash_resources, |
67 | }; | 69 | }; |
68 | 70 | ||
71 | /* Dummy supplies, where voltage doesn't matter */ | ||
72 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
73 | REGULATOR_SUPPLY("vddvario", "smsc911x"), | ||
74 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), | ||
75 | }; | ||
76 | |||
69 | static struct resource smsc911x_resources[] = { | 77 | static struct resource smsc911x_resources[] = { |
70 | [0] = { | 78 | [0] = { |
71 | .name = "smsc911x-memory", | 79 | .name = "smsc911x-memory", |
@@ -105,6 +113,8 @@ static struct platform_device *apsh4a3a_devices[] __initdata = { | |||
105 | 113 | ||
106 | static int __init apsh4a3a_devices_setup(void) | 114 | static int __init apsh4a3a_devices_setup(void) |
107 | { | 115 | { |
116 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
117 | |||
108 | return platform_add_devices(apsh4a3a_devices, | 118 | return platform_add_devices(apsh4a3a_devices, |
109 | ARRAY_SIZE(apsh4a3a_devices)); | 119 | ARRAY_SIZE(apsh4a3a_devices)); |
110 | } | 120 | } |
diff --git a/arch/sh/boards/board-apsh4ad0a.c b/arch/sh/boards/board-apsh4ad0a.c index b4d6292a9247..92eac3a99187 100644 --- a/arch/sh/boards/board-apsh4ad0a.c +++ b/arch/sh/boards/board-apsh4ad0a.c | |||
@@ -12,12 +12,20 @@ | |||
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> | ||
15 | #include <linux/smsc911x.h> | 17 | #include <linux/smsc911x.h> |
16 | #include <linux/irq.h> | 18 | #include <linux/irq.h> |
17 | #include <linux/clk.h> | 19 | #include <linux/clk.h> |
18 | #include <asm/machvec.h> | 20 | #include <asm/machvec.h> |
19 | #include <asm/sizes.h> | 21 | #include <asm/sizes.h> |
20 | 22 | ||
23 | /* Dummy supplies, where voltage doesn't matter */ | ||
24 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
25 | REGULATOR_SUPPLY("vddvario", "smsc911x"), | ||
26 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), | ||
27 | }; | ||
28 | |||
21 | static struct resource smsc911x_resources[] = { | 29 | static struct resource smsc911x_resources[] = { |
22 | [0] = { | 30 | [0] = { |
23 | .name = "smsc911x-memory", | 31 | .name = "smsc911x-memory", |
@@ -56,6 +64,8 @@ static struct platform_device *apsh4ad0a_devices[] __initdata = { | |||
56 | 64 | ||
57 | static int __init apsh4ad0a_devices_setup(void) | 65 | static int __init apsh4ad0a_devices_setup(void) |
58 | { | 66 | { |
67 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
68 | |||
59 | return platform_add_devices(apsh4ad0a_devices, | 69 | return platform_add_devices(apsh4ad0a_devices, |
60 | ARRAY_SIZE(apsh4ad0a_devices)); | 70 | ARRAY_SIZE(apsh4ad0a_devices)); |
61 | } | 71 | } |
diff --git a/arch/sh/boards/board-magicpanelr2.c b/arch/sh/boards/board-magicpanelr2.c index 90568f9de3a4..20500858b56c 100644 --- a/arch/sh/boards/board-magicpanelr2.c +++ b/arch/sh/boards/board-magicpanelr2.c | |||
@@ -14,6 +14,8 @@ | |||
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> | ||
17 | #include <linux/smsc911x.h> | 19 | #include <linux/smsc911x.h> |
18 | #include <linux/mtd/mtd.h> | 20 | #include <linux/mtd/mtd.h> |
19 | #include <linux/mtd/partitions.h> | 21 | #include <linux/mtd/partitions.h> |
@@ -24,6 +26,12 @@ | |||
24 | #include <asm/heartbeat.h> | 26 | #include <asm/heartbeat.h> |
25 | #include <cpu/sh7720.h> | 27 | #include <cpu/sh7720.h> |
26 | 28 | ||
29 | /* Dummy supplies, where voltage doesn't matter */ | ||
30 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
31 | REGULATOR_SUPPLY("vddvario", "smsc911x"), | ||
32 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), | ||
33 | }; | ||
34 | |||
27 | #define LAN9115_READY (__raw_readl(0xA8000084UL) & 0x00000001UL) | 35 | #define LAN9115_READY (__raw_readl(0xA8000084UL) & 0x00000001UL) |
28 | 36 | ||
29 | /* Wait until reset finished. Timeout is 100ms. */ | 37 | /* Wait until reset finished. Timeout is 100ms. */ |
@@ -348,6 +356,8 @@ static struct platform_device *mpr2_devices[] __initdata = { | |||
348 | 356 | ||
349 | static int __init mpr2_devices_setup(void) | 357 | static int __init mpr2_devices_setup(void) |
350 | { | 358 | { |
359 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
360 | |||
351 | return platform_add_devices(mpr2_devices, ARRAY_SIZE(mpr2_devices)); | 361 | return platform_add_devices(mpr2_devices, ARRAY_SIZE(mpr2_devices)); |
352 | } | 362 | } |
353 | device_initcall(mpr2_devices_setup); | 363 | device_initcall(mpr2_devices_setup); |
diff --git a/arch/sh/boards/board-polaris.c b/arch/sh/boards/board-polaris.c index 0978ae2e4847..37a08d094727 100644 --- a/arch/sh/boards/board-polaris.c +++ b/arch/sh/boards/board-polaris.c | |||
@@ -9,6 +9,8 @@ | |||
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> | ||
12 | #include <linux/smsc911x.h> | 14 | #include <linux/smsc911x.h> |
13 | #include <linux/io.h> | 15 | #include <linux/io.h> |
14 | #include <asm/irq.h> | 16 | #include <asm/irq.h> |
@@ -22,6 +24,12 @@ | |||
22 | #define AREA5_WAIT_CTRL (0x1C00) | 24 | #define AREA5_WAIT_CTRL (0x1C00) |
23 | #define WAIT_STATES_10 (0x7) | 25 | #define WAIT_STATES_10 (0x7) |
24 | 26 | ||
27 | /* Dummy supplies, where voltage doesn't matter */ | ||
28 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
29 | REGULATOR_SUPPLY("vddvario", "smsc911x.0"), | ||
30 | REGULATOR_SUPPLY("vdd33a", "smsc911x.0"), | ||
31 | }; | ||
32 | |||
25 | static struct resource smsc911x_resources[] = { | 33 | static struct resource smsc911x_resources[] = { |
26 | [0] = { | 34 | [0] = { |
27 | .name = "smsc911x-memory", | 35 | .name = "smsc911x-memory", |
@@ -88,6 +96,8 @@ static int __init polaris_initialise(void) | |||
88 | 96 | ||
89 | printk(KERN_INFO "Configuring Polaris external bus\n"); | 97 | printk(KERN_INFO "Configuring Polaris external bus\n"); |
90 | 98 | ||
99 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
100 | |||
91 | /* Configure area 5 with 2 wait states */ | 101 | /* Configure area 5 with 2 wait states */ |
92 | wcr = __raw_readw(WCR2); | 102 | wcr = __raw_readw(WCR2); |
93 | wcr &= (~AREA5_WAIT_CTRL); | 103 | wcr &= (~AREA5_WAIT_CTRL); |
diff --git a/arch/sh/boards/board-sh2007.c b/arch/sh/boards/board-sh2007.c index b90b78f6a829..1980bb7e5780 100644 --- a/arch/sh/boards/board-sh2007.c +++ b/arch/sh/boards/board-sh2007.c | |||
@@ -6,6 +6,8 @@ | |||
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> | ||
9 | #include <linux/smsc911x.h> | 11 | #include <linux/smsc911x.h> |
10 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
11 | #include <linux/ata_platform.h> | 13 | #include <linux/ata_platform.h> |
@@ -13,6 +15,14 @@ | |||
13 | #include <asm/machvec.h> | 15 | #include <asm/machvec.h> |
14 | #include <mach/sh2007.h> | 16 | #include <mach/sh2007.h> |
15 | 17 | ||
18 | /* Dummy supplies, where voltage doesn't matter */ | ||
19 | static 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 | |||
16 | struct smsc911x_platform_config smc911x_info = { | 26 | struct smsc911x_platform_config smc911x_info = { |
17 | .flags = SMSC911X_USE_32BIT, | 27 | .flags = SMSC911X_USE_32BIT, |
18 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | 28 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
@@ -98,6 +108,8 @@ static struct platform_device *sh2007_devices[] __initdata = { | |||
98 | 108 | ||
99 | static int __init sh2007_io_init(void) | 109 | static int __init sh2007_io_init(void) |
100 | { | 110 | { |
111 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
112 | |||
101 | platform_add_devices(sh2007_devices, ARRAY_SIZE(sh2007_devices)); | 113 | platform_add_devices(sh2007_devices, ARRAY_SIZE(sh2007_devices)); |
102 | return 0; | 114 | return 0; |
103 | } | 115 | } |
diff --git a/arch/sh/boards/board-sh7757lcr.c b/arch/sh/boards/board-sh7757lcr.c index 5087f8bb4cff..41f86702eb9f 100644 --- a/arch/sh/boards/board-sh7757lcr.c +++ b/arch/sh/boards/board-sh7757lcr.c | |||
@@ -12,6 +12,8 @@ | |||
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> | ||
15 | #include <linux/spi/spi.h> | 17 | #include <linux/spi/spi.h> |
16 | #include <linux/spi/flash.h> | 18 | #include <linux/spi/flash.h> |
17 | #include <linux/io.h> | 19 | #include <linux/io.h> |
@@ -199,6 +201,15 @@ static struct platform_device sh7757_eth_giga1_device = { | |||
199 | }, | 201 | }, |
200 | }; | 202 | }; |
201 | 203 | ||
204 | /* Fixed 3.3V regulator to be used by SDHI0, MMCIF */ | ||
205 | static 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 | |||
202 | /* SH_MMCIF */ | 213 | /* SH_MMCIF */ |
203 | static struct resource sh_mmcif_resources[] = { | 214 | static struct resource sh_mmcif_resources[] = { |
204 | [0] = { | 215 | [0] = { |
@@ -329,6 +340,9 @@ static struct spi_board_info spi_board_info[] = { | |||
329 | 340 | ||
330 | static int __init sh7757lcr_devices_setup(void) | 341 | static int __init sh7757lcr_devices_setup(void) |
331 | { | 342 | { |
343 | regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers, | ||
344 | ARRAY_SIZE(fixed3v3_power_consumers), 3300000); | ||
345 | |||
332 | /* RGMII (PTA) */ | 346 | /* RGMII (PTA) */ |
333 | gpio_request(GPIO_FN_ET0_MDC, NULL); | 347 | gpio_request(GPIO_FN_ET0_MDC, NULL); |
334 | gpio_request(GPIO_FN_ET0_MDIO, NULL); | 348 | gpio_request(GPIO_FN_ET0_MDIO, NULL); |
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c index f33ebf447073..9e963c1d1447 100644 --- a/arch/sh/boards/mach-ap325rxa/setup.c +++ b/arch/sh/boards/mach-ap325rxa/setup.c | |||
@@ -20,6 +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> | ||
23 | #include <linux/smsc911x.h> | 25 | #include <linux/smsc911x.h> |
24 | #include <linux/gpio.h> | 26 | #include <linux/gpio.h> |
25 | #include <linux/videodev2.h> | 27 | #include <linux/videodev2.h> |
@@ -34,6 +36,12 @@ | |||
34 | #include <asm/suspend.h> | 36 | #include <asm/suspend.h> |
35 | #include <cpu/sh7723.h> | 37 | #include <cpu/sh7723.h> |
36 | 38 | ||
39 | /* Dummy supplies, where voltage doesn't matter */ | ||
40 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
41 | REGULATOR_SUPPLY("vddvario", "smsc911x"), | ||
42 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), | ||
43 | }; | ||
44 | |||
37 | static struct smsc911x_platform_config smsc911x_config = { | 45 | static struct smsc911x_platform_config smsc911x_config = { |
38 | .phy_interface = PHY_INTERFACE_MODE_MII, | 46 | .phy_interface = PHY_INTERFACE_MODE_MII, |
39 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, | 47 | .irq_polarity = SMSC911X_IRQ_POLARITY_ACTIVE_LOW, |
@@ -423,6 +431,15 @@ static struct platform_device ceu_device = { | |||
423 | }, | 431 | }, |
424 | }; | 432 | }; |
425 | 433 | ||
434 | /* Fixed 3.3V regulators to be used by SDHI0, SDHI1 */ | ||
435 | static struct regulator_consumer_supply fixed3v3_power_consumers[] = | ||
436 | { | ||
437 | REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), | ||
438 | REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), | ||
439 | REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"), | ||
440 | REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"), | ||
441 | }; | ||
442 | |||
426 | static struct resource sdhi0_cn3_resources[] = { | 443 | static struct resource sdhi0_cn3_resources[] = { |
427 | [0] = { | 444 | [0] = { |
428 | .name = "SDHI0", | 445 | .name = "SDHI0", |
@@ -544,6 +561,10 @@ static int __init ap325rxa_devices_setup(void) | |||
544 | &ap325rxa_sdram_leave_start, | 561 | &ap325rxa_sdram_leave_start, |
545 | &ap325rxa_sdram_leave_end); | 562 | &ap325rxa_sdram_leave_end); |
546 | 563 | ||
564 | regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers, | ||
565 | ARRAY_SIZE(fixed3v3_power_consumers), 3300000); | ||
566 | regulator_register_fixed(1, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
567 | |||
547 | /* LD3 and LD4 LEDs */ | 568 | /* LD3 and LD4 LEDs */ |
548 | gpio_request(GPIO_PTX5, NULL); /* RUN */ | 569 | gpio_request(GPIO_PTX5, NULL); /* RUN */ |
549 | gpio_direction_output(GPIO_PTX5, 1); | 570 | gpio_direction_output(GPIO_PTX5, 1); |
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 4158d70c0dea..64559e8af14b 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
@@ -19,6 +19,8 @@ | |||
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> | ||
22 | #include <linux/usb/r8a66597.h> | 24 | #include <linux/usb/r8a66597.h> |
23 | #include <linux/usb/renesas_usbhs.h> | 25 | #include <linux/usb/renesas_usbhs.h> |
24 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
@@ -242,9 +244,17 @@ static int usbhs_get_id(struct platform_device *pdev) | |||
242 | return gpio_get_value(GPIO_PTB3); | 244 | return gpio_get_value(GPIO_PTB3); |
243 | } | 245 | } |
244 | 246 | ||
247 | static 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 | |||
245 | static struct renesas_usbhs_platform_info usbhs_info = { | 254 | static struct renesas_usbhs_platform_info usbhs_info = { |
246 | .platform_callback = { | 255 | .platform_callback = { |
247 | .get_id = usbhs_get_id, | 256 | .get_id = usbhs_get_id, |
257 | .phy_reset = usbhs_phy_reset, | ||
248 | }, | 258 | }, |
249 | .driver_param = { | 259 | .driver_param = { |
250 | .buswait_bwait = 4, | 260 | .buswait_bwait = 4, |
@@ -518,10 +528,86 @@ static struct i2c_board_info ts_i2c_clients = { | |||
518 | .irq = IRQ0, | 528 | .irq = IRQ0, |
519 | }; | 529 | }; |
520 | 530 | ||
531 | static struct regulator_consumer_supply cn12_power_consumers[] = | ||
532 | { | ||
533 | REGULATOR_SUPPLY("vmmc", "sh_mmcif.0"), | ||
534 | REGULATOR_SUPPLY("vqmmc", "sh_mmcif.0"), | ||
535 | REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.1"), | ||
536 | REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.1"), | ||
537 | }; | ||
538 | |||
539 | static struct regulator_init_data cn12_power_init_data = { | ||
540 | .constraints = { | ||
541 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
542 | }, | ||
543 | .num_consumer_supplies = ARRAY_SIZE(cn12_power_consumers), | ||
544 | .consumer_supplies = cn12_power_consumers, | ||
545 | }; | ||
546 | |||
547 | static struct fixed_voltage_config cn12_power_info = { | ||
548 | .supply_name = "CN12 SD/MMC Vdd", | ||
549 | .microvolts = 3300000, | ||
550 | .gpio = GPIO_PTB7, | ||
551 | .enable_high = 1, | ||
552 | .init_data = &cn12_power_init_data, | ||
553 | }; | ||
554 | |||
555 | static struct platform_device cn12_power = { | ||
556 | .name = "reg-fixed-voltage", | ||
557 | .id = 0, | ||
558 | .dev = { | ||
559 | .platform_data = &cn12_power_info, | ||
560 | }, | ||
561 | }; | ||
562 | |||
521 | #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) | 563 | #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) |
522 | /* SDHI0 */ | 564 | /* SDHI0 */ |
565 | static struct regulator_consumer_supply sdhi0_power_consumers[] = | ||
566 | { | ||
567 | REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), | ||
568 | REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), | ||
569 | }; | ||
570 | |||
571 | static struct regulator_init_data sdhi0_power_init_data = { | ||
572 | .constraints = { | ||
573 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
574 | }, | ||
575 | .num_consumer_supplies = ARRAY_SIZE(sdhi0_power_consumers), | ||
576 | .consumer_supplies = sdhi0_power_consumers, | ||
577 | }; | ||
578 | |||
579 | static struct fixed_voltage_config sdhi0_power_info = { | ||
580 | .supply_name = "CN11 SD/MMC Vdd", | ||
581 | .microvolts = 3300000, | ||
582 | .gpio = GPIO_PTB6, | ||
583 | .enable_high = 1, | ||
584 | .init_data = &sdhi0_power_init_data, | ||
585 | }; | ||
586 | |||
587 | static struct platform_device sdhi0_power = { | ||
588 | .name = "reg-fixed-voltage", | ||
589 | .id = 1, | ||
590 | .dev = { | ||
591 | .platform_data = &sdhi0_power_info, | ||
592 | }, | ||
593 | }; | ||
594 | |||
523 | static void sdhi0_set_pwr(struct platform_device *pdev, int state) | 595 | static void sdhi0_set_pwr(struct platform_device *pdev, int state) |
524 | { | 596 | { |
597 | static int power_gpio = -EINVAL; | ||
598 | |||
599 | if (power_gpio < 0) { | ||
600 | int ret = gpio_request(GPIO_PTB6, NULL); | ||
601 | if (!ret) { | ||
602 | power_gpio = GPIO_PTB6; | ||
603 | gpio_direction_output(power_gpio, 0); | ||
604 | } | ||
605 | } | ||
606 | |||
607 | /* | ||
608 | * Toggle the GPIO regardless, whether we managed to grab it above or | ||
609 | * the fixed regulator driver did. | ||
610 | */ | ||
525 | gpio_set_value(GPIO_PTB6, state); | 611 | gpio_set_value(GPIO_PTB6, state); |
526 | } | 612 | } |
527 | 613 | ||
@@ -562,13 +648,27 @@ static struct platform_device sdhi0_device = { | |||
562 | }, | 648 | }, |
563 | }; | 649 | }; |
564 | 650 | ||
565 | #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) | 651 | static void cn12_set_pwr(struct platform_device *pdev, int state) |
566 | /* SDHI1 */ | ||
567 | static void sdhi1_set_pwr(struct platform_device *pdev, int state) | ||
568 | { | 652 | { |
653 | static int power_gpio = -EINVAL; | ||
654 | |||
655 | if (power_gpio < 0) { | ||
656 | int ret = gpio_request(GPIO_PTB7, NULL); | ||
657 | if (!ret) { | ||
658 | power_gpio = GPIO_PTB7; | ||
659 | gpio_direction_output(power_gpio, 0); | ||
660 | } | ||
661 | } | ||
662 | |||
663 | /* | ||
664 | * Toggle the GPIO regardless, whether we managed to grab it above or | ||
665 | * the fixed regulator driver did. | ||
666 | */ | ||
569 | gpio_set_value(GPIO_PTB7, state); | 667 | gpio_set_value(GPIO_PTB7, state); |
570 | } | 668 | } |
571 | 669 | ||
670 | #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) | ||
671 | /* SDHI1 */ | ||
572 | static int sdhi1_get_cd(struct platform_device *pdev) | 672 | static int sdhi1_get_cd(struct platform_device *pdev) |
573 | { | 673 | { |
574 | return !gpio_get_value(GPIO_PTW7); | 674 | return !gpio_get_value(GPIO_PTW7); |
@@ -579,7 +679,7 @@ static struct sh_mobile_sdhi_info sdhi1_info = { | |||
579 | .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX, | 679 | .dma_slave_rx = SHDMA_SLAVE_SDHI1_RX, |
580 | .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD | | 680 | .tmio_caps = MMC_CAP_SDIO_IRQ | MMC_CAP_POWER_OFF_CARD | |
581 | MMC_CAP_NEEDS_POLL, | 681 | MMC_CAP_NEEDS_POLL, |
582 | .set_pwr = sdhi1_set_pwr, | 682 | .set_pwr = cn12_set_pwr, |
583 | .get_cd = sdhi1_get_cd, | 683 | .get_cd = sdhi1_get_cd, |
584 | }; | 684 | }; |
585 | 685 | ||
@@ -899,14 +999,9 @@ static struct platform_device vou_device = { | |||
899 | 999 | ||
900 | #if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE) | 1000 | #if defined(CONFIG_MMC_SH_MMCIF) || defined(CONFIG_MMC_SH_MMCIF_MODULE) |
901 | /* SH_MMCIF */ | 1001 | /* SH_MMCIF */ |
902 | static void mmcif_set_pwr(struct platform_device *pdev, int state) | ||
903 | { | ||
904 | gpio_set_value(GPIO_PTB7, state); | ||
905 | } | ||
906 | |||
907 | static void mmcif_down_pwr(struct platform_device *pdev) | 1002 | static void mmcif_down_pwr(struct platform_device *pdev) |
908 | { | 1003 | { |
909 | gpio_set_value(GPIO_PTB7, 0); | 1004 | cn12_set_pwr(pdev, 0); |
910 | } | 1005 | } |
911 | 1006 | ||
912 | static struct resource sh_mmcif_resources[] = { | 1007 | static struct resource sh_mmcif_resources[] = { |
@@ -929,7 +1024,7 @@ static struct resource sh_mmcif_resources[] = { | |||
929 | }; | 1024 | }; |
930 | 1025 | ||
931 | static struct sh_mmcif_plat_data sh_mmcif_plat = { | 1026 | static struct sh_mmcif_plat_data sh_mmcif_plat = { |
932 | .set_pwr = mmcif_set_pwr, | 1027 | .set_pwr = cn12_set_pwr, |
933 | .down_pwr = mmcif_down_pwr, | 1028 | .down_pwr = mmcif_down_pwr, |
934 | .sup_pclk = 0, /* SH7724: Max Pclk/2 */ | 1029 | .sup_pclk = 0, /* SH7724: Max Pclk/2 */ |
935 | .caps = MMC_CAP_4_BIT_DATA | | 1030 | .caps = MMC_CAP_4_BIT_DATA | |
@@ -960,7 +1055,9 @@ static struct platform_device *ecovec_devices[] __initdata = { | |||
960 | &ceu0_device, | 1055 | &ceu0_device, |
961 | &ceu1_device, | 1056 | &ceu1_device, |
962 | &keysc_device, | 1057 | &keysc_device, |
1058 | &cn12_power, | ||
963 | #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) | 1059 | #if defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) |
1060 | &sdhi0_power, | ||
964 | &sdhi0_device, | 1061 | &sdhi0_device, |
965 | #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) | 1062 | #if !defined(CONFIG_MMC_SH_MMCIF) && !defined(CONFIG_MMC_SH_MMCIF_MODULE) |
966 | &sdhi1_device, | 1063 | &sdhi1_device, |
@@ -1258,8 +1355,6 @@ static int __init arch_setup(void) | |||
1258 | gpio_request(GPIO_FN_SDHI0D2, NULL); | 1355 | gpio_request(GPIO_FN_SDHI0D2, NULL); |
1259 | gpio_request(GPIO_FN_SDHI0D1, NULL); | 1356 | gpio_request(GPIO_FN_SDHI0D1, NULL); |
1260 | gpio_request(GPIO_FN_SDHI0D0, NULL); | 1357 | gpio_request(GPIO_FN_SDHI0D0, NULL); |
1261 | gpio_request(GPIO_PTB6, NULL); | ||
1262 | gpio_direction_output(GPIO_PTB6, 0); | ||
1263 | #else | 1358 | #else |
1264 | /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */ | 1359 | /* enable MSIOF0 on CN11 (needs DS2.4 set to OFF) */ |
1265 | gpio_request(GPIO_FN_MSIOF0_TXD, NULL); | 1360 | gpio_request(GPIO_FN_MSIOF0_TXD, NULL); |
@@ -1288,8 +1383,6 @@ static int __init arch_setup(void) | |||
1288 | gpio_request(GPIO_FN_MMC_D0, NULL); | 1383 | gpio_request(GPIO_FN_MMC_D0, NULL); |
1289 | gpio_request(GPIO_FN_MMC_CLK, NULL); | 1384 | gpio_request(GPIO_FN_MMC_CLK, NULL); |
1290 | gpio_request(GPIO_FN_MMC_CMD, NULL); | 1385 | gpio_request(GPIO_FN_MMC_CMD, NULL); |
1291 | gpio_request(GPIO_PTB7, NULL); | ||
1292 | gpio_direction_output(GPIO_PTB7, 0); | ||
1293 | 1386 | ||
1294 | cn12_enabled = true; | 1387 | cn12_enabled = true; |
1295 | #elif defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) | 1388 | #elif defined(CONFIG_MMC_SDHI) || defined(CONFIG_MMC_SDHI_MODULE) |
@@ -1301,8 +1394,6 @@ static int __init arch_setup(void) | |||
1301 | gpio_request(GPIO_FN_SDHI1D2, NULL); | 1394 | gpio_request(GPIO_FN_SDHI1D2, NULL); |
1302 | gpio_request(GPIO_FN_SDHI1D1, NULL); | 1395 | gpio_request(GPIO_FN_SDHI1D1, NULL); |
1303 | gpio_request(GPIO_FN_SDHI1D0, NULL); | 1396 | gpio_request(GPIO_FN_SDHI1D0, NULL); |
1304 | gpio_request(GPIO_PTB7, NULL); | ||
1305 | gpio_direction_output(GPIO_PTB7, 0); | ||
1306 | 1397 | ||
1307 | /* Card-detect, used on CN12 with SDHI1 */ | 1398 | /* Card-detect, used on CN12 with SDHI1 */ |
1308 | gpio_request(GPIO_PTW7, NULL); | 1399 | gpio_request(GPIO_PTW7, NULL); |
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c index 43a179ce9afc..f2a4304fbe23 100644 --- a/arch/sh/boards/mach-kfr2r09/setup.c +++ b/arch/sh/boards/mach-kfr2r09/setup.c | |||
@@ -21,6 +21,8 @@ | |||
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> | ||
24 | #include <linux/usb/r8a66597.h> | 26 | #include <linux/usb/r8a66597.h> |
25 | #include <linux/videodev2.h> | 27 | #include <linux/videodev2.h> |
26 | #include <linux/sh_intc.h> | 28 | #include <linux/sh_intc.h> |
@@ -341,6 +343,13 @@ static struct platform_device kfr2r09_camera = { | |||
341 | }, | 343 | }, |
342 | }; | 344 | }; |
343 | 345 | ||
346 | /* Fixed 3.3V regulator to be used by SDHI0 */ | ||
347 | static struct regulator_consumer_supply fixed3v3_power_consumers[] = | ||
348 | { | ||
349 | REGULATOR_SUPPLY("vmmc", "sh_mobile_sdhi.0"), | ||
350 | REGULATOR_SUPPLY("vqmmc", "sh_mobile_sdhi.0"), | ||
351 | }; | ||
352 | |||
344 | static struct resource kfr2r09_sh_sdhi0_resources[] = { | 353 | static struct resource kfr2r09_sh_sdhi0_resources[] = { |
345 | [0] = { | 354 | [0] = { |
346 | .name = "SDHI0", | 355 | .name = "SDHI0", |
@@ -523,6 +532,9 @@ static int __init kfr2r09_devices_setup(void) | |||
523 | &kfr2r09_sdram_leave_start, | 532 | &kfr2r09_sdram_leave_start, |
524 | &kfr2r09_sdram_leave_end); | 533 | &kfr2r09_sdram_leave_end); |
525 | 534 | ||
535 | regulator_register_always_on(0, "fixed-3.3V", fixed3v3_power_consumers, | ||
536 | ARRAY_SIZE(fixed3v3_power_consumers), 3300000); | ||
537 | |||
526 | /* enable SCIF1 serial port for YC401 console support */ | 538 | /* enable SCIF1 serial port for YC401 console support */ |
527 | gpio_request(GPIO_FN_SCIF1_RXD, NULL); | 539 | gpio_request(GPIO_FN_SCIF1_RXD, NULL); |
528 | gpio_request(GPIO_FN_SCIF1_TXD, NULL); | 540 | gpio_request(GPIO_FN_SCIF1_TXD, NULL); |
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c index a8a1ca741c85..8b73194ed2ce 100644 --- a/arch/sh/boards/mach-migor/setup.c +++ b/arch/sh/boards/mach-migor/setup.c | |||
@@ -17,6 +17,8 @@ | |||
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> | ||
20 | #include <linux/smc91x.h> | 22 | #include <linux/smc91x.h> |
21 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
22 | #include <linux/clk.h> | 24 | #include <linux/clk.h> |
@@ -386,6 +388,13 @@ static struct platform_device migor_ceu_device = { | |||
386 | }, | 388 | }, |
387 | }; | 389 | }; |
388 | 390 | ||
391 | /* Fixed 3.3V regulator to be used by SDHI0 */ | ||
392 | static 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 | }; | ||
397 | |||
389 | static struct resource sdhi_cn9_resources[] = { | 398 | static struct resource sdhi_cn9_resources[] = { |
390 | [0] = { | 399 | [0] = { |
391 | .name = "SDHI", | 400 | .name = "SDHI", |
@@ -498,6 +507,10 @@ static int __init migor_devices_setup(void) | |||
498 | &migor_sdram_enter_end, | 507 | &migor_sdram_enter_end, |
499 | &migor_sdram_leave_start, | 508 | &migor_sdram_leave_start, |
500 | &migor_sdram_leave_end); | 509 | &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 | |||
501 | /* Let D11 LED show STATUS0 */ | 514 | /* Let D11 LED show STATUS0 */ |
502 | gpio_request(GPIO_FN_STATUS0, NULL); | 515 | gpio_request(GPIO_FN_STATUS0, NULL); |
503 | 516 | ||
diff --git a/arch/sh/boards/mach-rsk/setup.c b/arch/sh/boards/mach-rsk/setup.c index 895f030070d3..2685ea03b064 100644 --- a/arch/sh/boards/mach-rsk/setup.c +++ b/arch/sh/boards/mach-rsk/setup.c | |||
@@ -16,9 +16,17 @@ | |||
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 | #include <linux/mtd/map.h> | 18 | #include <linux/mtd/map.h> |
19 | #include <linux/regulator/fixed.h> | ||
20 | #include <linux/regulator/machine.h> | ||
19 | #include <asm/machvec.h> | 21 | #include <asm/machvec.h> |
20 | #include <asm/io.h> | 22 | #include <asm/io.h> |
21 | 23 | ||
24 | /* Dummy supplies, where voltage doesn't matter */ | ||
25 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
26 | REGULATOR_SUPPLY("vddvario", "smsc911x"), | ||
27 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), | ||
28 | }; | ||
29 | |||
22 | static const char *part_probes[] = { "cmdlinepart", NULL }; | 30 | static const char *part_probes[] = { "cmdlinepart", NULL }; |
23 | 31 | ||
24 | static struct mtd_partition rsk_partitions[] = { | 32 | static struct mtd_partition rsk_partitions[] = { |
@@ -67,6 +75,8 @@ static struct platform_device *rsk_devices[] __initdata = { | |||
67 | 75 | ||
68 | static int __init rsk_devices_setup(void) | 76 | static int __init rsk_devices_setup(void) |
69 | { | 77 | { |
78 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
79 | |||
70 | return platform_add_devices(rsk_devices, | 80 | return platform_add_devices(rsk_devices, |
71 | ARRAY_SIZE(rsk_devices)); | 81 | ARRAY_SIZE(rsk_devices)); |
72 | } | 82 | } |
diff --git a/arch/sh/boards/mach-sdk7786/setup.c b/arch/sh/boards/mach-sdk7786/setup.c index 27a2314f50ac..c29268bfd34a 100644 --- a/arch/sh/boards/mach-sdk7786/setup.c +++ b/arch/sh/boards/mach-sdk7786/setup.c | |||
@@ -11,6 +11,8 @@ | |||
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> | ||
14 | #include <linux/smsc911x.h> | 16 | #include <linux/smsc911x.h> |
15 | #include <linux/i2c.h> | 17 | #include <linux/i2c.h> |
16 | #include <linux/irq.h> | 18 | #include <linux/irq.h> |
@@ -38,6 +40,12 @@ static struct platform_device heartbeat_device = { | |||
38 | .resource = &heartbeat_resource, | 40 | .resource = &heartbeat_resource, |
39 | }; | 41 | }; |
40 | 42 | ||
43 | /* Dummy supplies, where voltage doesn't matter */ | ||
44 | static struct regulator_consumer_supply dummy_supplies[] = { | ||
45 | REGULATOR_SUPPLY("vddvario", "smsc911x"), | ||
46 | REGULATOR_SUPPLY("vdd33a", "smsc911x"), | ||
47 | }; | ||
48 | |||
41 | static struct resource smsc911x_resources[] = { | 49 | static struct resource smsc911x_resources[] = { |
42 | [0] = { | 50 | [0] = { |
43 | .name = "smsc911x-memory", | 51 | .name = "smsc911x-memory", |
@@ -236,6 +244,8 @@ static void __init sdk7786_setup(char **cmdline_p) | |||
236 | { | 244 | { |
237 | pr_info("Renesas Technology Europe SDK7786 support:\n"); | 245 | pr_info("Renesas Technology Europe SDK7786 support:\n"); |
238 | 246 | ||
247 | regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); | ||
248 | |||
239 | sdk7786_fpga_init(); | 249 | sdk7786_fpga_init(); |
240 | sdk7786_nmi_init(); | 250 | sdk7786_nmi_init(); |
241 | 251 | ||
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c index ffbf5bc7366b..35f6efa3ac0e 100644 --- a/arch/sh/boards/mach-se/7724/setup.c +++ b/arch/sh/boards/mach-se/7724/setup.c | |||
@@ -18,6 +18,8 @@ | |||
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> | ||
21 | #include <linux/smc91x.h> | 23 | #include <linux/smc91x.h> |
22 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
23 | #include <linux/input.h> | 25 | #include <linux/input.h> |
@@ -454,6 +456,15 @@ static struct platform_device sh7724_usb1_gadget_device = { | |||
454 | .resource = sh7724_usb1_gadget_resources, | 456 | .resource = sh7724_usb1_gadget_resources, |
455 | }; | 457 | }; |
456 | 458 | ||
459 | /* Fixed 3.3V regulator to be used by SDHI0, SDHI1 */ | ||
460 | static 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 | |||
457 | static struct resource sdhi0_cn7_resources[] = { | 468 | static struct resource sdhi0_cn7_resources[] = { |
458 | [0] = { | 469 | [0] = { |
459 | .name = "SDHI0", | 470 | .name = "SDHI0", |
@@ -684,6 +695,10 @@ static int __init devices_setup(void) | |||
684 | &ms7724se_sdram_enter_end, | 695 | &ms7724se_sdram_enter_end, |
685 | &ms7724se_sdram_leave_start, | 696 | &ms7724se_sdram_leave_start, |
686 | &ms7724se_sdram_leave_end); | 697 | &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 | |||
687 | /* Reset Release */ | 702 | /* Reset Release */ |
688 | fpga_out = __raw_readw(FPGA_OUT); | 703 | fpga_out = __raw_readw(FPGA_OUT); |
689 | /* bit4: NTSC_PDN, bit5: NTSC_RESET */ | 704 | /* bit4: NTSC_PDN, bit5: NTSC_RESET */ |
diff --git a/arch/sh/include/cpu-sh4/cpu/sh7757.h b/arch/sh/include/cpu-sh4/cpu/sh7757.h index 41f9f8b9db73..5340f3bc1863 100644 --- a/arch/sh/include/cpu-sh4/cpu/sh7757.h +++ b/arch/sh/include/cpu-sh4/cpu/sh7757.h | |||
@@ -283,5 +283,7 @@ enum { | |||
283 | SHDMA_SLAVE_RIIC8_RX, | 283 | SHDMA_SLAVE_RIIC8_RX, |
284 | SHDMA_SLAVE_RIIC9_TX, | 284 | SHDMA_SLAVE_RIIC9_TX, |
285 | SHDMA_SLAVE_RIIC9_RX, | 285 | SHDMA_SLAVE_RIIC9_RX, |
286 | SHDMA_SLAVE_RSPI_TX, | ||
287 | SHDMA_SLAVE_RSPI_RX, | ||
286 | }; | 288 | }; |
287 | #endif /* __ASM_SH7757_H__ */ | 289 | #endif /* __ASM_SH7757_H__ */ |
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c index c87e78f73234..5f30f805d2f2 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c | |||
@@ -334,8 +334,8 @@ static struct clk_lookup lookups[] = { | |||
334 | CLKDEV_CON_ID("tpu0", &mstp_clks[HWBLK_TPU]), | 334 | CLKDEV_CON_ID("tpu0", &mstp_clks[HWBLK_TPU]), |
335 | CLKDEV_CON_ID("irda0", &mstp_clks[HWBLK_IRDA]), | 335 | CLKDEV_CON_ID("irda0", &mstp_clks[HWBLK_IRDA]), |
336 | CLKDEV_CON_ID("tsif0", &mstp_clks[HWBLK_TSIF]), | 336 | CLKDEV_CON_ID("tsif0", &mstp_clks[HWBLK_TSIF]), |
337 | CLKDEV_CON_ID("usb1", &mstp_clks[HWBLK_USB1]), | 337 | CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[HWBLK_USB1]), |
338 | CLKDEV_CON_ID("usb0", &mstp_clks[HWBLK_USB0]), | 338 | CLKDEV_DEV_ID("renesas_usbhs.0", &mstp_clks[HWBLK_USB0]), |
339 | CLKDEV_CON_ID("2dg0", &mstp_clks[HWBLK_2DG]), | 339 | CLKDEV_CON_ID("2dg0", &mstp_clks[HWBLK_2DG]), |
340 | CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[HWBLK_SDHI0]), | 340 | CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[HWBLK_SDHI0]), |
341 | CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[HWBLK_SDHI1]), | 341 | CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[HWBLK_SDHI1]), |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c index 65786c7f5ded..6a868b091c2d 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/platform_device.h> | 12 | #include <linux/platform_device.h> |
13 | #include <linux/serial.h> | 13 | #include <linux/serial.h> |
14 | #include <linux/serial_sci.h> | 14 | #include <linux/serial_sci.h> |
15 | #include <linux/sh_dma.h> | ||
15 | #include <linux/sh_timer.h> | 16 | #include <linux/sh_timer.h> |
16 | #include <linux/sh_intc.h> | 17 | #include <linux/sh_intc.h> |
17 | #include <linux/uio_driver.h> | 18 | #include <linux/uio_driver.h> |
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c index a7708425afa9..4a2f357f4df8 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c | |||
@@ -216,6 +216,20 @@ static const struct sh_dmae_slave_config sh7757_dmae1_slaves[] = { | |||
216 | TS_INDEX2VAL(XMIT_SZ_8BIT), | 216 | TS_INDEX2VAL(XMIT_SZ_8BIT), |
217 | .mid_rid = 0x42, | 217 | .mid_rid = 0x42, |
218 | }, | 218 | }, |
219 | { | ||
220 | .slave_id = SHDMA_SLAVE_RSPI_TX, | ||
221 | .addr = 0xfe480004, | ||
222 | .chcr = SM_INC | 0x800 | 0x40000000 | | ||
223 | TS_INDEX2VAL(XMIT_SZ_16BIT), | ||
224 | .mid_rid = 0xc1, | ||
225 | }, | ||
226 | { | ||
227 | .slave_id = SHDMA_SLAVE_RSPI_RX, | ||
228 | .addr = 0xfe480004, | ||
229 | .chcr = DM_INC | 0x800 | 0x40000000 | | ||
230 | TS_INDEX2VAL(XMIT_SZ_16BIT), | ||
231 | .mid_rid = 0xc2, | ||
232 | }, | ||
219 | }; | 233 | }; |
220 | 234 | ||
221 | static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = { | 235 | static const struct sh_dmae_slave_config sh7757_dmae2_slaves[] = { |
diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c index 1fc25d85e515..3bdc1ad9a341 100644 --- a/arch/sh/mm/fault.c +++ b/arch/sh/mm/fault.c | |||
@@ -58,11 +58,15 @@ static void show_pte(struct mm_struct *mm, unsigned long addr) | |||
58 | { | 58 | { |
59 | pgd_t *pgd; | 59 | pgd_t *pgd; |
60 | 60 | ||
61 | if (mm) | 61 | if (mm) { |
62 | pgd = mm->pgd; | 62 | pgd = mm->pgd; |
63 | else | 63 | } else { |
64 | pgd = get_TTB(); | 64 | pgd = get_TTB(); |
65 | 65 | ||
66 | if (unlikely(!pgd)) | ||
67 | pgd = swapper_pg_dir; | ||
68 | } | ||
69 | |||
66 | printk(KERN_ALERT "pgd = %p\n", pgd); | 70 | printk(KERN_ALERT "pgd = %p\n", pgd); |
67 | pgd += pgd_index(addr); | 71 | pgd += pgd_index(addr); |
68 | printk(KERN_ALERT "[%08lx] *pgd=%0*Lx", addr, | 72 | printk(KERN_ALERT "[%08lx] *pgd=%0*Lx", addr, |
diff --git a/drivers/dma/sh/shdma-base.c b/drivers/dma/sh/shdma-base.c index 27f5c781fd73..f4cd946d259d 100644 --- a/drivers/dma/sh/shdma-base.c +++ b/drivers/dma/sh/shdma-base.c | |||
@@ -483,6 +483,7 @@ static struct shdma_desc *shdma_add_desc(struct shdma_chan *schan, | |||
483 | new->mark = DESC_PREPARED; | 483 | new->mark = DESC_PREPARED; |
484 | new->async_tx.flags = flags; | 484 | new->async_tx.flags = flags; |
485 | new->direction = direction; | 485 | new->direction = direction; |
486 | new->partial = 0; | ||
486 | 487 | ||
487 | *len -= copy_size; | 488 | *len -= copy_size; |
488 | if (direction == DMA_MEM_TO_MEM || direction == DMA_MEM_TO_DEV) | 489 | if (direction == DMA_MEM_TO_MEM || direction == DMA_MEM_TO_DEV) |
@@ -644,6 +645,14 @@ static int shdma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd, | |||
644 | case DMA_TERMINATE_ALL: | 645 | case DMA_TERMINATE_ALL: |
645 | spin_lock_irqsave(&schan->chan_lock, flags); | 646 | spin_lock_irqsave(&schan->chan_lock, flags); |
646 | ops->halt_channel(schan); | 647 | ops->halt_channel(schan); |
648 | |||
649 | if (ops->get_partial && !list_empty(&schan->ld_queue)) { | ||
650 | /* Record partial transfer */ | ||
651 | struct shdma_desc *desc = list_first_entry(&schan->ld_queue, | ||
652 | struct shdma_desc, node); | ||
653 | desc->partial = ops->get_partial(schan, desc); | ||
654 | } | ||
655 | |||
647 | spin_unlock_irqrestore(&schan->chan_lock, flags); | 656 | spin_unlock_irqrestore(&schan->chan_lock, flags); |
648 | 657 | ||
649 | shdma_chan_ld_cleanup(schan, true); | 658 | shdma_chan_ld_cleanup(schan, true); |
diff --git a/drivers/dma/sh/shdma.c b/drivers/dma/sh/shdma.c index 027c9be97654..f41bcc5267fd 100644 --- a/drivers/dma/sh/shdma.c +++ b/drivers/dma/sh/shdma.c | |||
@@ -381,6 +381,17 @@ static bool sh_dmae_chan_irq(struct shdma_chan *schan, int irq) | |||
381 | return true; | 381 | return true; |
382 | } | 382 | } |
383 | 383 | ||
384 | static size_t sh_dmae_get_partial(struct shdma_chan *schan, | ||
385 | struct shdma_desc *sdesc) | ||
386 | { | ||
387 | struct sh_dmae_chan *sh_chan = container_of(schan, struct sh_dmae_chan, | ||
388 | shdma_chan); | ||
389 | struct sh_dmae_desc *sh_desc = container_of(sdesc, | ||
390 | struct sh_dmae_desc, shdma_desc); | ||
391 | return (sh_desc->hw.tcr - sh_dmae_readl(sh_chan, TCR)) << | ||
392 | sh_chan->xmit_shift; | ||
393 | } | ||
394 | |||
384 | /* Called from error IRQ or NMI */ | 395 | /* Called from error IRQ or NMI */ |
385 | static bool sh_dmae_reset(struct sh_dmae_device *shdev) | 396 | static bool sh_dmae_reset(struct sh_dmae_device *shdev) |
386 | { | 397 | { |
@@ -632,6 +643,7 @@ static const struct shdma_ops sh_dmae_shdma_ops = { | |||
632 | .start_xfer = sh_dmae_start_xfer, | 643 | .start_xfer = sh_dmae_start_xfer, |
633 | .embedded_desc = sh_dmae_embedded_desc, | 644 | .embedded_desc = sh_dmae_embedded_desc, |
634 | .chan_irq = sh_dmae_chan_irq, | 645 | .chan_irq = sh_dmae_chan_irq, |
646 | .get_partial = sh_dmae_get_partial, | ||
635 | }; | 647 | }; |
636 | 648 | ||
637 | static int __devinit sh_dmae_probe(struct platform_device *pdev) | 649 | static int __devinit sh_dmae_probe(struct platform_device *pdev) |
diff --git a/drivers/sh/intc/Kconfig b/drivers/sh/intc/Kconfig index c88cbccc62b0..a305731742a9 100644 --- a/drivers/sh/intc/Kconfig +++ b/drivers/sh/intc/Kconfig | |||
@@ -1,3 +1,7 @@ | |||
1 | config SH_INTC | ||
2 | def_bool y | ||
3 | select IRQ_DOMAIN | ||
4 | |||
1 | comment "Interrupt controller options" | 5 | comment "Interrupt controller options" |
2 | 6 | ||
3 | config INTC_USERIMASK | 7 | config INTC_USERIMASK |
diff --git a/drivers/sh/intc/Makefile b/drivers/sh/intc/Makefile index 44f006d09471..54ec2a0643df 100644 --- a/drivers/sh/intc/Makefile +++ b/drivers/sh/intc/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | obj-y := access.o chip.o core.o handle.o virq.o | 1 | obj-y := access.o chip.o core.o handle.o irqdomain.o virq.o |
2 | 2 | ||
3 | obj-$(CONFIG_INTC_BALANCING) += balancing.o | 3 | obj-$(CONFIG_INTC_BALANCING) += balancing.o |
4 | obj-$(CONFIG_INTC_USERIMASK) += userimask.o | 4 | obj-$(CONFIG_INTC_USERIMASK) += userimask.o |
diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c index 7e562ccb6997..2374468615ed 100644 --- a/drivers/sh/intc/core.c +++ b/drivers/sh/intc/core.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/stat.h> | 25 | #include <linux/stat.h> |
26 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
27 | #include <linux/sh_intc.h> | 27 | #include <linux/sh_intc.h> |
28 | #include <linux/irqdomain.h> | ||
28 | #include <linux/device.h> | 29 | #include <linux/device.h> |
29 | #include <linux/syscore_ops.h> | 30 | #include <linux/syscore_ops.h> |
30 | #include <linux/list.h> | 31 | #include <linux/list.h> |
@@ -310,6 +311,8 @@ int __init register_intc_controller(struct intc_desc *desc) | |||
310 | 311 | ||
311 | BUG_ON(k > 256); /* _INTC_ADDR_E() and _INTC_ADDR_D() are 8 bits */ | 312 | BUG_ON(k > 256); /* _INTC_ADDR_E() and _INTC_ADDR_D() are 8 bits */ |
312 | 313 | ||
314 | intc_irq_domain_init(d, hw); | ||
315 | |||
313 | /* register the vectors one by one */ | 316 | /* register the vectors one by one */ |
314 | for (i = 0; i < hw->nr_vectors; i++) { | 317 | for (i = 0; i < hw->nr_vectors; i++) { |
315 | struct intc_vect *vect = hw->vectors + i; | 318 | struct intc_vect *vect = hw->vectors + i; |
@@ -319,8 +322,8 @@ int __init register_intc_controller(struct intc_desc *desc) | |||
319 | if (!vect->enum_id) | 322 | if (!vect->enum_id) |
320 | continue; | 323 | continue; |
321 | 324 | ||
322 | res = irq_alloc_desc_at(irq, numa_node_id()); | 325 | res = irq_create_identity_mapping(d->domain, irq); |
323 | if (res != irq && res != -EEXIST) { | 326 | if (unlikely(res)) { |
324 | pr_err("can't get irq_desc for %d\n", irq); | 327 | pr_err("can't get irq_desc for %d\n", irq); |
325 | continue; | 328 | continue; |
326 | } | 329 | } |
@@ -340,8 +343,8 @@ int __init register_intc_controller(struct intc_desc *desc) | |||
340 | * IRQ support, each vector still needs to have | 343 | * IRQ support, each vector still needs to have |
341 | * its own backing irq_desc. | 344 | * its own backing irq_desc. |
342 | */ | 345 | */ |
343 | res = irq_alloc_desc_at(irq2, numa_node_id()); | 346 | res = irq_create_identity_mapping(d->domain, irq2); |
344 | if (res != irq2 && res != -EEXIST) { | 347 | if (unlikely(res)) { |
345 | pr_err("can't get irq_desc for %d\n", irq2); | 348 | pr_err("can't get irq_desc for %d\n", irq2); |
346 | continue; | 349 | continue; |
347 | } | 350 | } |
diff --git a/drivers/sh/intc/internals.h b/drivers/sh/intc/internals.h index f034a979a16f..7dff08e2a071 100644 --- a/drivers/sh/intc/internals.h +++ b/drivers/sh/intc/internals.h | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/sh_intc.h> | 1 | #include <linux/sh_intc.h> |
2 | #include <linux/irq.h> | 2 | #include <linux/irq.h> |
3 | #include <linux/irqdomain.h> | ||
3 | #include <linux/list.h> | 4 | #include <linux/list.h> |
4 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
5 | #include <linux/types.h> | 6 | #include <linux/types.h> |
@@ -66,6 +67,7 @@ struct intc_desc_int { | |||
66 | unsigned int nr_sense; | 67 | unsigned int nr_sense; |
67 | struct intc_window *window; | 68 | struct intc_window *window; |
68 | unsigned int nr_windows; | 69 | unsigned int nr_windows; |
70 | struct irq_domain *domain; | ||
69 | struct irq_chip chip; | 71 | struct irq_chip chip; |
70 | bool skip_suspend; | 72 | bool skip_suspend; |
71 | }; | 73 | }; |
@@ -187,6 +189,9 @@ unsigned long intc_get_ack_handle(unsigned int irq); | |||
187 | void intc_enable_disable_enum(struct intc_desc *desc, struct intc_desc_int *d, | 189 | void intc_enable_disable_enum(struct intc_desc *desc, struct intc_desc_int *d, |
188 | intc_enum enum_id, int enable); | 190 | intc_enum enum_id, int enable); |
189 | 191 | ||
192 | /* irqdomain.c */ | ||
193 | void intc_irq_domain_init(struct intc_desc_int *d, struct intc_hw_desc *hw); | ||
194 | |||
190 | /* virq.c */ | 195 | /* virq.c */ |
191 | void intc_subgroup_init(struct intc_desc *desc, struct intc_desc_int *d); | 196 | void intc_subgroup_init(struct intc_desc *desc, struct intc_desc_int *d); |
192 | void intc_irq_xlate_set(unsigned int irq, intc_enum id, struct intc_desc_int *d); | 197 | void intc_irq_xlate_set(unsigned int irq, intc_enum id, struct intc_desc_int *d); |
diff --git a/drivers/sh/intc/irqdomain.c b/drivers/sh/intc/irqdomain.c new file mode 100644 index 000000000000..3968f1c3c5c3 --- /dev/null +++ b/drivers/sh/intc/irqdomain.c | |||
@@ -0,0 +1,68 @@ | |||
1 | /* | ||
2 | * IRQ domain support for SH INTC subsystem | ||
3 | * | ||
4 | * Copyright (C) 2012 Paul Mundt | ||
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 | #define pr_fmt(fmt) "intc: " fmt | ||
11 | |||
12 | #include <linux/irqdomain.h> | ||
13 | #include <linux/sh_intc.h> | ||
14 | #include <linux/export.h> | ||
15 | #include "internals.h" | ||
16 | |||
17 | /** | ||
18 | * intc_irq_domain_evt_xlate() - Generic xlate for vectored IRQs. | ||
19 | * | ||
20 | * This takes care of exception vector to hwirq translation through | ||
21 | * by way of evt2irq() translation. | ||
22 | * | ||
23 | * Note: For platforms that use a flat vector space without INTEVT this | ||
24 | * basically just mimics irq_domain_xlate_onecell() by way of a nopped | ||
25 | * out evt2irq() implementation. | ||
26 | */ | ||
27 | static int intc_evt_xlate(struct irq_domain *d, struct device_node *ctrlr, | ||
28 | const u32 *intspec, unsigned int intsize, | ||
29 | unsigned long *out_hwirq, unsigned int *out_type) | ||
30 | { | ||
31 | if (WARN_ON(intsize < 1)) | ||
32 | return -EINVAL; | ||
33 | |||
34 | *out_hwirq = evt2irq(intspec[0]); | ||
35 | *out_type = IRQ_TYPE_NONE; | ||
36 | |||
37 | return 0; | ||
38 | } | ||
39 | |||
40 | static const struct irq_domain_ops intc_evt_ops = { | ||
41 | .xlate = intc_evt_xlate, | ||
42 | }; | ||
43 | |||
44 | void __init intc_irq_domain_init(struct intc_desc_int *d, | ||
45 | struct intc_hw_desc *hw) | ||
46 | { | ||
47 | unsigned int irq_base, irq_end; | ||
48 | |||
49 | /* | ||
50 | * Quick linear revmap check | ||
51 | */ | ||
52 | irq_base = evt2irq(hw->vectors[0].vect); | ||
53 | irq_end = evt2irq(hw->vectors[hw->nr_vectors - 1].vect); | ||
54 | |||
55 | /* | ||
56 | * Linear domains have a hard-wired assertion that IRQs start at | ||
57 | * 0 in order to make some performance optimizations. Lamely | ||
58 | * restrict the linear case to these conditions here, taking the | ||
59 | * tree penalty for linear cases with non-zero hwirq bases. | ||
60 | */ | ||
61 | if (irq_base == 0 && irq_end == (irq_base + hw->nr_vectors - 1)) | ||
62 | d->domain = irq_domain_add_linear(NULL, hw->nr_vectors, | ||
63 | &intc_evt_ops, NULL); | ||
64 | else | ||
65 | d->domain = irq_domain_add_tree(NULL, &intc_evt_ops, NULL); | ||
66 | |||
67 | BUG_ON(!d->domain); | ||
68 | } | ||
diff --git a/drivers/sh/pfc/pinctrl.c b/drivers/sh/pfc/pinctrl.c index 0802b6c0d653..2804eaae804e 100644 --- a/drivers/sh/pfc/pinctrl.c +++ b/drivers/sh/pfc/pinctrl.c | |||
@@ -276,7 +276,6 @@ static int sh_pfc_pinconf_set(struct pinctrl_dev *pctldev, unsigned pin, | |||
276 | unsigned long config) | 276 | unsigned long config) |
277 | { | 277 | { |
278 | struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); | 278 | struct sh_pfc_pinctrl *pmx = pinctrl_dev_get_drvdata(pctldev); |
279 | struct sh_pfc *pfc = pmx->pfc; | ||
280 | 279 | ||
281 | /* Validate the new type */ | 280 | /* Validate the new type */ |
282 | if (config >= PINMUX_FLAG_TYPE) | 281 | if (config >= PINMUX_FLAG_TYPE) |
@@ -326,20 +325,6 @@ static struct pinctrl_desc sh_pfc_pinctrl_desc = { | |||
326 | .confops = &sh_pfc_pinconf_ops, | 325 | .confops = &sh_pfc_pinconf_ops, |
327 | }; | 326 | }; |
328 | 327 | ||
329 | int sh_pfc_register_pinctrl(struct sh_pfc *pfc) | ||
330 | { | ||
331 | sh_pfc_pmx = kzalloc(sizeof(struct sh_pfc_pinctrl), GFP_KERNEL); | ||
332 | if (unlikely(!sh_pfc_pmx)) | ||
333 | return -ENOMEM; | ||
334 | |||
335 | spin_lock_init(&sh_pfc_pmx->lock); | ||
336 | |||
337 | sh_pfc_pmx->pfc = pfc; | ||
338 | |||
339 | return 0; | ||
340 | } | ||
341 | EXPORT_SYMBOL_GPL(sh_pfc_register_pinctrl); | ||
342 | |||
343 | static inline void __devinit sh_pfc_map_one_gpio(struct sh_pfc *pfc, | 328 | static inline void __devinit sh_pfc_map_one_gpio(struct sh_pfc *pfc, |
344 | struct sh_pfc_pinctrl *pmx, | 329 | struct sh_pfc_pinctrl *pmx, |
345 | struct pinmux_gpio *gpio, | 330 | struct pinmux_gpio *gpio, |
@@ -481,7 +466,6 @@ static int __devexit sh_pfc_pinctrl_remove(struct platform_device *pdev) | |||
481 | { | 466 | { |
482 | struct sh_pfc_pinctrl *pmx = platform_get_drvdata(pdev); | 467 | struct sh_pfc_pinctrl *pmx = platform_get_drvdata(pdev); |
483 | 468 | ||
484 | pinctrl_remove_gpio_range(pmx->pctl, &sh_pfc_gpio_range); | ||
485 | pinctrl_unregister(pmx->pctl); | 469 | pinctrl_unregister(pmx->pctl); |
486 | 470 | ||
487 | platform_set_drvdata(pdev, NULL); | 471 | platform_set_drvdata(pdev, NULL); |
@@ -507,7 +491,7 @@ static struct platform_device sh_pfc_pinctrl_device = { | |||
507 | .id = -1, | 491 | .id = -1, |
508 | }; | 492 | }; |
509 | 493 | ||
510 | static int __init sh_pfc_pinctrl_init(void) | 494 | static int sh_pfc_pinctrl_init(void) |
511 | { | 495 | { |
512 | int rc; | 496 | int rc; |
513 | 497 | ||
@@ -521,10 +505,22 @@ static int __init sh_pfc_pinctrl_init(void) | |||
521 | return rc; | 505 | return rc; |
522 | } | 506 | } |
523 | 507 | ||
508 | int sh_pfc_register_pinctrl(struct sh_pfc *pfc) | ||
509 | { | ||
510 | sh_pfc_pmx = kzalloc(sizeof(struct sh_pfc_pinctrl), GFP_KERNEL); | ||
511 | if (unlikely(!sh_pfc_pmx)) | ||
512 | return -ENOMEM; | ||
513 | |||
514 | spin_lock_init(&sh_pfc_pmx->lock); | ||
515 | |||
516 | sh_pfc_pmx->pfc = pfc; | ||
517 | |||
518 | return sh_pfc_pinctrl_init(); | ||
519 | } | ||
520 | EXPORT_SYMBOL_GPL(sh_pfc_register_pinctrl); | ||
521 | |||
524 | static void __exit sh_pfc_pinctrl_exit(void) | 522 | static void __exit sh_pfc_pinctrl_exit(void) |
525 | { | 523 | { |
526 | platform_driver_unregister(&sh_pfc_pinctrl_driver); | 524 | platform_driver_unregister(&sh_pfc_pinctrl_driver); |
527 | } | 525 | } |
528 | |||
529 | subsys_initcall(sh_pfc_pinctrl_init); | ||
530 | module_exit(sh_pfc_pinctrl_exit); | 526 | module_exit(sh_pfc_pinctrl_exit); |
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c index d4d8c9453cd8..9be296cf7295 100644 --- a/drivers/tty/serial/sh-sci.c +++ b/drivers/tty/serial/sh-sci.c | |||
@@ -25,6 +25,7 @@ | |||
25 | 25 | ||
26 | #include <linux/module.h> | 26 | #include <linux/module.h> |
27 | #include <linux/errno.h> | 27 | #include <linux/errno.h> |
28 | #include <linux/sh_dma.h> | ||
28 | #include <linux/timer.h> | 29 | #include <linux/timer.h> |
29 | #include <linux/interrupt.h> | 30 | #include <linux/interrupt.h> |
30 | #include <linux/tty.h> | 31 | #include <linux/tty.h> |
@@ -1410,8 +1411,8 @@ static void work_fn_rx(struct work_struct *work) | |||
1410 | /* Handle incomplete DMA receive */ | 1411 | /* Handle incomplete DMA receive */ |
1411 | struct tty_struct *tty = port->state->port.tty; | 1412 | struct tty_struct *tty = port->state->port.tty; |
1412 | struct dma_chan *chan = s->chan_rx; | 1413 | struct dma_chan *chan = s->chan_rx; |
1413 | struct sh_desc *sh_desc = container_of(desc, struct sh_desc, | 1414 | struct shdma_desc *sh_desc = container_of(desc, |
1414 | async_tx); | 1415 | struct shdma_desc, async_tx); |
1415 | unsigned long flags; | 1416 | unsigned long flags; |
1416 | int count; | 1417 | int count; |
1417 | 1418 | ||
diff --git a/include/linux/shdma-base.h b/include/linux/shdma-base.h index 93f9821554b6..a3728bf66f0e 100644 --- a/include/linux/shdma-base.h +++ b/include/linux/shdma-base.h | |||
@@ -50,6 +50,7 @@ struct shdma_desc { | |||
50 | struct list_head node; | 50 | struct list_head node; |
51 | struct dma_async_tx_descriptor async_tx; | 51 | struct dma_async_tx_descriptor async_tx; |
52 | enum dma_transfer_direction direction; | 52 | enum dma_transfer_direction direction; |
53 | size_t partial; | ||
53 | dma_cookie_t cookie; | 54 | dma_cookie_t cookie; |
54 | int chunks; | 55 | int chunks; |
55 | int mark; | 56 | int mark; |
@@ -98,6 +99,7 @@ struct shdma_ops { | |||
98 | void (*start_xfer)(struct shdma_chan *, struct shdma_desc *); | 99 | void (*start_xfer)(struct shdma_chan *, struct shdma_desc *); |
99 | struct shdma_desc *(*embedded_desc)(void *, int); | 100 | struct shdma_desc *(*embedded_desc)(void *, int); |
100 | bool (*chan_irq)(struct shdma_chan *, int); | 101 | bool (*chan_irq)(struct shdma_chan *, int); |
102 | size_t (*get_partial)(struct shdma_chan *, struct shdma_desc *); | ||
101 | }; | 103 | }; |
102 | 104 | ||
103 | struct shdma_dev { | 105 | struct shdma_dev { |