summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Frid <afrid@nvidia.com>2013-07-17 14:23:25 -0700
committerVarun Colbert <vcolbert@nvidia.com>2013-07-20 22:11:31 -0700
commit025b4feb4254f31a748ff926b225ffbde7960f1c (patch)
treecef35ef5b23c9853304cb94b5af3af70817e4bf6
parentcaf42e72c877189dfc3b75d3d9d21fb2d2491fef (diff)
ARM: tegra11: clock: Add emc and host1x sysfs floors
Change-Id: Ia8bf319da85914e748c4a88877433e6c45667ef1 Signed-off-by: Alex Frid <afrid@nvidia.com> Reviewed-on: http://git-master/r/250565 GVS: Gerrit_Virtual_Submit Reviewed-by: Matt Wagner <mwagner@nvidia.com> Tested-by: Anshul Jain (SW) <anshulj@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/tegra11_clocks.c2
-rw-r--r--arch/arm/mach-tegra/tegra11_dvfs.c33
2 files changed, 33 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/tegra11_clocks.c b/arch/arm/mach-tegra/tegra11_clocks.c
index cf787580c2f9..1e147c3e6665 100644
--- a/arch/arm/mach-tegra/tegra11_clocks.c
+++ b/arch/arm/mach-tegra/tegra11_clocks.c
@@ -6788,6 +6788,7 @@ struct clk tegra_list_clks[] = {
SHARED_CLK("override.emc", "override.emc", NULL, &tegra_clk_emc, NULL, 0, SHARED_OVERRIDE),
SHARED_CLK("edp.emc", "edp.emc", NULL, &tegra_clk_emc, NULL, 0, SHARED_CEILING),
SHARED_CLK("battery.emc", "battery_edp", "emc", &tegra_clk_emc, NULL, 0, SHARED_CEILING),
+ SHARED_CLK("floor.profile.emc", "profile.emc", NULL, &tegra_clk_emc, NULL, 0, 0),
#ifdef CONFIG_TEGRA_DUAL_CBUS
DUAL_CBUS_CLK("3d.cbus", "tegra_gr3d", "gr3d", &tegra_clk_c2bus, "3d", 0, 0),
@@ -6830,6 +6831,7 @@ struct clk tegra_list_clks[] = {
SHARED_CLK("cap.host1x", "cap.host1x", NULL, &tegra_clk_host1x, NULL, 0, SHARED_CEILING),
SHARED_CLK("floor.host1x", "floor.host1x", NULL, &tegra_clk_host1x, NULL, 0, 0),
SHARED_CLK("override.host1x", "override.host1x", NULL, &tegra_clk_host1x, NULL, 0, SHARED_OVERRIDE),
+ SHARED_CLK("floor.profile.host1x", "profile.host1x", NULL, &tegra_clk_host1x, NULL, 0, 0),
};
diff --git a/arch/arm/mach-tegra/tegra11_dvfs.c b/arch/arm/mach-tegra/tegra11_dvfs.c
index 0d7c70332d9d..c063bad7ca35 100644
--- a/arch/arm/mach-tegra/tegra11_dvfs.c
+++ b/arch/arm/mach-tegra/tegra11_dvfs.c
@@ -778,6 +778,7 @@ int tegra_dvfs_rail_post_enable(struct dvfs_rail *rail)
/* Core voltage and bus cap object and tables */
static struct kobject *cap_kobj;
+static struct kobject *floor_kobj;
static struct core_dvfs_cap_table tegra11_core_cap_table[] = {
#ifdef CONFIG_TEGRA_DUAL_CBUS
@@ -809,7 +810,18 @@ static struct core_bus_cap_table tegra11_bus_cap_table[] = {
#endif
};
-static int __init tegra11_dvfs_init_core_cap(void)
+static struct core_bus_floor_table tegra11_bus_floor_table[] = {
+ { .floor_name = "floor.profile.host1x",
+ .refcnt_attr = {.attr = {.name = "h1x_floor_state", .mode = 0644} },
+ .level_attr = {.attr = {.name = "h1x_floor_level", .mode = 0644} },
+ },
+ { .floor_name = "floor.profile.emc",
+ .refcnt_attr = {.attr = {.name = "emc_floor_state", .mode = 0644} },
+ .level_attr = {.attr = {.name = "emc_floor_level", .mode = 0644} },
+ },
+};
+
+static int __init tegra11_dvfs_init_core_limits(void)
{
int ret;
@@ -841,6 +853,23 @@ static int __init tegra11_dvfs_init_core_cap(void)
}
pr_info("tegra dvfs: tegra sysfs cap interface is initialized\n");
+ floor_kobj = kobject_create_and_add("tegra_floor", kernel_kobj);
+ if (!floor_kobj) {
+ pr_err("tegra11_dvfs: failed to create sysfs floor object\n");
+ return 0;
+ }
+
+ ret = tegra_init_shared_bus_floor(
+ tegra11_bus_floor_table, ARRAY_SIZE(tegra11_bus_floor_table),
+ floor_kobj);
+ if (ret) {
+ pr_err("tegra11_dvfs: failed to init bus floor interface (%d)\n",
+ ret);
+ kobject_del(floor_kobj);
+ return 0;
+ }
+ pr_info("tegra dvfs: tegra sysfs floor interface is initialized\n");
+
return 0;
}
-late_initcall(tegra11_dvfs_init_core_cap);
+late_initcall(tegra11_dvfs_init_core_limits);