1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * ADXL355 3-Axis Digital Accelerometer
4  *
5  * Copyright (c) 2021 Puranjay Mohan <puranjay12@gmail.com>
6  */
7 
8 #ifndef _ADXL355_H_
9 #define _ADXL355_H_
10 
11 #include <linux/regmap.h>
12 
13 enum adxl355_device_type {
14 	ADXL355,
15 	ADXL359,
16 };
17 
18 struct adxl355_fractional_type {
19 	int integer;
20 	int decimal;
21 };
22 
23 struct device;
24 
25 struct adxl355_chip_info {
26 	const char			*name;
27 	u8				part_id;
28 	struct adxl355_fractional_type	accel_scale;
29 	struct adxl355_fractional_type	temp_offset;
30 };
31 
32 extern const struct regmap_access_table adxl355_readable_regs_tbl;
33 extern const struct regmap_access_table adxl355_writeable_regs_tbl;
34 extern const struct adxl355_chip_info adxl35x_chip_info[];
35 
36 int adxl355_core_probe(struct device *dev, struct regmap *regmap,
37 		       const struct adxl355_chip_info *chip_info);
38 
39 #endif /* _ADXL355_H_ */
40