diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2011-09-04 17:10:13 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-09-06 16:50:50 -0700 |
commit | 8d9e6bbe59ab68f44a4713f5d1bcc7877baf8180 (patch) | |
tree | 1eb34cd5702eda204aed4c53ea56b7c49b2577aa | |
parent | 4f36edabc585f3fea28e2f959558ac7e07dd2b5e (diff) |
arm: tegra: Add handle for kernel option power_supply
Adding the handler function for the kernel command line
option "power_supply".
Change-Id: I6289936a0f31404812b63f170d4fd9907609c855
Reviewed-on: http://git-master/r/50674
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/board.h | 6 | ||||
-rw-r--r-- | arch/arm/mach-tegra/common.c | 17 |
2 files changed, 23 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board.h b/arch/arm/mach-tegra/board.h index a58e0ba569a9..f0392704fed3 100644 --- a/arch/arm/mach-tegra/board.h +++ b/arch/arm/mach-tegra/board.h @@ -74,6 +74,11 @@ enum panel_type { panel_type_dsi, }; +enum power_supply_type { + power_supply_adapter, + power_supply_battery, +}; + void tegra_get_board_info(struct board_info *); void tegra_get_pmu_board_info(struct board_info *bi); #ifdef CONFIG_TEGRA_CONVSERVATIVE_GOV_ON_EARLYSUPSEND @@ -88,5 +93,6 @@ void cpufreq_set_conservative_governor_param(int up_th, int down_th); int get_core_edp(void); enum panel_type get_panel_type(void); int tegra_get_modem_id(void); +enum power_supply_type get_power_supply_type(void); #endif diff --git a/arch/arm/mach-tegra/common.c b/arch/arm/mach-tegra/common.c index b9b3e947d595..0b6c6f92fd90 100644 --- a/arch/arm/mach-tegra/common.c +++ b/arch/arm/mach-tegra/common.c @@ -93,6 +93,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; static int modem_id; void (*tegra_reset)(char mode, const char *cmd); @@ -488,6 +489,22 @@ 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_adapter; + else if (!strcmp(options, "Battery")) + pow_supply_type = power_supply_battery; + else + return 0; + return 1; +} +__setup("power_supply=", tegra_board_power_supply_type); + int get_core_edp(void) { return pmu_core_edp; |