thermal: rockchip: Support RV1106 SoC in the thermal driver

The RV1106 SoC have one channel TS-ADC(CPU).

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
Change-Id: Ib8485cd438feb5aab0e359ab1517ea263a6a978e
This commit is contained in:
Elaine Zhang
2022-01-27 16:28:26 +08:00
committed by Tao Huang
parent 4d2020372e
commit a521e711b1

View File

@@ -308,6 +308,14 @@ struct tsadc_table {
int temp;
};
static const struct tsadc_table rv1106_code_table[] = {
{TSADCV2_DATA_MASK, -40000},
{628, -40000},
{520, 25000},
{419, 85000},
{351, 125000},
{0, 125000},
};
static const struct tsadc_table rv1108_table[] = {
{0, -40000},
@@ -1246,6 +1254,28 @@ static const struct rockchip_tsadc_chip px30_tsadc_data = {
},
};
static const struct rockchip_tsadc_chip rv1106_tsadc_data = {
/* top, big_core0, big_core1, little_core, center, gpu, npu */
.chn_id[SENSOR_CPU] = 0, /* cpu sensor is channel 0 */
.chn_num = 1, /* seven channels for tsadc */
.tshut_mode = TSHUT_MODE_CRU, /* default TSHUT via CRU */
.tshut_polarity = TSHUT_LOW_ACTIVE, /* default TSHUT LOW ACTIVE */
.tshut_temp = 95000,
.initialize = rk_tsadcv8_initialize,
.irq_ack = rk_tsadcv4_irq_ack,
.control = rk_tsadcv4_control,
.get_temp = rk_tsadcv4_get_temp,
.set_alarm_temp = rk_tsadcv3_alarm_temp,
.set_tshut_temp = rk_tsadcv3_tshut_temp,
.set_tshut_mode = rk_tsadcv4_tshut_mode,
.table = {
.id = rv1106_code_table,
.length = ARRAY_SIZE(rv1106_code_table),
.data_mask = TSADCV2_DATA_MASK,
.mode = ADC_DECREMENT,
},
};
static const struct rockchip_tsadc_chip rv1108_tsadc_data = {
.chn_id[SENSOR_CPU] = 0, /* cpu sensor is channel 0 */
.chn_num = 1, /* one channel for tsadc */
@@ -1520,6 +1550,12 @@ static const struct of_device_id of_rockchip_thermal_match[] = {
.data = (void *)&px30_tsadc_data,
},
#endif
#ifdef CONFIG_CPU_RV1106
{
.compatible = "rockchip,rv1106-tsadc",
.data = (void *)&rv1106_tsadc_data,
},
#endif
#ifdef CONFIG_CPU_RV1108
{
.compatible = "rockchip,rv1108-tsadc",