18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef __HWMON_ADT7X10_H__
38c2ecf20Sopenharmony_ci#define __HWMON_ADT7X10_H__
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#include <linux/types.h>
68c2ecf20Sopenharmony_ci#include <linux/pm.h>
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci/* ADT7410 registers definition */
98c2ecf20Sopenharmony_ci#define ADT7X10_TEMPERATURE		0
108c2ecf20Sopenharmony_ci#define ADT7X10_STATUS			2
118c2ecf20Sopenharmony_ci#define ADT7X10_CONFIG			3
128c2ecf20Sopenharmony_ci#define ADT7X10_T_ALARM_HIGH		4
138c2ecf20Sopenharmony_ci#define ADT7X10_T_ALARM_LOW		6
148c2ecf20Sopenharmony_ci#define ADT7X10_T_CRIT			8
158c2ecf20Sopenharmony_ci#define ADT7X10_T_HYST			0xA
168c2ecf20Sopenharmony_ci#define ADT7X10_ID			0xB
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_cistruct device;
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_cistruct adt7x10_ops {
218c2ecf20Sopenharmony_ci	int (*read_byte)(struct device *, u8 reg);
228c2ecf20Sopenharmony_ci	int (*write_byte)(struct device *, u8 reg, u8 data);
238c2ecf20Sopenharmony_ci	int (*read_word)(struct device *, u8 reg);
248c2ecf20Sopenharmony_ci	int (*write_word)(struct device *, u8 reg, u16 data);
258c2ecf20Sopenharmony_ci};
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ciint adt7x10_probe(struct device *dev, const char *name, int irq,
288c2ecf20Sopenharmony_ci	const struct adt7x10_ops *ops);
298c2ecf20Sopenharmony_ciint adt7x10_remove(struct device *dev, int irq);
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci#ifdef CONFIG_PM_SLEEP
328c2ecf20Sopenharmony_ciextern const struct dev_pm_ops adt7x10_dev_pm_ops;
338c2ecf20Sopenharmony_ci#define ADT7X10_DEV_PM_OPS (&adt7x10_dev_pm_ops)
348c2ecf20Sopenharmony_ci#else
358c2ecf20Sopenharmony_ci#define ADT7X10_DEV_PM_OPS NULL
368c2ecf20Sopenharmony_ci#endif
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_ci#endif
39