Commit 3f16503b authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal

Pull thermal fixes from Eduardo Valentin:
 "Minor fixes to OF thermal, qoriq, and rcar drivers"

* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal:
  thermal: of-thermal: disable passive polling when thermal zone is disabled
  thermal: rcar_gen3_thermal: convert to SPDX identifiers
  thermal: rcar_thermal: convert to SPDX identifiers
  thermal: qoriq: Switch to SPDX identifier
  thermal: qoriq: Simplify the 'site' variable assignment
  thermal: qoriq: Use devm_thermal_zone_of_sensor_register()
parents 050cdc6c 152395fd
...@@ -260,10 +260,13 @@ static int of_thermal_set_mode(struct thermal_zone_device *tz, ...@@ -260,10 +260,13 @@ static int of_thermal_set_mode(struct thermal_zone_device *tz,
mutex_lock(&tz->lock); mutex_lock(&tz->lock);
if (mode == THERMAL_DEVICE_ENABLED) if (mode == THERMAL_DEVICE_ENABLED) {
tz->polling_delay = data->polling_delay; tz->polling_delay = data->polling_delay;
else tz->passive_delay = data->passive_delay;
} else {
tz->polling_delay = 0; tz->polling_delay = 0;
tz->passive_delay = 0;
}
mutex_unlock(&tz->lock); mutex_unlock(&tz->lock);
......
/* // SPDX-License-Identifier: GPL-2.0
* Copyright 2016 Freescale Semiconductor, Inc. //
* // Copyright 2016 Freescale Semiconductor, Inc.
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
*/
#include <linux/module.h> #include <linux/module.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
...@@ -197,7 +187,7 @@ static int qoriq_tmu_probe(struct platform_device *pdev) ...@@ -197,7 +187,7 @@ static int qoriq_tmu_probe(struct platform_device *pdev)
int ret; int ret;
struct qoriq_tmu_data *data; struct qoriq_tmu_data *data;
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
u32 site = 0; u32 site;
if (!np) { if (!np) {
dev_err(&pdev->dev, "Device OF-Node is NULL"); dev_err(&pdev->dev, "Device OF-Node is NULL");
...@@ -233,8 +223,9 @@ static int qoriq_tmu_probe(struct platform_device *pdev) ...@@ -233,8 +223,9 @@ static int qoriq_tmu_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
goto err_tmu; goto err_tmu;
data->tz = thermal_zone_of_sensor_register(&pdev->dev, data->sensor_id, data->tz = devm_thermal_zone_of_sensor_register(&pdev->dev,
data, &tmu_tz_ops); data->sensor_id,
data, &tmu_tz_ops);
if (IS_ERR(data->tz)) { if (IS_ERR(data->tz)) {
ret = PTR_ERR(data->tz); ret = PTR_ERR(data->tz);
dev_err(&pdev->dev, dev_err(&pdev->dev,
...@@ -243,7 +234,7 @@ static int qoriq_tmu_probe(struct platform_device *pdev) ...@@ -243,7 +234,7 @@ static int qoriq_tmu_probe(struct platform_device *pdev)
} }
/* Enable monitoring */ /* Enable monitoring */
site |= 0x1 << (15 - data->sensor_id); site = 0x1 << (15 - data->sensor_id);
tmu_write(data, site | TMR_ME | TMR_ALPF, &data->regs->tmr); tmu_write(data, site | TMR_ME | TMR_ALPF, &data->regs->tmr);
return 0; return 0;
...@@ -261,8 +252,6 @@ static int qoriq_tmu_remove(struct platform_device *pdev) ...@@ -261,8 +252,6 @@ static int qoriq_tmu_remove(struct platform_device *pdev)
{ {
struct qoriq_tmu_data *data = platform_get_drvdata(pdev); struct qoriq_tmu_data *data = platform_get_drvdata(pdev);
thermal_zone_of_sensor_unregister(&pdev->dev, data->tz);
/* Disable monitoring */ /* Disable monitoring */
tmu_write(data, TMR_DISABLE, &data->regs->tmr); tmu_write(data, TMR_DISABLE, &data->regs->tmr);
......
// SPDX-License-Identifier: GPL-2.0
/* /*
* R-Car Gen3 THS thermal sensor driver * R-Car Gen3 THS thermal sensor driver
* Based on rcar_thermal.c and work from Hien Dang and Khiem Nguyen. * Based on rcar_thermal.c and work from Hien Dang and Khiem Nguyen.
* *
* Copyright (C) 2016 Renesas Electronics Corporation. * Copyright (C) 2016 Renesas Electronics Corporation.
* Copyright (C) 2016 Sang Engineering * Copyright (C) 2016 Sang Engineering
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
*/ */
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/err.h> #include <linux/err.h>
......
// SPDX-License-Identifier: GPL-2.0
/* /*
* R-Car THS/TSC thermal sensor driver * R-Car THS/TSC thermal sensor driver
* *
* Copyright (C) 2012 Renesas Solutions Corp. * Copyright (C) 2012 Renesas Solutions Corp.
* Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> * Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/ */
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/err.h> #include <linux/err.h>
...@@ -660,6 +648,6 @@ static struct platform_driver rcar_thermal_driver = { ...@@ -660,6 +648,6 @@ static struct platform_driver rcar_thermal_driver = {
}; };
module_platform_driver(rcar_thermal_driver); module_platform_driver(rcar_thermal_driver);
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("R-Car THS/TSC thermal sensor driver"); MODULE_DESCRIPTION("R-Car THS/TSC thermal sensor driver");
MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>"); MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
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