Commit 61020d18 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Eduardo Valentin
Browse files

thermal: exynos: remove parsing of samsung, tmu_reference_voltage property



Since pdata reference_voltage values are SoC (not platform) specific
just move it from platform data to struct exynos_tmu_data instance.
Then remove parsing of samsung,tmu_reference_voltage property.

There should be no functional changes caused by this patch.

Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
parent e3ed3649
Loading
Loading
Loading
Loading
+15 −3
Original line number Original line Diff line number Diff line
@@ -123,6 +123,8 @@


#define EXYNOS5433_PD_DET_EN			1
#define EXYNOS5433_PD_DET_EN			1


#define EXYNOS5433_G3D_BASE			0x10070000

/*exynos5440 specific registers*/
/*exynos5440 specific registers*/
#define EXYNOS5440_TMU_S0_7_TRIM		0x000
#define EXYNOS5440_TMU_S0_7_TRIM		0x000
#define EXYNOS5440_TMU_S0_7_CTRL		0x020
#define EXYNOS5440_TMU_S0_7_CTRL		0x020
@@ -190,6 +192,9 @@
 * @max_efuse_value: maximum valid trimming data
 * @max_efuse_value: maximum valid trimming data
 * @temp_error1: fused value of the first point trim.
 * @temp_error1: fused value of the first point trim.
 * @temp_error2: fused value of the second point trim.
 * @temp_error2: fused value of the second point trim.
 * @reference_voltage: reference voltage of amplifier
 *	in the positive-TC generator block
 *	0 < reference_voltage <= 31
 * @regulator: pointer to the TMU regulator structure.
 * @regulator: pointer to the TMU regulator structure.
 * @reg_conf: pointer to structure to register with core thermal.
 * @reg_conf: pointer to structure to register with core thermal.
 * @ntrip: number of supported trip points.
 * @ntrip: number of supported trip points.
