Skip to contentSkip to conversation

Add temperature-tracking mode to

PATCH In review Phil Endecott 2 participants 4 messages Jun 16, 2007 – Jun 19, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add temperature-tracking mode to

This is a *first attempt* at a patch for the f71805f driver to add support for its temperature-tracking mode. This compiles and I have some evidence that it works, but it has not been thoroughly tested.

Issues that I would like to resolve before submitting a final version include the following. Some help will be needed.

- My hardware only has PWM control on pwm1, so I can only test that channel. If someone with different hardware could please volunteer to help test, that would be great.

- I plan to include documentation fixes in the final version.

- To clarify some of the Fintek documentation, there are indeed three fan/temp register pairs and it interpolates two other points between them. The naming scheme of 1-5-9 rather than 1-2-3 (or perhaps 1-3-5) is inexplicable. Currently I have mapped their 1 to auto_point0, 5 to auto_point1 and 9 to auto_point2; however, it seems that (as Jean observed) this is not the expected order i.e. their 1 (my auto_point0) is for the highest temperature pair. So I think that I will reverse this ordering in the final version.

- I have not yet implemented the 'channels' files. I plan to add these with read-only contents.

I await your comments.

Phil.

f71805f.c renamed from f71805f.c.orig +139 -1
@@ -10,6 +10,8 @@
  * The F71872F/FG is almost the same, with two more voltages monitored,
  * and 6 VID inputs.
  *
+ * Datasheets are available from the Fintek website.
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -126,6 +128,9 @@
 #define F71805F_REG_TEMP_HIGH(nr)	(0x54 + 2 * (nr))
 #define F71805F_REG_TEMP_HYST(nr)	(0x55 + 2 * (nr))
 #define F71805F_REG_TEMP_MODE		0x01
+/* pwm/fan pwmnr from 0 to 2, auto point apnr from 0 to 2 */
+#define F71805F_REG_PWM_AUTO_POINT_TEMP(pwmnr,apnr) (0xA0 + 0x10 * (pwmnr) + (apnr))
+#define F71805F_REG_PWM_AUTO_POINT_FAN(pwmnr,apnr)  (0xA4 + 0x10 * (pwmnr) + 2 * (apnr))
 
 #define F71805F_REG_START		0x00
 /* status nr from 0 to 2 */
@@ -143,6 +148,11 @@
  * Data structures and manipulation thereof
  */
 
+struct f71805f_auto_point {
+	u8 temp[3];
+	u16 fan[3];
+};
+
 struct f71805f_data {
 	unsigned short addr;
 	const char *name;
@@ -169,6 +179,7 @@
 	u8 temp_hyst[3];
 	u8 temp_mode;
 	unsigned long alarms;
+	struct f71805f_auto_point auto_points[3];
 };
 
 struct f71805f_sio_data {
@@ -311,7 +322,7 @@
 static struct f71805f_data *f71805f_update_device(struct device *dev)
 {
 	struct f71805f_data *data = dev_get_drvdata(dev);
-	int nr;
+	int nr, apnr;
 
 	mutex_lock(&data->update_lock);
 
@@ -341,6 +352,14 @@
 					      F71805F_REG_TEMP_HYST(nr));
 		}
 		data->temp_mode = f71805f_read8(data, F71805F_REG_TEMP_MODE);
+		for (nr = 0; nr < 3; nr++) {
+			for (apnr = 0; apnr < 3; apnr++) {
+				data->auto_points[nr].temp[apnr] +					f71805f_read8(data,F71805F_REG_PWM_AUTO_POINT_TEMP(nr,apnr));
+				data->auto_points[nr].fan[apnr] +					f71805f_read16(data,F71805F_REG_PWM_AUTO_POINT_FAN(nr,apnr));
+			}
+		}
 
 		data->last_limits = jiffies;
 	}
@@ -641,6 +660,7 @@
 	return count;
 }
 
+
 static struct attribute *f71805f_attr_pwm[];
 
 static ssize_t set_pwm_enable(struct device *dev, struct device_attribute
@@ -704,6 +724,68 @@
 	return count;
 }
 
