intel.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) */
  2. /* Copyright(c) 2015-17 Intel Corporation. */
  3. #ifndef __SDW_INTEL_LOCAL_H
  4. #define __SDW_INTEL_LOCAL_H
  5. /**
  6. * struct sdw_intel_link_res - Soundwire Intel link resource structure,
  7. * typically populated by the controller driver.
  8. * @mmio_base: mmio base of SoundWire registers
  9. * @registers: Link IO registers base
  10. * @shim: Audio shim pointer
  11. * @alh: ALH (Audio Link Hub) pointer
  12. * @irq: Interrupt line
  13. * @ops: Shim callback ops
  14. * @dev: device implementing hw_params and free callbacks
  15. * @shim_lock: mutex to handle access to shared SHIM registers
  16. * @shim_mask: global pointer to check SHIM register initialization
  17. * @clock_stop_quirks: mask defining requested behavior on pm_suspend
  18. * @link_mask: global mask needed for power-up/down sequences
  19. * @cdns: Cadence master descriptor
  20. * @list: used to walk-through all masters exposed by the same controller
  21. */
  22. struct sdw_intel_link_res {
  23. void __iomem *mmio_base; /* not strictly needed, useful for debug */
  24. void __iomem *registers;
  25. void __iomem *shim;
  26. void __iomem *alh;
  27. int irq;
  28. const struct sdw_intel_ops *ops;
  29. struct device *dev;
  30. struct mutex *shim_lock; /* protect shared registers */
  31. u32 *shim_mask;
  32. u32 clock_stop_quirks;
  33. u32 link_mask;
  34. struct sdw_cdns *cdns;
  35. struct list_head list;
  36. };
  37. struct sdw_intel {
  38. struct sdw_cdns cdns;
  39. int instance;
  40. struct sdw_intel_link_res *link_res;
  41. bool startup_done;
  42. #ifdef CONFIG_DEBUG_FS
  43. struct dentry *debugfs;
  44. #endif
  45. };
  46. int intel_link_startup(struct auxiliary_device *auxdev);
  47. int intel_link_process_wakeen_event(struct auxiliary_device *auxdev);
  48. struct sdw_intel_link_dev {
  49. struct auxiliary_device auxdev;
  50. struct sdw_intel_link_res link_res;
  51. };
  52. #define auxiliary_dev_to_sdw_intel_link_dev(auxiliary_dev) \
  53. container_of(auxiliary_dev, struct sdw_intel_link_dev, auxdev)
  54. #endif /* __SDW_INTEL_LOCAL_H */