exynos_tmu.c (0eb875d88aaa98ceb7134cb54638e49b35ab0946) | exynos_tmu.c (08d725cd93602312df2bc4208e4672a34c107d89) |
---|---|
1/* 2 * exynos_tmu.c - Samsung EXYNOS TMU (Thermal Management Unit) 3 * 4 * Copyright (C) 2014 Samsung Electronics 5 * Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> 6 * Lukasz Majewski <l.majewski@samsung.com> 7 * 8 * Copyright (C) 2011 Samsung Electronics --- 878 unchanged lines hidden (view full) --- 887 888 writel(interrupt_en, data->base + EXYNOS7_TMU_REG_INTEN); 889 writel(con, data->base + EXYNOS_TMU_REG_CONTROL); 890} 891 892static int exynos_get_temp(void *p, int *temp) 893{ 894 struct exynos_tmu_data *data = p; | 1/* 2 * exynos_tmu.c - Samsung EXYNOS TMU (Thermal Management Unit) 3 * 4 * Copyright (C) 2014 Samsung Electronics 5 * Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> 6 * Lukasz Majewski <l.majewski@samsung.com> 7 * 8 * Copyright (C) 2011 Samsung Electronics --- 878 unchanged lines hidden (view full) --- 887 888 writel(interrupt_en, data->base + EXYNOS7_TMU_REG_INTEN); 889 writel(con, data->base + EXYNOS_TMU_REG_CONTROL); 890} 891 892static int exynos_get_temp(void *p, int *temp) 893{ 894 struct exynos_tmu_data *data = p; |
895 int value, ret = 0; |
|
895 896 if (!data || !data->tmu_read || !data->enabled) 897 return -EINVAL; 898 899 mutex_lock(&data->lock); 900 clk_enable(data->clk); 901 | 896 897 if (!data || !data->tmu_read || !data->enabled) 898 return -EINVAL; 899 900 mutex_lock(&data->lock); 901 clk_enable(data->clk); 902 |
902 *temp = code_to_temp(data, data->tmu_read(data)) * MCELSIUS; | 903 value = data->tmu_read(data); 904 if (value < 0) 905 ret = value; 906 else 907 *temp = code_to_temp(data, value) * MCELSIUS; |
903 904 clk_disable(data->clk); 905 mutex_unlock(&data->lock); 906 | 908 909 clk_disable(data->clk); 910 mutex_unlock(&data->lock); 911 |
907 return 0; | 912 return ret; |
908} 909 910#ifdef CONFIG_THERMAL_EMULATION 911static u32 get_emul_con_reg(struct exynos_tmu_data *data, unsigned int val, 912 int temp) 913{ 914 if (temp) { 915 temp /= MCELSIUS; --- 569 unchanged lines hidden --- | 913} 914 915#ifdef CONFIG_THERMAL_EMULATION 916static u32 get_emul_con_reg(struct exynos_tmu_data *data, unsigned int val, 917 int temp) 918{ 919 if (temp) { 920 temp /= MCELSIUS; --- 569 unchanged lines hidden --- |