aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/db8500-prcmu.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2012-10-10 07:42:23 -0400
committerMike Turquette <mturquette@ti.com>2012-11-09 19:43:34 -0500
commitc280f45fb84bf49731c2b5122c997a9669e763ce (patch)
tree653b862328a2a51f8105cd7d57c2a9983fa473a6 /drivers/mfd/db8500-prcmu.c
parent50545e1d237b0fa790bd824bf5a945ddb8c48351 (diff)
mfd: db8500: Provide cpufreq table as platform data
The cpufreq table needs dynamically update due to what the PRCMU firmware is supporting. The table is then provided through to the mfd child device as platform data. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Acked-by: Jonas Aaberg <jonas.aberg@stericsson.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/mfd/db8500-prcmu.c')
-rw-r--r--drivers/mfd/db8500-prcmu.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c
index 3167bfdd13fa..ea1565018899 100644
--- a/drivers/mfd/db8500-prcmu.c
+++ b/drivers/mfd/db8500-prcmu.c
@@ -31,6 +31,7 @@
31#include <linux/mfd/abx500/ab8500.h> 31#include <linux/mfd/abx500/ab8500.h>
32#include <linux/regulator/db8500-prcmu.h> 32#include <linux/regulator/db8500-prcmu.h>
33#include <linux/regulator/machine.h> 33#include <linux/regulator/machine.h>
34#include <linux/cpufreq.h>
34#include <asm/hardware/gic.h> 35#include <asm/hardware/gic.h>
35#include <mach/hardware.h> 36#include <mach/hardware.h>
36#include <mach/irqs.h> 37#include <mach/irqs.h>
@@ -3002,6 +3003,15 @@ static struct regulator_init_data db8500_regulators[DB8500_NUM_REGULATORS] = {
3002 }, 3003 },
3003}; 3004};
3004 3005
3006/* CPU FREQ table, may be changed due to if MAX_OPP is supported. */
3007static struct cpufreq_frequency_table db8500_cpufreq_table[] = {
3008 { .frequency = 200000, .index = ARM_EXTCLK,},
3009 { .frequency = 400000, .index = ARM_50_OPP,},
3010 { .frequency = 800000, .index = ARM_100_OPP,},
3011 { .frequency = CPUFREQ_TABLE_END,}, /* To be used for MAX_OPP. */
3012 { .frequency = CPUFREQ_TABLE_END,},
3013};
3014
3005static struct resource ab8500_resources[] = { 3015static struct resource ab8500_resources[] = {
3006 [0] = { 3016 [0] = {
3007 .start = IRQ_DB8500_AB8500, 3017 .start = IRQ_DB8500_AB8500,
@@ -3020,6 +3030,8 @@ static struct mfd_cell db8500_prcmu_devs[] = {
3020 { 3030 {
3021 .name = "cpufreq-u8500", 3031 .name = "cpufreq-u8500",
3022 .of_compatible = "stericsson,cpufreq-u8500", 3032 .of_compatible = "stericsson,cpufreq-u8500",
3033 .platform_data = &db8500_cpufreq_table,
3034 .pdata_size = sizeof(db8500_cpufreq_table),
3023 }, 3035 },
3024 { 3036 {
3025 .name = "ab8500-core", 3037 .name = "ab8500-core",
@@ -3030,6 +3042,14 @@ static struct mfd_cell db8500_prcmu_devs[] = {
3030 }, 3042 },
3031}; 3043};
3032 3044
3045static void db8500_prcmu_update_cpufreq(void)
3046{
3047 if (prcmu_has_arm_maxopp()) {
3048 db8500_cpufreq_table[3].frequency = 1000000;
3049 db8500_cpufreq_table[3].index = ARM_MAX_OPP;
3050 }
3051}
3052
3033/** 3053/**
3034 * prcmu_fw_init - arch init call for the Linux PRCMU fw init logic 3054 * prcmu_fw_init - arch init call for the Linux PRCMU fw init logic
3035 * 3055 *
@@ -3074,6 +3094,8 @@ static int __devinit db8500_prcmu_probe(struct platform_device *pdev)
3074 if (cpu_is_u8500v20_or_later()) 3094 if (cpu_is_u8500v20_or_later())
3075 prcmu_config_esram0_deep_sleep(ESRAM0_DEEP_SLEEP_STATE_RET); 3095 prcmu_config_esram0_deep_sleep(ESRAM0_DEEP_SLEEP_STATE_RET);
3076 3096
3097 db8500_prcmu_update_cpufreq();
3098
3077 err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs, 3099 err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs,
3078 ARRAY_SIZE(db8500_prcmu_devs), NULL, 0, NULL); 3100 ARRAY_SIZE(db8500_prcmu_devs), NULL, 0, NULL);
3079 if (err) { 3101 if (err) {