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.
13 #ifndef HMC5843_CORE_H
14 #define HMC5843_CORE_H
16 #include <linux/regmap.h>
17 #include <linux/iio/iio.h>
19 #define HMC5843_CONFIG_REG_A 0x00
20 #define HMC5843_CONFIG_REG_B 0x01
21 #define HMC5843_MODE_REG 0x02
22 #define HMC5843_DATA_OUT_MSB_REGS 0x03
23 #define HMC5843_STATUS_REG 0x09
24 #define HMC5843_ID_REG 0x0a
25 #define HMC5843_ID_END 0x0c
35 * struct hcm5843_data - device specific data
37 * @lock: update and read regmap data
38 * @regmap: hardware access register maps
39 * @variant: describe chip variants
40 * @buffer: 3x 16-bit channels + padding + 64-bit timestamp
45 struct regmap *regmap;
46 const struct hmc5843_chip_info *variant;
50 int hmc5843_common_probe(struct device *dev, struct regmap *regmap,
52 int hmc5843_common_remove(struct device *dev);
54 int hmc5843_common_suspend(struct device *dev);
55 int hmc5843_common_resume(struct device *dev);
57 #ifdef CONFIG_PM_SLEEP
58 static SIMPLE_DEV_PM_OPS(hmc5843_pm_ops,
59 hmc5843_common_suspend,
60 hmc5843_common_resume);
61 #define HMC5843_PM_OPS (&hmc5843_pm_ops)
63 #define HMC5843_PM_OPS NULL
66 #endif /* HMC5843_CORE_H */