From 8431f5c560708b9e69e1107dbd958f08f124ef3a Mon Sep 17 00:00:00 2001 From: Alex Frid Date: Wed, 17 Jul 2013 14:23:25 -0700 Subject: ARM: tegra11: clock: Add emc and host1x sysfs floors Change-Id: Ia8bf319da85914e748c4a88877433e6c45667ef1 Signed-off-by: Alex Frid Reviewed-on: http://git-master/r/250565 (cherry picked from commit 025b4feb4254f31a748ff926b225ffbde7960f1c) Reviewed-on: http://git-master/r/253682 Tested-by: Shaoming Feng GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani --- arch/arm/mach-tegra/tegra11_clocks.c | 2 ++ arch/arm/mach-tegra/tegra11_dvfs.c | 33 +++++++++++++++++++++++++++++++-- 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 2c6bac409708..a67b33fa4a7c 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); -- cgit v1.2.3