+#define MK_AP_IDX(pwmnr,apnr) ((pwmnr)<<2|(apnr))
+#define GET_PWM_NR(ap_idx)    ((ap_idx)>>2)
+#define GET_AP_NR(ap_idx)     ((ap_idx)&3)
+
+static ssize_t show_pwm_auto_point_temp(struct device *dev, struct device_attribute *devattr,
+				        char* buf)
+{
+	struct f71805f_data *data = dev_get_drvdata(dev);
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	int pwmnr = GET_PWM_NR(attr->index);
+	int apnr  = GET_AP_NR(attr->index);
+
+	return sprintf(buf, "%ld\n", temp_from_reg(data->auto_points[pwmnr].temp[apnr]));
+}
+
+static ssize_t set_pwm_auto_point_temp(struct device *dev, struct device_attribute *devattr,
+				       const char* buf, size_t count)
+{
+	struct f71805f_data *data = dev_get_drvdata(dev);
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	int pwmnr = GET_PWM_NR(attr->index);
+	int apnr  = GET_AP_NR(attr->index);
+	unsigned long val = simple_strtoul(buf, NULL, 10);
+
+	mutex_lock(&data->update_lock);
+	data->auto_points[pwmnr].temp[apnr] = temp_to_reg(val);
+	f71805f_write8(data, F71805F_REG_PWM_AUTO_POINT_TEMP(pwmnr,apnr),
+		       data->auto_points[pwmnr].temp[apnr]);
+	mutex_unlock(&data->update_lock);
+
+	return count;
+}
+
+static ssize_t show_pwm_auto_point_fan(struct device *dev, struct device_attribute *devattr,
+				       char* buf)
+{
+	struct f71805f_data *data = dev_get_drvdata(dev);
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	int pwmnr = GET_PWM_NR(attr->index);
+	int apnr  = GET_AP_NR(attr->index);
+
+	return sprintf(buf, "%ld\n", fan_from_reg(data->auto_points[pwmnr].fan[apnr]));
+}
+
+static ssize_t set_pwm_auto_point_fan(struct device *dev, struct device_attribute *devattr,
+				      const char* buf, size_t count)
+{
+	struct f71805f_data *data = dev_get_drvdata(dev);
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	int pwmnr = GET_PWM_NR(attr->index);
+	int apnr  = GET_AP_NR(attr->index);
+	unsigned long val = simple_strtoul(buf, NULL, 10);
+
+	mutex_lock(&data->update_lock);
+	data->auto_points[pwmnr].fan[apnr] = fan_to_reg(val);
+	f71805f_write16(data, F71805F_REG_PWM_AUTO_POINT_FAN(pwmnr,apnr),
+		        data->auto_points[pwmnr].fan[apnr]);
+	mutex_unlock(&data->update_lock);
+
+	return count;
+}
+
 static ssize_t show_temp(struct device *dev, struct device_attribute *devattr,
 			 char *buf)
 {
@@ -931,6 +1013,45 @@
 			  show_pwm_freq, set_pwm_freq, 2);
 static SENSOR_DEVICE_ATTR(pwm3_mode, S_IRUGO, show_pwm_mode, NULL, 2);
 
