Commit be88fef3 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'thermal-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux

Pull thermal fixes from Daniel Lezcano:

 - Fix undefined temperature if negative on the rcar_gen3 (Dien Pham)

 - Fix wrong frequency converted from power for the cpufreq cooling
   device (Finley Xiao)

 - Fix compilation warnings by making functions static in the tsens
   driver (Amit Kucheria)

 - Fix return value of sprd_thm_probe for the Spreadtrum driver
   (Tiezhu Yang)

 - Fix bank number settings on the Mediatek mt8183 (Michael Kao)

 - Fix missing of_node_put() at probe time i.MX (Anson Huang)

* tag 'thermal-v5.8-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux:
  thermal/drivers/rcar_gen3: Fix undefined temperature if negative
  thermal/drivers/cpufreq_cooling: Fix wrong frequency converted from power
  thermal/drivers/tsens: Fix compilation warnings by making functions static
  thermal/drivers/sprd: Fix return value of sprd_thm_probe()
  thermal/drivers/mediatek: Fix bank number settings on mt8183
  thermal/drivers: imx: Fix missing of_node_put() at probe time
parents 2cfa46da 5f8f0642
...@@ -123,12 +123,12 @@ static u32 cpu_power_to_freq(struct cpufreq_cooling_device *cpufreq_cdev, ...@@ -123,12 +123,12 @@ static u32 cpu_power_to_freq(struct cpufreq_cooling_device *cpufreq_cdev,
{ {
int i; int i;
for (i = cpufreq_cdev->max_level - 1; i >= 0; i--) { for (i = cpufreq_cdev->max_level; i >= 0; i--) {
if (power > cpufreq_cdev->em->table[i].power) if (power >= cpufreq_cdev->em->table[i].power)
break; break;
} }
return cpufreq_cdev->em->table[i + 1].frequency; return cpufreq_cdev->em->table[i].frequency;
} }
/** /**
......
...@@ -649,7 +649,7 @@ MODULE_DEVICE_TABLE(of, of_imx_thermal_match); ...@@ -649,7 +649,7 @@ MODULE_DEVICE_TABLE(of, of_imx_thermal_match);
static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data) static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
{ {
struct device_node *np; struct device_node *np;
int ret; int ret = 0;
data->policy = cpufreq_cpu_get(0); data->policy = cpufreq_cpu_get(0);
if (!data->policy) { if (!data->policy) {
...@@ -664,11 +664,12 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data) ...@@ -664,11 +664,12 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)
if (IS_ERR(data->cdev)) { if (IS_ERR(data->cdev)) {
ret = PTR_ERR(data->cdev); ret = PTR_ERR(data->cdev);
cpufreq_cpu_put(data->policy); cpufreq_cpu_put(data->policy);
return ret;
} }
} }
return 0; of_node_put(np);
return ret;
} }
static void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data) static void imx_thermal_unregister_legacy_cooling(struct imx_thermal_data *data)
......
...@@ -211,6 +211,9 @@ enum { ...@@ -211,6 +211,9 @@ enum {
/* The total number of temperature sensors in the MT8183 */ /* The total number of temperature sensors in the MT8183 */
#define MT8183_NUM_SENSORS 6 #define MT8183_NUM_SENSORS 6
/* The number of banks in the MT8183 */
#define MT8183_NUM_ZONES 1
/* The number of sensing points per bank */ /* The number of sensing points per bank */
#define MT8183_NUM_SENSORS_PER_ZONE 6 #define MT8183_NUM_SENSORS_PER_ZONE 6
...@@ -497,7 +500,7 @@ static const struct mtk_thermal_data mt7622_thermal_data = { ...@@ -497,7 +500,7 @@ static const struct mtk_thermal_data mt7622_thermal_data = {
*/ */
static const struct mtk_thermal_data mt8183_thermal_data = { static const struct mtk_thermal_data mt8183_thermal_data = {
.auxadc_channel = MT8183_TEMP_AUXADC_CHANNEL, .auxadc_channel = MT8183_TEMP_AUXADC_CHANNEL,
.num_banks = MT8183_NUM_SENSORS_PER_ZONE, .num_banks = MT8183_NUM_ZONES,
.num_sensors = MT8183_NUM_SENSORS, .num_sensors = MT8183_NUM_SENSORS,
.vts_index = mt8183_vts_index, .vts_index = mt8183_vts_index,
.cali_val = MT8183_CALIBRATION, .cali_val = MT8183_CALIBRATION,
......
...@@ -382,7 +382,7 @@ static inline u32 masked_irq(u32 hw_id, u32 mask, enum tsens_ver ver) ...@@ -382,7 +382,7 @@ static inline u32 masked_irq(u32 hw_id, u32 mask, enum tsens_ver ver)
* *
* Return: IRQ_HANDLED * Return: IRQ_HANDLED
*/ */
irqreturn_t tsens_critical_irq_thread(int irq, void *data) static irqreturn_t tsens_critical_irq_thread(int irq, void *data)
{ {
struct tsens_priv *priv = data; struct tsens_priv *priv = data;
struct tsens_irq_data d; struct tsens_irq_data d;
...@@ -452,7 +452,7 @@ irqreturn_t tsens_critical_irq_thread(int irq, void *data) ...@@ -452,7 +452,7 @@ irqreturn_t tsens_critical_irq_thread(int irq, void *data)
* *
* Return: IRQ_HANDLED * Return: IRQ_HANDLED
*/ */
irqreturn_t tsens_irq_thread(int irq, void *data) static irqreturn_t tsens_irq_thread(int irq, void *data)
{ {
struct tsens_priv *priv = data; struct tsens_priv *priv = data;
struct tsens_irq_data d; struct tsens_irq_data d;
...@@ -520,7 +520,7 @@ irqreturn_t tsens_irq_thread(int irq, void *data) ...@@ -520,7 +520,7 @@ irqreturn_t tsens_irq_thread(int irq, void *data)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
int tsens_set_trips(void *_sensor, int low, int high) static int tsens_set_trips(void *_sensor, int low, int high)
{ {
struct tsens_sensor *s = _sensor; struct tsens_sensor *s = _sensor;
struct tsens_priv *priv = s->priv; struct tsens_priv *priv = s->priv;
...@@ -557,7 +557,7 @@ int tsens_set_trips(void *_sensor, int low, int high) ...@@ -557,7 +557,7 @@ int tsens_set_trips(void *_sensor, int low, int high)
return 0; return 0;
} }
int tsens_enable_irq(struct tsens_priv *priv) static int tsens_enable_irq(struct tsens_priv *priv)
{ {
int ret; int ret;
int val = tsens_version(priv) > VER_1_X ? 7 : 1; int val = tsens_version(priv) > VER_1_X ? 7 : 1;
...@@ -570,7 +570,7 @@ int tsens_enable_irq(struct tsens_priv *priv) ...@@ -570,7 +570,7 @@ int tsens_enable_irq(struct tsens_priv *priv)
return ret; return ret;
} }
void tsens_disable_irq(struct tsens_priv *priv) static void tsens_disable_irq(struct tsens_priv *priv)
{ {
regmap_field_write(priv->rf[INT_EN], 0); regmap_field_write(priv->rf[INT_EN], 0);
} }
......
...@@ -167,7 +167,7 @@ static int rcar_gen3_thermal_get_temp(void *devdata, int *temp) ...@@ -167,7 +167,7 @@ static int rcar_gen3_thermal_get_temp(void *devdata, int *temp)
{ {
struct rcar_gen3_thermal_tsc *tsc = devdata; struct rcar_gen3_thermal_tsc *tsc = devdata;
int mcelsius, val; int mcelsius, val;
u32 reg; int reg;
/* Read register and convert to mili Celsius */ /* Read register and convert to mili Celsius */
reg = rcar_gen3_thermal_read(tsc, REG_GEN3_TEMP) & CTEMP_MASK; reg = rcar_gen3_thermal_read(tsc, REG_GEN3_TEMP) & CTEMP_MASK;
......
...@@ -348,8 +348,8 @@ static int sprd_thm_probe(struct platform_device *pdev) ...@@ -348,8 +348,8 @@ static int sprd_thm_probe(struct platform_device *pdev)
thm->var_data = pdata; thm->var_data = pdata;
thm->base = devm_platform_ioremap_resource(pdev, 0); thm->base = devm_platform_ioremap_resource(pdev, 0);
if (!thm->base) if (IS_ERR(thm->base))
return -ENOMEM; return PTR_ERR(thm->base);
thm->nr_sensors = of_get_child_count(np); thm->nr_sensors = of_get_child_count(np);
if (thm->nr_sensors == 0 || thm->nr_sensors > SPRD_THM_MAX_SENSOR) { if (thm->nr_sensors == 0 || thm->nr_sensors > SPRD_THM_MAX_SENSOR) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment