From 16723e5d282ca40aeced4c2767fca6fb0ecf2bc3 Mon Sep 17 00:00:00 2001 From: Alex Frid Date: Wed, 5 Nov 2014 21:54:33 -0800 Subject: gpu: nvgpu: Add GPCPLL parameters to GM20b debugfs Bug 1555318 Change-Id: I0338e5d46c7f7d910faada0205dccf28aa62d6c2 Signed-off-by: Alex Frid Reviewed-on: http://git-master/r/594746 Reviewed-by: Yu-Huan Hsu --- drivers/gpu/nvgpu/gm20b/clk_gm20b.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'drivers/gpu/nvgpu/gm20b/clk_gm20b.c') diff --git a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c index 29a47f7c..f7404f81 100644 --- a/drivers/gpu/nvgpu/gm20b/clk_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/clk_gm20b.c @@ -1603,6 +1603,26 @@ static int monitor_get(void *data, u64 *val) } DEFINE_SIMPLE_ATTRIBUTE(monitor_fops, monitor_get, NULL, "%llu\n"); +static int pll_param_show(struct seq_file *s, void *data) +{ + seq_printf(s, "ADC offs = %d uV, ADC slope = %d uV, VCO ctrl = 0x%x\n", + gpc_pll_params.uvdet_offs, gpc_pll_params.uvdet_slope, + gpc_pll_params.vco_ctrl); + return 0; +} + +static int pll_param_open(struct inode *inode, struct file *file) +{ + return single_open(file, pll_param_show, inode->i_private); +} + +static const struct file_operations pll_param_fops = { + .open = pll_param_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + static int clk_gm20b_debugfs_init(struct gk20a *g) { struct dentry *d; @@ -1628,6 +1648,16 @@ static int clk_gm20b_debugfs_init(struct gk20a *g) if (!d) goto err_out; + d = debugfs_create_file( + "pll_param", S_IRUGO, platform->debugfs, g, &pll_param_fops); + if (!d) + goto err_out; + + d = debugfs_create_u32("pll_na_mode", S_IRUGO, platform->debugfs, + (u32 *)&g->clk.gpc_pll.mode); + if (!d) + goto err_out; + return 0; err_out: -- cgit v1.2.2