+static SENSOR_DEVICE_ATTR(pwm1_auto_point1_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(0,0));
+static SENSOR_DEVICE_ATTR(pwm1_auto_point1_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(0,0));
+static SENSOR_DEVICE_ATTR(pwm1_auto_point2_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(0,1));
+static SENSOR_DEVICE_ATTR(pwm1_auto_point2_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(0,1));
+static SENSOR_DEVICE_ATTR(pwm1_auto_point3_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(0,2));
+static SENSOR_DEVICE_ATTR(pwm1_auto_point3_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(0,2));
+
+static SENSOR_DEVICE_ATTR(pwm2_auto_point1_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(1,0));
+static SENSOR_DEVICE_ATTR(pwm2_auto_point1_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(1,0));
+static SENSOR_DEVICE_ATTR(pwm2_auto_point2_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(1,1));
+static SENSOR_DEVICE_ATTR(pwm2_auto_point2_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(1,1));
+static SENSOR_DEVICE_ATTR(pwm2_auto_point3_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(1,2));
+static SENSOR_DEVICE_ATTR(pwm2_auto_point3_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(1,2));
+
+static SENSOR_DEVICE_ATTR(pwm3_auto_point1_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(2,0));
+static SENSOR_DEVICE_ATTR(pwm3_auto_point1_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(2,0));
+static SENSOR_DEVICE_ATTR(pwm3_auto_point2_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(2,1));
+static SENSOR_DEVICE_ATTR(pwm3_auto_point2_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(2,1));
+static SENSOR_DEVICE_ATTR(pwm3_auto_point3_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(2,2));
+static SENSOR_DEVICE_ATTR(pwm3_auto_point3_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(2,2));
+
 static SENSOR_DEVICE_ATTR(in0_alarm, S_IRUGO, show_alarm, NULL, 0);
 static SENSOR_DEVICE_ATTR(in1_alarm, S_IRUGO, show_alarm, NULL, 1);
 static SENSOR_DEVICE_ATTR(in2_alarm, S_IRUGO, show_alarm, NULL, 2);
@@ -1013,6 +1134,25 @@
 	&sensor_dev_attr_temp3_max_hyst.dev_attr.attr,
 	&sensor_dev_attr_temp3_type.dev_attr.attr,
 
+	&sensor_dev_attr_pwm1_auto_point1_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm1_auto_point1_fan.dev_attr.attr,
+	&sensor_dev_attr_pwm1_auto_point2_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm1_auto_point2_fan.dev_attr.attr,
+	&sensor_dev_attr_pwm1_auto_point3_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm1_auto_point3_fan.dev_attr.attr,
+	&sensor_dev_attr_pwm2_auto_point1_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm2_auto_point1_fan.dev_attr.attr,
+	&sensor_dev_attr_pwm2_auto_point2_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm2_auto_point2_fan.dev_attr.attr,
+	&sensor_dev_attr_pwm2_auto_point3_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm2_auto_point3_fan.dev_attr.attr,
+	&sensor_dev_attr_pwm3_auto_point1_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm3_auto_point1_fan.dev_attr.attr,
+	&sensor_dev_attr_pwm3_auto_point2_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm3_auto_point2_fan.dev_attr.attr,
+	&sensor_dev_attr_pwm3_auto_point3_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm3_auto_point3_fan.dev_attr.attr,
+
 	&sensor_dev_attr_in0_alarm.dev_attr.attr,
 	&sensor_dev_attr_in1_alarm.dev_attr.attr,
 	&sensor_dev_attr_in2_alarm.dev_attr.attr,

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#2 lore raw

Re: [lm-sensors] [PATCH for review] Add temperature-tracking mode

In reply to Phil Endecott

Hi Phil,

Quoted 4 lines · Phil Endecott

A couple of things I should have said:

- Ooops, I did the diff from the hwmon directory. I'll try to get that right next time.

Yes please :)

Quoted 1 line

- Could someone please look at how this interacts with the F71872F/FG ?

I can't test, but according to the datasheet, these registers are exactly the same between the F71805F/FG and F71872F/FG, so there probably isn't anything to care about.

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#3 lore raw

Re: [lm-sensors] [PATCH for review] Add temperature-tracking mode

In reply to Phil Endecott

Hi Phil,

Quoted 10 lines · Phil Endecott

This is a *first attempt* at a patch for the f71805f driver to add support for its temperature-tracking mode. This compiles and I have some evidence that it works, but it has not been thoroughly tested.

Issues that I would like to resolve before submitting a final version include the following. Some help will be needed.

- My hardware only has PWM control on pwm1, so I can only test that channel. If someone with different hardware could please volunteer to help test, that would be great.

Unfortunately, I won't be able to help you with this, as my board also has only pwm1 wired. But I still tested your patch on my board, that's better than nothing. Verdict: it appears to work just fine :)

