| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Header file for hmc5843 driver |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Split from hmc5843.c |
|---|
| 5 | 6 | * 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. |
|---|
| 10 | 7 | */ |
|---|
| 11 | 8 | |
|---|
| 12 | 9 | #ifndef HMC5843_CORE_H |
|---|
| .. | .. |
|---|
| 31 | 28 | }; |
|---|
| 32 | 29 | |
|---|
| 33 | 30 | /** |
|---|
| 34 | | - * struct hcm5843_data - device specific data |
|---|
| 31 | + * struct hmc5843_data - device specific data |
|---|
| 35 | 32 | * @dev: actual device |
|---|
| 36 | 33 | * @lock: update and read regmap data |
|---|
| 37 | 34 | * @regmap: hardware access register maps |
|---|
| 38 | 35 | * @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() |
|---|
| 40 | 38 | */ |
|---|
| 41 | 39 | struct hmc5843_data { |
|---|
| 42 | 40 | struct device *dev; |
|---|
| 43 | 41 | struct mutex lock; |
|---|
| 44 | 42 | struct regmap *regmap; |
|---|
| 45 | 43 | 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; |
|---|
| 47 | 49 | }; |
|---|
| 48 | 50 | |
|---|
| 49 | 51 | int hmc5843_common_probe(struct device *dev, struct regmap *regmap, |
|---|
| .. | .. |
|---|
| 54 | 56 | int hmc5843_common_resume(struct device *dev); |
|---|
| 55 | 57 | |
|---|
| 56 | 58 | #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); |
|---|
| 60 | 62 | #define HMC5843_PM_OPS (&hmc5843_pm_ops) |
|---|
| 61 | 63 | #else |
|---|
| 62 | 64 | #define HMC5843_PM_OPS NULL |
|---|