|
@@ -4142,6 +4142,25 @@ static ssize_t voltage_vcore_store(struct kobject *kobj, struct kobj_attribute *
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+static ssize_t voltage_vbat_show(struct kobject *kobj, struct kobj_attribute *attr,
|
|
|
|
|
+ char *buf)
|
|
|
|
|
+{
|
|
|
|
|
+ int vlotage = 0;
|
|
|
|
|
+ uint8_t raw;
|
|
|
|
|
+ raw = hwm_read_reg_retry(IT8786_HWM_BASE_DEFAULT, 0x28);
|
|
|
|
|
+
|
|
|
|
|
+ vlotage = vin_raw_to_volt(raw, 10, 10);
|
|
|
|
|
+
|
|
|
|
|
+ return sprintf(buf, "%d", vlotage);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static ssize_t voltage_vbat_store(struct kobject *kobj, struct kobj_attribute *attr,
|
|
|
|
|
+ const char *buf, size_t count)
|
|
|
|
|
+{
|
|
|
|
|
+ return -EINVAL;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
static ssize_t voltage_5v_show(struct kobject *kobj, struct kobj_attribute *attr,
|
|
static ssize_t voltage_5v_show(struct kobject *kobj, struct kobj_attribute *attr,
|
|
|
char *buf)
|
|
char *buf)
|
|
|
{
|
|
{
|
|
@@ -4183,6 +4202,9 @@ static ssize_t voltage_12v_store(struct kobject *kobj, struct kobj_attribute *at
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+static struct kobj_attribute voltage_vbat =
|
|
|
|
|
+ __ATTR(voltage_vbat, 0644, voltage_vbat_show, voltage_vbat_store);
|
|
|
|
|
+
|
|
|
static struct kobj_attribute voltage_vcore =
|
|
static struct kobj_attribute voltage_vcore =
|
|
|
__ATTR(voltage_vcore, 0644, voltage_vcore_show, voltage_vcore_store);
|
|
__ATTR(voltage_vcore, 0644, voltage_vcore_show, voltage_vcore_store);
|
|
|
|
|
|
|
@@ -4236,6 +4258,7 @@ static struct attribute *fan_attrs[] = {
|
|
|
&power_flag.attr,
|
|
&power_flag.attr,
|
|
|
&ac_power.attr,
|
|
&ac_power.attr,
|
|
|
&voltage_vcore.attr,
|
|
&voltage_vcore.attr,
|
|
|
|
|
+ &voltage_vbat.attr,
|
|
|
&voltage_5v.attr,
|
|
&voltage_5v.attr,
|
|
|
&voltage_12v.attr,
|
|
&voltage_12v.attr,
|
|
|
NULL,
|
|
NULL,
|