aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-01-27thermal: stm32: Improve temperature computingPascal Paillet1-44/+14
Change the way of computing to avoid rounds by 1 or 2 degrees. Also simplify the sampling time management that is hard-coded to maximum value during probe. Signed-off-by: Pascal Paillet <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: stm32: Handle multiple trip pointsPascal Paillet1-212/+86
Let the thermal framework handle the trip points instead of custom code inside the driver. This is backward compatible, simplifies the driver and offers the possibility to the user to set any trip point he needs. stm_thermal_set_trips callback that is registered to set_trips ops to handle the low and high thresholds and replaces stm_thermal_set_threshold and stm_thermal_update_threshold functions. modify irq enable to handle the thresholds. Signed-off-by: Pascal Paillet <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: stm32: Disable interrupts at probePascal Paillet1-5/+14
In case of CPU reset, the interrupts could be enabled at boot time. Disable interrupts and clear flags. Signed-off-by: Pascal Paillet <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: stm32: Rework sensor mode managementPascal Paillet1-6/+4
Be sure get_temp returns an error while disabling or enabling the device. Set THERMAL_DEVICE_ENABLED state at the end of power on function. Set THERMAL_DEVICE_DISABLED state at the beginning of power off function. Signed-off-by: Pascal Paillet <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: stm32: Fix icifr register namePascal Paillet1-5/+5
Fix a mistake with the ICIFR register name. Signed-off-by: Pascal Paillet <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: of: Make thermal_zone_of_sensor_register return -ENODEV if a sensor ↵Peter Mamonov1-1/+1
OF node is missing When devm_thermal_zone_of_sensor_register() is called from hwmon_thermal_add_sensor() it is possible that the relevant sensor is missing an OF node. In this case thermal_zone_of_sensor_register() returns -EINVAL which causes hwmon_thermal_add_sensor() to fail as well. This patch changes relevant return code of thermal_zone_of_sensor_register() to -ENODEV, which is tolerated by hwmon_thermal_add_sensor(). Here is a particular case of such behaviour: the Marvell ethernet PHYs driver registers hwmon device for the built-in temperature sensor (see drivers/net/phy/marvell.c). Since the sensor doesn't have associated OF node devm_hwmon_device_register() returns error which ultimately causes failure of the PHY driver's probe function. Signed-off-by: Peter Mamonov <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: rcar_gen3_thermal: Remove temperature boundNiklas Söderlund1-3/+1
The hardware manual states that the operation of the sensor is not guaranteed with temperatures above 125°C, not that the readings are invalid. Remove the bound check and try to deliver temperature readings even if we are outside the guaranteed operation range. Signed-off-by: Niklas Söderlund <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: rcar_thermal: Remove temperature boundNiklas Söderlund1-6/+1
The hardware manual states that the operation of the sensor is not guaranteed outside the range of -45°C to 125°C, not that the readings are invalid. Remove the bound check and try to deliver temperature readings even if we are outside the guaranteed operation range. Signed-off-by: Niklas Söderlund <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: intel: intel_pch_thermal: Add Comet Lake (CML) platform supportGayatri Kammela1-0/+8
Add Comet Lake to the list of the platforms to support intel_pch_thermal driver. Cc: Zhang rui <[email protected]> Cc: Srinivas Pandruvada <[email protected]> Signed-off-by: Gayatri Kammela <[email protected]> Acked-by: Zhang Rui <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: intel: Fix unmatched pci_release_regionChuhong Yuan1-1/+1
The driver calls pci_request_regions() in probe and uses pci_release_regions() in probe failure. However, it calls pci_release_region() in remove, which does match the other two calls. Use pci_release_regions() instead to unify them. Signed-off-by: Chuhong Yuan <[email protected]> Acked-by: Zhang Rui <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: int340x: processor_thermal: Add Jasper Lake supportSwaminathan, Nivedita1-0/+4
Added new PCI id for Jasper Lake processor thermal device. Signed-off-by: Swaminathan, Nivedita <[email protected]> Signed-off-by: Srinivas Pandruvada <[email protected]> Acked-by: Zhang Rui <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27dt-bindings: brcm,avs-ro-thermal: Fix binding check issuesStefan Wahren1-3/+6
Drop the reg property since this only necessary for the parent and add the missing thermal-sensor-cells property description. Signed-off-by: Stefan Wahren <[email protected]> Fixes: 37e9cc08e9678 ("dt-bindings: Add Broadcom AVS RO thermal") Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: brcmstb_thermal: Register different ops per processFlorian Fainelli1-3/+12
Since we do not have interrupts on BCM7216, we cannot have trip point crossing, the thermal subsystem expects us to provide a NULL set_trips operation in that case, so make it possible to provide per-process thermal_zone_of_device_ops Reviewed-by: Amit Kucheria <[email protected]> Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: brcmstb_thermal: Restructure interrupt registrationFlorian Fainelli1-10/+9
If we are successful grabbing the interrupt resource, then register an interrupt handler, this makes it easier to support the interrupt as being optional, which is it for 7216. Reviewed-by: Amit Kucheria <[email protected]> Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: brcmstb_thermal: Add 16nm process thermal parametersFlorian Fainelli1-0/+6
Match the 7216 compatible string in order to derive the correct 16nm process thermal parameters to obtain correct readings. Reviewed-by: Amit Kucheria <[email protected]> Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27dt-bindings: thermal: Define BCM7216 thermal sensor compatibleFlorian Fainelli1-2/+6
BCM7216 is a 16nm process STB chip, which requires a different compatible string to differentiate different temperature formulas. Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: brcmstb_thermal: Prepare to support a different processFlorian Fainelli1-14/+33
The driver is currently assuming that it is operating with a 28nm process chip, which has a specific formula to convert temperature to a code and vice versa. Update the code to support providing two key values: offset and multiplier to derive the correct formulas. Signed-off-by: Florian Fainelli <[email protected]> Reviewed-by: Amit Kucheria <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: brcmstb_thermal: Do not use DT coefficientsFlorian Fainelli1-22/+9
At the time the brcmstb_thermal driver and its binding were merged, the DT binding did not make the coefficients properties a mandatory one, therefore all users of the brcmstb_thermal driver out there have a non functional implementation with zero coefficients. Even if these properties were provided, the formula used for computation is incorrect. The coefficients are entirely process specific (right now, only 28nm is supported) and not board or SoC specific, it is therefore appropriate to hard code them in the driver given the compatibility string we are probed with which has to be updated whenever a new process is introduced. We remove the existing coefficients definition since subsequent patches are going to add support for a new process and will introduce new coefficients as well. Fixes: 9e03cf1b2dd5 ("thermal: add brcmstb AVS TMON driver") Signed-off-by: Florian Fainelli <[email protected]> Reviewed-by: Amit Kucheria <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: rcar_thermal: Use usleep_range() instead of udelay()Geert Uytterhoeven1-1/+1
rcar_thermal_update_temp() takes a mutex, so it is always called in a context that can sleep. Hence replace the 300 µs busy loop by a call to usleep_range(), to allow other threads to run. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27ARM: configs: Build BCM2711 thermal as moduleStefan Wahren2-0/+2
This builds the BCM2711 thermal driver as module for the Raspberry Pi 4. Signed-off-by: Stefan Wahren <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Nicolas Saenz Julienne <[email protected]> Tested-by: Nicolas Saenz Julienne <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27ARM: dts: bcm2711: Enable thermalStefan Wahren1-0/+12
This enables thermal for the BCM2711 (used on Raspberry Pi 4) by adding the AVS monitor and a subnode for the thermal part. Signed-off-by: Stefan Wahren <[email protected]> Reviewed-by: Nicolas Saenz Julienne <[email protected]> Tested-by: Nicolas Saenz Julienne <[email protected]> Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: Add BCM2711 thermal driverStefan Wahren3-0/+131
This adds the thermal sensor driver for the Broadcom BCM2711 SoC, which is placed on the Raspberry Pi 4. The driver only provides SoC temperature reading so far. Signed-off-by: Stefan Wahren <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Nicolas Saenz Julienne <[email protected]> Tested-by: Nicolas Saenz Julienne <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27dt-bindings: Add Broadcom AVS RO thermalStefan Wahren1-0/+45
Since the BCM2711 doesn't have a AVS TMON block, the thermal information must be retrieved from the AVS ring oscillator block. This block is part of the AVS monitor which contains a bunch of raw sensors. Signed-off-by: Stefan Wahren <[email protected]> Reviewed-by: Rob Herring <[email protected]> Reviewed-by: Nicolas Saenz Julienne <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: sun8i: Add hwmon supportYangtao Li1-0/+6
Expose sun8i thermal as a HWMON device. Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: sun8i: Remove unused variable and unneeded macrosYangtao Li1-6/+0
The cp_ft_flag variable is not used after initialization, so delete it. After that, THS_EFUSE_CP_FT_MASK, THS_EFUSE_CP_FT_BIT and THS_CALIBRATION_IN_FT are not needed, so delete them. Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: sun8i: Fix using plain integer as NULL pointer in ↵Yangtao Li1-1/+1
sun8i_ths_resource_init sparse returns a warning: "drivers/thermal/sun8i_thermal.c:341:60: sparse: sparse: Using plain integer as NULL pointer". Fix it by replacing the zero integer by a NULL pointer. Reported-by: kbuild test robot <[email protected]> Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: sun8i: Fix r40 ths numberYangtao Li1-1/+1
According to the spec, r40 has 2 thermal sensors. Sensor0 located in the CPU, another in the GPU. Fixes: dccc5c3b6f30f ("thermal/drivers/sun8i: Add thermal driver for H6/H5/H3/A64/A83T/R40") Signed-off-by: Yangtao Li <[email protected]> Tested-by: Corentin Labbe <[email protected]> Tested-on: sun8i-r40-bananapi-m2-ultra Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: exynos: Rename Samsung and Exynos to lowercaseKrzysztof Kozlowski4-7/+7
Fix up inconsistent usage of upper and lowercase letters in "Samsung" and "Exynos" names. "SAMSUNG" and "EXYNOS" are not abbreviations but regular trademarked names. Therefore they should be written with lowercase letters starting with capital letter. The lowercase "Exynos" name is promoted by its manufacturer Samsung Electronics Co., Ltd., in advertisement materials and on website. Although advertisement materials usually use uppercase "SAMSUNG", the lowercase version is used in all legal aspects (e.g. on Wikipedia and in privacy/legal statements on https://www.samsung.com/semiconductor/privacy-global/). Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: generic-adc: silence info message for IIO_TEMP channelsMartin Blumenstingl1-1/+5
Since commit d36e2fa0253875 ("thermal: generic-adc: make lookup table optional") "generic-adc-thermal" can be used with an IIO_TEMP channel. In this case the following message is logged at probe time: no lookup table, assuming DAC channel returns milliCelcius Silence this info message if the channel type is known to be in milli celsius. Keep this message when the channel type is unknown or not of type temperature. Signed-off-by: Martin Blumenstingl <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: generic-adc: silence "no lookup table" on deferred probeMartin Blumenstingl1-7/+7
A "generic-adc-thermal" without "temperature-lookup-table" is perfectly valid since commit d36e2fa0253875 ("thermal: generic-adc: make lookup table optional"). On deferred probe the message "no lookup table, assuming DAC channel returns milliCelcius" is still logged. Prevent this message on deferred probe of the IIO channel by first looking up the IIO channel. Signed-off-by: Martin Blumenstingl <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27dt-bindings: thermal: Add YAML schema for sun8i-thermal driver bindingsYangtao Li1-0/+160
sun8i-thermal driver supports thermal sensor in wide range of Allwinner SoCs. Add YAML schema for its bindings. Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Vasily Khoruzhick <[email protected]> Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal/drivers/sun8i: Add thermal driver for H6/H5/H3/A64/A83T/R40Yangtao Li4-0/+662
This patch adds the support for allwinner thermal sensor, within allwinner SoC. It will register sensors for thermal framework and use device tree to bind cooling device. Signed-off-by: Yangtao Li <[email protected]> Signed-off-by: Ondrej Jirman <[email protected]> Signed-off-by: Vasily Khoruzhick <[email protected]> Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal/drivers/of-thermal: Move the of_thermal_free_zone() to the init sectionDaniel Lezcano1-1/+1
The function of_thermal_free_zone() is only used the initialization function which all belonging to the init section. Move it also to the __init section. Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal/drivers/of-thermal: Make of_thermal_destroy_zones staticDaniel Lezcano2-34/+32
The function of_thermal_destroy_zones() is only used internally by the of_parse_thermal_zones() for rollbacking in case of error. Make it static and tag it as an __init function. Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal/drivers/cpu_cooling: Rename to cpufreq_coolingDaniel Lezcano6-8/+8
As we introduced the idle injection cooling device called cpuidle_cooling, let's be consistent and rename the cpu_cooling to cpufreq_cooling as this one mitigates with OPPs changes. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Viresh Kumar <[email protected]> Reviewed-by: Amit Kucheria <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal/drivers/cpu_cooling: Introduce the cpu idle cooling driverDaniel Lezcano5-0/+261
The cpu idle cooling device offers a new method to cool down a CPU by injecting idle cycles at runtime. It has some similarities with the intel power clamp driver but it is actually designed to be more generic and relying on the idle injection powercap framework. The idle injection duration is fixed while the running duration is variable. That allows to have control on the device reactivity for the user experience. An idle state powering down the CPU or the cluster will allow to drop the static leakage, thus restoring the heat capacity of the SoC. It can be set with a trip point between the hot and the critical points, giving the opportunity to prevent a hard reset of the system when the cpufreq cooling fails to cool down the CPU. With more sophisticated boards having a per core sensor, the idle cooling device allows to cool down a single core without throttling the compute capacity of several cpus belonging to the same clock line, so it could be used in collaboration with the cpufreq cooling device. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Viresh Kumar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal/drivers/cpu_cooling: Add idle cooling device documentationDaniel Lezcano1-0/+189
Provide some documentation for the idle injection cooling effect in order to let people to understand the rational of the approach for the idle injection CPU cooling device. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Viresh Kumar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: rockchip: Enable hwmonStefan Schaeckeler1-1/+11
By default, of-based thermal drivers do not enable hwmon. Explicitly enable hwmon for both, the soc and gpu temperature sensor. Signed-off-by: Stefan Schaeckeler <[email protected]> Tested-by: Daniel Lezcano <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: armada: Clear reset in armadaxp_initZak Hays1-0/+3
The reset bit needs to be cleared in the init sequence otherwise it holds the block in reset. Signed-off-by: Zachary Hays <[email protected]> Reviewed-by: Miquel Raynal <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/BN8PR10MB33797EECAC557B5018A0A6628C580@BN8PR10MB3379.namprd10.prod.outlook.com
2020-01-27thermal: armada: Fix register offsets for AXPZak Hays1-1/+1
As shown in its device tree, Armada XP has the control1 register at 0x184d0, not 0x182d0. Signed-off-by: Zachary Hays <[email protected]> Reviewed-by: Miquel Raynal <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/BN8PR10MB337990B7688320D736760BB68C580@BN8PR10MB3379.namprd10.prod.outlook.com
2020-01-27thermal/drivers/Kconfig: Convert the CPU cooling device to a choiceDaniel Lezcano3-6/+16
The next changes will add a new way to cool down a CPU by injecting idle cycles. With the current configuration, a CPU cooling device is the cpufreq cooling device. As we want to add a new CPU cooling device, let's convert the CPU cooling to a choice giving a list of CPU cooling devices. At this point, there is obviously only one CPU cooling device. There is no functional changes. Signed-off-by: Daniel Lezcano <[email protected]> Acked-by: Viresh Kumar <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: qoriq: Add hwmon supportAndrey Smirnov1-0/+6
Expose thermal readings as a HWMON device, so that it could be accessed using lm-sensors. Signed-off-by: Andrey Smirnov <[email protected]> Reviewed-by: Daniel Lezcano <[email protected]> Tested-by: Lucas Stach <[email protected]> Cc: Chris Healy <[email protected]> Cc: Lucas Stach <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Daniel Lezcano <[email protected]> Cc: Angus Ainslie (Purism) <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal_hwmon: Add devres wrapper for thermal_add_hwmon_sysfs()Andrey Smirnov2-0/+35
Add devres wrapper for thermal_add_hwmon_sysfs() to simplify driver code. Signed-off-by: Andrey Smirnov <[email protected]> Reviewed-by: Daniel Lezcano <[email protected]> Tested-by: Lucas Stach <[email protected]> Cc: Chris Healy <[email protected]> Cc: Lucas Stach <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Daniel Lezcano <[email protected]> Cc: Angus Ainslie (Purism) <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: qoriq: Do not report invalid temperature readingAndrey Smirnov1-1/+18
Before returning measured temperature data to upper layer we need to make sure that the reading was marked as "valid" to avoid reporting bogus data. Signed-off-by: Andrey Smirnov <[email protected]> Reviewed-by: Daniel Lezcano <[email protected]> Tested-by: Lucas Stach <[email protected]> Cc: Chris Healy <[email protected]> Cc: Lucas Stach <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Daniel Lezcano <[email protected]> Cc: Angus Ainslie (Purism) <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: qoriq: Enable all sensors before registering themAndrey Smirnov1-19/+12
Tmu_get_temp will get called as a part of sensor registration via devm_thermal_zone_of_sensor_register(). To prevent it from retruning bogus data we need to enable sensor monitoring before that. Looking at the datasheet (i.MX8MQ RM) there doesn't seem to be any harm in enabling them all, so, for the sake of simplicity, change the code to do just that. Signed-off-by: Andrey Smirnov <[email protected]> Tested-by: Lucas Stach <[email protected]> Cc: Chris Healy <[email protected]> Cc: Lucas Stach <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Daniel Lezcano <[email protected]> Cc: Angus Ainslie (Purism) <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: qoriq: Convert driver to use regmap APIAndrey Smirnov1-130/+99
Convert driver to use regmap API, drop custom LE/BE IO helpers and simplify bit manipulation using regmap_update_bits(). This also allows us to convert some register initialization to use loops and adds convenient debug access to TMU registers via debugfs. Signed-off-by: Andrey Smirnov <[email protected]> Reviewed-by: Daniel Lezcano <[email protected]> Tested-by: Lucas Stach <[email protected]> Cc: Chris Healy <[email protected]> Cc: Lucas Stach <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Daniel Lezcano <[email protected]> Cc: Angus Ainslie (Purism) <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: qoriq: Drop unnecessary drvdata cleanupAndrey Smirnov1-2/+0
Driver data of underlying struct device will be set to NULL by Linux's driver infrastructure. Clearing it here is unnecessary. Signed-off-by: Andrey Smirnov <[email protected]> Reviewed-by: Daniel Lezcano <[email protected]> Tested-by: Lucas Stach <[email protected]> Cc: Chris Healy <[email protected]> Cc: Lucas Stach <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Daniel Lezcano <[email protected]> Cc: Angus Ainslie (Purism) <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: qoriq: Pass data to qoriq_tmu_calibration() directlyAndrey Smirnov1-10/+9
We can simplify error cleanup code if instead of passing a "struct platform_device *" to qoriq_tmu_calibration() and deriving a bunch of pointers from it, we pass those pointers directly. This way we won't be force to call platform_set_drvdata() as early in qoriq_tmu_probe() and need to have "platform_set_drvdata(pdev, NULL);" in error path. Signed-off-by: Andrey Smirnov <[email protected]> Reviewed-by: Daniel Lezcano <[email protected]> Tested-by: Lucas Stach <[email protected]> Cc: Chris Healy <[email protected]> Cc: Lucas Stach <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Daniel Lezcano <[email protected]> Cc: Angus Ainslie (Purism) <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: qoriq: Pass data to qoriq_tmu_register_tmu_zone() directlyAndrey Smirnov1-4/+4
Pass all necessary data to qoriq_tmu_register_tmu_zone() directly instead of passing a platform device and then deriving it. This is done as a first step to simplify resource deallocation code. Signed-off-by: Andrey Smirnov <[email protected]> Acked-by: Daniel Lezcano <[email protected]> Tested-by: Lucas Stach <[email protected]> Cc: Chris Healy <[email protected]> Cc: Lucas Stach <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Daniel Lezcano <[email protected]> Cc: Angus Ainslie (Purism) <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2020-01-27thermal: qoriq: Embed per-sensor data into struct qoriq_tmu_dataAndrey Smirnov1-15/+8
Embed per-sensor data into struct qoriq_tmu_data so we can drop the code allocating it. This also allows us to get rid of per-sensor back reference to struct qoriq_tmu_data since now its address can be calculated using container_of(). Signed-off-by: Andrey Smirnov <[email protected]> Cc: Chris Healy <[email protected]> Cc: Lucas Stach <[email protected]> Cc: Zhang Rui <[email protected]> Cc: Eduardo Valentin <[email protected]> Cc: Daniel Lezcano <[email protected]> Cc: Angus Ainslie (Purism) <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]