summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/volt/volt_dev.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/volt/volt_dev.h')
-rw-r--r--drivers/gpu/nvgpu/volt/volt_dev.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/volt/volt_dev.h b/drivers/gpu/nvgpu/volt/volt_dev.h
new file mode 100644
index 00000000..a3dc8cf6
--- /dev/null
+++ b/drivers/gpu/nvgpu/volt/volt_dev.h
@@ -0,0 +1,78 @@
1/*
2* Copyright (c) 2016, 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
24#ifndef _VOLTDEV_H_
25#define _VOLTDEV_H_
26
27#include "boardobj/boardobj.h"
28#include "boardobj/boardobjgrp.h"
29#include "ctrl/ctrlvolt.h"
30
31#define VOLTAGE_TABLE_MAX_ENTRIES_ONE 1
32#define VOLTAGE_TABLE_MAX_ENTRIES 256
33
34struct voltage_device {
35 struct boardobj super;
36 u8 volt_domain;
37 u8 i2c_dev_idx;
38 u32 switch_delay_us;
39 u32 num_entries;
40 struct voltage_device_entry *pentry[VOLTAGE_TABLE_MAX_ENTRIES];
41 struct voltage_device_entry *pcurr_entry;
42 u8 rsvd_0;
43 u8 rsvd_1;
44 u8 operation_type;
45 u32 voltage_min_uv;
46 u32 voltage_max_uv;
47 u32 volt_step_uv;
48};
49
50struct voltage_device_entry {
51 u32 voltage_uv;
52};
53
54struct voltage_device_metadata {
55 struct boardobjgrp_e32 volt_devices;
56};
57
58/*!
59 * Extends VOLTAGE_DEVICE providing attributes specific to PWM controllers.
60 */
61struct voltage_device_pwm {
62 struct voltage_device super;
63 s32 voltage_base_uv;
64 s32 voltage_offset_scale_uv;
65 enum nv_pmu_pmgr_pwm_source source;
66 u32 raw_period;
67};
68
69struct voltage_device_pwm_entry {
70 struct voltage_device_entry super;
71 u32 duty_cycle;
72};
73/* PWM end */
74
75u32 volt_dev_sw_setup(struct gk20a *g);
76u32 volt_dev_pmu_setup(struct gk20a *g);
77
78#endif /* _VOLTDEV_H_ */