[lm-sensors] [PATCH 1/4] hwmon: (w83791d) fan 4/5 pins can also be used for gpio

Jean Delvare khali at linux-fr.org
Tue Sep 30 15:59:55 CEST 2008

Hi Marc, Hans,

On Wed, 06 Aug 2008 09:46:05 +0200, Hans de Goede wrote:
> Marc Hulsman wrote:
> > Fan 4/5 and PWM 4/5 pins can be used for GPIO. If the bios initializes these 
> > pins as in use for GPIO we keep it that way and do not construct the 
> > sysfs-interface for them.  I left the code for reading the corresponding 
> > registers during update_device unchanged as adding conditional terms would 
> > only complicate the code. 
> Looks good:
> Acked-by: Hans de Goede <j.w.r.degoede at hhs.nl>

Patch applied, thanks.

> One note though (for a future patch) you say you keep reading the unused regs 
> to keep the code clean. I understand this, but please keep in mind that i2c is 
> pretty slow, so you might want todo another patch changing this.

I second that. Every I2C register access we can avoid (without loss of
functionality, of course) is welcome.

> Or even better write a patch where you stop re-reading never changing registers 
> completely, iow read config / min / max registers only once on probe and then 
> only read registers which actually measure things (and thus can change without 
> a write) in update_device (Yes there is the potential problem of acpi code 
> writing to the device underneath us but we aren't checking for that now anyways).

This could be done too.

Jean Delvare

More information about the lm-sensors mailing list