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  * @channels:	pointer to array of gsc_hwmon_channel structures
33  *		describing channels
34  * @nchannels:	number of elements in @channels array
35  * @vreference: voltage reference (mV)
36  * @resolution: ADC bit resolution
37  * @fan_base: register base for FAN controller
38  */
39 struct gsc_hwmon_platform_data {
40 	const struct gsc_hwmon_channel *channels;
41 	int nchannels;
42 	unsigned int resolution;
43 	unsigned int vreference;
44 	unsigned int fan_base;
45 };
46 #endif
47