adt7x10.h 971 B

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