ccu_reset.h 634 B

123456789101112131415161718192021222324252627282930313233
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2016 Maxime Ripard. All rights reserved.
  4. */
  5. #ifndef _CCU_RESET_H_
  6. #define _CCU_RESET_H_
  7. #include <linux/reset-controller.h>
  8. #include <linux/spinlock.h>
  9. struct ccu_reset_map {
  10. u16 reg;
  11. u32 bit;
  12. };
  13. struct ccu_reset {
  14. void __iomem *base;
  15. struct ccu_reset_map *reset_map;
  16. spinlock_t *lock;
  17. struct reset_controller_dev rcdev;
  18. };
  19. static inline struct ccu_reset *rcdev_to_ccu_reset(struct reset_controller_dev *rcdev)
  20. {
  21. return container_of(rcdev, struct ccu_reset, rcdev);
  22. }
  23. extern const struct reset_control_ops ccu_reset_ops;
  24. #endif /* _CCU_RESET_H_ */