ccu_reset.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) 2016 Maxime Ripard. All rights reserved.
  3. *
  4. * This software is licensed under the terms of the GNU General Public
  5. * License version 2, as published by the Free Software Foundation, and
  6. * may be copied, distributed, and modified under those terms.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. #ifndef _CCU_RESET_H_
  14. #define _CCU_RESET_H_
  15. #include <linux/reset-controller.h>
  16. #include <linux/spinlock.h>
  17. struct ccu_reset_map {
  18. u16 reg;
  19. u32 bit;
  20. };
  21. struct ccu_reset {
  22. void __iomem *base;
  23. struct ccu_reset_map *reset_map;
  24. spinlock_t *lock;
  25. struct reset_controller_dev rcdev;
  26. };
  27. static inline struct ccu_reset *rcdev_to_ccu_reset(struct reset_controller_dev *rcdev)
  28. {
  29. return container_of(rcdev, struct ccu_reset, rcdev);
  30. }
  31. extern const struct reset_control_ops ccu_reset_ops;
  32. #endif /* _CCU_RESET_H_ */