iio: imu: bmi270: move private struct declaration to source file

The device's private data struct is currently declared in the header
file, but it does not need to be exposed there. Move it to the driver's
core source file to avoid unnecessary #include directives or forward
declarations in the header.

Signed-off-by: Gustavo Silva <gustavograzs@gmail.com>
Acked-by: Alex Lanzano <lanzano.alex@gmail.com>
Link: https://patch.msgid.link/20250219-bmi270-irq-v1-1-145d02bbca3b@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Gustavo Silva
2025-02-19 20:54:45 -03:00
committed by Jonathan Cameron
parent 25331775b5
commit 4e0bd62e80
2 changed files with 16 additions and 16 deletions

View File

@@ -6,22 +6,6 @@
#include <linux/regmap.h>
#include <linux/iio/iio.h>
struct device;
struct bmi270_data {
struct device *dev;
struct regmap *regmap;
const struct bmi270_chip_info *chip_info;
/*
* Where IIO_DMA_MINALIGN may be larger than 8 bytes, align to
* that to ensure a DMA safe buffer.
*/
struct {
__le16 channels[6];
aligned_s64 timestamp;
} data __aligned(IIO_DMA_MINALIGN);
};
struct bmi270_chip_info {
const char *name;
int chip_id;
@@ -32,6 +16,7 @@ extern const struct regmap_config bmi270_regmap_config;
extern const struct bmi270_chip_info bmi260_chip_info;
extern const struct bmi270_chip_info bmi270_chip_info;
struct device;
int bmi270_core_probe(struct device *dev, struct regmap *regmap,
const struct bmi270_chip_info *chip_info);

View File

@@ -78,6 +78,21 @@
#define BMI260_INIT_DATA_FILE "bmi260-init-data.fw"
#define BMI270_INIT_DATA_FILE "bmi270-init-data.fw"
struct bmi270_data {
struct device *dev;
struct regmap *regmap;
const struct bmi270_chip_info *chip_info;
/*
* Where IIO_DMA_MINALIGN may be larger than 8 bytes, align to
* that to ensure a DMA safe buffer.
*/
struct {
__le16 channels[6];
aligned_s64 timestamp;
} data __aligned(IIO_DMA_MINALIGN);
};
enum bmi270_scan {
BMI270_SCAN_ACCEL_X,
BMI270_SCAN_ACCEL_Y,