diff options
Diffstat (limited to 'drivers/gpu/nvgpu/volt/volt_dev.h')
-rw-r--r-- | drivers/gpu/nvgpu/volt/volt_dev.h | 69 |
1 files changed, 69 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..5113567d --- /dev/null +++ b/drivers/gpu/nvgpu/volt/volt_dev.h | |||
@@ -0,0 +1,69 @@ | |||
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 | |||
15 | #ifndef _VOLTDEV_H_ | ||
16 | #define _VOLTDEV_H_ | ||
17 | |||
18 | #include "boardobj/boardobj.h" | ||
19 | #include "boardobj/boardobjgrp.h" | ||
20 | #include "ctrl/ctrlvolt.h" | ||
21 | |||
22 | #define VOLTAGE_TABLE_MAX_ENTRIES_ONE 1 | ||
23 | #define VOLTAGE_TABLE_MAX_ENTRIES 256 | ||
24 | |||
25 | struct voltage_device { | ||
26 | struct boardobj super; | ||
27 | u8 volt_domain; | ||
28 | u8 i2c_dev_idx; | ||
29 | u32 switch_delay_us; | ||
30 | u32 num_entries; | ||
31 | struct voltage_device_entry *pentry[VOLTAGE_TABLE_MAX_ENTRIES]; | ||
32 | struct voltage_device_entry *pcurr_entry; | ||
33 | u8 rsvd_0; | ||
34 | u8 rsvd_1; | ||
35 | u8 operation_type; | ||
36 | u32 voltage_min_uv; | ||
37 | u32 voltage_max_uv; | ||
38 | u32 volt_step_uv; | ||
39 | }; | ||
40 | |||
41 | struct voltage_device_entry { | ||
42 | u32 voltage_uv; | ||
43 | }; | ||
44 | |||
45 | struct voltage_device_metadata { | ||
46 | struct boardobjgrp_e32 volt_devices; | ||
47 | }; | ||
48 | |||
49 | /*! | ||
50 | * Extends VOLTAGE_DEVICE providing attributes specific to PWM controllers. | ||
51 | */ | ||
52 | struct voltage_device_pwm { | ||
53 | struct voltage_device super; | ||
54 | s32 voltage_base_uv; | ||
55 | s32 voltage_offset_scale_uv; | ||
56 | enum nv_pmu_pmgr_pwm_source source; | ||
57 | u32 raw_period; | ||
58 | }; | ||
59 | |||
60 | struct voltage_device_pwm_entry { | ||
61 | struct voltage_device_entry super; | ||
62 | u32 duty_cycle; | ||
63 | }; | ||
64 | /* PWM end */ | ||
65 | |||
66 | u32 volt_dev_sw_setup(struct gk20a *g); | ||
67 | u32 volt_dev_pmu_setup(struct gk20a *g); | ||
68 | |||
69 | #endif /* _VOLTDEV_H_ */ | ||