cadence_master.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
  2. // Copyright(c) 2015-17 Intel Corporation.
  3. #ifndef __SDW_CADENCE_H
  4. #define __SDW_CADENCE_H
  5. /**
  6. * struct sdw_cdns - Cadence driver context
  7. * @dev: Linux device
  8. * @bus: Bus handle
  9. * @instance: instance number
  10. * @response_buf: SoundWire response buffer
  11. * @tx_complete: Tx completion
  12. * @defer: Defer pointer
  13. * @registers: Cadence registers
  14. * @link_up: Link status
  15. * @msg_count: Messages sent on bus
  16. */
  17. struct sdw_cdns {
  18. struct device *dev;
  19. struct sdw_bus bus;
  20. unsigned int instance;
  21. u32 response_buf[0x80];
  22. struct completion tx_complete;
  23. struct sdw_defer *defer;
  24. void __iomem *registers;
  25. bool link_up;
  26. unsigned int msg_count;
  27. };
  28. #define bus_to_cdns(_bus) container_of(_bus, struct sdw_cdns, bus)
  29. /* Exported symbols */
  30. int sdw_cdns_probe(struct sdw_cdns *cdns);
  31. extern struct sdw_master_ops sdw_cdns_master_ops;
  32. irqreturn_t sdw_cdns_irq(int irq, void *dev_id);
  33. irqreturn_t sdw_cdns_thread(int irq, void *dev_id);
  34. int sdw_cdns_init(struct sdw_cdns *cdns);
  35. int sdw_cdns_enable_interrupt(struct sdw_cdns *cdns);
  36. #endif /* __SDW_CADENCE_H */