[PATCH 2.6] I2C: New hardware monitor driver: adm9240 (2nd try)

Grant Coady grant_lkml at dodo.com.au
Thu Apr 28 10:07:23 CEST 2005


Hi Khali,

On Thu, 28 Apr 2005 09:29:54 +0200 (CEST), "Jean Delvare" <khali at linux-fr.org> wrote:

>
>Hi Grant,
>
>> +		for (i = 1; i < 6; i++) {
>> +			adm9240_write_value(client,
>> +					ADM9240_REG_IN_MIN(i), 0);
>> +			adm9240_write_value(client,
>> +					ADM9240_REG_IN_MAX(i), 255);
>> +		}
>
>Shouldn't i start from 0 here?
Yep, missed that :)

>> +		/* start measurement cycle */
>> +		adm9240_write_value(client, ADM9240_REG_CONFIG, 1);
>
>I'm sorry but I'm still not quite happy with this. You want to change
>one bit and end up writing 8. What about something along the lines of:
>
>	reg = adm9240_read_value(client, ADM9240_REG_CONFIG);
>	adm9240_write_value(client, ADM9240_REG_CONFIG,
>		(reg | 0x01) & 0x7f);

That would fail to start the measurement cycle and leave user-space 
able to assert a hardware interrupt signal, plus it writes zero to 
bit 7 for what reason?

Thanks,
--Grant.



More information about the lm-sensors mailing list