channel.h 855 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Tegra host1x Channel
  4. *
  5. * Copyright (c) 2010-2013, NVIDIA Corporation.
  6. */
  7. #ifndef __HOST1X_CHANNEL_H
  8. #define __HOST1X_CHANNEL_H
  9. #include <linux/io.h>
  10. #include <linux/kref.h>
  11. #include "cdma.h"
  12. struct host1x;
  13. struct host1x_channel;
  14. struct host1x_channel_list {
  15. struct host1x_channel *channels;
  16. unsigned long *allocated_channels;
  17. };
  18. struct host1x_channel {
  19. struct kref refcount;
  20. unsigned int id;
  21. struct mutex submitlock;
  22. void __iomem *regs;
  23. struct device *dev;
  24. struct host1x_cdma cdma;
  25. };
  26. /* channel list operations */
  27. int host1x_channel_list_init(struct host1x_channel_list *chlist,
  28. unsigned int num_channels);
  29. void host1x_channel_list_free(struct host1x_channel_list *chlist);
  30. struct host1x_channel *host1x_channel_get_index(struct host1x *host,
  31. unsigned int index);
  32. #endif