diff options
author | Vijayakumar Subbu <vsubbu@nvidia.com> | 2016-07-28 01:29:15 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-09-29 16:17:46 -0400 |
commit | b17d9708c9e9930778de43de1edf1385acb13ebd (patch) | |
tree | fc485e96cc19575d463c61c8b80a09dd89745f3f /drivers/gpu/nvgpu/boardobj/boardobj.h | |
parent | 27b47b1969d7d9cdd3de9fd6f0131ad357f4b0fa (diff) |
gpu: nvgpu: Add dGPU clocks support
JIRA DNVGPU-45
Change-Id: I237ce81e31b036c05c82d46eea8694ffe1c2e3df
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Signed-off-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-on: http://git-master/r/1205849
(cherry picked from commit 9a4006f76b75a8ad525e7aa5ad1f609aaae49126)
Reviewed-on: http://git-master/r/1227256
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/boardobj/boardobj.h')
-rw-r--r-- | drivers/gpu/nvgpu/boardobj/boardobj.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/boardobj/boardobj.h b/drivers/gpu/nvgpu/boardobj/boardobj.h new file mode 100644 index 00000000..3d437a82 --- /dev/null +++ b/drivers/gpu/nvgpu/boardobj/boardobj.h | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | */ | ||
13 | |||
14 | #ifndef _BOARDOBJ_H_ | ||
15 | #define _BOARDOBJ_H_ | ||
16 | |||
17 | struct boardobj; | ||
18 | |||
19 | #include <linux/nvgpu.h> | ||
20 | #include "gk20a/gk20a.h" | ||
21 | #include "gk20a/pmu_gk20a.h" | ||
22 | #include "ctrl/ctrlboardobj.h" | ||
23 | #include "pmuif/gpmuifboardobj.h" | ||
24 | |||
25 | /* | ||
26 | * check whether the specified BOARDOBJ object implements the queried | ||
27 | * type/class enumeration. | ||
28 | */ | ||
29 | typedef bool boardobj_implements(struct gk20a *g, struct boardobj *pboardobj, | ||
30 | u8 type); | ||
31 | |||
32 | /* | ||
33 | * Fills out the appropriate the nv_pmu_xxxx_device_desc_<xyz> driver->PMU | ||
34 | * description structure, describing this BOARDOBJ board device to the PMU. | ||
35 | * | ||
36 | */ | ||
37 | typedef u32 boardobj_pmudatainit(struct gk20a *g, struct boardobj *pboardobj, | ||
38 | struct nv_pmu_boardobj *pmudata); | ||
39 | |||
40 | /* | ||
41 | * Constructor for the base Board Object. Called by each device-specific | ||
42 | * implementation of the BOARDOBJ interface to initialize the board object. | ||
43 | */ | ||
44 | typedef u32 boardobj_construct(struct gk20a *g, struct boardobj **pboardobj, | ||
45 | u16 size, void *args); | ||
46 | |||
47 | /* | ||
48 | * Destructor for the base board object. Called by each device-Specific | ||
49 | * implementation of the BOARDOBJ interface to destroy the board object. | ||
50 | * This has to be explicitly set by each device that extends from the | ||
51 | * board object. | ||
52 | */ | ||
53 | typedef u32 boardobj_destruct(struct boardobj *pboardobj); | ||
54 | |||
55 | /* | ||
56 | * Base Class for all physical or logical device on the PCB. | ||
57 | * Contains fields common to all devices on the board. Specific types of | ||
58 | * devices may extend this object adding any details specific to that | ||
59 | * device or device-type. | ||
60 | */ | ||
61 | |||
62 | struct boardobj { | ||
63 | u8 type; /*type of the device*/ | ||
64 | u8 idx; /*index of boardobj within in its group*/ | ||
65 | u32 type_mask; /*mask of types this boardobjimplements*/ | ||
66 | boardobj_implements *implements; | ||
67 | boardobj_destruct *destruct; | ||
68 | /* | ||
69 | * Access interface apis which will be overridden by the devices | ||
70 | * that inherit from BOARDOBJ | ||
71 | */ | ||
72 | boardobj_pmudatainit *pmudatainit; | ||
73 | }; | ||
74 | |||
75 | boardobj_construct boardobj_construct_super; | ||
76 | boardobj_destruct boardobj_destruct_super; | ||
77 | boardobj_implements boardobj_implements_super; | ||
78 | boardobj_pmudatainit boardobj_pmudatainit_super; | ||
79 | |||
80 | #define BOARDOBJ_GET_TYPE(pobj) (((struct boardobj *)(pobj))->type) | ||
81 | #define BOARDOBJ_GET_IDX(pobj) (((struct boardobj *)(pobj))->idx) | ||
82 | |||
83 | #endif | ||