diff --git a/arch/arm/boot/dts/ste-u300.dts b/arch/arm/boot/dts/ste-u300.dts index 05a082164c10878ea1b17ed93465855d75d85ed7..8a1032c1ffc9fd3bc129554d850f9d941585d390 100644 --- a/arch/arm/boot/dts/ste-u300.dts +++ b/arch/arm/boot/dts/ste-u300.dts @@ -31,7 +31,7 @@ }; syscon: syscon@c0011000 { - compatible = "stericsson,u300-syscon"; + compatible = "stericsson,u300-syscon", "syscon"; reg = <0xc0011000 0x1000>; clk32: app_32_clk@32k { #clock-cells = <0>; diff --git a/arch/arm/mach-u300/Kconfig b/arch/arm/mach-u300/Kconfig index e2f350f2c32bf1c26fc3a92a0d1827be14d8da56..09f4dda01d5ff3a6188cca8346255698b86c02b6 100644 --- a/arch/arm/mach-u300/Kconfig +++ b/arch/arm/mach-u300/Kconfig @@ -20,6 +20,7 @@ config ARCH_U300 select PINCTRL_COH901 select PINCTRL_U300 select SPARSE_IRQ + select MFD_SYSCON select USE_OF help 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 273fceb83685525d85ae3cdc9ec07a210f0e6b68..bf40cd478fe95d82d64073bb1ff184c07f25808f 100644 --- a/arch/arm/mach-u300/regulator.c +++ b/arch/arm/mach-u300/regulator.c @@ -15,9 +15,8 @@ #include #include #include -/* Those are just for writing in syscon */ -#include -#include +#include +#include /* Power Management Control 16bit (R/W) */ #define U300_SYSCON_PMCR (0x50) @@ -59,9 +58,8 @@ static int __init __u300_init_boardpower(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; struct device_node *syscon_np; - static void __iomem *syscon_base; + struct regmap *regmap; int err; - u32 val; pr_info("U300: setting up board power\n"); @@ -70,9 +68,9 @@ static int __init __u300_init_boardpower(struct platform_device *pdev) pr_crit("U300: no syscon node\n"); return -ENODEV; } - syscon_base = of_iomap(syscon_np, 0); - if (!syscon_base) { - pr_crit("U300: could not remap syscon\n"); + regmap = syscon_node_to_regmap(syscon_np); + if (!regmap) { + pr_crit("U300: could not locate syscon regmap\n"); return -ENODEV; } @@ -96,9 +94,8 @@ static int __init __u300_init_boardpower(struct platform_device *pdev) * the rest of the U300 power management is implemented. */ pr_info("U300: disable system controller pull-up\n"); - val = readw(syscon_base + U300_SYSCON_PMCR); - val &= ~U300_SYSCON_PMCR_DCON_ENABLE; - writew(val, syscon_base + U300_SYSCON_PMCR); + regmap_update_bits(regmap, U300_SYSCON_PMCR, + U300_SYSCON_PMCR_DCON_ENABLE, 0); /* Register globally exported PM poweroff hook */ pm_power_off = u300_pm_poweroff;