diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-23 18:08:34 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-23 18:08:34 +0100 |
commit | aa256f8d0dd9c2dff872849418d8e09e5d06718f (patch) | |
tree | 870fde25453b7eaffa4e9432b16cb4e2f4f4d23e /drivers/iio/magnetometer/mag3110.c | |
parent | staging: comedi: pcl816: tidy up pcl818_check() (diff) | |
parent | iio:event: Fix and cleanup locking (diff) | |
download | linux-aa256f8d0dd9c2dff872849418d8e09e5d06718f.tar.xz linux-aa256f8d0dd9c2dff872849418d8e09e5d06718f.zip |
Merge tag 'iio-for-3.15b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Second round of IIO new driver, functionality and cleanups for the 3.15 series.
There are a few fixes in here that might, earlier in a cycle, have gone
to Greg as fixes. Given they are either minor or have never actually
been observed as causing trouble (the locking bug in the event code) and
are invasive, I have included them in this pull request, targeting the
3.15 merge window instead.
The rest are pretty uncontroversial new drivers, a handy little tool for
the example code in our documentation and little cleanups.
New drivers
* Freescale Vybrid and i.MX6SLX ADC driver.
* HID Sensor hub proximity sensors.
* HID Sensor hub pressure sensors.
* LPS25H Pressure sensors added to the ST micro pressure sensor driver.
New functionality
* lsiio tool. This is added to the staging tree as we haven't yet moved
the example code it sits with out. Moving this code out is now a reasonably
high priority but holding up this tool in the meantime did not seem
worthwhile.
* mag3110 - add missing scale factor for temperature output to userspace.
Cleanups
* Fix a bug in the event reporting in which a spin lock might be held over
when a sleep occured. A similar bug was found by Lars in the buffer code.
It has not to our knowledge been observed as actually occuring and is
a little too invasive to push out as a fix.
* Drop the IIO_ST macro after clearing out all users. This macro was a very
bad idea leading to a number of bugs after it stopped covering all elements
of the structure being assigned and people started making assumptions about
what it did cover. Glad to see it go!
* Avoid applying extended name to shared attributes as it makes no sense.
No in tree drivers were using the combination, hence not pushed out as
a fix.
* ad799x - move to devm_request_threaded_irq to reduce boilerplate clean up.
* bma180 - make the low_pass_filter_3db_frequency info element shared rather
than per attribute. The old approach was valid but not as clean as it might
be and was setting a bad example. Hence the cleanup.
* mxs-lradc - propogate the error code form a platform_get_irq call rather than
eating it up by returning -EINVAL on all errors.
* ad799x - typo fix in the copyright message. Either that or Michael was
asserting a copyright that moved backwards in time by about a thousand years.
* ad799x - use a regulator for vref rather than platform data. The driver
dates from just as the regulator framework was coming into common use so
provides an alternative way of specifying the reference voltage. We no
longer need that approach so drop it in favour of a regulator only approach.
* max1363 - some internal vref values were out by a small amount. The effect
would have been tiny and no one noticed hence not pushing this through as
a fix.
* core - replace some pointless goto error_ret (with no clean up) lines with
direct returns. This is my bad coding style so I'm glad to see it cleaned
up.
* core - avoid a kasprintf that just directly prints a string with no
formatting elements. This has always been there but Lars just noticed it.
Oops.
Diffstat (limited to 'drivers/iio/magnetometer/mag3110.c')
-rw-r--r-- | drivers/iio/magnetometer/mag3110.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/iio/magnetometer/mag3110.c b/drivers/iio/magnetometer/mag3110.c index f66955fb3509..02e4f9765889 100644 --- a/drivers/iio/magnetometer/mag3110.c +++ b/drivers/iio/magnetometer/mag3110.c @@ -183,8 +183,17 @@ static int mag3110_read_raw(struct iio_dev *indio_dev, return -EINVAL; } case IIO_CHAN_INFO_SCALE: - *val = 0; - *val2 = 1000; + switch (chan->type) { + case IIO_MAGN: + *val = 0; + *val2 = 1000; + return IIO_VAL_INT_PLUS_MICRO; + case IIO_TEMP: + *val = 1000; + return IIO_VAL_INT; + default: + return -EINVAL; + } return IIO_VAL_INT_PLUS_MICRO; case IIO_CHAN_INFO_SAMP_FREQ: i = data->ctrl_reg1 >> MAG3110_CTRL_DR_SHIFT; @@ -270,7 +279,8 @@ static const struct iio_chan_spec mag3110_channels[] = { MAG3110_CHANNEL(Z, 2), { .type = IIO_TEMP, - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | + BIT(IIO_CHAN_INFO_SCALE), .scan_index = 3, .scan_type = { .sign = 's', |