From 92c43deefca150854193c6720717d56b61989c23 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 20 Jun 2017 12:18:47 -0700 Subject: gpu: nvgpu: Remove Linux devnode fields from gk20a Move Linux devnode related fields to a new header file os_linux.h. The class structure is defined in module.c, so move its declaration to module.h. JIRA NVGPU-38 Change-Id: I5d8920169064f4289ff61004f7f81543a9aba221 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1505927 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/os_linux.h | 76 +++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 drivers/gpu/nvgpu/common/linux/os_linux.h (limited to 'drivers/gpu/nvgpu/common/linux/os_linux.h') diff --git a/drivers/gpu/nvgpu/common/linux/os_linux.h b/drivers/gpu/nvgpu/common/linux/os_linux.h new file mode 100644 index 00000000..f23926b3 --- /dev/null +++ b/drivers/gpu/nvgpu/common/linux/os_linux.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#ifndef NVGPU_OS_LINUX_H +#define NVGPU_OS_LINUX_H + +#include + +#include "gk20a/gk20a.h" + +struct nvgpu_os_linux { + struct gk20a g; + + struct { + struct cdev cdev; + struct device *node; + } channel; + + struct { + struct cdev cdev; + struct device *node; + } ctrl; + + struct { + struct cdev cdev; + struct device *node; + } as_dev; + + struct { + struct cdev cdev; + struct device *node; + } dbg; + + struct { + struct cdev cdev; + struct device *node; + } prof; + + struct { + struct cdev cdev; + struct device *node; + } tsg; + + struct { + struct cdev cdev; + struct device *node; + } ctxsw; + + struct { + struct cdev cdev; + struct device *node; + } sched; + + dev_t cdev_region; +}; + +static inline struct nvgpu_os_linux *nvgpu_os_linux_from_gk20a(struct gk20a *g) +{ + return container_of(g, struct nvgpu_os_linux, g); +} + +#define INTERFACE_NAME "nvhost%s-gpu" + +#endif -- cgit v1.2.2