pcc.h 807 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * PCC (Platform Communications Channel) methods
  4. */
  5. #ifndef _PCC_H
  6. #define _PCC_H
  7. #include <linux/mailbox_controller.h>
  8. #include <linux/mailbox_client.h>
  9. struct pcc_mbox_chan {
  10. struct mbox_chan *mchan;
  11. u64 shmem_base_addr;
  12. u64 shmem_size;
  13. u32 latency;
  14. u32 max_access_rate;
  15. u16 min_turnaround_time;
  16. };
  17. #define MAX_PCC_SUBSPACES 256
  18. #ifdef CONFIG_PCC
  19. extern struct pcc_mbox_chan *
  20. pcc_mbox_request_channel(struct mbox_client *cl, int subspace_id);
  21. extern void pcc_mbox_free_channel(struct pcc_mbox_chan *chan);
  22. #else
  23. static inline struct pcc_mbox_chan *
  24. pcc_mbox_request_channel(struct mbox_client *cl, int subspace_id)
  25. {
  26. return ERR_PTR(-ENODEV);
  27. }
  28. static inline void pcc_mbox_free_channel(struct pcc_mbox_chan *chan) { }
  29. #endif
  30. #endif /* _PCC_H */