struct thermal_zone_device *tzd = data->tzd;
const struct thermal_trip * const trips =
of_thermal_get_trip_points(tzd);
+ unsigned int status;
int ret = 0, temp;
if (!trips) {
clk_enable(data->clk);
if (!IS_ERR(data->clk_sec))
clk_enable(data->clk_sec);
- ret = data->tmu_initialize(pdev);
+
+ status = readb(data->base + EXYNOS_TMU_REG_STATUS);
+ if (!status)
+ ret = -EBUSY;
+ else
+ ret = data->tmu_initialize(pdev);
+
clk_disable(data->clk);
mutex_unlock(&data->lock);
if (!IS_ERR(data->clk_sec))
of_thermal_get_trip_points(tz);
int ret = 0, threshold_code, i;
unsigned long reference, temp;
- unsigned int status;
-
- status = readb(data->base + EXYNOS_TMU_REG_STATUS);
- if (!status) {
- ret = -EBUSY;
- goto out;
- }
sanitize_temp_error(data, readl(data->base + EXYNOS_TMU_REG_TRIMINFO));
struct exynos_tmu_data *data = platform_get_drvdata(pdev);
const struct thermal_trip * const trips =
of_thermal_get_trip_points(data->tzd);
- unsigned int status, trim_info, con, ctrl, rising_threshold;
+ unsigned int trim_info, con, ctrl, rising_threshold;
int ret = 0, threshold_code, i;
unsigned long crit_temp = 0;
- status = readb(data->base + EXYNOS_TMU_REG_STATUS);
- if (!status) {
- ret = -EBUSY;
- goto out;
- }
-
if (data->soc == SOC_ARCH_EXYNOS3250 ||
data->soc == SOC_ARCH_EXYNOS4412 ||
data->soc == SOC_ARCH_EXYNOS5250) {
con |= (1 << EXYNOS_TMU_THERM_TRIP_EN_SHIFT);
writel(con, data->base + EXYNOS_TMU_REG_CONTROL);
-out:
return ret;
}
{
struct exynos_tmu_data *data = platform_get_drvdata(pdev);
struct thermal_zone_device *tz = data->tzd;
- unsigned int status, trim_info;
+ unsigned int trim_info;
unsigned int rising_threshold = 0, falling_threshold = 0;
int temp, temp_hist;
int ret = 0, threshold_code, i, sensor_id, cal_type;
- status = readb(data->base + EXYNOS_TMU_REG_STATUS);
- if (!status) {
- ret = -EBUSY;
- goto out;
- }
-
trim_info = readl(data->base + EXYNOS_TMU_REG_TRIMINFO);
sanitize_temp_error(data, trim_info);
}
data->tmu_clear_irqs(data);
-out:
+
return ret;
}
{
struct exynos_tmu_data *data = platform_get_drvdata(pdev);
struct thermal_zone_device *tz = data->tzd;
- unsigned int status, trim_info;
+ unsigned int trim_info;
unsigned int rising_threshold = 0, falling_threshold = 0;
int ret = 0, threshold_code, i;
int temp, temp_hist;
unsigned int reg_off, bit_off;
- status = readb(data->base + EXYNOS_TMU_REG_STATUS);
- if (!status) {
- ret = -EBUSY;
- goto out;
- }
-
trim_info = readl(data->base + EXYNOS_TMU_REG_TRIMINFO);
data->temp_error1 = trim_info & EXYNOS7_TMU_TEMP_MASK;
}
data->tmu_clear_irqs(data);
-out:
+
return ret;
}