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