greybus: interface: Expose DDBL1 manufacturing and production id in sysfs
authorViresh Kumar <viresh.kumar@linaro.org>
Tue, 22 Dec 2015 16:34:34 +0000 (22:04 +0530)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 22 Dec 2015 21:00:52 +0000 (13:00 -0800)
These ids are already fetched from the SVC, but were never exposed to
sysfs. Userspace may be interested in using these values and hence these
must be exposed to it.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/Documentation/sysfs-bus-greybus
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/ddbl1_manufacturer_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/ddbl1_product_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/ddbl1_manufacturer_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/ddbl1_product_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/ddbl1_manufacturer_id [new file with mode: 0644]
drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/ddbl1_product_id [new file with mode: 0644]
drivers/staging/greybus/interface.c

index a0363bfbdd4b1167a42b9295c5e57702ff5c5c5d..2cd17c70694052407c42d0fac849779133a5323d 100644 (file)
@@ -14,6 +14,22 @@ Description:
                An Interface I on the bus N, where I is the 1-byte interface
                ID.
 
+What:          /sys/bus/greybus/device/N-I/ddbl1_manufacturer_id
+Date:          October 2015
+KernelVersion: 4.XX
+Contact:       Greg Kroah-Hartman <greg@kroah.com>
+Description:
+               Unipro Device Descriptor Block Level 1 manufacturer ID for the
+               greybus Interface.
+
+What:          /sys/bus/greybus/device/N-I/ddbl1_product_id
+Date:          October 2015
+KernelVersion: 4.XX
+Contact:       Greg Kroah-Hartman <greg@kroah.com>
+Description:
+               Unipro Device Descriptor Block Level 1 product ID for the
+               greybus Interface.
+
 What:          /sys/bus/greybus/device/N-I/interface_id
 Date:          October 2015
 KernelVersion: 4.XX
diff --git a/drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/ddbl1_manufacturer_id b/drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/ddbl1_manufacturer_id
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/ddbl1_product_id b/drivers/staging/greybus/Documentation/sysfs/greybus1/1-2/ddbl1_product_id
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/ddbl1_manufacturer_id b/drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/ddbl1_manufacturer_id
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/ddbl1_product_id b/drivers/staging/greybus/Documentation/sysfs/greybus1/1-4/ddbl1_product_id
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/ddbl1_manufacturer_id b/drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/ddbl1_manufacturer_id
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/ddbl1_product_id b/drivers/staging/greybus/Documentation/sysfs/greybus2/2-3/ddbl1_product_id
new file mode 100644 (file)
index 0000000..e69de29
index c43992d783f4edb003f9d0ea1167844917f0401f..c4b9e14868289951d412cad089c03164e5a3aa34 100644 (file)
@@ -20,6 +20,8 @@ static ssize_t field##_show(struct device *dev,                               \
 }                                                                      \
 static DEVICE_ATTR_RO(field)
 
+gb_interface_attr(ddbl1_manufacturer_id, "0x%08x");
+gb_interface_attr(ddbl1_product_id, "0x%08x");
 gb_interface_attr(interface_id, "%u");
 gb_interface_attr(vendor_id, "0x%08x");
 gb_interface_attr(product_id, "0x%08x");
@@ -27,6 +29,8 @@ gb_interface_attr(vendor_string, "%s");
 gb_interface_attr(product_string, "%s");
 
 static struct attribute *interface_attrs[] = {
+       &dev_attr_ddbl1_manufacturer_id.attr,
+       &dev_attr_ddbl1_product_id.attr,
        &dev_attr_interface_id.attr,
        &dev_attr_vendor_id.attr,
        &dev_attr_product_id.attr,