limit usr ion fd up to 1023, original limitation 255 maybe cause overflow
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-rockchip / cpu.c
1 #include <linux/kernel.h>
2 #include <linux/cpu.h>
3 #include <linux/rockchip/cpu.h>
4
5 unsigned long rockchip_soc_id;
6 EXPORT_SYMBOL(rockchip_soc_id);
7
8 static ssize_t type_show(struct device *dev, struct device_attribute *attr, char *buf)
9 {
10         const char *type;
11
12         if (cpu_is_rk3288())
13                 type = "rk3288";
14         else if (cpu_is_rk319x())
15                 type = "rk319x";
16         else if (cpu_is_rk3188())
17                 type = "rk3188";
18         else if (cpu_is_rk3066b())
19                 type = "rk3066b";
20         else if (cpu_is_rk3026())
21                 type = "rk3026";
22         else if (cpu_is_rk30xx())
23                 type = "rk30xx";
24         else if (cpu_is_rk2928())
25                 type = "rk2928";
26         else
27                 type = "";
28
29         return sprintf(buf, "%s\n", type);
30 }
31
32 static struct device_attribute type_attr = __ATTR_RO(type);
33
34 static ssize_t soc_show(struct device *dev, struct device_attribute *attr, char *buf)
35 {
36         const char *soc;
37
38         if (soc_is_rk3288())
39                 soc = "rk3288";
40         else if (soc_is_rk3190())
41                 soc = "rk3190";
42         else if (soc_is_rk3188plus())
43                 soc = "rk3188+";
44         else if (soc_is_rk3188())
45                 soc = "rk3188";
46         else if (soc_is_rk3168())
47                 soc = "rk3168";
48         else if (soc_is_rk3028())
49                 soc = "rk3028";
50         else if (soc_is_rk3066b())
51                 soc = "rk3066b";
52         else if (soc_is_rk3028a())
53                 soc = "rk3028a";
54         else if (soc_is_rk3026())
55                 soc = "rk3026";
56         else if (soc_is_rk2928g())
57                 soc = "rk2928g";
58         else if (soc_is_rk2928l())
59                 soc = "rk2928l";
60         else if (soc_is_rk2926())
61                 soc = "rk2926";
62         else if (soc_is_rk3066())
63                 soc = "rk3066";
64         else if (soc_is_rk3068())
65                 soc = "rk3068";
66         else if (soc_is_rk3000())
67                 soc = "rk3000";
68         else
69                 soc = "";
70
71         return sprintf(buf, "%s\n", soc);
72 }
73
74 static struct device_attribute soc_attr = __ATTR_RO(soc);
75
76 static int __init rockchip_cpu_lateinit(void)
77 {
78         int err;
79
80         err = device_create_file(cpu_subsys.dev_root, &type_attr);
81         err = device_create_file(cpu_subsys.dev_root, &soc_attr);
82
83         return err;
84 }
85 late_initcall(rockchip_cpu_lateinit);