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