diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-24 14:57:19 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-24 14:57:19 -0700 |
commit | 040bf7d63d624ad63be8b4b3a3c76a495c9cc569 (patch) | |
tree | 7c427332c498b29c23f305fd82272fb4edd1b7a1 /drivers/iio/accel | |
parent | 16fae052074aa44ffa8c15b789719bd9611a1278 (diff) | |
parent | e6ca2d848c9b7b292d22cbf6fe10019ccab72345 (diff) | |
download | linux-stable-040bf7d63d624ad63be8b4b3a3c76a495c9cc569.tar.gz linux-stable-040bf7d63d624ad63be8b4b3a3c76a495c9cc569.tar.bz2 linux-stable-040bf7d63d624ad63be8b4b3a3c76a495c9cc569.zip |
Merge tag 'iio-for-3.17d' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
Fourth round of IIO new drivers, functionality and cleanups for the 3.17 cycle
New functionality
* A new modifier to indicate that a rotation is relative to either
true or magnetic north. This is to be used by some magnetometers
that provide data in this way.
* hid magnetometer now supports output rotations from various variants on
North
* HMC5843 driver converted to regmap and reworked to allow easy support
of other similar devices. Support for HMC5983 added via both i2c and SPI.
* Rework of Exynos driver to simplify extension to support more devices.
* Addition of support for the Exynos3250 ADC (which requires an additional
clock) Support for quite a few more devices on its way.
Cleanups
* ad7997 - a number of cleanups and tweaks to how the events are controlled
to make it more intuitive.
* kxcjk - cleanups and minor fixes for this new driver.
Diffstat (limited to 'drivers/iio/accel')
-rw-r--r-- | drivers/iio/accel/kxcjk-1013.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c index 72a6dbbc18d1..7941cf2d31ee 100644 --- a/drivers/iio/accel/kxcjk-1013.c +++ b/drivers/iio/accel/kxcjk-1013.c @@ -98,7 +98,7 @@ static const struct { int val2; int odr_bits; } samp_freq_table[] = { {0, 781000, 0x08}, {1, 563000, 0x09}, - {3, 125000, 0x0A}, {6, 25000, 0x0B}, {12, 5000, 0}, + {3, 125000, 0x0A}, {6, 250000, 0x0B}, {12, 500000, 0}, {25, 0, 0x01}, {50, 0, 0x02}, {100, 0, 0x03}, {200, 0, 0x04}, {400, 0, 0x05}, {800, 0, 0x06}, {1600, 0, 0x07} }; @@ -138,19 +138,6 @@ static int kxcjk1013_set_mode(struct kxcjk1013_data *data, return 0; } -static int kxcjk1013_chip_ack_intr(struct kxcjk1013_data *data) -{ - int ret; - - ret = i2c_smbus_read_byte_data(data->client, KXCJK1013_REG_INT_REL); - if (ret < 0) { - dev_err(&data->client->dev, "Error writing reg_int_rel\n"); - return ret; - } - - return ret; -} - static int kxcjk1013_chip_init(struct kxcjk1013_data *data) { int ret; @@ -466,7 +453,7 @@ static const struct attribute_group kxcjk1013_attrs_group = { .realbits = 12, \ .storagebits = 16, \ .shift = 4, \ - .endianness = IIO_LE, \ + .endianness = IIO_CPU, \ }, \ } @@ -498,15 +485,11 @@ static irqreturn_t kxcjk1013_trigger_handler(int irq, void *p) indio_dev->masklength) { ret = kxcjk1013_get_acc_reg(data, bit); if (ret < 0) { - kxcjk1013_chip_ack_intr(data); mutex_unlock(&data->mutex); goto err; } data->buffer[i++] = ret; } - - kxcjk1013_chip_ack_intr(data); - mutex_unlock(&data->mutex); iio_push_to_buffers_with_timestamp(indio_dev, data->buffer, @@ -517,6 +500,21 @@ err: return IRQ_HANDLED; } +static int kxcjk1013_trig_try_reen(struct iio_trigger *trig) +{ + struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig); + struct kxcjk1013_data *data = iio_priv(indio_dev); + int ret; + + ret = i2c_smbus_read_byte_data(data->client, KXCJK1013_REG_INT_REL); + if (ret < 0) { + dev_err(&data->client->dev, "Error reading reg_int_rel\n"); + return ret; + } + + return 0; +} + static int kxcjk1013_data_rdy_trigger_set_state(struct iio_trigger *trig, bool state) { @@ -543,6 +541,7 @@ static int kxcjk1013_data_rdy_trigger_set_state(struct iio_trigger *trig, static const struct iio_trigger_ops kxcjk1013_trigger_ops = { .set_trigger_state = kxcjk1013_data_rdy_trigger_set_state, + .try_reenable = kxcjk1013_trig_try_reen, .owner = THIS_MODULE, }; @@ -645,6 +644,7 @@ static int kxcjk1013_probe(struct i2c_client *client, iio_trigger_set_drvdata(trig, indio_dev); data->trig = trig; indio_dev->trig = trig; + iio_trigger_get(indio_dev->trig); ret = iio_trigger_register(trig); if (ret) |