Quoted 8 lines

- I plan to include documentation fixes in the final version.

- To clarify some of the Fintek documentation, there are indeed three fan/temp register pairs and it interpolates two other points between them. The naming scheme of 1-5-9 rather than 1-2-3 (or perhaps 1-3-5) is inexplicable. Currently I have mapped their 1 to auto_point0, 5 to auto_point1 and 9 to auto_point2; however, it seems that (as Jean observed) this is not the expected order i.e. their 1 (my auto_point0) is for the highest temperature pair. So I think that I will reverse this ordering in the final version.

Correct, my own experimental results confirm this.

Quoted 2 lines

- I have not yet implemented the 'channels' files. I plan to add these with read-only contents.

Not strictly necessary - at your option.

Quoted 1 line

I await your comments.

Here you go:

f71805f.c line 14

Quoted 10 lines
f71805f.c renamed from f71805f.c.orig +2 -0
@@ -10,6 +10,8 @@
  * The F71872F/FG is almost the same, with two more voltages monitored,
  * and 6 VID inputs.
  *
+ * Datasheets are available from the Fintek website.
+ *

Please instead update Documentation/hwmon/f71805f. The datasheets were not available for download at the time I wrote the driver.

f71805f.c line 133

Quoted 10 lines
f71805f.c renamed from f71805f.c.orig +3 -0
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
@@ -126,6 +128,9 @@
 #define F71805F_REG_TEMP_HIGH(nr)	(0x54 + 2 * (nr))
 #define F71805F_REG_TEMP_HYST(nr)	(0x55 + 2 * (nr))
 #define F71805F_REG_TEMP_MODE		0x01
+/* pwm/fan pwmnr from 0 to 2, auto point apnr from 0 to 2 */
+#define F71805F_REG_PWM_AUTO_POINT_TEMP(pwmnr,apnr) (0xA0 + 0x10 * (pwmnr) + (apnr))
+#define F71805F_REG_PWM_AUTO_POINT_FAN(pwmnr,apnr)  (0xA4 + 0x10 * (pwmnr) + 2 * (apnr))

Line length is limited to 80 columns, as per Documentation/CodingStyle.

Quoted 33 lines
f71805f.c renamed from f71805f.c.orig +7 -1
 #define F71805F_REG_START		0x00
 /* status nr from 0 to 2 */
@@ -143,6 +148,11 @@
  * Data structures and manipulation thereof
  */
 
+struct f71805f_auto_point {
+	u8 temp[3];
+	u16 fan[3];
+};
+
 struct f71805f_data {
 	unsigned short addr;
 	const char *name;
@@ -169,6 +179,7 @@
 	u8 temp_hyst[3];
 	u8 temp_mode;
 	unsigned long alarms;
+	struct f71805f_auto_point auto_points[3];
 };
 
 struct f71805f_sio_data {
@@ -311,7 +322,7 @@
 static struct f71805f_data *f71805f_update_device(struct device *dev)
 {
 	struct f71805f_data *data = dev_get_drvdata(dev);
-	int nr;
+	int nr, apnr;
 
 	mutex_lock(&data->update_lock);
 

f71805f.c line 357

Quoted 6 lines
f71805f.c renamed from f71805f.c.orig +3 -0
@@ -341,6 +352,14 @@
 					      F71805F_REG_TEMP_HYST(nr));
 		}
 		data->temp_mode = f71805f_read8(data, F71805F_REG_TEMP_MODE);
+		for (nr = 0; nr < 3; nr++) {
+			for (apnr = 0; apnr < 3; apnr++) {
+				data->auto_points[nr].temp[apnr] > +					f71805f_read8(data,F71805F_REG_PWM_AUTO_POINT_TEMP(nr,apnr));

The usual coding style practice is to leave a space after the comma. Makes the code much more readable.

Quoted 7 lines
f71805f.c renamed from f71805f.c.orig +3 -0
+				data->auto_points[nr].fan[apnr] > +					f71805f_read16(data,F71805F_REG_PWM_AUTO_POINT_FAN(nr,apnr));
+			}
+		}
 
 		data->last_limits = jiffies;
 	}

