mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
Remove static class definition and registration for iGPU and dGPU. Create the class dynamically in gk20a_user_init() and setup the callback function to create devnode name based on GPU type. For now add nvgpu_pci_devnode() callback for dGPU that sets correct dev node path for dGPUs. For iGPU, Android apparently does not honor dev node path set in callback and hence override the device name for iGPU with function nvgpu_devnode(). Destroy the class in gk20a_user_deinit(). This will overall be helpful in adding multiple classes and dev nodes for each GPU instance in MIG mode. Set GPU device pointer as the parent of new devices created with device_create(). This is helpful in getting GPU device name in callback function nvgpu_pci_devnode(). Update functions to not pass class structure and interface names : nvgpu_probe() gk20a_user_init() gk20a_user_deinit() nvgpu_remove() Remove static interface name format like INTERFACE_NAME since it is no longer needed. Update GK20A_NUM_CDEVS to 10 since there are 10 dev nodes per GPU right now. Jira NVGPU-5648 Change-Id: I5d41db5a0f87fa4a558297fb4135a9fbfcd51080 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2423492 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
38 lines
1.4 KiB
C
38 lines
1.4 KiB
C
/*
|
|
* Copyright (c) 2011-2018, 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.
|
|
*/
|
|
#ifndef __NVGPU_COMMON_LINUX_MODULE_H__
|
|
#define __NVGPU_COMMON_LINUX_MODULE_H__
|
|
|
|
struct gk20a;
|
|
struct device;
|
|
struct platform_device;
|
|
struct nvgpu_os_linux;
|
|
|
|
int gk20a_pm_finalize_poweron(struct device *dev);
|
|
int nvgpu_finalize_poweron_linux(struct nvgpu_os_linux *l);
|
|
void gk20a_remove_support(struct gk20a *g);
|
|
void gk20a_driver_start_unload(struct gk20a *g);
|
|
int nvgpu_quiesce(struct gk20a *g);
|
|
int nvgpu_remove(struct device *dev);
|
|
int nvgpu_wait_for_gpu_idle(struct gk20a *g);
|
|
void nvgpu_free_irq(struct gk20a *g);
|
|
struct device_node *nvgpu_get_node(struct gk20a *g);
|
|
void __iomem *nvgpu_devm_ioremap_resource(struct platform_device *dev, int i,
|
|
struct resource **out);
|
|
void __iomem *nvgpu_devm_ioremap(struct device *dev, resource_size_t offset,
|
|
resource_size_t size);
|
|
u64 nvgpu_resource_addr(struct platform_device *dev, int i);
|
|
extern struct class nvgpu_class;
|
|
void gk20a_init_linux_characteristics(struct gk20a *g);
|
|
#endif
|