xref: /rk3399_ARM-atf/include/drivers/marvell/thermal.h (revision c3cf06f1a3a9b9ee8ac7a0ae505f95c45f7dca84)
1d5a6f86cSKonstantin Porotchkin /*
2d5a6f86cSKonstantin Porotchkin  * Copyright (C) 2018 Marvell International Ltd.
3d5a6f86cSKonstantin Porotchkin  *
4d5a6f86cSKonstantin Porotchkin  * SPDX-License-Identifier:	BSD-3-Clause
5d5a6f86cSKonstantin Porotchkin  * https://spdx.org/licenses
6d5a6f86cSKonstantin Porotchkin  */
7d5a6f86cSKonstantin Porotchkin 
8d5a6f86cSKonstantin Porotchkin /* Driver for thermal unit located in Marvell ARMADA 8K and compatible SoCs */
9d5a6f86cSKonstantin Porotchkin 
10*c3cf06f1SAntonio Nino Diaz #ifndef THERMAL_H
11*c3cf06f1SAntonio Nino Diaz #define THERMAL_H
12d5a6f86cSKonstantin Porotchkin 
13d5a6f86cSKonstantin Porotchkin struct tsen_config {
14d5a6f86cSKonstantin Porotchkin 	/* thermal temperature parameters */
15d5a6f86cSKonstantin Porotchkin 	int tsen_offset;
16d5a6f86cSKonstantin Porotchkin 	int tsen_gain;
17d5a6f86cSKonstantin Porotchkin 	int tsen_divisor;
18d5a6f86cSKonstantin Porotchkin 	/* thermal data */
19d5a6f86cSKonstantin Porotchkin 	int tsen_ready;
20d5a6f86cSKonstantin Porotchkin 	void *regs_base;
21d5a6f86cSKonstantin Porotchkin 	/* thermal functionality */
22d5a6f86cSKonstantin Porotchkin 	int (*ptr_tsen_probe)(struct tsen_config *cfg);
23d5a6f86cSKonstantin Porotchkin 	int (*ptr_tsen_read)(struct tsen_config *cfg, int *temp);
24d5a6f86cSKonstantin Porotchkin };
25d5a6f86cSKonstantin Porotchkin 
26d5a6f86cSKonstantin Porotchkin /* Thermal driver APIs */
27d5a6f86cSKonstantin Porotchkin int marvell_thermal_init(struct tsen_config *tsen_cfg);
28d5a6f86cSKonstantin Porotchkin int marvell_thermal_read(struct tsen_config *tsen_cfg, int *temp);
29d5a6f86cSKonstantin Porotchkin struct tsen_config *marvell_thermal_config_get(void);
30d5a6f86cSKonstantin Porotchkin 
31*c3cf06f1SAntonio Nino Diaz #endif /* THERMAL_H */
32