Re: [PATCH] iio: Add si7005 relative humidity and temperature sensor driver

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

 



On 01/08/2014 10:17 PM, Peter Meerwald wrote:
> sensor provides 12-bit relative humidity and 14-bit temperature
> via I2C interface; temperature and linearity compensation is not
> implemented (yet)
> 
> driver also supports the Si7015, but not the 2nd generation
> sensors Si7013/Si7020/Si7021
> 
> datasheet is here
> http://www.silabs.com/Support%20Documents/TechnicalDocs/Si7005.pdf
> 
> Signed-off-by: Peter Meerwald <pmeerw@xxxxxxxxxx>

Reviewed-by: Lars-Peter Clausen <lars@xxxxxxxxxx>

One nitpick:


> +	case IIO_CHAN_INFO_SCALE:
> +		if (chan->type == IIO_TEMP) {
> +			*val = 7; *val2 = 812500;

I can understand why you'd put this on one line, but its a bit confusing
this way when you read the code since two statements on one line is
unexpected. To quote CodingStyle: "Don't put multiple statements on a single
line unless you have something to hide".

> +		} else {
> +			*val = 3; *val2 = 906250;
> +		}
> +		return IIO_VAL_INT_PLUS_MICRO;

> +static int si7005_probe(struct i2c_client *client,
> +			 const struct i2c_device_id *id)
> +{
[...]
> +	return iio_device_register(indio_dev);

Sachin will probably send a patch changing this to devm_iio_device_register ;)


--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux