summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorJinyoung Park <jinyoungp@nvidia.com>2014-01-28 15:47:05 +0900
committerHarry Hong <hhong@nvidia.com>2014-02-18 16:34:03 -0800
commit4cff6adb0e6b4b77a5eac4c2f80ba51c08560732 (patch)
treec29ea76a6a91a5b6e7fa068eaac612a9eba06665 /arch
parent8c29df1c10ed3cb52b060af16edfe49c59aeba6c (diff)
ARM: tegra: tegratab: Enable ADC auto shutdown
Enable ADC auto shutdown based on Tboard temperature for both TN7 and TN7C. System will be shutdown if Tboard temperature is above 78C. Bug 1366274 Change-Id: Iffaebd6112bca7c9be6814482b6bb31ab02e061d Signed-off-by: Jinyoung Park <jinyoungp@nvidia.com> Reviewed-on: http://git-master/r/360824 Reviewed-by: Harry Hong <hhong@nvidia.com> Tested-by: Harry Hong <hhong@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/board-tegranote7c-power.c10
-rw-r--r--arch/arm/mach-tegra/board-tegratab-power.c16
2 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-tegranote7c-power.c b/arch/arm/mach-tegra/board-tegranote7c-power.c
index 1d7f67724d28..b603f135325b 100644
--- a/arch/arm/mach-tegra/board-tegranote7c-power.c
+++ b/arch/arm/mach-tegra/board-tegranote7c-power.c
@@ -421,6 +421,13 @@ static struct iio_map palmas_adc_iio_maps[] = {
PALMAS_GPADC_IIO_MAP(NULL, NULL, NULL),
};
+struct palmas_adc_auto_conv_property palmas_adc_auto_conv0_data = {
+ .adc_channel_number = PALMAS_ADC_CH_IN1, /* NTC thermistor(Tboard) */
+ /* Shutdown if ADC auto conversion is below 298(>78C). */
+ .adc_low_threshold = 298, /* 78C */
+ .adc_shutdown = true,
+};
+
static struct palmas_gpadc_platform_data palmas_adc_pdata = {
.ch0_current_uA = 5,
/* If ch3_dual_current is true, it will measure ch3 input signal with
@@ -666,6 +673,9 @@ int __init tegranote7c_palmas_regulator_init(void)
palmas_pdata.clk32k_init_data_size =
ARRAY_SIZE(tegranote7c_palmas_clk32k_idata);
+ palmas_adc_pdata.auto_conversion_period_ms = 1000;
+ palmas_adc_pdata.adc_auto_conv0_data = &palmas_adc_auto_conv0_data;
+
if (get_androidboot_mode_charger())
palmas_pdata.long_press_delay =
PALMAS_LONG_PRESS_KEY_TIME_12SECONDS;
diff --git a/arch/arm/mach-tegra/board-tegratab-power.c b/arch/arm/mach-tegra/board-tegratab-power.c
index 172da27c3658..690c69bf1d01 100644
--- a/arch/arm/mach-tegra/board-tegratab-power.c
+++ b/arch/arm/mach-tegra/board-tegratab-power.c
@@ -418,6 +418,13 @@ static struct iio_map palmas_adc_iio_maps[] = {
PALMAS_GPADC_IIO_MAP(NULL, NULL, NULL),
};
+struct palmas_adc_auto_conv_property palmas_adc_auto_conv0_data = {
+ .adc_channel_number = PALMAS_ADC_CH_IN1, /* NTC thermistor(Tboard) */
+ /* Shutdown if ADC auto conversion is below 298(>78C). */
+ .adc_low_threshold = 298, /* 78C */
+ .adc_shutdown = true,
+};
+
static struct palmas_gpadc_platform_data palmas_adc_pdata = {
.ch0_current_uA = 5,
/* If ch3_dual_current is true, it will measure ch3 input signal with
@@ -702,6 +709,15 @@ int __init tegratab_palmas_regulator_init(void)
ARRAY_SIZE(tegratab_palmas_clk32k_idata);
}
+ if (board_info.board_id != BOARD_E1569 &&
+ (board_info.board_id == BOARD_P1640 &&
+ (board_info.fab != BOARD_FAB_A00 &&
+ board_info.fab != BOARD_FAB_A01))) {
+ palmas_adc_pdata.auto_conversion_period_ms = 1000;
+ palmas_adc_pdata.adc_auto_conv0_data =
+ &palmas_adc_auto_conv0_data;
+ }
+
if (get_androidboot_mode_charger())
palmas_pdata.long_press_delay =
PALMAS_LONG_PRESS_KEY_TIME_12SECONDS;