Terje Bergstrom | 6579324 | 2013-03-22 16:34:03 +0200 | [diff] [blame] | 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 | |
| 19 | #ifndef __HOST1X_CHANNEL_H |
| 20 | #define __HOST1X_CHANNEL_H |
| 21 | |
| 22 | #include <linux/io.h> |
Mikko Perttunen | 8474b02 | 2017-06-15 02:18:42 +0300 | [diff] [blame] | 23 | #include <linux/kref.h> |
Terje Bergstrom | 6579324 | 2013-03-22 16:34:03 +0200 | [diff] [blame] | 24 | |
| 25 | #include "cdma.h" |
| 26 | |
| 27 | struct host1x; |
Mikko Perttunen | 8474b02 | 2017-06-15 02:18:42 +0300 | [diff] [blame] | 28 | struct host1x_channel; |
| 29 | |
| 30 | struct host1x_channel_list { |
| 31 | struct host1x_channel *channels; |
| 32 | unsigned long *allocated_channels; |
| 33 | }; |
Terje Bergstrom | 6579324 | 2013-03-22 16:34:03 +0200 | [diff] [blame] | 34 | |
| 35 | struct host1x_channel { |
Mikko Perttunen | 8474b02 | 2017-06-15 02:18:42 +0300 | [diff] [blame] | 36 | struct kref refcount; |
Terje Bergstrom | 6579324 | 2013-03-22 16:34:03 +0200 | [diff] [blame] | 37 | unsigned int id; |
Terje Bergstrom | 6579324 | 2013-03-22 16:34:03 +0200 | [diff] [blame] | 38 | struct mutex submitlock; |
| 39 | void __iomem *regs; |
| 40 | struct device *dev; |
| 41 | struct host1x_cdma cdma; |
| 42 | }; |
| 43 | |
| 44 | /* channel list operations */ |
Mikko Perttunen | 8474b02 | 2017-06-15 02:18:42 +0300 | [diff] [blame] | 45 | int host1x_channel_list_init(struct host1x_channel_list *chlist, |
| 46 | unsigned int num_channels); |
| 47 | void host1x_channel_list_free(struct host1x_channel_list *chlist); |
| 48 | struct host1x_channel *host1x_channel_get_index(struct host1x *host, |
| 49 | unsigned int index); |
Terje Bergstrom | 6579324 | 2013-03-22 16:34:03 +0200 | [diff] [blame] | 50 | |
| 51 | #endif |