Skip to content

Commit 62a094e

Browse files
Alex Leibovichdlezcano
authored andcommitted
thermal/drivers/armada: Add support for AP807 thermal data
Add support for the AP807 die thermal data. This is the same as AP806, except for the coefficients. ap807 values taken from TSENSE_ADC_16FFC spec, which says: T(in Celsius) = T(code)*TSENE_GAIN+TSENE_OFFSET where in default: TSENE_OFFSET = 128.9 TSENE_GAIN = 0.394 Signed-off-by: Alex Leibovich <[email protected]> Tested-by: sa_ip-sw-jenkins <[email protected]> Reviewed-by: Stefan Chulski <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]> Reviewed-by: Miquel Raynal <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 705fd8f commit 62a094e

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

drivers/thermal/armada_thermal.c

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ static void armada380_init(struct platform_device *pdev,
231231
regmap_write(priv->syscon, data->syscon_control0_off, reg);
232232
}
233233

234-
static void armada_ap806_init(struct platform_device *pdev,
234+
static void armada_ap80x_init(struct platform_device *pdev,
235235
struct armada_thermal_priv *priv)
236236
{
237237
struct armada_thermal_data *data = priv->data;
@@ -614,7 +614,7 @@ static const struct armada_thermal_data armada380_data = {
614614
};
615615

616616
static const struct armada_thermal_data armada_ap806_data = {
617-
.init = armada_ap806_init,
617+
.init = armada_ap80x_init,
618618
.is_valid_bit = BIT(16),
619619
.temp_shift = 0,
620620
.temp_mask = 0x3ff,
@@ -637,6 +637,30 @@ static const struct armada_thermal_data armada_ap806_data = {
637637
.cpu_nr = 4,
638638
};
639639

640+
static const struct armada_thermal_data armada_ap807_data = {
641+
.init = armada_ap80x_init,
642+
.is_valid_bit = BIT(16),
643+
.temp_shift = 0,
644+
.temp_mask = 0x3ff,
645+
.thresh_shift = 3,
646+
.hyst_shift = 19,
647+
.hyst_mask = 0x3,
648+
.coef_b = -128900LL,
649+
.coef_m = 394ULL,
650+
.coef_div = 1,
651+
.inverted = true,
652+
.signed_sample = true,
653+
.syscon_control0_off = 0x84,
654+
.syscon_control1_off = 0x88,
655+
.syscon_status_off = 0x8C,
656+
.dfx_irq_cause_off = 0x108,
657+
.dfx_irq_mask_off = 0x10C,
658+
.dfx_overheat_irq = BIT(22),
659+
.dfx_server_irq_mask_off = 0x104,
660+
.dfx_server_irq_en = BIT(1),
661+
.cpu_nr = 4,
662+
};
663+
640664
static const struct armada_thermal_data armada_cp110_data = {
641665
.init = armada_cp110_init,
642666
.is_valid_bit = BIT(10),
@@ -680,6 +704,10 @@ static const struct of_device_id armada_thermal_id_table[] = {
680704
.compatible = "marvell,armada-ap806-thermal",
681705
.data = &armada_ap806_data,
682706
},
707+
{
708+
.compatible = "marvell,armada-ap807-thermal",
709+
.data = &armada_ap807_data,
710+
},
683711
{
684712
.compatible = "marvell,armada-cp110-thermal",
685713
.data = &armada_cp110_data,

0 commit comments

Comments
 (0)