f71805f.c line 666

Quoted 7 lines
f71805f.c renamed from f71805f.c.orig +1 -0
@@ -641,6 +660,7 @@
 	return count;
 }
 
+
 static struct attribute *f71805f_attr_pwm[];
 
 static ssize_t set_pwm_enable(struct device *dev, struct device_attribute

Patch noise, scratch this.

f71805f.c line 730

Quoted 8 lines
f71805f.c renamed from f71805f.c.orig +4 -0
@@ -704,6 +724,68 @@
 	return count;
 }
 
+#define MK_AP_IDX(pwmnr,apnr) ((pwmnr)<<2|(apnr))
+#define GET_PWM_NR(ap_idx)    ((ap_idx)>>2)
+#define GET_AP_NR(ap_idx)     ((ap_idx)&3)
+

Please just use SENSOR_DEVICE_ATTR_2 so that you don't need to combine and decode the values.

Quoted 123 lines
f71805f.c renamed from f71805f.c.orig +109 -0
+static ssize_t show_pwm_auto_point_temp(struct device *dev, struct device_attribute *devattr,
+				        char* buf)
+{
+	struct f71805f_data *data = dev_get_drvdata(dev);
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	int pwmnr = GET_PWM_NR(attr->index);
+	int apnr  = GET_AP_NR(attr->index);
+
+	return sprintf(buf, "%ld\n", temp_from_reg(data->auto_points[pwmnr].temp[apnr]));
+}
+
+static ssize_t set_pwm_auto_point_temp(struct device *dev, struct device_attribute *devattr,
+				       const char* buf, size_t count)
+{
+	struct f71805f_data *data = dev_get_drvdata(dev);
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	int pwmnr = GET_PWM_NR(attr->index);
+	int apnr  = GET_AP_NR(attr->index);
+	unsigned long val = simple_strtoul(buf, NULL, 10);
+
+	mutex_lock(&data->update_lock);
+	data->auto_points[pwmnr].temp[apnr] = temp_to_reg(val);
+	f71805f_write8(data, F71805F_REG_PWM_AUTO_POINT_TEMP(pwmnr,apnr),
+		       data->auto_points[pwmnr].temp[apnr]);
+	mutex_unlock(&data->update_lock);
+
+	return count;
+}
+
+static ssize_t show_pwm_auto_point_fan(struct device *dev, struct device_attribute *devattr,
+				       char* buf)
+{
+	struct f71805f_data *data = dev_get_drvdata(dev);
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	int pwmnr = GET_PWM_NR(attr->index);
+	int apnr  = GET_AP_NR(attr->index);
+
+	return sprintf(buf, "%ld\n", fan_from_reg(data->auto_points[pwmnr].fan[apnr]));
+}
+
+static ssize_t set_pwm_auto_point_fan(struct device *dev, struct device_attribute *devattr,
+				      const char* buf, size_t count)
+{
+	struct f71805f_data *data = dev_get_drvdata(dev);
+	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
+	int pwmnr = GET_PWM_NR(attr->index);
+	int apnr  = GET_AP_NR(attr->index);
+	unsigned long val = simple_strtoul(buf, NULL, 10);
+
+	mutex_lock(&data->update_lock);
+	data->auto_points[pwmnr].fan[apnr] = fan_to_reg(val);
+	f71805f_write16(data, F71805F_REG_PWM_AUTO_POINT_FAN(pwmnr,apnr),
+		        data->auto_points[pwmnr].fan[apnr]);
+	mutex_unlock(&data->update_lock);
+
+	return count;
+}
+
 static ssize_t show_temp(struct device *dev, struct device_attribute *devattr,
 			 char *buf)
 {
@@ -931,6 +1013,45 @@
 			  show_pwm_freq, set_pwm_freq, 2);
 static SENSOR_DEVICE_ATTR(pwm3_mode, S_IRUGO, show_pwm_mode, NULL, 2);
 
