Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging

Pull more hwmon updates from Jean Delvare.

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
hwmon: (w83627ehf) Use swap() in w82627ehf_swap_tempreg()
hwmon: Document which I2C addresses can be probed
hwmon: (w83792d) Additional PWM outputs support

+47 -31
+7
Documentation/hwmon/submitting-patches
··· 81 81 82 82 * Provide a detect function if and only if a chip can be detected reliably. 83 83 84 + * Only the following I2C addresses shall be probed: 0x18-0x1f, 0x28-0x2f, 85 + 0x48-0x4f, 0x58, 0x5c, 0x73 and 0x77. Probing other addresses is strongly 86 + discouraged as it is known to cause trouble with other (non-hwmon) I2C 87 + chips. If your chip lives at an address which can't be probed then the 88 + device will have to be instantiated explicitly (which is always better 89 + anyway.) 90 + 84 91 * Avoid writing to chip registers in the detect function. If you have to write, 85 92 only do it after you have already gathered enough data to be certain that the 86 93 detection is going to be successful.
+13 -5
Documentation/hwmon/w83792d
··· 8 8 Datasheet: http://www.winbond.com.tw 9 9 10 10 Author: Shane Huang (Winbond) 11 + Updated: Roger Lucas 11 12 12 13 13 14 Module Parameters ··· 39 38 The driver implements three temperature sensors, seven fan rotation speed 40 39 sensors, nine voltage sensors, and two automatic fan regulation 41 40 strategies called: Smart Fan I (Thermal Cruise mode) and Smart Fan II. 42 - Automatic fan control mode is possible only for fan1-fan3. Fan4-fan7 can run 43 - synchronized with selected fan (fan1-fan3). This functionality and manual PWM 44 - control for fan4-fan7 is not yet implemented. 41 + 42 + The driver also implements up to seven fan control outputs: pwm1-7. Pwm1-7 43 + can be configured to PWM output or Analogue DC output via their associated 44 + pwmX_mode. Outputs pwm4 through pwm7 may or may not be present depending on 45 + how the W83792AD/D was configured by the BIOS. 46 + 47 + Automatic fan control mode is possible only for fan1-fan3. 48 + 49 + For all pwmX outputs, a value of 0 means minimum fan speed and a value of 50 + 255 means maximum fan speed. 45 51 46 52 Temperatures are measured in degrees Celsius and measurement resolution is 1 47 53 degC for temp1 and 0.5 degC for temp2 and temp3. An alarm is triggered when ··· 165 157 /sys files 166 158 ---------- 167 159 168 - pwm[1-3] - this file stores PWM duty cycle or DC value (fan speed) in range: 160 + pwm[1-7] - this file stores PWM duty cycle or DC value (fan speed) in range: 169 161 0 (stop) to 255 (full) 170 162 pwm[1-3]_enable - this file controls mode of fan/temperature control: 171 163 * 0 Disabled 172 164 * 1 Manual mode 173 165 * 2 Smart Fan II 174 166 * 3 Thermal Cruise 175 - pwm[1-3]_mode - Select PWM of DC mode 167 + pwm[1-7]_mode - Select PWM or DC mode 176 168 * 0 DC 177 169 * 1 PWM 178 170 thermal_cruise[1-3] - Selects the desired temperature for cruise (degC)
+5 -21
drivers/hwmon/w83627ehf.c
··· 1937 1937 static void w82627ehf_swap_tempreg(struct w83627ehf_data *data, 1938 1938 int r1, int r2) 1939 1939 { 1940 - u16 tmp; 1941 - 1942 - tmp = data->temp_src[r1]; 1943 - data->temp_src[r1] = data->temp_src[r2]; 1944 - data->temp_src[r2] = tmp; 1945 - 1946 - tmp = data->reg_temp[r1]; 1947 - data->reg_temp[r1] = data->reg_temp[r2]; 1948 - data->reg_temp[r2] = tmp; 1949 - 1950 - tmp = data->reg_temp_over[r1]; 1951 - data->reg_temp_over[r1] = data->reg_temp_over[r2]; 1952 - data->reg_temp_over[r2] = tmp; 1953 - 1954 - tmp = data->reg_temp_hyst[r1]; 1955 - data->reg_temp_hyst[r1] = data->reg_temp_hyst[r2]; 1956 - data->reg_temp_hyst[r2] = tmp; 1957 - 1958 - tmp = data->reg_temp_config[r1]; 1959 - data->reg_temp_config[r1] = data->reg_temp_config[r2]; 1960 - data->reg_temp_config[r2] = tmp; 1940 + swap(data->temp_src[r1], data->temp_src[r2]); 1941 + swap(data->reg_temp[r1], data->reg_temp[r2]); 1942 + swap(data->reg_temp_over[r1], data->reg_temp_over[r2]); 1943 + swap(data->reg_temp_hyst[r1], data->reg_temp_hyst[r2]); 1944 + swap(data->reg_temp_config[r1], data->reg_temp_config[r2]); 1961 1945 } 1962 1946 1963 1947 static void
+22 -5
drivers/hwmon/w83792d.c
··· 289 289 u8 temp1[3]; /* current, over, thyst */ 290 290 u8 temp_add[2][6]; /* Register value */ 291 291 u8 fan_div[7]; /* Register encoding, shifted right */ 292 - u8 pwm[7]; /* 293 - * We only consider the first 3 set of pwm, 294 - * although 792 chip has 7 set of pwm. 295 - */ 292 + u8 pwm[7]; /* The 7 PWM outputs */ 296 293 u8 pwmenable[3]; 297 294 u32 alarms; /* realtime status register encoding,combined */ 298 295 u8 chassis; /* Chassis status */ ··· 1072 1075 static SENSOR_DEVICE_ATTR(pwm1, S_IWUSR | S_IRUGO, show_pwm, store_pwm, 0); 1073 1076 static SENSOR_DEVICE_ATTR(pwm2, S_IWUSR | S_IRUGO, show_pwm, store_pwm, 1); 1074 1077 static SENSOR_DEVICE_ATTR(pwm3, S_IWUSR | S_IRUGO, show_pwm, store_pwm, 2); 1078 + static SENSOR_DEVICE_ATTR(pwm4, S_IWUSR | S_IRUGO, show_pwm, store_pwm, 3); 1079 + static SENSOR_DEVICE_ATTR(pwm5, S_IWUSR | S_IRUGO, show_pwm, store_pwm, 4); 1080 + static SENSOR_DEVICE_ATTR(pwm6, S_IWUSR | S_IRUGO, show_pwm, store_pwm, 5); 1081 + static SENSOR_DEVICE_ATTR(pwm7, S_IWUSR | S_IRUGO, show_pwm, store_pwm, 6); 1075 1082 static SENSOR_DEVICE_ATTR(pwm1_enable, S_IWUSR | S_IRUGO, 1076 1083 show_pwmenable, store_pwmenable, 1); 1077 1084 static SENSOR_DEVICE_ATTR(pwm2_enable, S_IWUSR | S_IRUGO, ··· 1088 1087 show_pwm_mode, store_pwm_mode, 1); 1089 1088 static SENSOR_DEVICE_ATTR(pwm3_mode, S_IWUSR | S_IRUGO, 1090 1089 show_pwm_mode, store_pwm_mode, 2); 1090 + static SENSOR_DEVICE_ATTR(pwm4_mode, S_IWUSR | S_IRUGO, 1091 + show_pwm_mode, store_pwm_mode, 3); 1092 + static SENSOR_DEVICE_ATTR(pwm5_mode, S_IWUSR | S_IRUGO, 1093 + show_pwm_mode, store_pwm_mode, 4); 1094 + static SENSOR_DEVICE_ATTR(pwm6_mode, S_IWUSR | S_IRUGO, 1095 + show_pwm_mode, store_pwm_mode, 5); 1096 + static SENSOR_DEVICE_ATTR(pwm7_mode, S_IWUSR | S_IRUGO, 1097 + show_pwm_mode, store_pwm_mode, 6); 1091 1098 static SENSOR_DEVICE_ATTR(tolerance1, S_IWUSR | S_IRUGO, 1092 1099 show_tolerance, store_tolerance, 1); 1093 1100 static SENSOR_DEVICE_ATTR(tolerance2, S_IWUSR | S_IRUGO, ··· 1186 1177 static SENSOR_DEVICE_ATTR(fan7_div, S_IWUSR | S_IRUGO, 1187 1178 show_fan_div, store_fan_div, 7); 1188 1179 1189 - static struct attribute *w83792d_attributes_fan[4][5] = { 1180 + static struct attribute *w83792d_attributes_fan[4][7] = { 1190 1181 { 1191 1182 &sensor_dev_attr_fan4_input.dev_attr.attr, 1192 1183 &sensor_dev_attr_fan4_min.dev_attr.attr, 1193 1184 &sensor_dev_attr_fan4_div.dev_attr.attr, 1194 1185 &sensor_dev_attr_fan4_alarm.dev_attr.attr, 1186 + &sensor_dev_attr_pwm4.dev_attr.attr, 1187 + &sensor_dev_attr_pwm4_mode.dev_attr.attr, 1195 1188 NULL 1196 1189 }, { 1197 1190 &sensor_dev_attr_fan5_input.dev_attr.attr, 1198 1191 &sensor_dev_attr_fan5_min.dev_attr.attr, 1199 1192 &sensor_dev_attr_fan5_div.dev_attr.attr, 1200 1193 &sensor_dev_attr_fan5_alarm.dev_attr.attr, 1194 + &sensor_dev_attr_pwm5.dev_attr.attr, 1195 + &sensor_dev_attr_pwm5_mode.dev_attr.attr, 1201 1196 NULL 1202 1197 }, { 1203 1198 &sensor_dev_attr_fan6_input.dev_attr.attr, 1204 1199 &sensor_dev_attr_fan6_min.dev_attr.attr, 1205 1200 &sensor_dev_attr_fan6_div.dev_attr.attr, 1206 1201 &sensor_dev_attr_fan6_alarm.dev_attr.attr, 1202 + &sensor_dev_attr_pwm6.dev_attr.attr, 1203 + &sensor_dev_attr_pwm6_mode.dev_attr.attr, 1207 1204 NULL 1208 1205 }, { 1209 1206 &sensor_dev_attr_fan7_input.dev_attr.attr, 1210 1207 &sensor_dev_attr_fan7_min.dev_attr.attr, 1211 1208 &sensor_dev_attr_fan7_div.dev_attr.attr, 1212 1209 &sensor_dev_attr_fan7_alarm.dev_attr.attr, 1210 + &sensor_dev_attr_pwm7.dev_attr.attr, 1211 + &sensor_dev_attr_pwm7_mode.dev_attr.attr, 1213 1212 NULL 1214 1213 } 1215 1214 };