1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _GSC_HWMON_H
3 #define _GSC_HWMON_H
4 
5 enum gsc_hwmon_mode {
6 	mode_temperature,
7 	mode_voltage_24bit,
8 	mode_voltage_raw,
9 	mode_voltage_16bit,
10 	mode_fan,
11 	mode_max,
12 };
13 
14 /**
15  * struct gsc_hwmon_channel - configuration parameters
16  * @reg:  I2C register offset
17  * @mode: channel mode
18  * @name: channel name
19  * @mvoffset: voltage offset
20  * @vdiv: voltage divider array (2 resistor values in milli-ohms)
21  */
22 struct gsc_hwmon_channel {
23 	unsigned int reg;
24 	unsigned int mode;
25 	const char *name;
26 	unsigned int mvoffset;
27 	unsigned int vdiv[2];
28 };
29 
30 /**
31  * struct gsc_hwmon_platform_data - platform data for gsc_hwmon driver
32  * @nchannels:	number of elements in @channels array
33  * @vreference: voltage reference (mV)
34  * @resolution: ADC bit resolution
35  * @fan_base: register base for FAN controller
36  * @channels:	array of gsc_hwmon_channel structures describing channels
37  */
38 struct gsc_hwmon_platform_data {
39 	int nchannels;
40 	unsigned int resolution;
41 	unsigned int vreference;
42 	unsigned int fan_base;
43 	struct gsc_hwmon_channel channels[];
44 };
45 #endif
46