diff options
author | Philippe Langlais <philippe.langlais@linaro.org> | 2011-07-05 10:43:56 +0100 |
---|---|---|
committer | Robert Marklund <robert.marklund@stericsson.com> | 2011-10-05 12:16:56 +0200 |
commit | 7d767f007ad2f15d669a54533d79391e11964c39 (patch) | |
tree | 4c99b3ad4a19b913824132b74b78d99305198b5b | |
parent | 0c78d405f87b50f306f0708dde06de085b344f4e (diff) |
mach-ux500: prcmu regulators: use upstream db8500 prcmu regulator driver instead
Signed-off-by: Philippe Langlais <philippe.langlais@linaro.org>
-rw-r--r-- | arch/arm/mach-ux500/Kconfig | 4 | ||||
-rw-r--r-- | arch/arm/mach-ux500/Makefile | 4 | ||||
-rw-r--r-- | arch/arm/mach-ux500/pm/cpuidle.c | 3 | ||||
-rw-r--r-- | arch/arm/mach-ux500/regulator-db8500.c | 274 | ||||
-rw-r--r-- | arch/arm/mach-ux500/regulator-db8500.h | 45 | ||||
-rw-r--r-- | arch/arm/mach-ux500/regulator-ux500.c | 6 | ||||
-rw-r--r-- | drivers/regulator/db8500-prcmu.c | 3 |
7 files changed, 11 insertions, 328 deletions
diff --git a/arch/arm/mach-ux500/Kconfig b/arch/arm/mach-ux500/Kconfig index 04f2cb5c1cb..7dafc08e9ac 100644 --- a/arch/arm/mach-ux500/Kconfig +++ b/arch/arm/mach-ux500/Kconfig @@ -4,7 +4,6 @@ config UX500_SOC_COMMON bool default y select ARM_GIC - # select HAS_MTU select NOMADIK_GPIO select ARM_ERRATA_753970 select SYS_SOC @@ -22,6 +21,8 @@ config UX500_SOC_DB5500 config UX500_SOC_DB8500 bool "DB8500" + select MFD_DB8500_PRCMU + select REGULATOR_DB8500_PRCMU select UX500_SOC_DBX500 endmenu @@ -38,6 +39,7 @@ config MACH_U8500 config MACH_HREFV60 bool "U85000 Development platform, HREFv60 version" depends on UX500_SOC_DB8500 + select MACH_U8500 help Include support for the HREFv60 new development platform. diff --git a/arch/arm/mach-ux500/Makefile b/arch/arm/mach-ux500/Makefile index fcdc8620de9..05e491a5ad9 100644 --- a/arch/arm/mach-ux500/Makefile +++ b/arch/arm/mach-ux500/Makefile @@ -40,10 +40,6 @@ obj-$(CONFIG_U5500_MLOADER) += mloader-db5500.o obj-$(CONFIG_UX500_PRCMU_TIMER) += timer-prcmu.o obj-$(CONFIG_REGULATOR) += regulator-ux500.o -ifeq ($(CONFIG_UX500_SOC_DB8500), y) -obj-$(CONFIG_REGULATOR) += regulator-db8500.o -endif - ifeq ($(CONFIG_UX500_SOC_DB5500), y) obj-$(CONFIG_REGULATOR) += regulator-u5500.o endif diff --git a/arch/arm/mach-ux500/pm/cpuidle.c b/arch/arm/mach-ux500/pm/cpuidle.c index bba32577259..1dab0691b89 100644 --- a/arch/arm/mach-ux500/pm/cpuidle.c +++ b/arch/arm/mach-ux500/pm/cpuidle.c @@ -15,8 +15,8 @@ #include <linux/sched.h> #include <linux/tick.h> #include <linux/clockchips.h> - #include <linux/gpio.h> +#include <linux/regulator/db8500-prcmu.h> #include <mach/prcmu.h> @@ -25,7 +25,6 @@ #include "context.h" #include "pm.h" #include "timer.h" -#include "../regulator-db8500.h" /* * All measurements are with two cpus online (worst case) and at diff --git a/arch/arm/mach-ux500/regulator-db8500.c b/arch/arm/mach-ux500/regulator-db8500.c deleted file mode 100644 index a9026c9b686..00000000000 --- a/arch/arm/mach-ux500/regulator-db8500.c +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright (C) ST-Ericsson SA 2010 - * - * License Terms: GNU General Public License v2 - * Author: Bengt Jonsson <bengt.g.jonsson@stericsson.com> for ST-Ericsson - */ - -#include <linux/kernel.h> -#include <linux/init.h> -#include <linux/module.h> -#include <linux/platform_device.h> -#include <linux/regulator/driver.h> -#include <linux/regulator/machine.h> - -#include <mach/prcmu.h> - -#include "regulator-ux500.h" -#include "regulator-db8500.h" - -static struct u8500_regulator_info - db8500_regulator_info[DB8500_NUM_REGULATORS] = { - [DB8500_REGULATOR_VAPE] = { - .desc = { - .name = "db8500-vape", - .id = DB8500_REGULATOR_VAPE, - .ops = &ux500_regulator_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - }, - [DB8500_REGULATOR_VARM] = { - .desc = { - .name = "db8500-varm", - .id = DB8500_REGULATOR_VARM, - .ops = &ux500_regulator_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - }, - [DB8500_REGULATOR_VMODEM] = { - .desc = { - .name = "db8500-vmodem", - .id = DB8500_REGULATOR_VMODEM, - .ops = &ux500_regulator_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - }, - [DB8500_REGULATOR_VPLL] = { - .desc = { - .name = "db8500-vpll", - .id = DB8500_REGULATOR_VPLL, - .ops = &ux500_regulator_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - }, - [DB8500_REGULATOR_VSMPS1] = { - .desc = { - .name = "db8500-vsmps1", - .id = DB8500_REGULATOR_VSMPS1, - .ops = &ux500_regulator_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - }, - [DB8500_REGULATOR_VSMPS2] = { - .desc = { - .name = "db8500-vsmps2", - .id = DB8500_REGULATOR_VSMPS2, - .ops = &ux500_regulator_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - .exclude_from_power_state = true, - }, - [DB8500_REGULATOR_VSMPS3] = { - .desc = { - .name = "db8500-vsmps3", - .id = DB8500_REGULATOR_VSMPS3, - .ops = &ux500_regulator_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - }, - [DB8500_REGULATOR_VRF1] = { - .desc = { - .name = "db8500-vrf1", - .id = DB8500_REGULATOR_VRF1, - .ops = &ux500_regulator_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - }, - [DB8500_REGULATOR_SWITCH_SVAMMDSP] = { - .desc = { - .name = "db8500-sva-mmdsp", - .id = DB8500_REGULATOR_SWITCH_SVAMMDSP, - .ops = &ux500_regulator_switch_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - .epod_id = EPOD_ID_SVAMMDSP, - }, - [DB8500_REGULATOR_SWITCH_SVAMMDSPRET] = { - .desc = { - .name = "db8500-sva-mmdsp-ret", - .id = DB8500_REGULATOR_SWITCH_SVAMMDSPRET, - .ops = &ux500_regulator_switch_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - .epod_id = EPOD_ID_SVAMMDSP, - .is_ramret = true, - }, - [DB8500_REGULATOR_SWITCH_SVAPIPE] = { - .desc = { - .name = "db8500-sva-pipe", - .id = DB8500_REGULATOR_SWITCH_SVAPIPE, - .ops = &ux500_regulator_switch_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - .epod_id = EPOD_ID_SVAPIPE, - }, - [DB8500_REGULATOR_SWITCH_SIAMMDSP] = { - .desc = { - .name = "db8500-sia-mmdsp", - .id = DB8500_REGULATOR_SWITCH_SIAMMDSP, - .ops = &ux500_regulator_switch_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - .epod_id = EPOD_ID_SIAMMDSP, - }, - [DB8500_REGULATOR_SWITCH_SIAMMDSPRET] = { - .desc = { - .name = "db8500-sia-mmdsp-ret", - .id = DB8500_REGULATOR_SWITCH_SIAMMDSPRET, - .ops = &ux500_regulator_switch_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - .epod_id = EPOD_ID_SIAMMDSP, - .is_ramret = true, - }, - [DB8500_REGULATOR_SWITCH_SIAPIPE] = { - .desc = { - .name = "db8500-sia-pipe", - .id = DB8500_REGULATOR_SWITCH_SIAPIPE, - .ops = &ux500_regulator_switch_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - .epod_id = EPOD_ID_SIAPIPE, - }, - [DB8500_REGULATOR_SWITCH_SGA] = { - .desc = { - .name = "db8500-sga", - .id = DB8500_REGULATOR_SWITCH_SGA, - .ops = &ux500_regulator_switch_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - .epod_id = EPOD_ID_SGA, - }, - [DB8500_REGULATOR_SWITCH_B2R2_MCDE] = { - .desc = { - .name = "db8500-b2r2-mcde", - .id = DB8500_REGULATOR_SWITCH_B2R2_MCDE, - .ops = &ux500_regulator_switch_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - .epod_id = EPOD_ID_B2R2_MCDE, - }, - [DB8500_REGULATOR_SWITCH_ESRAM12] = { - .desc = { - .name = "db8500-esram12", - .id = DB8500_REGULATOR_SWITCH_ESRAM12, - .ops = &ux500_regulator_switch_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - .epod_id = EPOD_ID_ESRAM12, - .is_enabled = true, - }, - [DB8500_REGULATOR_SWITCH_ESRAM12RET] = { - .desc = { - .name = "db8500-esram12-ret", - .id = DB8500_REGULATOR_SWITCH_ESRAM12RET, - .ops = &ux500_regulator_switch_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - .epod_id = EPOD_ID_ESRAM12, - .is_ramret = true, - }, - [DB8500_REGULATOR_SWITCH_ESRAM34] = { - .desc = { - .name = "db8500-esram34", - .id = DB8500_REGULATOR_SWITCH_ESRAM34, - .ops = &ux500_regulator_switch_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - .epod_id = EPOD_ID_ESRAM34, - .is_enabled = true, - }, - [DB8500_REGULATOR_SWITCH_ESRAM34RET] = { - .desc = { - .name = "db8500-esram34-ret", - .id = DB8500_REGULATOR_SWITCH_ESRAM34RET, - .ops = &ux500_regulator_switch_ops, - .type = REGULATOR_VOLTAGE, - .owner = THIS_MODULE, - }, - .epod_id = EPOD_ID_ESRAM34, - .is_ramret = true, - }, -}; - -static int __devinit db8500_regulator_probe(struct platform_device *pdev) -{ - int ret; - - ret = ux500_regulator_probe(pdev, db8500_regulator_info, - ARRAY_SIZE(db8500_regulator_info)); - if (!ret) - regulator_has_full_constraints(); - - return ret; -} - -static int __devexit db8500_regulator_remove(struct platform_device *pdev) -{ - return ux500_regulator_remove(pdev, db8500_regulator_info, - ARRAY_SIZE(db8500_regulator_info)); -} - -static struct platform_driver db8500_regulator_driver = { - .driver = { - .name = "db8500-regulators", - .owner = THIS_MODULE, - }, - .remove = __devexit_p(db8500_regulator_remove), -}; - -static int __init db8500_regulator_init(void) -{ - int ret; - - ret = platform_driver_probe(&db8500_regulator_driver, - db8500_regulator_probe); - if (ret < 0) { - pr_info("db8500_regulator: platform_driver_register fails\n"); - return -ENODEV; - } - - return 0; -} - -static void __exit db8500_regulator_exit(void) -{ - platform_driver_unregister(&db8500_regulator_driver); -} - -/* replaced subsys_initcall as regulators must be turned on early */ -arch_initcall(db8500_regulator_init); -module_exit(db8500_regulator_exit); - -MODULE_AUTHOR("Bengt Jonsson <bengt.g.jonsson@stericsson.com>"); -MODULE_DESCRIPTION("DB8500 regulator driver"); -MODULE_LICENSE("GPL v2"); diff --git a/arch/arm/mach-ux500/regulator-db8500.h b/arch/arm/mach-ux500/regulator-db8500.h deleted file mode 100644 index 612062313b6..00000000000 --- a/arch/arm/mach-ux500/regulator-db8500.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) ST-Ericsson SA 2010 - * - * License Terms: GNU General Public License v2 - * - * Author: Bengt Jonsson <bengt.g.jonsson@stericsson.com> for ST-Ericsson - * - * Interface to power domain regulators on DB8500 - */ - -#ifndef __REGULATOR_H__ -#define __REGULATOR_H__ - -/* Number of DB8500 regulators and regulator enumeration */ -enum db8500_regulator_id { - DB8500_REGULATOR_VAPE, - DB8500_REGULATOR_VARM, - DB8500_REGULATOR_VMODEM, - DB8500_REGULATOR_VPLL, - DB8500_REGULATOR_VSMPS1, - DB8500_REGULATOR_VSMPS2, - DB8500_REGULATOR_VSMPS3, - DB8500_REGULATOR_VRF1, - DB8500_REGULATOR_SWITCH_SVAMMDSP, - DB8500_REGULATOR_SWITCH_SVAMMDSPRET, - DB8500_REGULATOR_SWITCH_SVAPIPE, - DB8500_REGULATOR_SWITCH_SIAMMDSP, - DB8500_REGULATOR_SWITCH_SIAMMDSPRET, - DB8500_REGULATOR_SWITCH_SIAPIPE, - DB8500_REGULATOR_SWITCH_SGA, - DB8500_REGULATOR_SWITCH_B2R2_MCDE, - DB8500_REGULATOR_SWITCH_ESRAM12, - DB8500_REGULATOR_SWITCH_ESRAM12RET, - DB8500_REGULATOR_SWITCH_ESRAM34, - DB8500_REGULATOR_SWITCH_ESRAM34RET, - DB8500_NUM_REGULATORS -}; - -/* - * Exported interface for CPUIdle only. This function is called with all - * interrupts turned off. - */ -int power_state_active_is_enabled(void); - -#endif diff --git a/arch/arm/mach-ux500/regulator-ux500.c b/arch/arm/mach-ux500/regulator-ux500.c index 750a5b53d63..c76ea008ba0 100644 --- a/arch/arm/mach-ux500/regulator-ux500.c +++ b/arch/arm/mach-ux500/regulator-ux500.c @@ -53,7 +53,8 @@ out: return ret; } -#if 0 +/* FIXME: double definitions if U8500+U5500 enabled */ +#ifdef CONFIG_UX500_SOC_DB5500 /* * Exported interface for CPUIdle only. This function is called when interrupts * are turned off. Hence, no locking. @@ -160,6 +161,7 @@ void ux500_regulator_put(struct ux500_regulator *regulator) } EXPORT_SYMBOL_GPL(ux500_regulator_put); +#ifdef CONFIG_UX500_SOC_DB5500 static int u8500_regulator_enable(struct regulator_dev *rdev) { struct u8500_regulator_info *info = rdev_get_drvdata(rdev); @@ -403,3 +405,5 @@ ux500_regulator_remove(struct platform_device *pdev, return 0; } + +#endif diff --git a/drivers/regulator/db8500-prcmu.c b/drivers/regulator/db8500-prcmu.c index 2bb8f451cc0..cc8fcc96b0a 100644 --- a/drivers/regulator/db8500-prcmu.c +++ b/drivers/regulator/db8500-prcmu.c @@ -13,11 +13,12 @@ #include <linux/err.h> #include <linux/spinlock.h> #include <linux/platform_device.h> -#include <linux/mfd/db8500-prcmu.h> #include <linux/regulator/driver.h> #include <linux/regulator/machine.h> #include <linux/regulator/db8500-prcmu.h> +#include <mach/prcmu.h> + /* * power state reference count */ |