channel.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Tegra host1x Channel
  3. *
  4. * Copyright (c) 2010-2013, NVIDIA Corporation.
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms and conditions of the GNU General Public License,
  8. * version 2, as published by the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef __HOST1X_CHANNEL_H
  19. #define __HOST1X_CHANNEL_H
  20. #include <linux/io.h>
  21. #include <linux/kref.h>
  22. #include "cdma.h"
  23. struct host1x;
  24. struct host1x_channel;
  25. struct host1x_channel_list {
  26. struct host1x_channel *channels;
  27. unsigned long *allocated_channels;
  28. };
  29. struct host1x_channel {
  30. struct kref refcount;
  31. unsigned int id;
  32. struct mutex submitlock;
  33. void __iomem *regs;
  34. struct device *dev;
  35. struct host1x_cdma cdma;
  36. };
  37. /* channel list operations */
  38. int host1x_channel_list_init(struct host1x_channel_list *chlist,
  39. unsigned int num_channels);
  40. void host1x_channel_list_free(struct host1x_channel_list *chlist);
  41. struct host1x_channel *host1x_channel_get_index(struct host1x *host,
  42. unsigned int index);
  43. #endif