The TI thermal framework is a non existing entity in mainline kernel. It is a framework present inside TI android tree. This patch removes references to this config entry from the SCM driver code.
Signed-off-by: Eduardo Valentin eduardo.valentin@ti.com --- drivers/mfd/omap4460plus_temp_sensor.c | 153 +------------------------------ drivers/mfd/omap4plus_scm.c | 9 -- include/linux/mfd/omap4_scm.h | 4 +- 3 files changed, 6 insertions(+), 160 deletions(-)
diff --git a/drivers/mfd/omap4460plus_temp_sensor.c b/drivers/mfd/omap4460plus_temp_sensor.c index acf8c10..18140b7 100644 --- a/drivers/mfd/omap4460plus_temp_sensor.c +++ b/drivers/mfd/omap4460plus_temp_sensor.c @@ -40,9 +40,7 @@ #include <linux/mfd/omap4_scm.h> #include <mach/ctrl_module_core_44xx.h>
-#ifdef CONFIG_THERMAL_FRAMEWORK -#include <linux/thermal_framework.h> -#elif defined(CONFIG_CPU_THERMAL) +#if defined(CONFIG_CPU_THERMAL) #include <linux/thermal.h> #include <linux/omap_thermal.h> #include <linux/platform_data/omap4_thermal_data.h> @@ -810,90 +808,7 @@ int omap4460_tshut_init(struct scm *scm_ptr) return 0; }
-#ifdef CONFIG_THERMAL_FRAMEWORK -static int omap_report_temp(struct thermal_dev *tdev) -{ - struct platform_device *pdev = to_platform_device(tdev->dev); - struct scm *scm_ptr = platform_get_drvdata(pdev); - int id = tdev->sen_id; - - scm_ptr->therm_fw[id]->current_temp = - omap4460plus_scm_read_temp(scm_ptr, id); - - if (scm_ptr->therm_fw[id]->current_temp != -EINVAL) { - thermal_sensor_set_temp(scm_ptr->therm_fw[id]); - kobject_uevent(&scm_ptr->tsh_ptr[id].pdev->dev.kobj, - KOBJ_CHANGE); - } - - return scm_ptr->therm_fw[id]->current_temp; -} - -static int omap_set_temp_thresh(struct thermal_dev *tdev, int min, int max) -{ - struct platform_device *pdev = to_platform_device(tdev->dev); - struct scm *scm_ptr = platform_get_drvdata(pdev); - int ret, t_cold, t_hot, thresh_val, hot, cold; - int id = tdev->sen_id; - struct omap4460plus_temp_sensor_registers *tsr; - - tsr = scm_ptr->registers[id]; - t_cold = temp_to_adc_conversion(min, scm_ptr, id); - t_hot = temp_to_adc_conversion(max, scm_ptr, id); - - thresh_val = omap4plus_scm_readl(scm_ptr, tsr->bgap_threshold); - hot = (thresh_val & tsr->threshold_thot_mask) >> - __ffs(tsr->threshold_thot_mask); - cold = (thresh_val & tsr->threshold_tcold_mask) >> - __ffs(tsr->threshold_tcold_mask); - - if (t_hot < cold) { - ret = omap4460plus_scm_set_temp_max_hyst(scm_ptr, id, min); - ret = omap4460plus_scm_set_temp_max(scm_ptr, id, max); - } else { - ret = omap4460plus_scm_set_temp_max(scm_ptr, id, max); - ret = omap4460plus_scm_set_temp_max_hyst(scm_ptr, id, min); - } - - return ret; -} - -static int omap_set_measuring_rate(struct thermal_dev *tdev, int rate) -{ - struct platform_device *pdev = to_platform_device(tdev->dev); - struct scm *scm_ptr = platform_get_drvdata(pdev); - int id = tdev->sen_id; - - omap4460plus_scm_set_update_interval(scm_ptr, rate, id); - - return rate; -} - -static int omap_report_slope(struct thermal_dev *tdev) -{ - struct platform_device *pdev = to_platform_device(tdev->dev); - struct scm *scm_ptr = platform_get_drvdata(pdev); - int id = tdev->sen_id; - return scm_ptr->therm_fw[id]->slope; -} - -static int omap_report_offset(struct thermal_dev *tdev) -{ - struct platform_device *pdev = to_platform_device(tdev->dev); - struct scm *scm_ptr = platform_get_drvdata(pdev); - int id = tdev->sen_id; - - return scm_ptr->therm_fw[id]->constant_offset; -} - -static struct thermal_dev_ops omap_sensor_ops = { - .report_temp = omap_report_temp, - .set_temp_thresh = omap_set_temp_thresh, - .set_temp_report_rate = omap_set_measuring_rate, - .init_slope = omap_report_slope, - .init_offset = omap_report_offset -}; -#elif defined(CONFIG_CPU_THERMAL) +#if defined(CONFIG_CPU_THERMAL)
struct omap_thermal_zone *omap_zones[3];
@@ -1020,14 +935,7 @@ int omap4460plus_temp_sensor_init(struct scm *scm_ptr) goto fail_alloc; }
-#ifdef CONFIG_THERMAL_FRAMEWORK - scm_ptr->therm_fw = kzalloc(sizeof(struct thermal_dev *) - * scm_ptr->cnt, GFP_KERNEL); - if (!scm_ptr->therm_fw) { - pr_err("Unable to allocate memory for ts data\n"); - return -ENOMEM; - } -#elif defined(CONFIG_CPU_THERMAL) +#if defined(CONFIG_CPU_THERMAL) scm_ptr->cpu_therm = kzalloc(sizeof(struct thermal_sensor_conf) * scm_ptr->cnt, GFP_KERNEL); if (!scm_ptr->cpu_therm) { @@ -1037,10 +945,6 @@ int omap4460plus_temp_sensor_init(struct scm *scm_ptr) #endif
for (i = 0; i < scm_ptr->cnt; i++) { -#ifdef CONFIG_THERMAL_FRAMEWORK - scm_ptr->therm_fw[i] = - kzalloc(sizeof(struct thermal_dev), GFP_KERNEL); -#endif scm_ptr->regval[i] = kzalloc(sizeof(struct scm_regval), GFP_KERNEL); } @@ -1057,22 +961,7 @@ int omap4460plus_temp_sensor_init(struct scm *scm_ptr) if (!omap4plus_scm_readl(scm_ptr, scm_ptr->registers[0]->bgap_efuse)) pr_info("Non-trimmed BGAP, Temp not accurate\n"); -#ifdef CONFIG_THERMAL_FRAMEWORK - if (scm_ptr->therm_fw) { - scm_ptr->therm_fw[0]->name = "omap_ondie_sensor"; - scm_ptr->therm_fw[0]->domain_name = "cpu"; - scm_ptr->therm_fw[0]->dev = scm_ptr->dev; - scm_ptr->therm_fw[0]->dev_ops = &omap_sensor_ops; - scm_ptr->therm_fw[0]->sen_id = 0; - scm_ptr->therm_fw[0]->slope = 376; - scm_ptr->therm_fw[0]->constant_offset = -16000; - thermal_sensor_dev_register(scm_ptr->therm_fw[0]); - } else { - pr_err("%s:Cannot alloc memory for thermal fw\n", - __func__); - ret = -ENOMEM; - } -#elif defined(CONFIG_CPU_THERMAL) +#if defined(CONFIG_CPU_THERMAL) strncpy(scm_ptr->cpu_therm[0].name, "omap_ondie_sensor", SENSOR_NAME_LEN); scm_ptr->cpu_therm[0].private_data = scm_ptr; @@ -1093,39 +982,7 @@ int omap4460plus_temp_sensor_init(struct scm *scm_ptr) scm_ptr->registers[2] = &omap5430_core_temp_sensor_registers; scm_ptr->ts_data[2] = &omap5430_core_temp_sensor_data; scm_ptr->conv_table = omap5430_adc_to_temp; -#ifdef CONFIG_THERMAL_FRAMEWORK - if (scm_ptr->therm_fw) { - scm_ptr->therm_fw[0]->name = "omap_ondie_mpu_sensor"; - scm_ptr->therm_fw[0]->domain_name = "cpu"; - scm_ptr->therm_fw[0]->dev = scm_ptr->dev; - scm_ptr->therm_fw[0]->dev_ops = &omap_sensor_ops; - scm_ptr->therm_fw[0]->sen_id = 0; - scm_ptr->therm_fw[0]->slope = 196; - scm_ptr->therm_fw[0]->constant_offset = -6822; - thermal_sensor_dev_register(scm_ptr->therm_fw[0]); - scm_ptr->therm_fw[1]->name = "omap_ondie_gpu_sensor"; - scm_ptr->therm_fw[1]->domain_name = "gpu"; - scm_ptr->therm_fw[1]->dev = scm_ptr->dev; - scm_ptr->therm_fw[1]->dev_ops = &omap_sensor_ops; - scm_ptr->therm_fw[1]->sen_id = 1; - scm_ptr->therm_fw[1]->slope = 0; - scm_ptr->therm_fw[1]->constant_offset = 7000; - thermal_sensor_dev_register(scm_ptr->therm_fw[1]); - scm_ptr->therm_fw[2]->name = "omap_ondie_core_sensor"; - scm_ptr->therm_fw[2]->domain_name = "core"; - scm_ptr->therm_fw[2]->dev = scm_ptr->dev; - scm_ptr->therm_fw[2]->dev_ops = &omap_sensor_ops; - scm_ptr->therm_fw[2]->sen_id = 2; - scm_ptr->therm_fw[2]->slope = 0; - scm_ptr->therm_fw[2]->constant_offset = 0; - thermal_sensor_dev_register(scm_ptr->therm_fw[2]); - /*TO DO: Add for GPU and core */ - } else { - pr_err("%s:Cannot alloc memory for thermal fw\n", - __func__); - ret = -ENOMEM; - } -#elif defined(CONFIG_CPU_THERMAL) +#if defined(CONFIG_CPU_THERMAL) strncpy(scm_ptr->cpu_therm[0].name, "omap_ondie_sensor", SENSOR_NAME_LEN); scm_ptr->cpu_therm[0].private_data = scm_ptr; diff --git a/drivers/mfd/omap4plus_scm.c b/drivers/mfd/omap4plus_scm.c index 20df540..a54d3fe 100644 --- a/drivers/mfd/omap4plus_scm.c +++ b/drivers/mfd/omap4plus_scm.c @@ -39,10 +39,6 @@ #include <plat/scm.h> #include <linux/mfd/omap4_scm.h>
-#ifdef CONFIG_THERMAL_FRAMEWORK -#include <linux/thermal_framework.h> -#endif - #ifdef CONFIG_CPU_THERMAL #include <linux/thermal.h> #include <linux/omap_thermal.h> @@ -124,11 +120,6 @@ static irqreturn_t talert_irq_handler(int irq, void *data) temp &= tsr->bgap_dtemp_mask;
if (t_hot || t_cold) { -#ifdef CONFIG_THERMAL_FRAMEWORK - scm_ptr->therm_fw[i]->current_temp = - adc_to_temp_conversion(scm_ptr, i, temp); - thermal_sensor_set_temp(scm_ptr->therm_fw[i]); -#endif #ifdef CONFIG_CPU_THERMAL if (omap_zones[0]) omap4_report_trigger(omap_zones[0]); diff --git a/include/linux/mfd/omap4_scm.h b/include/linux/mfd/omap4_scm.h index 43db7a3..9a700de 100644 --- a/include/linux/mfd/omap4_scm.h +++ b/include/linux/mfd/omap4_scm.h @@ -133,9 +133,7 @@ struct scm { struct device *dev; struct omap4460plus_temp_sensor_data **ts_data; struct omap4460plus_temp_sensor_registers **registers; -#if defined(CONFIG_THERMAL_FRAMEWORK) - struct thermal_dev **therm_fw; -#elif defined(CONFIG_CPU_THERMAL) +#if defined(CONFIG_CPU_THERMAL) struct thermal_sensor_conf *cpu_therm; #endif struct scm_regval **regval;