1 #include <linux/kernel.h>
3 #include <linux/rockchip/cpu.h>
5 unsigned long rockchip_soc_id;
6 EXPORT_SYMBOL(rockchip_soc_id);
8 static ssize_t type_show(struct device *dev, struct device_attribute *attr, char *buf)
14 else if (cpu_is_rk319x())
16 else if (cpu_is_rk3188())
18 else if (cpu_is_rk3066b())
20 else if (cpu_is_rk3026())
22 else if (cpu_is_rk30xx())
24 else if (cpu_is_rk2928())
26 else if (cpu_is_rk312x())
31 return sprintf(buf, "%s\n", type);
34 static struct device_attribute type_attr = __ATTR_RO(type);
36 static ssize_t soc_show(struct device *dev, struct device_attribute *attr, char *buf)
42 else if (soc_is_rk3190())
44 else if (soc_is_rk3188plus())
46 else if (soc_is_rk3188())
48 else if (soc_is_rk3168())
50 else if (soc_is_rk3028())
52 else if (soc_is_rk3066b())
54 else if (soc_is_rk3028a())
56 else if (soc_is_rk3026())
58 else if (soc_is_rk2928g())
60 else if (soc_is_rk2928l())
62 else if (soc_is_rk2926())
64 else if (soc_is_rk3066())
66 else if (soc_is_rk3068())
68 else if (soc_is_rk3000())
70 else if (soc_is_rk3126())
72 else if (soc_is_rk3128())
77 return sprintf(buf, "%s\n", soc);
80 static struct device_attribute soc_attr = __ATTR_RO(soc);
82 static int __init rockchip_cpu_lateinit(void)
86 err = device_create_file(cpu_subsys.dev_root, &type_attr);
87 err = device_create_file(cpu_subsys.dev_root, &soc_attr);
91 late_initcall(rockchip_cpu_lateinit);