adxl355.h 853 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. #ifndef _ADXL355_H_
  8. #define _ADXL355_H_
  9. #include <linux/regmap.h>
  10. enum adxl355_device_type {
  11. ADXL355,
  12. ADXL359,
  13. };
  14. struct adxl355_fractional_type {
  15. int integer;
  16. int decimal;
  17. };
  18. struct device;
  19. struct adxl355_chip_info {
  20. const char *name;
  21. u8 part_id;
  22. struct adxl355_fractional_type accel_scale;
  23. struct adxl355_fractional_type temp_offset;
  24. };
  25. extern const struct regmap_access_table adxl355_readable_regs_tbl;
  26. extern const struct regmap_access_table adxl355_writeable_regs_tbl;
  27. extern const struct adxl355_chip_info adxl35x_chip_info[];
  28. int adxl355_core_probe(struct device *dev, struct regmap *regmap,
  29. const struct adxl355_chip_info *chip_info);
  30. #endif /* _ADXL355_H_ */