|
@@ -254,6 +254,38 @@ static ssize_t power_flag_store(struct kobject *kobj, struct kobj_attribute *att
|
|
|
return count;
|
|
return count;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+static ssize_t temp1_input_show(struct kobject *kobj, struct kobj_attribute *attr,
|
|
|
|
|
+ char *buf)
|
|
|
|
|
+{
|
|
|
|
|
+ static int count = 0;
|
|
|
|
|
+ count++;
|
|
|
|
|
+
|
|
|
|
|
+ return sprintf(buf, "temp1_input_show count=%d\n", count);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static ssize_t temp1_input_store(struct kobject *kobj, struct kobj_attribute *attr,
|
|
|
|
|
+ const char *buf, size_t count)
|
|
|
|
|
+{
|
|
|
|
|
+ printk("temp1_input_store kernel rev:%s\n", buf);
|
|
|
|
|
+ return count;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static ssize_t temp2_input_show(struct kobject *kobj, struct kobj_attribute *attr,
|
|
|
|
|
+ char *buf)
|
|
|
|
|
+{
|
|
|
|
|
+ static int count = 0;
|
|
|
|
|
+ count++;
|
|
|
|
|
+
|
|
|
|
|
+ return sprintf(buf, "temp2_input_show count=%d\n", count);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+static ssize_t temp2_input_store(struct kobject *kobj, struct kobj_attribute *attr,
|
|
|
|
|
+ const char *buf, size_t count)
|
|
|
|
|
+{
|
|
|
|
|
+ printk("temp2_input_store kernel rev:%s\n", buf);
|
|
|
|
|
+ return count;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
static struct kobj_attribute fan1_input =
|
|
static struct kobj_attribute fan1_input =
|
|
|
__ATTR(fan1_input, 0644, fan1_input_show, fan1_input_store);
|
|
__ATTR(fan1_input, 0644, fan1_input_show, fan1_input_store);
|
|
|
|
|
|
|
@@ -287,6 +319,12 @@ static struct kobj_attribute ac_power =
|
|
|
static struct kobj_attribute power_flag =
|
|
static struct kobj_attribute power_flag =
|
|
|
__ATTR(power_flag, 0644, power_flag_show, power_flag_store);
|
|
__ATTR(power_flag, 0644, power_flag_show, power_flag_store);
|
|
|
|
|
|
|
|
|
|
+static struct kobj_attribute temp1_input =
|
|
|
|
|
+ __ATTR(temp1_input, 0444, temp1_input_show, temp1_input_store);
|
|
|
|
|
+
|
|
|
|
|
+static struct kobj_attribute temp2_input =
|
|
|
|
|
+ __ATTR(temp2_input, 0444, temp2_input_show, temp2_input_store);
|
|
|
|
|
+
|
|
|
/* ==================== 属性组 ==================== */
|
|
/* ==================== 属性组 ==================== */
|
|
|
static struct attribute *fan_attrs[] = {
|
|
static struct attribute *fan_attrs[] = {
|
|
|
&fan1_input.attr,
|
|
&fan1_input.attr,
|
|
@@ -300,6 +338,8 @@ static struct attribute *fan_attrs[] = {
|
|
|
&voltage_vcore.attr,
|
|
&voltage_vcore.attr,
|
|
|
&ac_power.attr,
|
|
&ac_power.attr,
|
|
|
&power_flag.attr,
|
|
&power_flag.attr,
|
|
|
|
|
+ &temp1_input.attr,
|
|
|
|
|
+ &temp2_input.attr,
|
|
|
NULL,
|
|
NULL,
|
|
|
};
|
|
};
|
|
|
|
|
|