* [PATCH 1/2] thermal: exynos: Check the range of temperature code
@ 2012-11-28 0:48 Jonghwan Choi
0 siblings, 0 replies; only message in thread
From: Jonghwan Choi @ 2012-11-28 0:48 UTC (permalink / raw)
To: 'Jonghwan Choi', 'open list'
Cc: 'Amit Daniel Kachhap', 'Sachin Kamat',
'Zhang Rui'
The temperature code should range between 46 and 146.
Signed-off-by: Jonghwan Choi <jhbird.choi@samsung.com>
---
drivers/thermal/exynos_thermal.c | 21 ++++++++++++++-------
1 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/thermal/exynos_thermal.c
b/drivers/thermal/exynos_thermal.c
index 6dd29e4..dc2ad6c 100644
--- a/drivers/thermal/exynos_thermal.c
+++ b/drivers/thermal/exynos_thermal.c
@@ -530,14 +530,21 @@ out:
static int code_to_temp(struct exynos_tmu_data *data, u8 temp_code)
{
struct exynos_tmu_platform_data *pdata = data->pdata;
- int temp;
+ int min, max, temp;
- if (data->soc == SOC_ARCH_EXYNOS4210)
- /* temp_code should range between 75 and 175 */
- if (temp_code < 75 || temp_code > 175) {
- temp = -ENODATA;
- goto out;
- }
+ if (data->soc == SOC_ARCH_EXYNOS4210) {
+ min = 75;
+ max = 175;
+ } else {
+ min = 46;
+ max = 146;
+ }
+
+ /* temp_code should range between min and max */
+ if (temp_code < min || temp_code > max) {
+ temp = -ENODATA;
+ goto out;
+ }
switch (pdata->cal_type) {
case TYPE_TWO_POINT_TRIMMING:
--
1.7.4.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-11-28 0:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-28 0:48 [PATCH 1/2] thermal: exynos: Check the range of temperature code Jonghwan Choi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®