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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

> +		/* 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 way you really only set the bits which need be.

Thanks,
--
Jean Delvare



[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux