Sonic Zhang | 35f6b6b | 2010-10-27 21:43:52 -0400 | [diff] [blame] | 1 | /* |
| 2 | * ADT7316 digital temperature sensor driver supporting ADT7316/7/8 ADT7516/7/9 |
| 3 | * |
| 4 | * Copyright 2010 Analog Devices Inc. |
| 5 | * |
| 6 | * Licensed under the GPL-2 or later. |
| 7 | */ |
| 8 | |
| 9 | #ifndef _ADT7316_H_ |
| 10 | #define _ADT7316_H_ |
| 11 | |
| 12 | #include <linux/types.h> |
Lars-Peter Clausen | 01788c5 | 2012-02-20 19:37:05 +0100 | [diff] [blame] | 13 | #include <linux/pm.h> |
Sonic Zhang | 35f6b6b | 2010-10-27 21:43:52 -0400 | [diff] [blame] | 14 | |
| 15 | #define ADT7316_REG_MAX_ADDR 0x3F |
| 16 | |
| 17 | struct adt7316_bus { |
| 18 | void *client; |
| 19 | int irq; |
| 20 | int irq_flags; |
| 21 | int (*read) (void *client, u8 reg, u8 *data); |
| 22 | int (*write) (void *client, u8 reg, u8 val); |
| 23 | int (*multi_read) (void *client, u8 first_reg, u8 count, u8 *data); |
| 24 | int (*multi_write) (void *client, u8 first_reg, u8 count, u8 *data); |
| 25 | }; |
| 26 | |
Lars-Peter Clausen | 01788c5 | 2012-02-20 19:37:05 +0100 | [diff] [blame] | 27 | #ifdef CONFIG_PM_SLEEP |
| 28 | extern const struct dev_pm_ops adt7316_pm_ops; |
| 29 | #define ADT7316_PM_OPS (&adt7316_pm_ops) |
| 30 | #else |
| 31 | #define ADT7316_PM_OPS NULL |
Sonic Zhang | 35f6b6b | 2010-10-27 21:43:52 -0400 | [diff] [blame] | 32 | #endif |
| 33 | int adt7316_probe(struct device *dev, struct adt7316_bus *bus, const char *name); |
| 34 | int adt7316_remove(struct device *dev); |
| 35 | |
| 36 | #endif |