Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1282ab3f authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Couple of regressions, couple of zero-day bugs, a minor enhancement.
Nothing really major.

* tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
  hwmon: (f75375s) Let f75375_update_device treat pwmX as a measured value
  hwmon: (f75375s) Fix bit shifting in f75375_write16
  hwmon: (f75375s) Fix reading of wrong register when initializing the F75387
  hwmon: (f75375s) Fix automatic pwm mode setting for F75373 & F75375
  hwmon: (w83627ehf) Remove duplicate code
parents 19e00f2f a1c1baf0
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -172,7 +172,7 @@ static inline void f75375_write8(struct i2c_client *client, u8 reg,
static inline void f75375_write16(struct i2c_client *client, u8 reg,
		u16 value)
{
	int err = i2c_smbus_write_byte_data(client, reg, (value << 8));
	int err = i2c_smbus_write_byte_data(client, reg, (value >> 8));
	if (err)
		return;
	i2c_smbus_write_byte_data(client, reg + 1, (value & 0xFF));
@@ -200,9 +200,6 @@ static struct f75375_data *f75375_update_device(struct device *dev)
				f75375_read16(client, F75375_REG_FAN_MIN(nr));
			data->fan_target[nr] =
				f75375_read16(client, F75375_REG_FAN_EXP(nr));
			data->pwm[nr] =	f75375_read8(client,
				F75375_REG_FAN_PWM_DUTY(nr));

		}
		for (nr = 0; nr < 4; nr++) {
			data->in_max[nr] =
@@ -218,6 +215,8 @@ static struct f75375_data *f75375_update_device(struct device *dev)
	if (time_after(jiffies, data->last_updated + 2 * HZ)
		|| !data->valid) {
		for (nr = 0; nr < 2; nr++) {
			data->pwm[nr] =	f75375_read8(client,
				F75375_REG_FAN_PWM_DUTY(nr));
			/* assign MSB, therefore shift it by 8 bits */
			data->temp11[nr] =
				f75375_read8(client, F75375_REG_TEMP(nr)) << 8;
@@ -369,7 +368,7 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
			fanmode  |= (3 << FAN_CTRL_MODE(nr));
			break;
		case 2: /* AUTOMATIC*/
			fanmode  |= (2 << FAN_CTRL_MODE(nr));
			fanmode  |= (1 << FAN_CTRL_MODE(nr));
			break;
		case 3: /* fan speed */
			break;
@@ -723,7 +722,7 @@ static void f75375_init(struct i2c_client *client, struct f75375_data *data,
			if (data->kind == f75387) {
				bool manu, duty;

				if (!(conf & (1 << F75387_FAN_CTRL_LINEAR(nr))))
				if (!(mode & (1 << F75387_FAN_CTRL_LINEAR(nr))))
					data->pwm_mode[nr] = 1;

				manu = ((mode >> F75387_FAN_MANU_MODE(nr)) & 1);
+0 −5
Original line number Diff line number Diff line
@@ -2349,11 +2349,6 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev)
	/* Read fan clock dividers immediately */
	w83627ehf_update_fan_div_common(dev, data);

	/* Read pwm data to save original values */
	w83627ehf_update_pwm_common(dev, data);
	for (i = 0; i < data->pwm_num; i++)
		data->pwm_enable_orig[i] = data->pwm_enable[i];

	/* Read pwm data to save original values */
	w83627ehf_update_pwm_common(dev, data);
	for (i = 0; i < data->pwm_num; i++)