From 2489007e7d740ccbc3e0a202914e243ad5178787 Mon Sep 17 00:00:00 2001 From: codeworkx Date: Sat, 22 Sep 2012 09:48:20 +0200 Subject: merge opensource jb u5 Change-Id: I1aaec157aa196f3448eff8636134fce89a814cf2 --- arch/arm/mach-exynos/sec_thermistor.c | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'arch/arm/mach-exynos/sec_thermistor.c') diff --git a/arch/arm/mach-exynos/sec_thermistor.c b/arch/arm/mach-exynos/sec_thermistor.c index 2ae7ef3..a196abf 100644 --- a/arch/arm/mach-exynos/sec_thermistor.c +++ b/arch/arm/mach-exynos/sec_thermistor.c @@ -31,6 +31,13 @@ struct sec_therm_info { int curr_temp_adc; }; +#if defined(CONFIG_MACH_C1_KOR_SKT) || defined(CONFIG_MACH_C1_KOR_KT) || \ + defined(CONFIG_MACH_C1_KOR_LGT) +static void notify_change_of_temperature(struct sec_therm_info *info); +int siopLevellimit; +EXPORT_SYMBOL(siopLevellimit); +#endif + static ssize_t sec_therm_show_temperature(struct device *dev, struct device_attribute *attr, char *buf) @@ -49,12 +56,44 @@ static ssize_t sec_therm_show_temp_adc(struct device *dev, return sprintf(buf, "%d\n", info->curr_temp_adc); } +#if defined(CONFIG_MACH_C1_KOR_SKT) || defined(CONFIG_MACH_C1_KOR_KT) || \ + defined(CONFIG_MACH_C1_KOR_LGT) +static ssize_t sec_therm_show_sioplevel(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + return sprintf(buf, "%d\n", siopLevellimit); +} + +static ssize_t sec_therm_store_sioplevel(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t n) +{ + unsigned int val; + struct sec_therm_info *info = dev_get_drvdata(dev); + + if (sscanf(buf, "%u", &val) == 1) + siopLevellimit = val; + + notify_change_of_temperature(info); + + return n; +} + +static DEVICE_ATTR(sioplevel, S_IWUSR | S_IRUGO, sec_therm_show_sioplevel, \ + sec_therm_store_sioplevel); +#endif + static DEVICE_ATTR(temperature, S_IRUGO, sec_therm_show_temperature, NULL); static DEVICE_ATTR(temp_adc, S_IRUGO, sec_therm_show_temp_adc, NULL); static struct attribute *sec_therm_attributes[] = { &dev_attr_temperature.attr, &dev_attr_temp_adc.attr, +#if defined(CONFIG_MACH_C1_KOR_SKT) || defined(CONFIG_MACH_C1_KOR_KT) || \ + defined(CONFIG_MACH_C1_KOR_LGT) + &dev_attr_sioplevel.attr, +#endif NULL }; @@ -141,6 +180,7 @@ static void notify_change_of_temperature(struct sec_therm_info *info) if (info->pdata->get_siop_level) siop_level = info->pdata->get_siop_level(info->curr_temperature); + if (siop_level >= 0) { snprintf(siop_buf, sizeof(siop_buf), "SIOP_LEVEL=%d", siop_level); -- cgit v1.1