adt7x10.h 932 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef __HWMON_ADT7X10_H__
  2. #define __HWMON_ADT7X10_H__
  3. #include <linux/types.h>
  4. #include <linux/pm.h>
  5. /* ADT7410 registers definition */
  6. #define ADT7X10_TEMPERATURE 0
  7. #define ADT7X10_STATUS 2
  8. #define ADT7X10_CONFIG 3
  9. #define ADT7X10_T_ALARM_HIGH 4
  10. #define ADT7X10_T_ALARM_LOW 6
  11. #define ADT7X10_T_CRIT 8
  12. #define ADT7X10_T_HYST 0xA
  13. #define ADT7X10_ID 0xB
  14. struct device;
  15. struct adt7x10_ops {
  16. int (*read_byte)(struct device *, u8 reg);
  17. int (*write_byte)(struct device *, u8 reg, u8 data);
  18. int (*read_word)(struct device *, u8 reg);
  19. int (*write_word)(struct device *, u8 reg, u16 data);
  20. };
  21. int adt7x10_probe(struct device *dev, const char *name, int irq,
  22. const struct adt7x10_ops *ops);
  23. int adt7x10_remove(struct device *dev, int irq);
  24. #ifdef CONFIG_PM_SLEEP
  25. extern const struct dev_pm_ops adt7x10_dev_pm_ops;
  26. #define ADT7X10_DEV_PM_OPS (&adt7x10_dev_pm_ops)
  27. #else
  28. #define ADT7X10_DEV_PM_OPS NULL
  29. #endif
  30. #endif