hwmon.h 836 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. hwmon.h - part of lm_sensors, Linux kernel modules for hardware monitoring
  3. This file declares helper functions for the sysfs class "hwmon",
  4. for use by sensors drivers.
  5. Copyright (C) 2005 Mark M. Hoffman <mhoffman@lightlink.com>
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; version 2 of the License.
  9. */
  10. #ifndef _HWMON_H_
  11. #define _HWMON_H_
  12. struct device;
  13. struct device *hwmon_device_register(struct device *dev);
  14. void hwmon_device_unregister(struct device *dev);
  15. /* Scale user input to sensible values */
  16. static inline int SENSORS_LIMIT(long value, long low, long high)
  17. {
  18. if (value < low)
  19. return low;
  20. else if (value > high)
  21. return high;
  22. else
  23. return value;
  24. }
  25. #endif