summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/clk/clk_mclk.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/clk/clk_mclk.h')
-rw-r--r--drivers/gpu/nvgpu/clk/clk_mclk.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_mclk.h b/drivers/gpu/nvgpu/clk/clk_mclk.h
new file mode 100644
index 00000000..cb7f0de0
--- /dev/null
+++ b/drivers/gpu/nvgpu/clk/clk_mclk.h
@@ -0,0 +1,52 @@
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 _CLKMCLK_H_
15#define _CLKMCLK_H_
16
17#include <linux/mutex.h>
18
19enum gk20a_mclk_speed {
20 gk20a_mclk_low_speed,
21 gk20a_mclk_mid_speed,
22 gk20a_mclk_high_speed,
23};
24
25struct clk_mclk_state {
26 enum gk20a_mclk_speed speed;
27 struct mutex mclk_lock;
28 struct mutex data_lock;
29
30 u16 p5_min;
31 u16 p0_min;
32
33 void *vreg_buf;
34 bool init;
35
36 /* function pointers */
37 int (*change)(struct gk20a *g, u16 val);
38
39#ifdef CONFIG_DEBUG_FS
40 s64 switch_max;
41 s64 switch_min;
42 u64 switch_num;
43 s64 switch_avg;
44 s64 switch_std;
45 bool debugfs_set;
46#endif
47};
48
49int clk_mclkseq_init_mclk_gddr5(struct gk20a *g);
50int clk_mclkseq_change_mclk_gddr5(struct gk20a *g, u16 val);
51
52#endif