@@ -28,0 +29,7 @@ Description:
+What: /sys/devices/socX/serial_number
+Date: January 2019
+contact: Bjorn Andersson <bjorn.andersson@linaro.org>
+Description:
+ Read-only attribute supported by most SoCs. Contains the SoC's
+ serial number, if available.
+
@@ -35,0 +36 @@ static DEVICE_ATTR(family, S_IRUGO, soc_info_get, NULL);
+static DEVICE_ATTR(serial_number, S_IRUGO, soc_info_get, NULL);
@@ -59,0 +61,3 @@ static umode_t soc_attribute_mode(struct kobject *kobj,
+ if ((attr == &dev_attr_serial_number.attr)
+ && (soc_dev->attr->serial_number != NULL))
+ return attr->mode;
@@ -79,0 +84,2 @@ static ssize_t soc_info_get(struct device *dev,
+ if (attr == &dev_attr_serial_number)
+ return sprintf(buf, "%s\n", soc_dev->attr->serial_number);
@@ -89,0 +96 @@ static struct attribute *soc_attr[] = {
+ &dev_attr_serial_number.attr,
@@ -14,0 +15 @@ struct soc_device_attribute {
+ const char *serial_number;