hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/iio/magnetometer/hmc5843.h
....@@ -1,12 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Header file for hmc5843 driver
34 *
45 * Split from hmc5843.c
56 * Copyright (C) Josef Gajdusek <atx@atx.name>
6
- *
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.
107 */
118
129 #ifndef HMC5843_CORE_H
....@@ -31,19 +28,24 @@
3128 };
3229
3330 /**
34
- * struct hcm5843_data - device specific data
31
+ * struct hmc5843_data - device specific data
3532 * @dev: actual device
3633 * @lock: update and read regmap data
3734 * @regmap: hardware access register maps
3835 * @variant: describe chip variants
39
- * @buffer: 3x 16-bit channels + padding + 64-bit timestamp
36
+ * @scan: buffer to pack data for passing to
37
+ * iio_push_to_buffers_with_timestamp()
4038 */
4139 struct hmc5843_data {
4240 struct device *dev;
4341 struct mutex lock;
4442 struct regmap *regmap;
4543 const struct hmc5843_chip_info *variant;
46
- __be16 buffer[8];
44
+ struct iio_mount_matrix orientation;
45
+ struct {
46
+ __be16 chans[3];
47
+ s64 timestamp __aligned(8);
48
+ } scan;
4749 };
4850
4951 int hmc5843_common_probe(struct device *dev, struct regmap *regmap,
....@@ -54,9 +56,9 @@
5456 int hmc5843_common_resume(struct device *dev);
5557
5658 #ifdef CONFIG_PM_SLEEP
57
-static SIMPLE_DEV_PM_OPS(hmc5843_pm_ops,
58
- hmc5843_common_suspend,
59
- hmc5843_common_resume);
59
+static __maybe_unused SIMPLE_DEV_PM_OPS(hmc5843_pm_ops,
60
+ hmc5843_common_suspend,
61
+ hmc5843_common_resume);
6062 #define HMC5843_PM_OPS (&hmc5843_pm_ops)
6163 #else
6264 #define HMC5843_PM_OPS NULL