hwmon-kernel-api.rst (cecdd52a3dd312564f81a39df08378b7b39a2654) hwmon-kernel-api.rst (d8cc9415a40f479b666fc03e7b1f4601868e6dc8)
1The Linux Hardware Monitoring kernel API
2========================================
3
4Guenter Roeck
5
6Introduction
7------------
8

--- 119 unchanged lines hidden (view full) ---

128
129This function returns a pointer to the created hardware monitoring device
130on success and a negative error code for failure.
131
132The hwmon_chip_info structure looks as follows::
133
134 struct hwmon_chip_info {
135 const struct hwmon_ops *ops;
1The Linux Hardware Monitoring kernel API
2========================================
3
4Guenter Roeck
5
6Introduction
7------------
8

--- 119 unchanged lines hidden (view full) ---

128
129This function returns a pointer to the created hardware monitoring device
130on success and a negative error code for failure.
131
132The hwmon_chip_info structure looks as follows::
133
134 struct hwmon_chip_info {
135 const struct hwmon_ops *ops;
136 const struct hwmon_channel_info **info;
136 const struct hwmon_channel_info * const *info;
137 };
138
139It contains the following fields:
140
141* ops:
142 Pointer to device operations.
143* info:
144 NULL-terminated list of device channel descriptors.

--- 79 unchanged lines hidden (view full) ---

224 0
225 };
226
227 static const struct hwmon_channel_info lm75_temp = {
228 .type = hwmon_temp,
229 .config = lm75_temp_config,
230 };
231
137 };
138
139It contains the following fields:
140
141* ops:
142 Pointer to device operations.
143* info:
144 NULL-terminated list of device channel descriptors.

--- 79 unchanged lines hidden (view full) ---

224 0
225 };
226
227 static const struct hwmon_channel_info lm75_temp = {
228 .type = hwmon_temp,
229 .config = lm75_temp_config,
230 };
231
232 static const struct hwmon_channel_info *lm75_info[] = {
232 static const struct hwmon_channel_info * const lm75_info[] = {
233 &lm75_chip,
234 &lm75_temp,
235 NULL
236 };
237
238 The HWMON_CHANNEL_INFO() macro can and should be used when possible.
239 With this macro, the above example can be simplified to
240
233 &lm75_chip,
234 &lm75_temp,
235 NULL
236 };
237
238 The HWMON_CHANNEL_INFO() macro can and should be used when possible.
239 With this macro, the above example can be simplified to
240
241 static const struct hwmon_channel_info *lm75_info[] = {
241 static const struct hwmon_channel_info * const lm75_info[] = {
242 HWMON_CHANNEL_INFO(chip,
243 HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL),
244 HWMON_CHANNEL_INFO(temp,
245 HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST),
246 NULL
247 };
248
249 The remaining declarations are as follows.

--- 153 unchanged lines hidden ---
242 HWMON_CHANNEL_INFO(chip,
243 HWMON_C_REGISTER_TZ | HWMON_C_UPDATE_INTERVAL),
244 HWMON_CHANNEL_INFO(temp,
245 HWMON_T_INPUT | HWMON_T_MAX | HWMON_T_MAX_HYST),
246 NULL
247 };
248
249 The remaining declarations are as follows.

--- 153 unchanged lines hidden ---