Commit Graph

9 Commits

Author SHA1 Message Date
Bhaskar Chowdhury 76d6329534 thermal: Fix couple of spellos in the file sun8i_thermal.c
s/calibartion/calibration/
s/undocummented/undocumented/

Signed-off-by: Bhaskar Chowdhury <unixbhaskar@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210305014348.17412-1-unixbhaskar@gmail.com
2021-03-10 12:54:58 +01:00
Yangtao Li e01aac5353 thermal: sun8i: Use bitmap API instead of open code
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-11-12 11:05:12 +01:00
Yangtao Li 92ad897302 thermal: sun8i: Add A100's THS controller support
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-12 12:08:36 +02:00
Yangtao Li 771151bed9 thermal: sun8i: add TEMP_CALIB_MASK for calibration data in 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-10-12 12:08:36 +02:00
Yangtao Li 85f0ad2213 thermal: sun8i: Add hwmon support
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-27 11:41:08 +01:00
Yangtao Li 291292cddc thermal: sun8i: Remove unused variable and unneeded macros
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-27 11:41:08 +01:00
Yangtao Li 69d5f3a9c0 thermal: sun8i: Fix using plain integer as NULL pointer in 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-27 11:41:08 +01:00
Yangtao Li d8186285f1 thermal: sun8i: Fix r40 ths number
According to the spec, r40 has 2 thermal sensors.
Sensor0 located in the CPU, another in the GPU.

Fixes: dccc5c3b6f ("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-27 11:41:08 +01:00
Yangtao Li dccc5c3b6f thermal/drivers/sun8i: Add thermal driver for H6/H5/H3/A64/A83T/R40
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
2020-01-27 10:24:32 +01:00