diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2011-09-04 17:10:13 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:49:20 -0800 |
commit | 8644fc08c6f1a6557e549f98513af2364691d40c (patch) | |
tree | 9c530e1e64e3d5aafa96795bd045aa7870f4608f /arch/arm/mach-tegra/common.c | |
parent | e86a8bc2593f7a97a3c1f60f594449cef349b132 (diff) |
arm: tegra: Add handle for kernel option power_supply
Adding the handler function for the kernel command line
option "power_supply".
Reviewed-on: http://git-master/r/50674
(cherry picked from commit 8d9e6bbe59ab68f44a4713f5d1bcc7877baf8180)
Change-Id: I07796b6ee5893d73ac7557e81aac5d26b299c491
Reviewed-on: http://git-master/r/57262
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
Rebase-Id: Rd64bf314bcdfe3f7bdbcdee946ed261bfce5938f
Diffstat (limited to 'arch/arm/mach-tegra/common.c')
-rw-r--r-- | arch/arm/mach-tegra/common.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c index 6a6c08ad5519..37f95808bf69 100644 --- a/arch/arm/mach-tegra/common.c +++ b/arch/arm/mach-tegra/common.c @@ -92,6 +92,7 @@ static struct board_info pmu_board_info; static int pmu_core_edp = 1200; /* default 1.2V EDP limit */ static int board_panel_type; +static enum power_supply_type pow_supply_type = POWER_SUPPLY_TYPE_MAINS; void (*arch_reset)(char mode, const char *cmd) = tegra_assert_system_reset; @@ -369,6 +370,24 @@ static int __init tegra_board_panel_type(char *options) } __setup("panel=", tegra_board_panel_type); +enum power_supply_type get_power_supply_type(void) +{ + return pow_supply_type; +} +static int __init tegra_board_power_supply_type(char *options) +{ + if (!strcmp(options, "Adapter")) + pow_supply_type = POWER_SUPPLY_TYPE_MAINS; + if (!strcmp(options, "Mains")) + pow_supply_type = POWER_SUPPLY_TYPE_MAINS; + else if (!strcmp(options, "Battery")) + pow_supply_type = POWER_SUPPLY_TYPE_BATTERY; + else + return 0; + return 1; +} +__setup("power_supply=", tegra_board_power_supply_type); + int get_core_edp(void) { return pmu_core_edp; |