blob: d491c698529ebb0c1bca4d49db807ea81c682a47 [file] [log] [blame]
Lars-Peter Clausen51c2a482013-03-12 11:38:46 +01001#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
17struct device;
18
19struct 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
Lars-Peter Clausen4b5e5362013-03-12 11:38:47 +010026int adt7x10_probe(struct device *dev, const char *name, int irq,
Lars-Peter Clausen51c2a482013-03-12 11:38:46 +010027 const struct adt7x10_ops *ops);
Lars-Peter Clausen4b5e5362013-03-12 11:38:47 +010028int adt7x10_remove(struct device *dev, int irq);
Lars-Peter Clausen51c2a482013-03-12 11:38:46 +010029
30#ifdef CONFIG_PM_SLEEP
31extern 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