aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/boot/dts/ste-u300.dts2
-rw-r--r--arch/arm/mach-u300/Kconfig1
-rw-r--r--arch/arm/mach-u300/regulator.c19
3 files changed, 10 insertions, 12 deletions
diff --git a/arch/arm/boot/dts/ste-u300.dts b/arch/arm/boot/dts/ste-u300.dts
index 05a082164c10..8a1032c1ffc9 100644
--- a/arch/arm/boot/dts/ste-u300.dts
+++ b/arch/arm/boot/dts/ste-u300.dts
@@ -31,7 +31,7 @@
31 }; 31 };
32 32
33 syscon: syscon@c0011000 { 33 syscon: syscon@c0011000 {
34 compatible = "stericsson,u300-syscon"; 34 compatible = "stericsson,u300-syscon", "syscon";
35 reg = <0xc0011000 0x1000>; 35 reg = <0xc0011000 0x1000>;
36 clk32: app_32_clk@32k { 36 clk32: app_32_clk@32k {
37 #clock-cells = <0>; 37 #clock-cells = <0>;
diff --git a/arch/arm/mach-u300/Kconfig b/arch/arm/mach-u300/Kconfig
index e2f350f2c32b..09f4dda01d5f 100644
--- a/arch/arm/mach-u300/Kconfig
+++ b/arch/arm/mach-u300/Kconfig
@@ -20,6 +20,7 @@ config ARCH_U300
20 select PINCTRL_COH901 20 select PINCTRL_COH901
21 select PINCTRL_U300 21 select PINCTRL_U300
22 select SPARSE_IRQ 22 select SPARSE_IRQ
23 select MFD_SYSCON
23 select USE_OF 24 select USE_OF
24 help 25 help
25 Support for ST-Ericsson U300 series mobile platforms. 26 Support for ST-Ericsson U300 series mobile platforms.
diff --git a/arch/arm/mach-u300/regulator.c b/arch/arm/mach-u300/regulator.c
index 273fceb83685..bf40cd478fe9 100644
--- a/arch/arm/mach-u300/regulator.c
+++ b/arch/arm/mach-u300/regulator.c
@@ -15,9 +15,8 @@
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/regulator/machine.h> 16#include <linux/regulator/machine.h>
17#include <linux/regulator/consumer.h> 17#include <linux/regulator/consumer.h>
18/* Those are just for writing in syscon */ 18#include <linux/mfd/syscon.h>
19#include <linux/of_address.h> 19#include <linux/regmap.h>
20#include <linux/io.h>
21 20
22/* Power Management Control 16bit (R/W) */ 21/* Power Management Control 16bit (R/W) */
23#define U300_SYSCON_PMCR (0x50) 22#define U300_SYSCON_PMCR (0x50)
@@ -59,9 +58,8 @@ static int __init __u300_init_boardpower(struct platform_device *pdev)
59{ 58{
60 struct device_node *np = pdev->dev.of_node; 59 struct device_node *np = pdev->dev.of_node;
61 struct device_node *syscon_np; 60 struct device_node *syscon_np;
62 static void __iomem *syscon_base; 61 struct regmap *regmap;
63 int err; 62 int err;
64 u32 val;
65 63
66 pr_info("U300: setting up board power\n"); 64 pr_info("U300: setting up board power\n");
67 65
@@ -70,9 +68,9 @@ static int __init __u300_init_boardpower(struct platform_device *pdev)
70 pr_crit("U300: no syscon node\n"); 68 pr_crit("U300: no syscon node\n");
71 return -ENODEV; 69 return -ENODEV;
72 } 70 }
73 syscon_base = of_iomap(syscon_np, 0); 71 regmap = syscon_node_to_regmap(syscon_np);
74 if (!syscon_base) { 72 if (!regmap) {
75 pr_crit("U300: could not remap syscon\n"); 73 pr_crit("U300: could not locate syscon regmap\n");
76 return -ENODEV; 74 return -ENODEV;
77 } 75 }
78 76
@@ -96,9 +94,8 @@ static int __init __u300_init_boardpower(struct platform_device *pdev)
96 * the rest of the U300 power management is implemented. 94 * the rest of the U300 power management is implemented.
97 */ 95 */
98 pr_info("U300: disable system controller pull-up\n"); 96 pr_info("U300: disable system controller pull-up\n");
99 val = readw(syscon_base + U300_SYSCON_PMCR); 97 regmap_update_bits(regmap, U300_SYSCON_PMCR,
100 val &= ~U300_SYSCON_PMCR_DCON_ENABLE; 98 U300_SYSCON_PMCR_DCON_ENABLE, 0);
101 writew(val, syscon_base + U300_SYSCON_PMCR);
102 99
103 /* Register globally exported PM poweroff hook */ 100 /* Register globally exported PM poweroff hook */
104 pm_power_off = u300_pm_poweroff; 101 pm_power_off = u300_pm_poweroff;