Source
222
222
}
223
223
break;
224
224
225
225
default:
226
226
break;
227
227
}
228
228
229
229
return 0;
230
230
}
231
231
232
-
static const u32 mlxreg_fan_hwmon_fan_config[] = {
233
-
HWMON_F_INPUT | HWMON_F_FAULT,
234
-
HWMON_F_INPUT | HWMON_F_FAULT,
235
-
HWMON_F_INPUT | HWMON_F_FAULT,
236
-
HWMON_F_INPUT | HWMON_F_FAULT,
237
-
HWMON_F_INPUT | HWMON_F_FAULT,
238
-
HWMON_F_INPUT | HWMON_F_FAULT,
239
-
HWMON_F_INPUT | HWMON_F_FAULT,
240
-
HWMON_F_INPUT | HWMON_F_FAULT,
241
-
HWMON_F_INPUT | HWMON_F_FAULT,
242
-
HWMON_F_INPUT | HWMON_F_FAULT,
243
-
HWMON_F_INPUT | HWMON_F_FAULT,
244
-
HWMON_F_INPUT | HWMON_F_FAULT,
245
-
0
246
-
};
247
-
248
-
static const struct hwmon_channel_info mlxreg_fan_hwmon_fan = {
249
-
.type = hwmon_fan,
250
-
.config = mlxreg_fan_hwmon_fan_config,
251
-
};
252
-
253
-
static const u32 mlxreg_fan_hwmon_pwm_config[] = {
254
-
HWMON_PWM_INPUT,
255
-
0
256
-
};
257
-
258
-
static const struct hwmon_channel_info mlxreg_fan_hwmon_pwm = {
259
-
.type = hwmon_pwm,
260
-
.config = mlxreg_fan_hwmon_pwm_config,
261
-
};
262
-
263
232
static const struct hwmon_channel_info *mlxreg_fan_hwmon_info[] = {
264
-
&mlxreg_fan_hwmon_fan,
265
-
&mlxreg_fan_hwmon_pwm,
233
+
HWMON_CHANNEL_INFO(fan,
234
+
HWMON_F_INPUT | HWMON_F_FAULT,
235
+
HWMON_F_INPUT | HWMON_F_FAULT,
236
+
HWMON_F_INPUT | HWMON_F_FAULT,
237
+
HWMON_F_INPUT | HWMON_F_FAULT,
238
+
HWMON_F_INPUT | HWMON_F_FAULT,
239
+
HWMON_F_INPUT | HWMON_F_FAULT,
240
+
HWMON_F_INPUT | HWMON_F_FAULT,
241
+
HWMON_F_INPUT | HWMON_F_FAULT,
242
+
HWMON_F_INPUT | HWMON_F_FAULT,
243
+
HWMON_F_INPUT | HWMON_F_FAULT,
244
+
HWMON_F_INPUT | HWMON_F_FAULT,
245
+
HWMON_F_INPUT | HWMON_F_FAULT),
246
+
HWMON_CHANNEL_INFO(pwm,
247
+
HWMON_PWM_INPUT),
266
248
NULL
267
249
};
268
250
269
251
static const struct hwmon_ops mlxreg_fan_hwmon_hwmon_ops = {
270
252
.is_visible = mlxreg_fan_is_visible,
271
253
.read = mlxreg_fan_read,
272
254
.write = mlxreg_fan_write,
273
255
};
274
256
275
257
static const struct hwmon_chip_info mlxreg_fan_hwmon_chip_info = {