-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbmi260.h
48 lines (37 loc) · 1.37 KB
/
bmi260.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef BMI260_H_
#define BMI260_H_
#include <linux/version.h>
#include <linux/iio/iio.h>
#include <linux/regulator/consumer.h>
enum bmi260_int_pin {
BMI260_PIN_INT1,
BMI260_PIN_INT2
};
struct bmi260_data {
struct regmap *regmap;
struct iio_trigger *trig;
struct regulator_bulk_data supplies[2];
struct iio_mount_matrix orientation;
enum bmi260_int_pin int_pin;
/*
* Ensure natural alignment for timestamp if present.
* Max length needed: 2 * 3 channels + 4 bytes padding + 8 byte ts.
* If fewer channels are enabled, less space may be needed, as
* long as the timestamp is still aligned to 8 bytes.
*/
__le16 buf[12] __aligned(8);
};
extern const struct regmap_config bmi260_regmap_config;
int bmi260_core_probe(struct device *dev, struct regmap *regmap,
int irq, const char *name, bool use_spi);
int bmi260_enable_irq(struct regmap *regmap, enum bmi260_int_pin pin, bool enable);
int bmi260_probe_trigger(struct iio_dev *indio_dev, int irq, u32 irq_type);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 13, 0)
#define BMI260_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL_NS_GPL(symbol, "IIO_BMI260");
#define BMI260_IMPORT_NS MODULE_IMPORT_NS("IIO_BMI260");
#else
#define BMI260_EXPORT_SYMBOL(symbol) EXPORT_SYMBOL_NS_GPL(symbol, IIO_BMI260);
#define BMI260_IMPORT_NS MODULE_IMPORT_NS(IIO_BMI260);
#endif
#endif /* BMI260_H_ */