reset-spacemit-common.h 973 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * SpacemiT reset controller driver - common definitions
  4. */
  5. #ifndef _RESET_SPACEMIT_COMMON_H_
  6. #define _RESET_SPACEMIT_COMMON_H_
  7. #include <linux/auxiliary_bus.h>
  8. #include <linux/regmap.h>
  9. #include <linux/reset-controller.h>
  10. #include <linux/types.h>
  11. struct ccu_reset_data {
  12. u32 offset;
  13. u32 assert_mask;
  14. u32 deassert_mask;
  15. };
  16. struct ccu_reset_controller_data {
  17. const struct ccu_reset_data *reset_data; /* array */
  18. size_t count;
  19. };
  20. struct ccu_reset_controller {
  21. struct reset_controller_dev rcdev;
  22. const struct ccu_reset_controller_data *data;
  23. struct regmap *regmap;
  24. };
  25. #define RESET_DATA(_offset, _assert_mask, _deassert_mask) \
  26. { \
  27. .offset = (_offset), \
  28. .assert_mask = (_assert_mask), \
  29. .deassert_mask = (_deassert_mask), \
  30. }
  31. /* Common probe function */
  32. int spacemit_reset_probe(struct auxiliary_device *adev,
  33. const struct auxiliary_device_id *id);
  34. #endif /* _RESET_SPACEMIT_COMMON_H_ */