1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Header file for hmc5843 driver
6 * Copyright (C) Josef Gajdusek <atx@atx.name>
10 #define HMC5843_CORE_H
12 #include <linux/regmap.h>
13 #include <linux/iio/iio.h>
15 #define HMC5843_CONFIG_REG_A 0x00
16 #define HMC5843_CONFIG_REG_B 0x01
17 #define HMC5843_MODE_REG 0x02
18 #define HMC5843_DATA_OUT_MSB_REGS 0x03
19 #define HMC5843_STATUS_REG 0x09
20 #define HMC5843_ID_REG 0x0a
21 #define HMC5843_ID_END 0x0c
31 * struct hmc5843_data - device specific data
33 * @lock: update and read regmap data
34 * @regmap: hardware access register maps
35 * @variant: describe chip variants
36 * @buffer: 3x 16-bit channels + padding + 64-bit timestamp
41 struct regmap
*regmap
;
42 const struct hmc5843_chip_info
*variant
;
43 struct iio_mount_matrix orientation
;
47 int hmc5843_common_probe(struct device
*dev
, struct regmap
*regmap
,
48 enum hmc5843_ids id
, const char *name
);
49 int hmc5843_common_remove(struct device
*dev
);
51 int hmc5843_common_suspend(struct device
*dev
);
52 int hmc5843_common_resume(struct device
*dev
);
54 #ifdef CONFIG_PM_SLEEP
55 static __maybe_unused
SIMPLE_DEV_PM_OPS(hmc5843_pm_ops
,
56 hmc5843_common_suspend
,
57 hmc5843_common_resume
);
58 #define HMC5843_PM_OPS (&hmc5843_pm_ops)
60 #define HMC5843_PM_OPS NULL
63 #endif /* HMC5843_CORE_H */