reset-controller.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. struct of_phandle_args;
  21. /**
  22. * struct reset_controller_dev - reset controller entity that might
  23. * provide multiple reset controls
  24. * @ops: a pointer to device specific struct reset_control_ops
  25. * @owner: kernel module of the reset controller driver
  26. * @list: internal list of reset controller devices
  27. * @of_node: corresponding device tree node as phandle target
  28. * @of_reset_n_cells: number of cells in reset line specifiers
  29. * @of_xlate: translation function to translate from specifier as found in the
  30. * device tree to id as given to the reset control ops
  31. * @nr_resets: number of reset controls in this reset controller device
  32. */
  33. struct reset_controller_dev {
  34. struct reset_control_ops *ops;
  35. struct module *owner;
  36. struct list_head list;
  37. struct device_node *of_node;
  38. int of_reset_n_cells;
  39. int (*of_xlate)(struct reset_controller_dev *rcdev,
  40. const struct of_phandle_args *reset_spec);
  41. unsigned int nr_resets;
  42. };
  43. int reset_controller_register(struct reset_controller_dev *rcdev);
  44. void reset_controller_unregister(struct reset_controller_dev *rcdev);
  45. #endif