diff options
author | Guenter Roeck <linux@roeck-us.net> | 2012-01-19 14:02:22 -0500 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2012-03-18 21:26:47 -0400 |
commit | 703af96040491912efbe8b48e14cb70db054cc1b (patch) | |
tree | 0b436a887d48f0d6906aa11caf2089392f99662d /drivers/hwmon/max6650.c | |
parent | c531eb3f229bcc3b4ee7fb471e580caff86dafad (diff) |
hwmon: (max6650) Fix multi-line comments
Cc: Hans J. Koch <hjk@hansjkoch.de>
Acked-by: Hans J. Koch <hjk@hansjkoch.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/max6650.c')
-rw-r--r-- | drivers/hwmon/max6650.c | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c index 159ce0275325..0998094a2871 100644 --- a/drivers/hwmon/max6650.c +++ b/drivers/hwmon/max6650.c | |||
@@ -159,13 +159,13 @@ static ssize_t get_fan(struct device *dev, struct device_attribute *devattr, | |||
159 | int rpm; | 159 | int rpm; |
160 | 160 | ||
161 | /* | 161 | /* |
162 | * Calculation details: | 162 | * Calculation details: |
163 | * | 163 | * |
164 | * Each tachometer counts over an interval given by the "count" | 164 | * Each tachometer counts over an interval given by the "count" |
165 | * register (0.25, 0.5, 1 or 2 seconds). This module assumes | 165 | * register (0.25, 0.5, 1 or 2 seconds). This module assumes |
166 | * that the fans produce two pulses per revolution (this seems | 166 | * that the fans produce two pulses per revolution (this seems |
167 | * to be the most common). | 167 | * to be the most common). |
168 | */ | 168 | */ |
169 | 169 | ||
170 | rpm = ((data->tach[attr->index] * 120) / DIV_FROM_REG(data->count)); | 170 | rpm = ((data->tach[attr->index] * 120) / DIV_FROM_REG(data->count)); |
171 | return sprintf(buf, "%d\n", rpm); | 171 | return sprintf(buf, "%d\n", rpm); |
@@ -219,12 +219,12 @@ static ssize_t get_target(struct device *dev, struct device_attribute *devattr, | |||
219 | int kscale, ktach, rpm; | 219 | int kscale, ktach, rpm; |
220 | 220 | ||
221 | /* | 221 | /* |
222 | * Use the datasheet equation: | 222 | * Use the datasheet equation: |
223 | * | 223 | * |
224 | * FanSpeed = KSCALE x fCLK / [256 x (KTACH + 1)] | 224 | * FanSpeed = KSCALE x fCLK / [256 x (KTACH + 1)] |
225 | * | 225 | * |
226 | * then multiply by 60 to give rpm. | 226 | * then multiply by 60 to give rpm. |
227 | */ | 227 | */ |
228 | 228 | ||
229 | kscale = DIV_FROM_REG(data->config); | 229 | kscale = DIV_FROM_REG(data->config); |
230 | ktach = data->speed; | 230 | ktach = data->speed; |
@@ -248,11 +248,11 @@ static ssize_t set_target(struct device *dev, struct device_attribute *devattr, | |||
248 | rpm = SENSORS_LIMIT(rpm, FAN_RPM_MIN, FAN_RPM_MAX); | 248 | rpm = SENSORS_LIMIT(rpm, FAN_RPM_MIN, FAN_RPM_MAX); |
249 | 249 | ||
250 | /* | 250 | /* |
251 | * Divide the required speed by 60 to get from rpm to rps, then | 251 | * Divide the required speed by 60 to get from rpm to rps, then |
252 | * use the datasheet equation: | 252 | * use the datasheet equation: |
253 | * | 253 | * |
254 | * KTACH = [(fCLK x KSCALE) / (256 x FanSpeed)] - 1 | 254 | * KTACH = [(fCLK x KSCALE) / (256 x FanSpeed)] - 1 |
255 | */ | 255 | */ |
256 | 256 | ||
257 | mutex_lock(&data->update_lock); | 257 | mutex_lock(&data->update_lock); |
258 | 258 | ||
@@ -286,8 +286,10 @@ static ssize_t get_pwm(struct device *dev, struct device_attribute *devattr, | |||
286 | int pwm; | 286 | int pwm; |
287 | struct max6650_data *data = max6650_update_device(dev); | 287 | struct max6650_data *data = max6650_update_device(dev); |
288 | 288 | ||
289 | /* Useful range for dac is 0-180 for 12V fans and 0-76 for 5V fans. | 289 | /* |
290 | Lower DAC values mean higher speeds. */ | 290 | * Useful range for dac is 0-180 for 12V fans and 0-76 for 5V fans. |
291 | * Lower DAC values mean higher speeds. | ||
292 | */ | ||
291 | if (data->config & MAX6650_CFG_V12) | 293 | if (data->config & MAX6650_CFG_V12) |
292 | pwm = 255 - (255 * (int)data->dac)/180; | 294 | pwm = 255 - (255 * (int)data->dac)/180; |
293 | else | 295 | else |
@@ -657,7 +659,8 @@ static int max6650_init_client(struct i2c_client *client) | |||
657 | dev_info(&client->dev, "Prescaler is set to %d.\n", | 659 | dev_info(&client->dev, "Prescaler is set to %d.\n", |
658 | 1 << (config & MAX6650_CFG_PRESCALER_MASK)); | 660 | 1 << (config & MAX6650_CFG_PRESCALER_MASK)); |
659 | 661 | ||
660 | /* If mode is set to "full off", we change it to "open loop" and | 662 | /* |
663 | * If mode is set to "full off", we change it to "open loop" and | ||
661 | * set DAC to 255, which has the same effect. We do this because | 664 | * set DAC to 255, which has the same effect. We do this because |
662 | * there's no "full off" mode defined in hwmon specifcations. | 665 | * there's no "full off" mode defined in hwmon specifcations. |
663 | */ | 666 | */ |
@@ -711,9 +714,11 @@ static struct max6650_data *max6650_update_device(struct device *dev) | |||
711 | MAX6650_REG_COUNT); | 714 | MAX6650_REG_COUNT); |
712 | data->dac = i2c_smbus_read_byte_data(client, MAX6650_REG_DAC); | 715 | data->dac = i2c_smbus_read_byte_data(client, MAX6650_REG_DAC); |
713 | 716 | ||
714 | /* Alarms are cleared on read in case the condition that | 717 | /* |
718 | * Alarms are cleared on read in case the condition that | ||
715 | * caused the alarm is removed. Keep the value latched here | 719 | * caused the alarm is removed. Keep the value latched here |
716 | * for providing the register through different alarm files. */ | 720 | * for providing the register through different alarm files. |
721 | */ | ||
717 | data->alarm |= i2c_smbus_read_byte_data(client, | 722 | data->alarm |= i2c_smbus_read_byte_data(client, |
718 | MAX6650_REG_ALARM); | 723 | MAX6650_REG_ALARM); |
719 | 724 | ||