Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Lars-Peter Clausen | 51c2a48 | 2013-03-12 11:38:46 +0100 | [diff] [blame] | 2 | #ifndef __HWMON_ADT7X10_H__ |
| 3 | #define __HWMON_ADT7X10_H__ |
| 4 | |
| 5 | #include <linux/types.h> |
| 6 | #include <linux/pm.h> |
| 7 | |
| 8 | /* ADT7410 registers definition */ |
| 9 | #define ADT7X10_TEMPERATURE 0 |
| 10 | #define ADT7X10_STATUS 2 |
| 11 | #define ADT7X10_CONFIG 3 |
| 12 | #define ADT7X10_T_ALARM_HIGH 4 |
| 13 | #define ADT7X10_T_ALARM_LOW 6 |
| 14 | #define ADT7X10_T_CRIT 8 |
| 15 | #define ADT7X10_T_HYST 0xA |
| 16 | #define ADT7X10_ID 0xB |
| 17 | |
| 18 | struct device; |
| 19 | |
| 20 | struct adt7x10_ops { |
| 21 | int (*read_byte)(struct device *, u8 reg); |
| 22 | int (*write_byte)(struct device *, u8 reg, u8 data); |
| 23 | int (*read_word)(struct device *, u8 reg); |
| 24 | int (*write_word)(struct device *, u8 reg, u16 data); |
| 25 | }; |
| 26 | |
Lars-Peter Clausen | 4b5e536 | 2013-03-12 11:38:47 +0100 | [diff] [blame] | 27 | int adt7x10_probe(struct device *dev, const char *name, int irq, |
Lars-Peter Clausen | 51c2a48 | 2013-03-12 11:38:46 +0100 | [diff] [blame] | 28 | const struct adt7x10_ops *ops); |
Lars-Peter Clausen | 4b5e536 | 2013-03-12 11:38:47 +0100 | [diff] [blame] | 29 | int adt7x10_remove(struct device *dev, int irq); |
Lars-Peter Clausen | 51c2a48 | 2013-03-12 11:38:46 +0100 | [diff] [blame] | 30 | |
| 31 | #ifdef CONFIG_PM_SLEEP |
| 32 | extern const struct dev_pm_ops adt7x10_dev_pm_ops; |
| 33 | #define ADT7X10_DEV_PM_OPS (&adt7x10_dev_pm_ops) |
| 34 | #else |
| 35 | #define ADT7X10_DEV_PM_OPS NULL |
| 36 | #endif |
| 37 | |
| 38 | #endif |