xref: /linux/drivers/iio/imu/bmi270/bmi270.h (revision 2eff01ee2881becc9daaa0d53477ec202136b1f4)
1 /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
2 
3 #ifndef BMI270_H_
4 #define BMI270_H_
5 
6 #include <linux/regmap.h>
7 #include <linux/iio/iio.h>
8 
9 struct device;
10 struct bmi270_data {
11 	struct device *dev;
12 	struct regmap *regmap;
13 	const struct bmi270_chip_info *chip_info;
14 
15 	/*
16 	 * Where IIO_DMA_MINALIGN may be larger than 8 bytes, align to
17 	 * that to ensure a DMA safe buffer.
18 	 */
19 	struct {
20 		__le16 channels[6];
21 		aligned_s64 timestamp;
22 	} data __aligned(IIO_DMA_MINALIGN);
23 };
24 
25 struct bmi270_chip_info {
26 	const char *name;
27 	int chip_id;
28 	const char *fw_name;
29 };
30 
31 extern const struct regmap_config bmi270_regmap_config;
32 extern const struct bmi270_chip_info bmi260_chip_info;
33 extern const struct bmi270_chip_info bmi270_chip_info;
34 
35 int bmi270_core_probe(struct device *dev, struct regmap *regmap,
36 		      const struct bmi270_chip_info *chip_info);
37 
38 #endif  /* BMI270_H_ */
39