mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 02:39:48 +00:00
thermal: exynos: remove parsing of samsung,tmu_gain property
Since pdata gain values are SoC (not platform) specific just move it from platform data to struct exynos_tmu_data instance. Then remove parsing of samsung,tmu_gain property. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
This commit is contained in:
parent
61020d189d
commit
fccfe0993b
2 changed files with 9 additions and 13 deletions
|
@ -192,6 +192,8 @@
|
|||
* @max_efuse_value: maximum valid trimming data
|
||||
* @temp_error1: fused value of the first point trim.
|
||||
* @temp_error2: fused value of the second point trim.
|
||||
* @gain: gain of amplifier in the positive-TC generator block
|
||||
* 0 < gain <= 15
|
||||
* @reference_voltage: reference voltage of amplifier
|
||||
* in the positive-TC generator block
|
||||
* 0 < reference_voltage <= 31
|
||||
|
@ -219,6 +221,7 @@ struct exynos_tmu_data {
|
|||
u32 min_efuse_value;
|
||||
u32 max_efuse_value;
|
||||
u16 temp_error1, temp_error2;
|
||||
u8 gain;
|
||||
u8 reference_voltage;
|
||||
struct regulator *regulator;
|
||||
struct thermal_zone_device *tzd;
|
||||
|
@ -368,8 +371,6 @@ static int exynos_tmu_initialize(struct platform_device *pdev)
|
|||
|
||||
static u32 get_con_reg(struct exynos_tmu_data *data, u32 con)
|
||||
{
|
||||
struct exynos_tmu_platform_data *pdata = data->pdata;
|
||||
|
||||
if (data->soc == SOC_ARCH_EXYNOS4412 ||
|
||||
data->soc == SOC_ARCH_EXYNOS3250)
|
||||
con |= (EXYNOS4412_MUX_ADDR_VALUE << EXYNOS4412_MUX_ADDR_SHIFT);
|
||||
|
@ -378,7 +379,7 @@ static u32 get_con_reg(struct exynos_tmu_data *data, u32 con)
|
|||
con |= data->reference_voltage << EXYNOS_TMU_REF_VOLTAGE_SHIFT;
|
||||
|
||||
con &= ~(EXYNOS_TMU_BUF_SLOPE_SEL_MASK << EXYNOS_TMU_BUF_SLOPE_SEL_SHIFT);
|
||||
con |= (pdata->gain << EXYNOS_TMU_BUF_SLOPE_SEL_SHIFT);
|
||||
con |= (data->gain << EXYNOS_TMU_BUF_SLOPE_SEL_SHIFT);
|
||||
|
||||
con &= ~(EXYNOS_TMU_TRIP_MODE_MASK << EXYNOS_TMU_TRIP_MODE_SHIFT);
|
||||
con |= (EXYNOS_NOISE_CANCEL_MODE << EXYNOS_TMU_TRIP_MODE_SHIFT);
|
||||
|
@ -1135,14 +1136,8 @@ MODULE_DEVICE_TABLE(of, exynos_tmu_match);
|
|||
static int exynos_of_sensor_conf(struct device_node *np,
|
||||
struct exynos_tmu_platform_data *pdata)
|
||||
{
|
||||
u32 value;
|
||||
int ret;
|
||||
|
||||
of_node_get(np);
|
||||
|
||||
ret = of_property_read_u32(np, "samsung,tmu_gain", &value);
|
||||
pdata->gain = (u8)value;
|
||||
|
||||
of_property_read_u32(np, "samsung,tmu_cal_type", &pdata->cal_type);
|
||||
|
||||
of_node_put(np);
|
||||
|
@ -1196,6 +1191,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
|
|||
data->tmu_read = exynos4210_tmu_read;
|
||||
data->tmu_clear_irqs = exynos4210_tmu_clear_irqs;
|
||||
data->ntrip = 4;
|
||||
data->gain = 15;
|
||||
data->reference_voltage = 7;
|
||||
data->efuse_value = 55;
|
||||
data->min_efuse_value = 40;
|
||||
|
@ -1213,6 +1209,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
|
|||
data->tmu_set_emulation = exynos4412_tmu_set_emulation;
|
||||
data->tmu_clear_irqs = exynos4210_tmu_clear_irqs;
|
||||
data->ntrip = 4;
|
||||
data->gain = 8;
|
||||
data->reference_voltage = 16;
|
||||
data->efuse_value = 55;
|
||||
if (data->soc != SOC_ARCH_EXYNOS5420 &&
|
||||
|
@ -1229,6 +1226,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
|
|||
data->tmu_set_emulation = exynos4412_tmu_set_emulation;
|
||||
data->tmu_clear_irqs = exynos4210_tmu_clear_irqs;
|
||||
data->ntrip = 8;
|
||||
data->gain = 8;
|
||||
if (res.start == EXYNOS5433_G3D_BASE)
|
||||
data->reference_voltage = 23;
|
||||
else
|
||||
|
@ -1244,6 +1242,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
|
|||
data->tmu_set_emulation = exynos5440_tmu_set_emulation;
|
||||
data->tmu_clear_irqs = exynos5440_tmu_clear_irqs;
|
||||
data->ntrip = 4;
|
||||
data->gain = 5;
|
||||
data->reference_voltage = 16;
|
||||
data->efuse_value = 0x5d2d;
|
||||
data->min_efuse_value = 16;
|
||||
|
@ -1256,6 +1255,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
|
|||
data->tmu_set_emulation = exynos4412_tmu_set_emulation;
|
||||
data->tmu_clear_irqs = exynos4210_tmu_clear_irqs;
|
||||
data->ntrip = 8;
|
||||
data->gain = 9;
|
||||
data->reference_voltage = 17;
|
||||
data->efuse_value = 75;
|
||||
data->min_efuse_value = 15;
|
||||
|
|
|
@ -40,15 +40,11 @@ enum soc_type {
|
|||
|
||||
/**
|
||||
* struct exynos_tmu_platform_data
|
||||
* @gain: gain of amplifier in the positive-TC generator block
|
||||
* 0 < gain <= 15
|
||||
* @cal_type: calibration type for temperature
|
||||
*
|
||||
* This structure is required for configuration of exynos_tmu driver.
|
||||
*/
|
||||
struct exynos_tmu_platform_data {
|
||||
u8 gain;
|
||||
|
||||
u32 cal_type;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue