diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c index b68073af..8eaee190 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | |||
@@ -228,6 +228,55 @@ static DEVICE_ATTR(ptimer_scale_factor, | |||
228 | ptimer_scale_factor_show, | 228 | ptimer_scale_factor_show, |
229 | NULL); | 229 | NULL); |
230 | 230 | ||
231 | static ssize_t ptimer_ref_freq_show(struct device *dev, | ||
232 | struct device_attribute *attr, | ||
233 | char *buf) | ||
234 | { | ||
235 | struct gk20a_platform *platform = dev_get_drvdata(dev); | ||
236 | u32 src_freq_hz = platform->ptimer_src_freq; | ||
237 | ssize_t res; | ||
238 | |||
239 | if (!src_freq_hz) { | ||
240 | dev_err(dev, "reference clk_m rate is not set correctly\n"); | ||
241 | return -EINVAL; | ||
242 | } | ||
243 | |||
244 | res = sprintf(buf, "%u\n", PTIMER_REF_FREQ_HZ); | ||
245 | |||
246 | return res; | ||
247 | |||
248 | } | ||
249 | |||
250 | static DEVICE_ATTR(ptimer_ref_freq, | ||
251 | S_IRUGO, | ||
252 | ptimer_ref_freq_show, | ||
253 | NULL); | ||
254 | |||
255 | static ssize_t ptimer_src_freq_show(struct device *dev, | ||
256 | struct device_attribute *attr, | ||
257 | char *buf) | ||
258 | { | ||
259 | struct gk20a_platform *platform = dev_get_drvdata(dev); | ||
260 | u32 src_freq_hz = platform->ptimer_src_freq; | ||
261 | ssize_t res; | ||
262 | |||
263 | if (!src_freq_hz) { | ||
264 | dev_err(dev, "reference clk_m rate is not set correctly\n"); | ||
265 | return -EINVAL; | ||
266 | } | ||
267 | |||
268 | res = sprintf(buf, "%u\n", src_freq_hz); | ||
269 | |||
270 | return res; | ||
271 | |||
272 | } | ||
273 | |||
274 | static DEVICE_ATTR(ptimer_src_freq, | ||
275 | S_IRUGO, | ||
276 | ptimer_src_freq_show, | ||
277 | NULL); | ||
278 | |||
279 | |||
231 | #if defined(CONFIG_PM) && defined(CONFIG_PM_GENERIC_DOMAINS) | 280 | #if defined(CONFIG_PM) && defined(CONFIG_PM_GENERIC_DOMAINS) |
232 | static ssize_t railgate_enable_store(struct device *dev, | 281 | static ssize_t railgate_enable_store(struct device *dev, |
233 | struct device_attribute *attr, const char *buf, size_t count) | 282 | struct device_attribute *attr, const char *buf, size_t count) |
@@ -742,6 +791,8 @@ void gk20a_remove_sysfs(struct device *dev) | |||
742 | device_remove_file(dev, &dev_attr_blcg_enable); | 791 | device_remove_file(dev, &dev_attr_blcg_enable); |
743 | device_remove_file(dev, &dev_attr_slcg_enable); | 792 | device_remove_file(dev, &dev_attr_slcg_enable); |
744 | device_remove_file(dev, &dev_attr_ptimer_scale_factor); | 793 | device_remove_file(dev, &dev_attr_ptimer_scale_factor); |
794 | device_remove_file(dev, &dev_attr_ptimer_ref_freq); | ||
795 | device_remove_file(dev, &dev_attr_ptimer_src_freq); | ||
745 | device_remove_file(dev, &dev_attr_elpg_enable); | 796 | device_remove_file(dev, &dev_attr_elpg_enable); |
746 | device_remove_file(dev, &dev_attr_emc3d_ratio); | 797 | device_remove_file(dev, &dev_attr_emc3d_ratio); |
747 | device_remove_file(dev, &dev_attr_fmax_at_vmin_safe); | 798 | device_remove_file(dev, &dev_attr_fmax_at_vmin_safe); |
@@ -782,6 +833,8 @@ void gk20a_create_sysfs(struct device *dev) | |||
782 | error |= device_create_file(dev, &dev_attr_blcg_enable); | 833 | error |= device_create_file(dev, &dev_attr_blcg_enable); |
783 | error |= device_create_file(dev, &dev_attr_slcg_enable); | 834 | error |= device_create_file(dev, &dev_attr_slcg_enable); |
784 | error |= device_create_file(dev, &dev_attr_ptimer_scale_factor); | 835 | error |= device_create_file(dev, &dev_attr_ptimer_scale_factor); |
836 | error |= device_create_file(dev, &dev_attr_ptimer_ref_freq); | ||
837 | error |= device_create_file(dev, &dev_attr_ptimer_src_freq); | ||
785 | error |= device_create_file(dev, &dev_attr_elpg_enable); | 838 | error |= device_create_file(dev, &dev_attr_elpg_enable); |
786 | error |= device_create_file(dev, &dev_attr_emc3d_ratio); | 839 | error |= device_create_file(dev, &dev_attr_emc3d_ratio); |
787 | error |= device_create_file(dev, &dev_attr_fmax_at_vmin_safe); | 840 | error |= device_create_file(dev, &dev_attr_fmax_at_vmin_safe); |