hwmon.c (8faee73f92cd4dd4928e6860001315a0cc834c99) hwmon.c (f9f7bb3a0efafb662a4c639bc62df1df2b7321f9)
1/*
2 * hwmon.c - part of lm_sensors, Linux kernel modules for hardware monitoring
3 *
4 * This file defines the sysfs class "hwmon", for use by sensors drivers.
5 *
6 * Copyright (C) 2005 Mark M. Hoffman <mhoffman@lightlink.com>
7 *
8 * This program is free software; you can redistribute it and/or modify

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

381 [hwmon_fan_pulses] = "fan%d_pulses",
382 [hwmon_fan_target] = "fan%d_target",
383 [hwmon_fan_alarm] = "fan%d_alarm",
384 [hwmon_fan_min_alarm] = "fan%d_min_alarm",
385 [hwmon_fan_max_alarm] = "fan%d_max_alarm",
386 [hwmon_fan_fault] = "fan%d_fault",
387};
388
1/*
2 * hwmon.c - part of lm_sensors, Linux kernel modules for hardware monitoring
3 *
4 * This file defines the sysfs class "hwmon", for use by sensors drivers.
5 *
6 * Copyright (C) 2005 Mark M. Hoffman <mhoffman@lightlink.com>
7 *
8 * This program is free software; you can redistribute it and/or modify

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

381 [hwmon_fan_pulses] = "fan%d_pulses",
382 [hwmon_fan_target] = "fan%d_target",
383 [hwmon_fan_alarm] = "fan%d_alarm",
384 [hwmon_fan_min_alarm] = "fan%d_min_alarm",
385 [hwmon_fan_max_alarm] = "fan%d_max_alarm",
386 [hwmon_fan_fault] = "fan%d_fault",
387};
388
389static const char * const hwmon_pwm_attr_templates[] = {
390 [hwmon_pwm_input] = "pwm%d",
391 [hwmon_pwm_enable] = "pwm%d_enable",
392 [hwmon_pwm_mode] = "pwm%d_mode",
393 [hwmon_pwm_freq] = "pwm%d_freq",
394};
395
389static const char * const *__templates[] = {
390 [hwmon_chip] = hwmon_chip_attr_templates,
391 [hwmon_temp] = hwmon_temp_attr_templates,
392 [hwmon_in] = hwmon_in_attr_templates,
393 [hwmon_curr] = hwmon_curr_attr_templates,
394 [hwmon_power] = hwmon_power_attr_templates,
395 [hwmon_energy] = hwmon_energy_attr_templates,
396 [hwmon_humidity] = hwmon_humidity_attr_templates,
397 [hwmon_fan] = hwmon_fan_attr_templates,
396static const char * const *__templates[] = {
397 [hwmon_chip] = hwmon_chip_attr_templates,
398 [hwmon_temp] = hwmon_temp_attr_templates,
399 [hwmon_in] = hwmon_in_attr_templates,
400 [hwmon_curr] = hwmon_curr_attr_templates,
401 [hwmon_power] = hwmon_power_attr_templates,
402 [hwmon_energy] = hwmon_energy_attr_templates,
403 [hwmon_humidity] = hwmon_humidity_attr_templates,
404 [hwmon_fan] = hwmon_fan_attr_templates,
405 [hwmon_pwm] = hwmon_pwm_attr_templates,
398};
399
400static const int __templates_size[] = {
401 [hwmon_chip] = ARRAY_SIZE(hwmon_chip_attr_templates),
402 [hwmon_temp] = ARRAY_SIZE(hwmon_temp_attr_templates),
403 [hwmon_in] = ARRAY_SIZE(hwmon_in_attr_templates),
404 [hwmon_curr] = ARRAY_SIZE(hwmon_curr_attr_templates),
405 [hwmon_power] = ARRAY_SIZE(hwmon_power_attr_templates),
406 [hwmon_energy] = ARRAY_SIZE(hwmon_energy_attr_templates),
407 [hwmon_humidity] = ARRAY_SIZE(hwmon_humidity_attr_templates),
408 [hwmon_fan] = ARRAY_SIZE(hwmon_fan_attr_templates),
406};
407
408static const int __templates_size[] = {
409 [hwmon_chip] = ARRAY_SIZE(hwmon_chip_attr_templates),
410 [hwmon_temp] = ARRAY_SIZE(hwmon_temp_attr_templates),
411 [hwmon_in] = ARRAY_SIZE(hwmon_in_attr_templates),
412 [hwmon_curr] = ARRAY_SIZE(hwmon_curr_attr_templates),
413 [hwmon_power] = ARRAY_SIZE(hwmon_power_attr_templates),
414 [hwmon_energy] = ARRAY_SIZE(hwmon_energy_attr_templates),
415 [hwmon_humidity] = ARRAY_SIZE(hwmon_humidity_attr_templates),
416 [hwmon_fan] = ARRAY_SIZE(hwmon_fan_attr_templates),
417 [hwmon_pwm] = ARRAY_SIZE(hwmon_pwm_attr_templates),
409};
410
411static int hwmon_num_channel_attrs(const struct hwmon_channel_info *info)
412{
413 int i, n;
414
415 for (i = n = 0; info->config[i]; i++)
416 n += hweight32(info->config[i]);

--- 408 unchanged lines hidden ---
418};
419
420static int hwmon_num_channel_attrs(const struct hwmon_channel_info *info)
421{
422 int i, n;
423
424 for (i = n = 0; info->config[i]; i++)
425 n += hweight32(info->config[i]);

--- 408 unchanged lines hidden ---