File: sensors.h

package info (click to toggle)
xmbmon 2.05-8
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 928 kB
  • ctags: 910
  • sloc: ansic: 6,089; sh: 2,151; perl: 87; makefile: 79
file content (136 lines) | stat: -rw-r--r-- 2,339 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#if !defined(__sensor_h__)
#define	__sensor_h__

#include "methods.h"

struct hwm_access {
	char	*Name;
	int		(*Probe)(LM_METHODS *pMethods);
	float	(*Temp)(LM_METHODS *pMethods, int no);
	float	(*Volt)(LM_METHODS *pMethods, int no);
	int		(*FanRPM)(LM_METHODS *pMethods, int no);
};

typedef struct hwm_access SENSOR;

extern SENSOR winbond;
extern SENSOR wl784;
extern SENSOR via686;
extern SENSOR it87;
extern SENSOR gl52;
extern SENSOR lm85;
extern SENSOR lm80;
extern SENSOR lm90;
extern SENSOR lm75;

/* should be larger than the number of "HWM_sensor_chip" */
#define SEARCH	2002

/*
 *	Supported HWM, ordering is important!!
 *	HWM_sensor_chip{} should be consistent with
 *	HWM_module[] and HWM_name[]
 */

enum HWM_sensor_chip {
	c_winbond,
	c_wl784,
	c_via686,
	c_it87,
	c_gl52,
	c_lm85,
	c_lm80,
	c_lm90,
	c_lm75
};

#ifdef INCLUDE_HWM_MODULE

/* Array of Supported HWM, ordering is important!! */
SENSOR *HWM_module[] = {
	&winbond,
	&wl784,
	&via686,
	&it87,
	&gl52,
	&lm85,
	&lm80,
	&lm90,
	&lm75,
	NULL };

/* HWM_name[] should have one-to-one correspondence to HWM_module[] */
char *HWM_name[] = {
	"winbond",
	"wl784",
	"via686",
	"it87",
	"gl52",
	"lm85",
	"lm80",
	"lm90",
	"lm75",
	NULL };

/* number of VIA device found */
int HWM_VIA = 0;

/* number of SMB device found */
int HWM_SMB = 0;

/* HWM_SMBchip[] should have one-to-one correspondence to HWM_module[] */
int HWM_SMBchip[] = {
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0 };

/* HWM_smbslave[] should have one-to-one correspondence to HWM_module[] */
int HWM_smbslave[] = {
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0 };

/* number of ISA device found */
int HWM_ISA = 0;

/* HWM_ISAchip[] should have one-to-one correspondence to HWM_module[] */
int HWM_ISAchip[] = {
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0,
	0 };

#endif	/* INCLUDE_HWM_MODULE */


/* functions commonly used in each HWM module */
extern int chkReg_Probe(int slave, char *comment, int Reg[], LM_METHODS *);
extern int strict_chkReg_Probe(int Reg[], LM_METHODS *method);
extern int scan_smbus(int addr_start, int addr_end, int result[]);
extern int find_smb_dev(void);
extern void kill_smb_slave(int slave);
extern int get_smb_slave(int start, int end);
extern int set_smb_Extemp(int start, int end, int *slavet1, int *slavet2);
extern void info_Extemp(LM_METHODS *, int, int);

#endif	/*!__sensor_h__*/