aboutsummaryrefslogtreecommitdiffstats
path: root/include/clk/clk_vin.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clk/clk_vin.h')
-rw-r--r--include/clk/clk_vin.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/include/clk/clk_vin.h b/include/clk/clk_vin.h
new file mode 100644
index 0000000..73b93e4
--- /dev/null
+++ b/include/clk/clk_vin.h
@@ -0,0 +1,79 @@
1/*
2* Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
3*
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21*/
22
23#ifndef NVGPU_CLK_VIN_H
24#define NVGPU_CLK_VIN_H
25
26#include "boardobj/boardobj.h"
27#include "boardobj/boardobjgrp.h"
28#include "boardobj/boardobjgrp_e32.h"
29
30struct vin_device;
31struct clk_pmupstate;
32
33struct avfsvinobjs {
34 struct boardobjgrp_e32 super;
35 u8 calibration_rev_vbios;
36 u8 calibration_rev_fused;
37 bool vin_is_disable_allowed;
38};
39typedef u32 vin_device_state_load(struct gk20a *g,
40 struct clk_pmupstate *clk, struct vin_device *pdev);
41
42struct vin_device {
43 struct boardobj super;
44 u8 id;
45 u8 volt_domain;
46 u8 volt_domain_vbios;
47 u32 flls_shared_mask;
48
49 vin_device_state_load *state_load;
50};
51
52struct vin_device_v10 {
53 struct vin_device super;
54 struct ctrl_clk_vin_device_info_data_v10 data;
55};
56
57struct vin_device_v20 {
58 struct vin_device super;
59 struct ctrl_clk_vin_device_info_data_v20 data;
60};
61
62/* get vin device object from descriptor table index*/
63#define CLK_GET_VIN_DEVICE(pvinobjs, dev_index) \
64 ((struct vin_device *)BOARDOBJGRP_OBJ_GET_BY_IDX( \
65 ((struct boardobjgrp *)&(pvinobjs->super.super)), (dev_index)))
66
67boardobj_construct construct_vindevice;
68boardobj_pmudatainit vindeviceinit_pmudata_super;
69
70int clk_vin_sw_setup(struct gk20a *g);
71int clk_vin_pmu_setup(struct gk20a *g);
72u32 clk_avfs_get_vin_cal_fuse_v10(struct gk20a *g,
73 struct avfsvinobjs *pvinobjs,
74 struct vin_device_v20 *pvindev);
75u32 clk_avfs_get_vin_cal_fuse_v20(struct gk20a *g,
76 struct avfsvinobjs *pvinobjs,
77 struct vin_device_v20 *pvindev);
78
79#endif /* NVGPU_CLK_VIN_H */