[devices]: Export reboot_reason sysfs attribute for DellEMC S6100/Z9100 (#2922)
This commit is contained in:
parent
a5a5ba6d6a
commit
85077a9211
@ -45,6 +45,7 @@
|
||||
#define SMF_READ_DATA_REG_OFFSET 2
|
||||
#define SMF_REG_ADDR 0x200
|
||||
#define SMF_PROBE_ADDR 0x210
|
||||
#define SMF_RST_SRC_REG 0x20A
|
||||
|
||||
#define SIO_REG_DEVID 0x1
|
||||
#define SIO_Z9100_ID 0x1
|
||||
@ -502,6 +503,23 @@ static ssize_t show_smf_version(struct device *dev,
|
||||
}
|
||||
|
||||
|
||||
/* SMF Reset Reason */
|
||||
static ssize_t show_reset_reason(struct device *dev,
|
||||
struct device_attribute *devattr, char *buf)
|
||||
{
|
||||
int index = to_sensor_dev_attr(devattr)->index;
|
||||
unsigned int ret = 0, val = 0;
|
||||
struct smf_data *data = dev_get_drvdata(dev);
|
||||
|
||||
ret = inb(SMF_RST_SRC_REG);
|
||||
|
||||
if(ret < 0)
|
||||
return ret;
|
||||
|
||||
return sprintf(buf, "%x\n", ret);
|
||||
}
|
||||
|
||||
|
||||
/* FANIN ATTR */
|
||||
static ssize_t
|
||||
show_fan_label(struct device *dev, struct device_attribute *attr, char *buf)
|
||||
@ -1779,10 +1797,14 @@ static SENSOR_DEVICE_ATTR(current_total_power, S_IRUGO, show_psu, NULL, 10);
|
||||
static SENSOR_DEVICE_ATTR(smf_version, S_IRUGO, show_smf_version, NULL, 0);
|
||||
static SENSOR_DEVICE_ATTR(smf_firmware_ver, S_IRUGO, show_smf_version, NULL, 1);
|
||||
|
||||
/* SMF Reset Reason */
|
||||
static SENSOR_DEVICE_ATTR(smf_reset_reason, S_IRUGO, show_reset_reason, NULL, 1);
|
||||
|
||||
|
||||
static struct attribute *smf_dell_attrs[] = {
|
||||
&sensor_dev_attr_smf_version.dev_attr.attr,
|
||||
&sensor_dev_attr_smf_firmware_ver.dev_attr.attr,
|
||||
&sensor_dev_attr_smf_reset_reason.dev_attr.attr,
|
||||
&sensor_dev_attr_fan_tray_presence.dev_attr.attr,
|
||||
&sensor_dev_attr_fan1_airflow.dev_attr.attr,
|
||||
&sensor_dev_attr_fan3_airflow.dev_attr.attr,
|
||||
|
Loading…
Reference in New Issue
Block a user