diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-04-19 17:09:05 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-27 06:57:13 -0400 |
commit | 8b3d94ffd3e5b6d7a622c6ad54692d79bf39d1ce (patch) | |
tree | fb8648cd40e99892e18e28de8e8851915a0ac0b9 /drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c | |
parent | 52445fba1feac3ee20bf1c3db149adc42715af9e (diff) |
gpu: nvgpu: Move sysfs dependencies from HAL to Linux
Move sysfs dependencies from gk20a/ and gp10b/ to common/linux. At
the same time the gk20a and gp10b variants are merged into one.
JIRA NVGPU-48
Change-Id: I212be8f1beb8d20a57de04a57513e8fa0e2e83b4
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master/r/1466055
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c b/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c deleted file mode 100644 index 1c90d2f9..00000000 --- a/drivers/gpu/nvgpu/gp10b/gp10b_sysfs.c +++ /dev/null | |||
@@ -1,68 +0,0 @@ | |||
1 | /* | ||
2 | * GP10B specific sysfs files | ||
3 | * | ||
4 | * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms and conditions of the GNU General Public License, | ||
8 | * version 2, as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
13 | * more details. | ||
14 | */ | ||
15 | |||
16 | #include <linux/platform_device.h> | ||
17 | |||
18 | #include "gk20a/gk20a.h" | ||
19 | #include "gk20a/platform_gk20a.h" | ||
20 | #include "gp10b_sysfs.h" | ||
21 | |||
22 | #include <nvgpu/hw/gp10b/hw_gr_gp10b.h> | ||
23 | |||
24 | #define ROOTRW (S_IRWXU|S_IRGRP|S_IROTH) | ||
25 | |||
26 | static ssize_t czf_bypass_store(struct device *dev, | ||
27 | struct device_attribute *attr, const char *buf, size_t count) | ||
28 | { | ||
29 | struct gk20a *g = get_gk20a(dev); | ||
30 | unsigned long val; | ||
31 | |||
32 | if (kstrtoul(buf, 10, &val) < 0) | ||
33 | return -EINVAL; | ||
34 | |||
35 | if (val >= 4) | ||
36 | return -EINVAL; | ||
37 | |||
38 | g->gr.czf_bypass = val; | ||
39 | |||
40 | return count; | ||
41 | } | ||
42 | |||
43 | static ssize_t czf_bypass_read(struct device *dev, | ||
44 | struct device_attribute *attr, char *buf) | ||
45 | { | ||
46 | struct gk20a *g = get_gk20a(dev); | ||
47 | |||
48 | return sprintf(buf, "%d\n", g->gr.czf_bypass); | ||
49 | } | ||
50 | |||
51 | static DEVICE_ATTR(czf_bypass, ROOTRW, czf_bypass_read, czf_bypass_store); | ||
52 | |||
53 | void gp10b_create_sysfs(struct device *dev) | ||
54 | { | ||
55 | struct gk20a *g = get_gk20a(dev); | ||
56 | int error = 0; | ||
57 | |||
58 | g->gr.czf_bypass = gr_gpc0_prop_debug1_czf_bypass_init_v(); | ||
59 | |||
60 | error |= device_create_file(dev, &dev_attr_czf_bypass); | ||
61 | if (error) | ||
62 | nvgpu_err(g, "Failed to create sysfs attributes!"); | ||
63 | } | ||
64 | |||
65 | void gp10b_remove_sysfs(struct device *dev) | ||
66 | { | ||
67 | device_remove_file(dev, &dev_attr_czf_bypass); | ||
68 | } | ||