lkml.org 
[lkml]   [2012]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] devfreq: exynos4: Support initialization of freq_table and max_state of devfreq's profile.
Date
This patch initializes freq_table and max_state of devfreq's profile.
They will be used for creating transition table.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
---
drivers/devfreq/exynos4_bus.c | 30 +++++++++++++++++++++++++++++-
1 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/drivers/devfreq/exynos4_bus.c b/drivers/devfreq/exynos4_bus.c
index 88ddc77..9c08855 100644
--- a/drivers/devfreq/exynos4_bus.c
+++ b/drivers/devfreq/exynos4_bus.c
@@ -985,7 +985,8 @@ static __devinit int exynos4_busfreq_probe(struct platform_device *pdev)
struct busfreq_data *data;
struct opp *opp;
struct device *dev = &pdev->dev;
- int err = 0;
+ int err = 0, i;
+ unsigned int *freq_table;

data = kzalloc(sizeof(struct busfreq_data), GFP_KERNEL);
if (data == NULL) {
@@ -1042,6 +1043,33 @@ static __devinit int exynos4_busfreq_probe(struct platform_device *pdev)

platform_set_drvdata(pdev, data);

+ switch (data->type) {
+ case TYPE_BUSF_EXYNOS4210:
+ freq_table = devm_kzalloc(&pdev->dev, sizeof(unsigned int) * EX4210_LV_NUM,
+ GFP_KERNEL);
+
+ for (i = 0; i < EX4210_LV_NUM; i++)
+ freq_table[i] = exynos4210_busclk_table[i].clk;
+
+ exynos4_devfreq_profile.max_state = EX4210_LV_NUM;
+ break;
+ case TYPE_BUSF_EXYNOS4x12:
+ freq_table = devm_kzalloc(&pdev->dev, sizeof(unsigned int) * EX4x12_LV_NUM,
+ GFP_KERNEL);
+
+ for (i = 0; i < EX4x12_LV_NUM; i++)
+ freq_table[i] = exynos4x12_mifclk_table[i].clk;
+
+ exynos4_devfreq_profile.max_state = EX4x12_LV_NUM;
+ break;
+ default:
+ dev_err(dev, "Cannot determine the device id %d\n", data->type);
+ err = -EINVAL;
+ goto err_opp_add;
+ }
+
+ exynos4_devfreq_profile.freq_table = freq_table;
+
busfreq_mon_reset(data);

data->devfreq = devfreq_add_device(dev, &exynos4_devfreq_profile,
--
1.7.4.1


\
 
 \ /
  Last update: 2012-08-16 09:23    [W:0.053 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site