1
0
Fork 0

thermal: sun8i: get ths init func from device compatible

There are some differences in register initialization for
different socs. So we get different initialization functions
from device compatible.

Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
alistair/sunxi64-5.4-dsi
Yangtao Li 2019-06-23 12:42:01 -04:00 committed by Alistair Francis
parent 9008acf6a2
commit 1f5a8f6160
1 changed files with 3 additions and 1 deletions

View File

@ -59,6 +59,7 @@ struct ths_thermal_chip {
int scale;
int ft_deviation;
int temp_data_base;
int (*init)(struct ths_device *tmdev);
};
struct ths_device {
@ -362,7 +363,7 @@ static int sun8i_ths_probe(struct platform_device *pdev)
if (irq < 0)
return irq;
ret = sun50i_thermal_init(tmdev);
ret = tmdev->chip->init(tmdev);
if (ret)
return ret;
@ -400,6 +401,7 @@ static const struct ths_thermal_chip sun50i_h6_ths = {
.scale = -67,
.ft_deviation = SUN50I_H6_FT_DEVIATION,
.temp_data_base = SUN50I_H6_THS_TEMP_DATA,
.init = sun50i_thermal_init,
};
static const struct of_device_id of_ths_match[] = {