@@ -947,6 +947,20 @@ static ssize_t possible_values_show(struct kobject *kobj, struct kobj_attribute
947
947
return sysfs_emit (buf , "%s\n" , setting -> possible_values );
948
948
}
949
949
950
+ static ssize_t type_show (struct kobject * kobj , struct kobj_attribute * attr ,
951
+ char * buf )
952
+ {
953
+ struct tlmi_attr_setting * setting = to_tlmi_attr_setting (kobj );
954
+
955
+ if (setting -> possible_values ) {
956
+ /* Figure out what setting type is as BIOS does not return this */
957
+ if (strchr (setting -> possible_values , ',' ))
958
+ return sysfs_emit (buf , "enumeration\n" );
959
+ }
960
+ /* Anything else is going to be a string */
961
+ return sysfs_emit (buf , "string\n" );
962
+ }
963
+
950
964
static ssize_t current_value_store (struct kobject * kobj ,
951
965
struct kobj_attribute * attr ,
952
966
const char * buf , size_t count )
@@ -1036,10 +1050,13 @@ static struct kobj_attribute attr_possible_values = __ATTR_RO(possible_values);
1036
1050
1037
1051
static struct kobj_attribute attr_current_val = __ATTR_RW_MODE (current_value , 0600 );
1038
1052
1053
+ static struct kobj_attribute attr_type = __ATTR_RO (type );
1054
+
1039
1055
static struct attribute * tlmi_attrs [] = {
1040
1056
& attr_displ_name .attr ,
1041
1057
& attr_current_val .attr ,
1042
1058
& attr_possible_values .attr ,
1059
+ & attr_type .attr ,
1043
1060
NULL
1044
1061
};
1045
1062
0 commit comments