reset-controller.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef _LINUX_RESET_CONTROLLER_H_
  2. #define _LINUX_RESET_CONTROLLER_H_
  3. #include <linux/list.h>
  4. struct reset_controller_dev;
  5. /**
  6. * struct reset_control_ops
  7. *
  8. * @reset: for self-deasserting resets, does all necessary
  9. * things to reset the device
  10. * @assert: manually assert the reset line, if supported
  11. * @deassert: manually deassert the reset line, if supported
  12. */
  13. struct reset_control_ops {
  14. int (*reset)(struct reset_controller_dev *rcdev, unsigned long id);
  15. int (*assert)(struct reset_controller_dev *rcdev, unsigned long id);
  16. int (*deassert)(struct reset_controller_dev *rcdev, unsigned long id);
  17. };
  18. struct module;
  19. struct device_node;
  20. /**
  21. * struct reset_controller_dev - reset controller entity that might
  22. * provide multiple reset controls
  23. * @ops: a pointer to device specific struct reset_control_ops
  24. * @owner: kernel module of the reset controller driver
  25. * @list: internal list of reset controller devices
  26. * @of_node: corresponding device tree node as phandle target
  27. * @of_reset_n_cells: number of cells in reset line specifiers
  28. * @of_xlate: translation function to translate from specifier as found in the
  29. * device tree to id as given to the reset control ops
  30. * @nr_resets: number of reset controls in this reset controller device
  31. */
  32. struct reset_controller_dev {
  33. struct reset_control_ops *ops;
  34. struct module *owner;
  35. struct list_head list;
  36. struct device_node *of_node;
  37. int of_reset_n_cells;
  38. int (*of_xlate)(struct reset_controller_dev *rcdev,
  39. const struct of_phandle_args *reset_spec);
  40. unsigned int nr_resets;
  41. };
  42. int reset_controller_register(struct reset_controller_dev *rcdev);
  43. void reset_controller_unregister(struct reset_controller_dev *rcdev);
  44. #endif