+static SENSOR_DEVICE_ATTR(pwm1_auto_point1_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(0,0));
+static SENSOR_DEVICE_ATTR(pwm1_auto_point1_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(0,0));
+static SENSOR_DEVICE_ATTR(pwm1_auto_point2_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(0,1));
+static SENSOR_DEVICE_ATTR(pwm1_auto_point2_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(0,1));
+static SENSOR_DEVICE_ATTR(pwm1_auto_point3_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(0,2));
+static SENSOR_DEVICE_ATTR(pwm1_auto_point3_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(0,2));
+
+static SENSOR_DEVICE_ATTR(pwm2_auto_point1_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(1,0));
+static SENSOR_DEVICE_ATTR(pwm2_auto_point1_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(1,0));
+static SENSOR_DEVICE_ATTR(pwm2_auto_point2_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(1,1));
+static SENSOR_DEVICE_ATTR(pwm2_auto_point2_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(1,1));
+static SENSOR_DEVICE_ATTR(pwm2_auto_point3_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(1,2));
+static SENSOR_DEVICE_ATTR(pwm2_auto_point3_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(1,2));
+
+static SENSOR_DEVICE_ATTR(pwm3_auto_point1_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(2,0));
+static SENSOR_DEVICE_ATTR(pwm3_auto_point1_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(2,0));
+static SENSOR_DEVICE_ATTR(pwm3_auto_point2_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(2,1));
+static SENSOR_DEVICE_ATTR(pwm3_auto_point2_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(2,1));
+static SENSOR_DEVICE_ATTR(pwm3_auto_point3_temp, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_temp, set_pwm_auto_point_temp, MK_AP_IDX(2,2));
+static SENSOR_DEVICE_ATTR(pwm3_auto_point3_fan, S_IRUGO | S_IWUSR,
+			  show_pwm_auto_point_fan, set_pwm_auto_point_fan, MK_AP_IDX(2,2));
+
 static SENSOR_DEVICE_ATTR(in0_alarm, S_IRUGO, show_alarm, NULL, 0);
 static SENSOR_DEVICE_ATTR(in1_alarm, S_IRUGO, show_alarm, NULL, 1);
 static SENSOR_DEVICE_ATTR(in2_alarm, S_IRUGO, show_alarm, NULL, 2);
@@ -1013,6 +1134,25 @@
 	&sensor_dev_attr_temp3_max_hyst.dev_attr.attr,
 	&sensor_dev_attr_temp3_type.dev_attr.attr,
 
+	&sensor_dev_attr_pwm1_auto_point1_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm1_auto_point1_fan.dev_attr.attr,
+	&sensor_dev_attr_pwm1_auto_point2_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm1_auto_point2_fan.dev_attr.attr,
+	&sensor_dev_attr_pwm1_auto_point3_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm1_auto_point3_fan.dev_attr.attr,
+	&sensor_dev_attr_pwm2_auto_point1_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm2_auto_point1_fan.dev_attr.attr,
+	&sensor_dev_attr_pwm2_auto_point2_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm2_auto_point2_fan.dev_attr.attr,
+	&sensor_dev_attr_pwm2_auto_point3_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm2_auto_point3_fan.dev_attr.attr,

f71805f.c line 1158

Quoted 10 lines
f71805f.c renamed from f71805f.c.orig +7 -0
+	&sensor_dev_attr_pwm3_auto_point1_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm3_auto_point1_fan.dev_attr.attr,
+	&sensor_dev_attr_pwm3_auto_point2_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm3_auto_point2_fan.dev_attr.attr,
+	&sensor_dev_attr_pwm3_auto_point3_temp.dev_attr.attr,
+	&sensor_dev_attr_pwm3_auto_point3_fan.dev_attr.attr,
+
 	&sensor_dev_attr_in0_alarm.dev_attr.attr,
 	&sensor_dev_attr_in1_alarm.dev_attr.attr,
 	&sensor_dev_attr_in2_alarm.dev_attr.attr,

I'm waiting for the next iteration of this patch, then we can push it upstream.

Thanks,

Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors