diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-05 11:42:48 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-05 11:42:48 -0800 |
commit | be61a0d78449f53519905640ac3a9f24c197cbaf (patch) | |
tree | 216a7655e2d6dc8f751214aa93a4863a27954a98 /drivers/staging | |
parent | 7be921a226dcbbbd8fb6f5d63bea4856b3a11624 (diff) | |
parent | 4e4cd14e7cbead5ca20465f4a7ce973d42434a2f (diff) | |
download | linux-be61a0d78449f53519905640ac3a9f24c197cbaf.tar.bz2 |
Merge tag 'iio-for-3.19a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
First round of new drivers, features and cleanups for IIO in the 3.19 cycle.
New drivers / supported parts
* rockchip - rk3066-tsadc variant
* si7020 humidity and temperature sensor
* mcp320x - add mcp3001, mcp3002, mcp3004, mcp3008, mcp3201, mcp3202
* bmp280 pressure and temperature sensor
* Qualcomm SPMI PMIC current ADC driver
* Exynos_adc - support exynos7
New features
* vf610-adc - add temperature sensor support
* Documentation of current attributes, scaled pressure, offset and
scaled humidity, RGBC intensity gain factor and scale applied to
differential voltage channels.
* Bring iio_event_monitor up to date with newer modifiers.
* Add of_xlate function to allow for complex channel mappings from the
device tree.
* Add -g parameter to generic_buffer example to allow for devices with
directly fed (no trigger) buffers.
* Move exynos driver over to syscon for PMU register access.
Cleanups, fixes for new drivers
* lis3l02dq drop an unneeded else.
* st sensors - renam st_sensors to st_sensor_settings (for clarity)
* st sensors - drop an unused parameter from all the probe utility
functions.
* vf610 better error handling and tidy up.
* si7020 - cleanups following merge
* as3935 - drop some unnecessary semicolons.
* bmp280 - fix the pressure calculation.
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/iio/Documentation/generic_buffer.c | 77 | ||||
-rw-r--r-- | drivers/staging/iio/accel/lis3l02dq_ring.c | 1 |
2 files changed, 46 insertions, 32 deletions
diff --git a/drivers/staging/iio/Documentation/generic_buffer.c b/drivers/staging/iio/Documentation/generic_buffer.c index 31dfb21587ff..de4647e2495e 100644 --- a/drivers/staging/iio/Documentation/generic_buffer.c +++ b/drivers/staging/iio/Documentation/generic_buffer.c @@ -162,11 +162,12 @@ int main(int argc, char **argv) char *buffer_access; int scan_size; int noevents = 0; + int notrigger = 0; char *dummy; struct iio_channel_info *channels; - while ((c = getopt(argc, argv, "l:w:c:et:n:")) != -1) { + while ((c = getopt(argc, argv, "l:w:c:et:n:g")) != -1) { switch (c) { case 'n': device_name = optarg; @@ -187,6 +188,9 @@ int main(int argc, char **argv) case 'l': buf_len = strtoul(optarg, &dummy, 10); break; + case 'g': + notrigger = 1; + break; case '?': return -1; } @@ -205,28 +209,32 @@ int main(int argc, char **argv) printf("iio device number being used is %d\n", dev_num); asprintf(&dev_dir_name, "%siio:device%d", iio_dir, dev_num); - if (trigger_name == NULL) { - /* - * Build the trigger name. If it is device associated its - * name is <device_name>_dev[n] where n matches the device - * number found above - */ - ret = asprintf(&trigger_name, - "%s-dev%d", device_name, dev_num); - if (ret < 0) { - ret = -ENOMEM; - goto error_ret; + + if (!notrigger) { + if (trigger_name == NULL) { + /* + * Build the trigger name. If it is device associated + * its name is <device_name>_dev[n] where n matches + * the device number found above. + */ + ret = asprintf(&trigger_name, + "%s-dev%d", device_name, dev_num); + if (ret < 0) { + ret = -ENOMEM; + goto error_ret; + } } - } - /* Verify the trigger exists */ - trig_num = find_type_by_name(trigger_name, "trigger"); - if (trig_num < 0) { - printf("Failed to find the trigger %s\n", trigger_name); - ret = -ENODEV; - goto error_free_triggername; - } - printf("iio trigger number being used is %d\n", trig_num); + /* Verify the trigger exists */ + trig_num = find_type_by_name(trigger_name, "trigger"); + if (trig_num < 0) { + printf("Failed to find the trigger %s\n", trigger_name); + ret = -ENODEV; + goto error_free_triggername; + } + printf("iio trigger number being used is %d\n", trig_num); + } else + printf("trigger-less mode selected\n"); /* * Parse the files in scan_elements to identify what channels are @@ -250,14 +258,18 @@ int main(int argc, char **argv) ret = -ENOMEM; goto error_free_triggername; } - printf("%s %s\n", dev_dir_name, trigger_name); - /* Set the device trigger to be the data ready trigger found above */ - ret = write_sysfs_string_and_verify("trigger/current_trigger", - dev_dir_name, - trigger_name); - if (ret < 0) { - printf("Failed to write current_trigger file\n"); - goto error_free_buf_dir_name; + + if (!notrigger) { + printf("%s %s\n", dev_dir_name, trigger_name); + /* Set the device trigger to be the data ready trigger found + * above */ + ret = write_sysfs_string_and_verify("trigger/current_trigger", + dev_dir_name, + trigger_name); + if (ret < 0) { + printf("Failed to write current_trigger file\n"); + goto error_free_buf_dir_name; + } } /* Setup ring buffer parameters */ @@ -327,9 +339,10 @@ int main(int argc, char **argv) if (ret < 0) goto error_close_buffer_access; - /* Disconnect the trigger - just write a dummy name. */ - write_sysfs_string("trigger/current_trigger", - dev_dir_name, "NULL"); + if (!notrigger) + /* Disconnect the trigger - just write a dummy name. */ + write_sysfs_string("trigger/current_trigger", + dev_dir_name, "NULL"); error_close_buffer_access: close(fp); diff --git a/drivers/staging/iio/accel/lis3l02dq_ring.c b/drivers/staging/iio/accel/lis3l02dq_ring.c index 61f94221b8b7..9efc77b0ebdd 100644 --- a/drivers/staging/iio/accel/lis3l02dq_ring.c +++ b/drivers/staging/iio/accel/lis3l02dq_ring.c @@ -35,6 +35,7 @@ irqreturn_t lis3l02dq_data_rdy_trig_poll(int irq, void *private) iio_trigger_poll(st->trig); return IRQ_HANDLED; } + return IRQ_WAKE_THREAD; } |