17 Aug, 2012
13 commits
-
The values reported by the AD7780 are unsigned with a binary offset:
0x000000 is negative fullscale
0x800000 is zeroscale
0xffffff is positive fullscaleSo mark the channel in the channel spec as unsigned rather than signed.
Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The temperature channel reports values in degree Kelvin with sensitivity of 5630
codes per degree. If the chip is configured in bipolar mode there is an
additional binary offset of 0x800000 and the sensitivity is divided by two.Currently the driver does the mapping from the raw value to degree Celsius when
doing a manual conversion. This has several disadvantages, the major one being
that it does not work for buffered mode, also by doing the division by the
sensitivity in the driver the precession of the reported value is needlessly
reduced.Furthermore the current calculation only works in bipolar mode and the current
scale is of by a factor of 1000.This patch modifies the driver to report correct offset and scale values in
both unipolar and bipolar mode and to report the raw temperature value
for manual conversions.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
In bipolar mode there is a a binary offset of 2**(N-1) (with N being the number
of bits) on the reported value. Currently this value is subtracted when doing a
manual read. While this works for manual channel readings it does not work for
buffered mode. So report the offset in the channels offset property, which will
work in both modes.Signed-off-by: Lars-Peter Clausen
-
The values reported by the AD7793 are unsigned.
In uniploar mode:
0x000000 is zeroscale
0xffffff is fullscale
In bipolar mode:
0x000000 is negative fullscale
0x800000 is zeroscale
0xffffff is positive fullscaleIn bipolar mode there is a binary offset, but the values are still unsigned.
Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
Write to the correct register when setting the ACX bit.
Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
Without the break statement we fall right through to the default case and return
an error value.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The internal reference for the ad7793 and similar is 1.17V
Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
Make the "in-in_scale_available" attribute follow the new naming spec and
rename it to "in_voltage-voltage_scale_available".Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The temperature channel uses the internal 1.17V reference with 0.81 mv/C. The
reported temperature is in Kevlin, so we need to add the Kelvin to Celcius
offset when reporting the offset for the temperature channel.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
In bipolar mode there is a a binary offset of 2**(N-1) (with N being the number
of bits) on the reported value. Currently this value is subtracted when doing a
manual read. While this works for manual channel readings it does not work for
buffered mode. So report the offset in the channels offset property, which will
work in both modes.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The values reported by the AD7793 are unsigned.
In uniploar mode:
0x000000 is zeroscale
0xffffff is fullscale
In bipolar mode:
0x000000 is negative fullscale
0x800000 is zeroscale
0xffffff is positive fullscaleIn bipolar mode there is a binary offset, but the values are still unsigned.
Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
Without the break statement we fall right through to the default case and return
an error value.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
drivers/staging/iio/adc/ad7298_ring.c:97:37: warning: 'time_ns' may
be used uninitialized in this function [-Wmaybe-uninitialized]Reported-by: Fengguang Wu
Signed-off-by: Michael Hennerich
Signed-off-by: Jonathan Cameron
16 Jul, 2012
2 commits
-
Signed-off-by: Peter Meerwald
Signed-off-by: Jonathan Cameron -
Signed-off-by: Peter Meerwald
Signed-off-by: Jonathan Cameron
14 Jul, 2012
4 commits
-
The data parameters for request_irq and free_irq have to match, otherwise the
IRQ wont be freed.The issue has been discovered using the following coccinelle patch:
//
@r1@
type T;
T data;
@@
(
request_irq(..., (void *)data)
|
request_irq(..., data)
|
request_threaded_irq(..., (void *)data)
|
request_threaded_irq(..., data)
)@r2@
type r1.T;
T data;
position p;
@@
(
free_irq@p(..., (void *)data)
|
free_irq@p(..., data)
)@depends on r1@
position p != r2.p;
@@
*free_irq@p(...)//
Cc: Jon Brenner
Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The data parameters for request_irq and free_irq have to match, otherwise the
IRQ wont be freed.The issue has been discovered using the following coccinelle patch:
//
@r1@
type T;
T data;
@@
(
request_irq(..., (void *)data)
|
request_irq(..., data)
|
request_threaded_irq(..., (void *)data)
|
request_threaded_irq(..., data)
)@r2@
type r1.T;
T data;
position p;
@@
(
free_irq@p(..., (void *)data)
|
free_irq@p(..., data)
)@depends on r1@
position p != r2.p;
@@
*free_irq@p(...)//
Cc: Roland Stigge
Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
In probe the I2C client data is set to the iio_dev struct in probe(), but
assumed to be the tsl2X7X_chip struct in remove(). Fix this by reading the
client data back as iio_dev as well.The issue has been discovered using the following coccinelle patch:
//
@r1@
type T;
T data;
expression dev;
@@
(
i2c_set_clientdata(dev, (void *)data)
|
i2c_set_clientdata(dev, data)
)@r2@
type r1.T;
T data;
position p;
expression dev;
@@
data = i2c_get_clientdata@p(dev)@depends on r1@
position p != r2.p;
expression dev;
identifier data;
@@
*data = i2c_get_clientdata@p(dev)
//Cc: Jon Brenner
Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The SPI drvdata is set to adis16260_state struct in probe(), but assumed to be
the iio_dev struct in remove(). Fix this by setting it to the iio_dev in
probe().The issue has been discovered using the following coccinelle patch:
//
@r1@
type T;
T data;
expression dev;
@@
(
spi_set_drvdata(dev, (void *)data)
|
spi_set_drvdata(dev, data)
)@r2@
type r1.T;
T data;
position p;
expression dev;
@@
data = spi_get_drvdata@p(dev)@depends on r1@
position p != r2.p;
expression dev;
identifier data;
@@
*data = spi_get_drvdata@p(dev)
//Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron
13 Jul, 2012
3 commits
-
IIO: One new driver and a couple of nice cleanups.
-
…ic23/iio into work-next
Various minor IIO fixes for staging-next.
-
It is possible that on one of the error paths we are going to try to free
'rxbuf', even though it has not been allocated yet, which cause the following
warning:
drivers/staging/iio/adc/max1363_ring.c: In function 'max1363_trigger_handler':
drivers/staging/iio/adc/max1363_ring.c:87:7: warning: 'rxbuf' may be used
uninitialized in this functionReported-by: Fengguang Wu
Signed-off-by: Lars-Peter Clausen
11 Jul, 2012
2 commits
-
21cd1fab058671313f7c178b640999fcd0d8de21
Signed-off-by: Jonathan Cameron
Reported-by: Peter Meerwald -
Add iio channel type and modifiers for Correlated Color Temperature (CCT)
and RGBC (red/green/blue/clear) data.
Add CCT and RGBC descriptions to documentation.Changes:
Revised/condensed RGBC descriptions.Merge and trivial fix done by Jonathan Cameron.
Signed-off-by: Jon Brenner
Signed-off-by: Jonathan Cameron
10 Jul, 2012
4 commits
-
…23/iio into staging-next
Mixed back of updates and trivial examples fixes.
Nothing terribly interesting in this one.8 July 2012
-
Only one of the channels of the ade7758 may be sampled at a time. Use the new
validate_scan_mask callback and the iio_validate_scan_mask_onehot function to
implement this restriction. Previously this was implemented using
available_scan_masks, but this requires a individual scan mask for each channel.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
Only one of the channels of the ad7793 may be sampled at a time. Use the new
validate_scan_mask callback and the iio_validate_scan_mask_onehot function to
implement this restriction. Previously this was implemented using
available_scan_masks, but this requires a individual scan mask for each channel.Also the previous code was adding the scan index of the timestamp channel to
each available scan mask, this is not required though since the timestamp
channel is not restricted by the available scan masks and can be enabled or
disabled independently. So the new code does not have to take care of this.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
Only one of the channels of the ad7192 may be sampled at a time. Use the new
validate_scan_mask callback and the iio_validate_scan_mask_onehot function to
implement this restriction. Previously this was implemented using
available_scan_masks, but this requires a individual scan mask for each channel.Also the previous code was adding the scan index of the timestamp channel to
each available scan mask, this is not required though since the timestamp
channel is not restricted by the available scan masks and can be enabled or
disabled independently. So the new code does not have to take care of this.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron
09 Jul, 2012
12 commits
-
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The interrupt handler should only ever return one of the three irqreturn_t
constants and not an error code. Also make sure to always call
iio_trigger_notify_done before leaving the trigger handler.Signed-off-by: Lars-Peter Clausen
Signed-off-by: Jonathan Cameron -
The driver assumes that in 13bit mode the 16bit value has
to be shifted to the right by 3 bits. This is not true, in
both 16bit and 13bit mode the MSB is at the same position.
Currently the driver returns a temperature of 194 degrees
Celsius in 13bit mode and 24 degrees Celsius in 16bit mode.
Fix this by using the same algorithm for 16bit and 13bit
mode and by just masking out the lower three bits in 13bit
mode.Signed-off-by: Sascha Hauer
Acked-by: Sonic Zhang
Signed-off-by: Jonathan Cameron