diff options
author | 2016-04-11 10:41:07 +0300 | |
---|---|---|
committer | 2016-04-13 08:17:18 +0300 | |
commit | e09b41010ba33a20a87472ee821fa407a5b8da36 (patch) | |
tree | d10dc367189862e7ca5c592f033dc3726e1df4e3 /kernel/drivers/staging/iio/iio_simple_dummy_events.c | |
parent | f93b97fd65072de626c074dbe099a1fff05ce060 (diff) |
These changes are the raw update to linux-4.4.6-rt14. Kernel sources
are taken from kernel.org, and rt patch from the rt wiki download page.
During the rebasing, the following patch collided:
Force tick interrupt and get rid of softirq magic(I70131fb85).
Collisions have been removed because its logic was found on the
source already.
Change-Id: I7f57a4081d9deaa0d9ccfc41a6c8daccdee3b769
Signed-off-by: José Pekkarinen <jose.pekkarinen@nokia.com>
Diffstat (limited to 'kernel/drivers/staging/iio/iio_simple_dummy_events.c')
-rw-r--r-- | kernel/drivers/staging/iio/iio_simple_dummy_events.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/kernel/drivers/staging/iio/iio_simple_dummy_events.c b/kernel/drivers/staging/iio/iio_simple_dummy_events.c index a5cd3bb21..6eb600ff7 100644 --- a/kernel/drivers/staging/iio/iio_simple_dummy_events.c +++ b/kernel/drivers/staging/iio/iio_simple_dummy_events.c @@ -84,6 +84,7 @@ int iio_simple_dummy_write_event_config(struct iio_dev *indio_dev, default: return -EINVAL; } + break; case IIO_STEPS: switch (type) { case IIO_EV_TYPE_CHANGE: @@ -92,6 +93,7 @@ int iio_simple_dummy_write_event_config(struct iio_dev *indio_dev, default: return -EINVAL; } + break; default: return -EINVAL; } @@ -118,7 +120,7 @@ int iio_simple_dummy_read_event_value(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - enum iio_event_info info, + enum iio_event_info info, int *val, int *val2) { struct iio_dummy_state *st = iio_priv(indio_dev); @@ -141,7 +143,7 @@ int iio_simple_dummy_write_event_value(struct iio_dev *indio_dev, const struct iio_chan_spec *chan, enum iio_event_type type, enum iio_event_direction dir, - enum iio_event_info info, + enum iio_event_info info, int val, int val2) { struct iio_dummy_state *st = iio_priv(indio_dev); @@ -151,6 +153,15 @@ int iio_simple_dummy_write_event_value(struct iio_dev *indio_dev, return 0; } +static irqreturn_t iio_simple_dummy_get_timestamp(int irq, void *private) +{ + struct iio_dev *indio_dev = private; + struct iio_dummy_state *st = iio_priv(indio_dev); + + st->event_timestamp = iio_get_time_ns(); + return IRQ_WAKE_THREAD; +} + /** * iio_simple_dummy_event_handler() - identify and pass on event * @irq: irq of event line @@ -175,7 +186,7 @@ static irqreturn_t iio_simple_dummy_event_handler(int irq, void *private) IIO_EVENT_CODE(IIO_VOLTAGE, 0, 0, IIO_EV_DIR_RISING, IIO_EV_TYPE_THRESH, 0, 0, 0), - iio_get_time_ns()); + st->event_timestamp); break; case 1: if (st->activity_running > st->event_val) @@ -185,7 +196,7 @@ static irqreturn_t iio_simple_dummy_event_handler(int irq, void *private) IIO_EV_DIR_RISING, IIO_EV_TYPE_THRESH, 0, 0, 0), - iio_get_time_ns()); + st->event_timestamp); break; case 2: if (st->activity_walking < st->event_val) @@ -195,14 +206,14 @@ static irqreturn_t iio_simple_dummy_event_handler(int irq, void *private) IIO_EV_DIR_FALLING, IIO_EV_TYPE_THRESH, 0, 0, 0), - iio_get_time_ns()); + st->event_timestamp); break; case 3: iio_push_event(indio_dev, IIO_EVENT_CODE(IIO_STEPS, 0, IIO_NO_MOD, IIO_EV_DIR_NONE, IIO_EV_TYPE_CHANGE, 0, 0, 0), - iio_get_time_ns()); + st->event_timestamp); break; default: break; @@ -236,7 +247,7 @@ int iio_simple_dummy_events_register(struct iio_dev *indio_dev) st->regs = iio_dummy_evgen_get_regs(st->event_irq); ret = request_threaded_irq(st->event_irq, - NULL, + &iio_simple_dummy_get_timestamp, &iio_simple_dummy_event_handler, IRQF_ONESHOT, "iio_simple_event", @@ -255,13 +266,11 @@ error_ret: * iio_simple_dummy_events_unregister() - tidy up interrupt handling on remove * @indio_dev: device instance data */ -int iio_simple_dummy_events_unregister(struct iio_dev *indio_dev) +void iio_simple_dummy_events_unregister(struct iio_dev *indio_dev) { struct iio_dummy_state *st = iio_priv(indio_dev); free_irq(st->event_irq, indio_dev); /* Not part of normal driver */ iio_dummy_evgen_release_irq(st->event_irq); - - return 0; } |