summaryrefslogtreecommitdiff
path: root/drivers/scsi/ufs/ufs-sysfs.c
diff options
context:
space:
mode:
authorStanislav Nijnikov <stanislav.nijnikov@wdc.com>2018-02-15 15:14:03 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2018-02-16 02:34:24 +0300
commit8c2582bfbd9abe84b9cf435996aa720a84f908c4 (patch)
treed1ffb06405be5ecfe2ed8cf2d60451b968d25544 /drivers/scsi/ufs/ufs-sysfs.c
parent45bced87e79316ecd868aee8f187284025792c5f (diff)
downloadlinux-8c2582bfbd9abe84b9cf435996aa720a84f908c4.tar.xz
scsi: ufs: sysfs: interconnect descriptor
This patch introduces a sysfs group entry for the UFS interconnect descriptor parameters. The group adds "interconnect_descriptor" folder under the UFS driver sysfs entry (/sys/bus/platform/drivers/ufshcd/*). The parameters are shown as hexadecimal numbers. The full information about the parameters could be found at UFS specifications 2.1. Signed-off-by: Stanislav Nijnikov <stanislav.nijnikov@wdc.com> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs/ufs-sysfs.c')
-rw-r--r--drivers/scsi/ufs/ufs-sysfs.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/scsi/ufs/ufs-sysfs.c b/drivers/scsi/ufs/ufs-sysfs.c
index 440b94e453bf..ba229d9f326b 100644
--- a/drivers/scsi/ufs/ufs-sysfs.c
+++ b/drivers/scsi/ufs/ufs-sysfs.c
@@ -249,9 +249,27 @@ static const struct attribute_group ufs_sysfs_device_descriptor_group = {
.attrs = ufs_sysfs_device_descriptor,
};
+#define UFS_INTERCONNECT_DESC_PARAM(_name, _uname, _size) \
+ UFS_DESC_PARAM(_name, _uname, INTERCONNECT, _size)
+
+UFS_INTERCONNECT_DESC_PARAM(unipro_version, _UNIPRO_VER, 2);
+UFS_INTERCONNECT_DESC_PARAM(mphy_version, _MPHY_VER, 2);
+
+static struct attribute *ufs_sysfs_interconnect_descriptor[] = {
+ &dev_attr_unipro_version.attr,
+ &dev_attr_mphy_version.attr,
+ NULL,
+};
+
+static const struct attribute_group ufs_sysfs_interconnect_descriptor_group = {
+ .name = "interconnect_descriptor",
+ .attrs = ufs_sysfs_interconnect_descriptor,
+};
+
static const struct attribute_group *ufs_sysfs_groups[] = {
&ufs_sysfs_default_group,
&ufs_sysfs_device_descriptor_group,
+ &ufs_sysfs_interconnect_descriptor_group,
NULL,
};