summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/sun8i_thermal.c
AgeCommit message (Collapse)Author
2020-11-12thermal: sun8i: Use bitmap API instead of open codeYangtao Li
The bitmap_* API is the standard way to access data in the bitfield. So convert irq_ack to return an unsigned long, and make things to use bitmap API. Signed-off-by: Yangtao Li <frank@allwinnertech.com> Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20201109114624.23035-1-frank@allwinnertech.com
2020-10-12thermal: sun8i: Add A100's THS controller supportYangtao Li
This patch add thermal sensor controller support for A100, which is similar to the previous ones. Signed-off-by: Yangtao Li <frank@allwinnertech.com> Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/48cc75920b5c69027134626157089d8b94942711.1595572867.git.frank@allwinnertech.com
2020-10-12thermal: sun8i: add TEMP_CALIB_MASK for calibration data in ↵Yangtao Li
sun50i_h6_ths_calibrate For sun50i_h6_ths_calibrate(), the data read from nvmem needs a round of calculation. On the other hand, the newer SOC may store other data in the space other than 12bit sensor data. Add mask operation to read data to avoid conversion error. Signed-off-by: Yangtao Li <frank@allwinnertech.com> Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/dcf98648c16aff7649ff82438bfce6caae3e176f.1595572867.git.frank@allwinnertech.com
2020-01-27thermal: sun8i: Add hwmon supportYangtao Li
Expose sun8i thermal as a HWMON device. Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20191228171904.24618-1-tiny.windzz@gmail.com
2020-01-27thermal: sun8i: Remove unused variable and unneeded macrosYangtao Li
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 <tiny.windzz@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20200112180925.23705-1-tiny.windzz@gmail.com
2020-01-27thermal: sun8i: Fix using plain integer as NULL pointer in ↵Yangtao Li
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 <lkp@intel.com> Signed-off-by: Yangtao Li <tiny.windzz@gmail.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20200112171318.23025-1-tiny.windzz@gmail.com
2020-01-27thermal: sun8i: Fix r40 ths numberYangtao Li
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 <tiny.windzz@gmail.com> Tested-by: Corentin Labbe <clabbe.montjoie@gmail.com> Tested-on: sun8i-r40-bananapi-m2-ultra Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20200106174639.20862-1-tiny.windzz@gmail.com
2020-01-27thermal/drivers/sun8i: Add thermal driver for H6/H5/H3/A64/A83T/R40Yangtao Li
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 <tiny.windzz@gmail.com> Signed-off-by: Ondrej Jirman <megous@megous.com> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20191219172823.1652600-2-anarsoul@gmail.com