2 * Header file for hmc5843 driver
5 * Copyright (C) Josef Gajdusek <atx@atx.name>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
14 #ifndef HMC5843_CORE_H
15 #define HMC5843_CORE_H
17 #include <linux/regmap.h>
18 #include <linux/iio/iio.h>
20 #define HMC5843_CONFIG_REG_A 0x00
21 #define HMC5843_CONFIG_REG_B 0x01
22 #define HMC5843_MODE_REG 0x02
23 #define HMC5843_DATA_OUT_MSB_REGS 0x03
24 #define HMC5843_STATUS_REG 0x09
25 #define HMC5843_ID_REG 0x0a
26 #define HMC5843_ID_END 0x0c
38 struct regmap *regmap;
39 const struct hmc5843_chip_info *variant;
40 __be16 buffer[8]; /* 3x 16-bit channels + padding + 64-bit timestamp */
43 int hmc5843_common_probe(struct device *dev, struct regmap *regmap,
45 int hmc5843_common_remove(struct device *dev);
47 int hmc5843_common_suspend(struct device *dev);
48 int hmc5843_common_resume(struct device *dev);
50 #ifdef CONFIG_PM_SLEEP
51 static SIMPLE_DEV_PM_OPS(hmc5843_pm_ops,
52 hmc5843_common_suspend,
53 hmc5843_common_resume);
54 #define HMC5843_PM_OPS (&hmc5843_pm_ops)
56 #define HMC5843_PM_OPS NULL
59 #endif /* HMC5843_CORE_H */