@@ -214,6 +219,7 @@ struct exynos_tmu_data {
	u32 min_efuse_value;
	u32 min_efuse_value;
	u32 max_efuse_value;
	u32 max_efuse_value;
	u16 temp_error1, temp_error2;
	u16 temp_error1, temp_error2;
	u8 reference_voltage;
	struct regulator *regulator;
	struct regulator *regulator;
	struct thermal_zone_device *tzd;
	struct thermal_zone_device *tzd;
	unsigned int ntrip;
	unsigned int ntrip;
@@ -369,7 +375,7 @@ static u32 get_con_reg(struct exynos_tmu_data *data, u32 con)
		con |= (EXYNOS4412_MUX_ADDR_VALUE << EXYNOS4412_MUX_ADDR_SHIFT);
		con |= (EXYNOS4412_MUX_ADDR_VALUE << EXYNOS4412_MUX_ADDR_SHIFT);


	con &= ~(EXYNOS_TMU_REF_VOLTAGE_MASK << EXYNOS_TMU_REF_VOLTAGE_SHIFT);
	con &= ~(EXYNOS_TMU_REF_VOLTAGE_MASK << EXYNOS_TMU_REF_VOLTAGE_SHIFT);
	con |= pdata->reference_voltage << EXYNOS_TMU_REF_VOLTAGE_SHIFT;
	con |= data->reference_voltage << EXYNOS_TMU_REF_VOLTAGE_SHIFT;


	con &= ~(EXYNOS_TMU_BUF_SLOPE_SEL_MASK << EXYNOS_TMU_BUF_SLOPE_SEL_SHIFT);
	con &= ~(EXYNOS_TMU_BUF_SLOPE_SEL_MASK << EXYNOS_TMU_BUF_SLOPE_SEL_SHIFT);
	con |= (pdata->gain << EXYNOS_TMU_BUF_SLOPE_SEL_SHIFT);
	con |= (pdata->gain << EXYNOS_TMU_BUF_SLOPE_SEL_SHIFT);
@@ -1136,8 +1142,6 @@ static int exynos_of_sensor_conf(struct device_node *np,


	ret = of_property_read_u32(np, "samsung,tmu_gain", &value);
	ret = of_property_read_u32(np, "samsung,tmu_gain", &value);
	pdata->gain = (u8)value;
	pdata->gain = (u8)value;
	of_property_read_u32(np, "samsung,tmu_reference_voltage", &value);
	pdata->reference_voltage = (u8)value;


	of_property_read_u32(np, "samsung,tmu_cal_type", &pdata->cal_type);
	of_property_read_u32(np, "samsung,tmu_cal_type", &pdata->cal_type);


@@ -1192,6 +1196,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
		data->tmu_read = exynos4210_tmu_read;
		data->tmu_read = exynos4210_tmu_read;
		data->tmu_clear_irqs = exynos4210_tmu_clear_irqs;
		data->tmu_clear_irqs = exynos4210_tmu_clear_irqs;
		data->ntrip = 4;
		data->ntrip = 4;
		data->reference_voltage = 7;
		data->efuse_value = 55;
		data->efuse_value = 55;
		data->min_efuse_value = 40;
		data->min_efuse_value = 40;
		data->max_efuse_value = 100;
		data->max_efuse_value = 100;
@@ -1208,6 +1213,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
		data->tmu_set_emulation = exynos4412_tmu_set_emulation;
		data->tmu_set_emulation = exynos4412_tmu_set_emulation;
		data->tmu_clear_irqs = exynos4210_tmu_clear_irqs;
		data->tmu_clear_irqs = exynos4210_tmu_clear_irqs;
		data->ntrip = 4;
		data->ntrip = 4;
		data->reference_voltage = 16;
		data->efuse_value = 55;
		data->efuse_value = 55;
		if (data->soc != SOC_ARCH_EXYNOS5420 &&
		if (data->soc != SOC_ARCH_EXYNOS5420 &&
		    data->soc != SOC_ARCH_EXYNOS5420_TRIMINFO)
		    data->soc != SOC_ARCH_EXYNOS5420_TRIMINFO)
@@ -1223,6 +1229,10 @@ static int exynos_map_dt_data(struct platform_device *pdev)
		data->tmu_set_emulation = exynos4412_tmu_set_emulation;
		data->tmu_set_emulation = exynos4412_tmu_set_emulation;
		data->tmu_clear_irqs = exynos4210_tmu_clear_irqs;
		data->tmu_clear_irqs = exynos4210_tmu_clear_irqs;
		data->ntrip = 8;
		data->ntrip = 8;
		if (res.start == EXYNOS5433_G3D_BASE)
			data->reference_voltage = 23;
		else
			data->reference_voltage = 16;
		data->efuse_value = 75;
		data->efuse_value = 75;
		data->min_efuse_value = 40;
		data->min_efuse_value = 40;
		data->max_efuse_value = 150;
		data->max_efuse_value = 150;
@@ -1234,6 +1244,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
		data->tmu_set_emulation = exynos5440_tmu_set_emulation;
		data->tmu_set_emulation = exynos5440_tmu_set_emulation;
		data->tmu_clear_irqs = exynos5440_tmu_clear_irqs;
		data->tmu_clear_irqs = exynos5440_tmu_clear_irqs;
		data->ntrip = 4;
		data->ntrip = 4;
		data->reference_voltage = 16;
		data->efuse_value = 0x5d2d;
		data->efuse_value = 0x5d2d;
		data->min_efuse_value = 16;
		data->min_efuse_value = 16;
		data->max_efuse_value = 76;
		data->max_efuse_value = 76;
@@ -1245,6 +1256,7 @@ static int exynos_map_dt_data(struct platform_device *pdev)
		data->tmu_set_emulation = exynos4412_tmu_set_emulation;
		data->tmu_set_emulation = exynos4412_tmu_set_emulation;
		data->tmu_clear_irqs = exynos4210_tmu_clear_irqs;
		data->tmu_clear_irqs = exynos4210_tmu_clear_irqs;
		data->ntrip = 8;
		data->ntrip = 8;
		data->reference_voltage = 17;
		data->efuse_value = 75;
		data->efuse_value = 75;
		data->min_efuse_value = 15;
		data->min_efuse_value = 15;
		data->max_efuse_value = 100;
		data->max_efuse_value = 100;
+0 −4
Original line number Original line Diff line number Diff line
@@ -42,16 +42,12 @@ enum soc_type {
 * struct exynos_tmu_platform_data
 * struct exynos_tmu_platform_data
 * @gain: gain of amplifier in the positive-TC generator block
 * @gain: gain of amplifier in the positive-TC generator block
 *	0 < gain <= 15
 *	0 < gain <= 15
 * @reference_voltage: reference voltage of amplifier
 *	in the positive-TC generator block
 *	0 < reference_voltage <= 31
 * @cal_type: calibration type for temperature
 * @cal_type: calibration type for temperature
 *
 *
 * This structure is required for configuration of exynos_tmu driver.
 * This structure is required for configuration of exynos_tmu driver.
 */
 */
struct exynos_tmu_platform_data {
struct exynos_tmu_platform_data {
	u8 gain;
	u8 gain;
	u8 reference_voltage;


	u32 cal_type;
	u32 cal_type;
};
};