Skip to contentSkip to conversation

hwmon: (f75375s) Let f75375_update_device treat pwmX as a measured value

PATCH Applied Nikolaus Schulz 2 participants 4 messages Feb 8, 2012 – Feb 9, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/4 hwmon: (f75375s) Let f75375_update_device treat pwmX as a measured value

From: Nikolaus Schulz <[email protected]>

Treat pwmX as a measured value, not as a (mostly static) limit value, so that it is updated more frequently from the device register.

---
 drivers/hwmon/f75375s.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/hwmon/f75375s.c +0 -3
index 0aabaaf..f609b57 100644
@@ -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;

Signature · 7 lines
1.7.9


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

Re: [lm-sensors] [PATCH 4/4] hwmon: (f75375s) Let f75375_update_device treat pwmX as a measured valu

Quoted 24 lines · Nikolaus Schulz

From: Nikolaus Schulz <[email protected]>

Treat pwmX as a measured value, not as a (mostly static) limit value, so that it is updated more frequently from the device register.

---
 drivers/hwmon/f75375s.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/hwmon/f75375s.c +0 -3
index 0aabaaf..f609b57 100644
@@ -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)

drivers/hwmon/f75375s.c

Quoted 6 lines
drivers/hwmon/f75375s.c +2 -0
 		|| !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;

This also fixes a bug where pwm was not read at all if there is no platform data. Doesn't apply to -stable, since support for automatic startup (no platform data) was only added recently, but still ...

Thanks, applied.

Guenter

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

#2 lore raw

Re: [lm-sensors] [PATCH 4/4] hwmon: (f75375s) Let f75375_update_device treat pwmX as a measured valu

In reply to Nikolaus Schulz
Quoted 26 lines · Guenter Roeck
Quoted 25 lines · Nikolaus Schulz

From: Nikolaus Schulz <[email protected]>

Treat pwmX as a measured value, not as a (mostly static) limit value, so that it is updated more frequently from the device register.

---
 drivers/hwmon/f75375s.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/hwmon/f75375s.c +0 -3
index 0aabaaf..f609b57 100644
@@ -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) {

Quoted 8 lines

drivers/hwmon/f75375s.c

Quoted 5 lines
drivers/hwmon/f75375s.c +2 -0
 		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;

This also fixes a bug where pwm was not read at all if there is no platform data.

I don't think so, but anyways...

Quoted 2 lines

Doesn't apply to -stable, since support for automatic startup (no platform data) was only added recently, but still ...

([email protected] wasn't cc'ed here.)

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

#3 lore raw

Re: [lm-sensors] [PATCH 4/4] hwmon: (f75375s) Let f75375_update_device treat pwmX as a measured valu

In reply to Nikolaus Schulz
Quoted 36 lines · Nikolaus Schulz
Quoted 26 lines · Guenter Roeck
Quoted 25 lines · Nikolaus Schulz

From: Nikolaus Schulz <[email protected]>

Treat pwmX as a measured value, not as a (mostly static) limit value, so that it is updated more frequently from the device register.

---
 drivers/hwmon/f75375s.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/hwmon/f75375s.c +0 -3
index 0aabaaf..f609b57 100644
@@ -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) {

Quoted 8 lines

drivers/hwmon/f75375s.c

Quoted 5 lines
drivers/hwmon/f75375s.c +2 -0
 		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;

This also fixes a bug where pwm was not read at all if there is no platform data.

Quoted 2 lines

I don't think so, but anyways...

You are right, I missed the (now removed) first round of reading the pwm value. Sorry for the noise; I'll updated the commit accordingly.

Guenter

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