diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-15 18:06:13 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-15 18:06:13 -0800 |
commit | dab363f938a53ddaee60bfecc1aebdbb3d3af5f0 (patch) | |
tree | ccdb11a6e6191ba71fbc7716714c47b79172070d /drivers/staging/iio | |
parent | a68db9cb858d10820add66682ad4d412f9914288 (diff) | |
parent | 17d2c6439be65777245914be354c5a97c76ad246 (diff) | |
download | linux-dab363f938a53ddaee60bfecc1aebdbb3d3af5f0.tar.bz2 |
Merge tag 'staging-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH:
"Here's the big staging tree pull request for 3.19-rc1.
We continued to delete more lines than were added, always a good
thing, but not at a huge rate this release, only about 70k lines
removed overall mostly from removing the horrid bcm driver.
Lots of normal staging driver cleanups and fixes all over the place,
well over a thousand of them, the shortlog shows all the horrid
details.
The "contentious" thing here is the movement of the Android binder
code out of staging into the "real" part of the kernel. This is code
that has been stable for a few years now and is working as-is in the
tens of millions of devices with no issues. Yes, the code is horrid,
and the userspace api leaves a lot to be desired, but it's not going
to change due to legacy issues that we have no control over. Because
so many devices and companies rely on this, and the code is stable,
might as well promote it out of staging.
This was all discussed at the Linux Plumbers conference, and everyone
participating agreed that this was the best way forward.
There is work happening to replace the binder code with something new
that is happening right now, but I don't expect to see the results of
that work for another year at the earliest. If that ever happens, and
Android switches over to it, I'll gladly remove this version.
As for maintainers, I'll be glad to maintain this code, I've been
doing it for the past few years with no problems. I'll send a
MAINTAINERS entry for it before 3.19-final is out, still need to talk
to the Google developers about if they are willing to help with it or
not, last I checked they were, which was good.
All of these patches have been in linux-next for a while with no
reported issues"
* tag 'staging-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1382 commits)
Staging: slicoss: Fix long line issues in slicoss.c
staging: rtl8712: remove unnecessary else after return
staging: comedi: change some printk calls to pr_err
staging: rtl8723au: hal: Removed the extra semicolon
lustre: Deletion of unnecessary checks before three function calls
staging: lustre: fix sparse warnings: static function declaration
staging: lustre: fixed sparse warnings related to static declarations
staging: unisys: remove duplicate header
staging: unisys: remove unneeded structure
staging: ft1000 : replace __attribute ((__packed__) with __packed
drivers: staging: rtl8192e: Include "asm/unaligned.h" instead of "access_ok.h" in "rtl819x_BAProc.c"
Drivers:staging:rtl8192e: Fixed checkpatch warning
Drivers:staging:clocking-wizard: Added a newline
staging: clocking-wizard: check for a valid clk_name pointer
staging: rtl8723au: Hal_InitPGData() avoid unnecessary typecasts
staging: rtl8723au: _DisableAnalog(): Avoid zero-init variables unnecessarily
staging: rtl8723au: Remove unnecessary wrapper _ResetDigitalProcedure1()
staging: rtl8723au: _ResetDigitalProcedure1_92C() reduce code obfuscation
staging: rtl8723au: Remove unnecessary wrapper _DisableRFAFEAndResetBB()
staging: rtl8723au: _DisableRFAFEAndResetBB8192C(): Reduce code obfuscation
...
Diffstat (limited to 'drivers/staging/iio')
20 files changed, 187 insertions, 72 deletions
diff --git a/drivers/staging/iio/Documentation/generic_buffer.c b/drivers/staging/iio/Documentation/generic_buffer.c index 044ea196aa6f..de4647e2495e 100644 --- a/drivers/staging/iio/Documentation/generic_buffer.c +++ b/drivers/staging/iio/Documentation/generic_buffer.c @@ -47,6 +47,7 @@ int size_from_channelarray(struct iio_channel_info *channels, int num_channels) { int bytes = 0; int i = 0; + while (i < num_channels) { if (bytes % channels[i].bytes == 0) channels[i].location = bytes; @@ -74,12 +75,14 @@ void print2byte(int input, struct iio_channel_info *info) input = input >> info->shift; if (info->is_signed) { int16_t val = input; + val &= (1 << info->bits_used) - 1; val = (int16_t)(val << (16 - info->bits_used)) >> (16 - info->bits_used); printf("%05f ", ((float)val + info->offset)*info->scale); } else { uint16_t val = input; + val &= (1 << info->bits_used) - 1; printf("%05f ", ((float)val + info->offset)*info->scale); } @@ -97,6 +100,7 @@ void process_scan(char *data, int num_channels) { int k; + for (k = 0; k < num_channels; k++) switch (channels[k].bytes) { /* only a few cases implemented so far */ @@ -158,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; @@ -183,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; } @@ -201,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 @@ -246,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 */ @@ -323,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/Documentation/iio_event_monitor.c b/drivers/staging/iio/Documentation/iio_event_monitor.c index 569d6f8face5..940ed2399e73 100644 --- a/drivers/staging/iio/Documentation/iio_event_monitor.c +++ b/drivers/staging/iio/Documentation/iio_event_monitor.c @@ -69,16 +69,29 @@ static const char * const iio_modifier_names[] = { [IIO_MOD_X] = "x", [IIO_MOD_Y] = "y", [IIO_MOD_Z] = "z", + [IIO_MOD_X_AND_Y] = "x&y", + [IIO_MOD_X_AND_Z] = "x&z", + [IIO_MOD_Y_AND_Z] = "y&z", + [IIO_MOD_X_AND_Y_AND_Z] = "x&y&z", + [IIO_MOD_X_OR_Y] = "x|y", + [IIO_MOD_X_OR_Z] = "x|z", + [IIO_MOD_Y_OR_Z] = "y|z", + [IIO_MOD_X_OR_Y_OR_Z] = "x|y|z", [IIO_MOD_LIGHT_BOTH] = "both", [IIO_MOD_LIGHT_IR] = "ir", [IIO_MOD_ROOT_SUM_SQUARED_X_Y] = "sqrt(x^2+y^2)", [IIO_MOD_SUM_SQUARED_X_Y_Z] = "x^2+y^2+z^2", - [IIO_MOD_LIGHT_BOTH] = "both", - [IIO_MOD_LIGHT_IR] = "ir", [IIO_MOD_LIGHT_CLEAR] = "clear", [IIO_MOD_LIGHT_RED] = "red", [IIO_MOD_LIGHT_GREEN] = "green", [IIO_MOD_LIGHT_BLUE] = "blue", + [IIO_MOD_QUATERNION] = "quaternion", + [IIO_MOD_TEMP_AMBIENT] = "ambient", + [IIO_MOD_TEMP_OBJECT] = "object", + [IIO_MOD_NORTH_MAGN] = "from_north_magnetic", + [IIO_MOD_NORTH_TRUE] = "from_north_true", + [IIO_MOD_NORTH_MAGN_TILT_COMP] = "from_north_magnetic_tilt_comp", + [IIO_MOD_NORTH_TRUE_TILT_COMP] = "from_north_true_tilt_comp", }; static bool event_is_known(struct iio_event_data *event) @@ -118,6 +131,14 @@ static bool event_is_known(struct iio_event_data *event) case IIO_MOD_X: case IIO_MOD_Y: case IIO_MOD_Z: + case IIO_MOD_X_AND_Y: + case IIO_MOD_X_AND_Z: + case IIO_MOD_Y_AND_Z: + case IIO_MOD_X_AND_Y_AND_Z: + case IIO_MOD_X_OR_Y: + case IIO_MOD_X_OR_Z: + case IIO_MOD_Y_OR_Z: + case IIO_MOD_X_OR_Y_OR_Z: case IIO_MOD_LIGHT_BOTH: case IIO_MOD_LIGHT_IR: case IIO_MOD_ROOT_SUM_SQUARED_X_Y: @@ -126,6 +147,13 @@ static bool event_is_known(struct iio_event_data *event) case IIO_MOD_LIGHT_RED: case IIO_MOD_LIGHT_GREEN: case IIO_MOD_LIGHT_BLUE: + case IIO_MOD_QUATERNION: + case IIO_MOD_TEMP_AMBIENT: + case IIO_MOD_TEMP_OBJECT: + case IIO_MOD_NORTH_MAGN: + case IIO_MOD_NORTH_TRUE: + case IIO_MOD_NORTH_MAGN_TILT_COMP: + case IIO_MOD_NORTH_TRUE_TILT_COMP: break; default: return false; diff --git a/drivers/staging/iio/Documentation/iio_utils.h b/drivers/staging/iio/Documentation/iio_utils.h index 0973a092224a..568eff06f803 100644 --- a/drivers/staging/iio/Documentation/iio_utils.h +++ b/drivers/staging/iio/Documentation/iio_utils.h @@ -34,6 +34,7 @@ inline int iioutils_break_up_name(const char *full_name, char *current; char *w, *r; char *working; + current = strdup(full_name); working = strtok(current, "_\0"); w = working; @@ -335,6 +336,7 @@ inline int build_channel_array(const char *device_dir, if (strcmp(ent->d_name + strlen(ent->d_name) - strlen("_en"), "_en") == 0) { int current_enabled = 0; + current = &(*ci_array)[count++]; ret = asprintf(&filename, "%s/%s", scan_el_dir, ent->d_name); @@ -506,6 +508,7 @@ inline int _write_sysfs_int(char *filename, char *basedir, int val, int verify) FILE *sysfsfp; int test; char *temp = malloc(strlen(basedir) + strlen(filename) + 2); + if (temp == NULL) return -ENOMEM; sprintf(temp, "%s/%s", basedir, filename); @@ -554,6 +557,7 @@ int _write_sysfs_string(char *filename, char *basedir, char *val, int verify) int ret = 0; FILE *sysfsfp; char *temp = malloc(strlen(basedir) + strlen(filename) + 2); + if (temp == NULL) { printf("Memory allocation failed\n"); return -ENOMEM; @@ -614,6 +618,7 @@ int read_sysfs_posint(char *filename, char *basedir) int ret; FILE *sysfsfp; char *temp = malloc(strlen(basedir) + strlen(filename) + 2); + if (temp == NULL) { printf("Memory allocation failed"); return -ENOMEM; @@ -636,6 +641,7 @@ int read_sysfs_float(char *filename, char *basedir, float *val) int ret = 0; FILE *sysfsfp; char *temp = malloc(strlen(basedir) + strlen(filename) + 2); + if (temp == NULL) { printf("Memory allocation failed"); return -ENOMEM; @@ -658,6 +664,7 @@ int read_sysfs_string(const char *filename, const char *basedir, char *str) int ret = 0; FILE *sysfsfp; char *temp = malloc(strlen(basedir) + strlen(filename) + 2); + if (temp == NULL) { printf("Memory allocation failed"); return -ENOMEM; diff --git a/drivers/staging/iio/Documentation/lsiio.c b/drivers/staging/iio/Documentation/lsiio.c index 24ae9694eb41..98a0de098130 100644 --- a/drivers/staging/iio/Documentation/lsiio.c +++ b/drivers/staging/iio/Documentation/lsiio.c @@ -46,6 +46,7 @@ static int dump_channels(const char *dev_dir_name) { DIR *dp; const struct dirent *ent; + dp = opendir(dev_dir_name); if (dp == NULL) return -errno; @@ -62,17 +63,17 @@ static int dump_one_device(const char *dev_dir_name) { char name[IIO_MAX_NAME_LENGTH]; int dev_idx; + int retval; - sscanf(dev_dir_name + strlen(iio_dir) + strlen(type_device), + retval = sscanf(dev_dir_name + strlen(iio_dir) + strlen(type_device), "%i", &dev_idx); + if (retval != 1) + return -EINVAL; read_sysfs_string("name", dev_dir_name, name); printf("Device %03d: %s\n", dev_idx, name); - if (verblevel >= VERBLEVEL_SENSORS) { - int ret = dump_channels(dev_dir_name); - if (ret) - return ret; - } + if (verblevel >= VERBLEVEL_SENSORS) + return dump_channels(dev_dir_name); return 0; } @@ -80,9 +81,12 @@ static int dump_one_trigger(const char *dev_dir_name) { char name[IIO_MAX_NAME_LENGTH]; int dev_idx; + int retval; - sscanf(dev_dir_name + strlen(iio_dir) + strlen(type_trigger), + retval = sscanf(dev_dir_name + strlen(iio_dir) + strlen(type_trigger), "%i", &dev_idx); + if (retval != 1) + return -EINVAL; read_sysfs_string("name", dev_dir_name, name); printf("Trigger %03d: %s\n", dev_idx, name); return 0; @@ -107,6 +111,7 @@ static void dump_devices(void) while (ent = readdir(dp), ent != NULL) { if (check_prefix(ent->d_name, type_device)) { char *dev_dir_name; + asprintf(&dev_dir_name, "%s%s", iio_dir, ent->d_name); dump_one_device(dev_dir_name); free(dev_dir_name); @@ -118,6 +123,7 @@ static void dump_devices(void) while (ent = readdir(dp), ent != NULL) { if (check_prefix(ent->d_name, type_trigger)) { char *dev_dir_name; + asprintf(&dev_dir_name, "%s%s", iio_dir, ent->d_name); dump_one_trigger(dev_dir_name); free(dev_dir_name); diff --git a/drivers/staging/iio/accel/Kconfig b/drivers/staging/iio/accel/Kconfig index ad45dfbdf417..07b7ffa00ab5 100644 --- a/drivers/staging/iio/accel/Kconfig +++ b/drivers/staging/iio/accel/Kconfig @@ -9,53 +9,71 @@ config ADIS16201 select IIO_ADIS_LIB select IIO_ADIS_LIB_BUFFER if IIO_BUFFER help - Say yes here to build support for Analog Devices adis16201 dual-axis + Say Y here to build support for Analog Devices adis16201 dual-axis digital inclinometer and accelerometer. + To compile this driver as a module, say M here: the module will + be called adis16201. + config ADIS16203 tristate "Analog Devices ADIS16203 Programmable 360 Degrees Inclinometer" depends on SPI select IIO_ADIS_LIB select IIO_ADIS_LIB_BUFFER if IIO_BUFFER help - Say yes here to build support for Analog Devices adis16203 Programmable + Say Y here to build support for Analog Devices adis16203 Programmable 360 Degrees Inclinometer. + To compile this driver as a module, say M here: the module will be + called adis16203. + config ADIS16204 tristate "Analog Devices ADIS16204 Programmable High-g Digital Impact Sensor and Recorder" depends on SPI select IIO_ADIS_LIB select IIO_ADIS_LIB_BUFFER if IIO_BUFFER help - Say yes here to build support for Analog Devices adis16204 Programmable + Say Y here to build support for Analog Devices adis16204 Programmable High-g Digital Impact Sensor and Recorder. + To compile this driver as a module, say M here: the module will be + called adis16204. + config ADIS16209 tristate "Analog Devices ADIS16209 Dual-Axis Digital Inclinometer and Accelerometer" depends on SPI select IIO_ADIS_LIB select IIO_ADIS_LIB_BUFFER if IIO_BUFFER help - Say yes here to build support for Analog Devices adis16209 dual-axis digital inclinometer + Say Y here to build support for Analog Devices adis16209 dual-axis digital inclinometer and accelerometer. + To compile this driver as a module, say M here: the module will be + called adis16209. + config ADIS16220 tristate "Analog Devices ADIS16220 Programmable Digital Vibration Sensor" depends on SPI select IIO_ADIS_LIB help - Say yes here to build support for Analog Devices adis16220 programmable + Say Y here to build support for Analog Devices adis16220 programmable digital vibration sensor. + To compile this driver as a module, say M here: the module will be + called adis16220. + config ADIS16240 tristate "Analog Devices ADIS16240 Programmable Impact Sensor and Recorder" depends on SPI select IIO_ADIS_LIB select IIO_ADIS_LIB_BUFFER if IIO_BUFFER help - Say yes here to build support for Analog Devices adis16240 programmable + Say Y here to build support for Analog Devices adis16240 programmable impact Sensor and recorder. + To compile this driver as a module, say M here: the module will be + called adis16240. + config LIS3L02DQ tristate "ST Microelectronics LIS3L02DQ Accelerometer Driver" depends on SPI @@ -63,16 +81,21 @@ config LIS3L02DQ depends on !IIO_BUFFER || IIO_KFIFO_BUF depends on GPIOLIB help - Say yes here to build SPI support for the ST microelectronics + Say Y here to build SPI support for the ST microelectronics accelerometer. The driver supplies direct access via sysfs files and an event interface via a character device. + To compile this driver as a module, say M here: the module will be + called lis3l02dq. + config SCA3000 depends on IIO_BUFFER depends on SPI tristate "VTI SCA3000 series accelerometers" help - Say yes here to build support for the VTI SCA3000 series of SPI + Say Y here to build support for the VTI SCA3000 series of SPI accelerometers. These devices use a hardware ring buffer. + To compile this driver as a module, say M here: the module will be + called sca3000. endmenu 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; } diff --git a/drivers/staging/iio/adc/ad7192.c b/drivers/staging/iio/adc/ad7192.c index c110a255d4e8..f6526aa22e8a 100644 --- a/drivers/staging/iio/adc/ad7192.c +++ b/drivers/staging/iio/adc/ad7192.c @@ -223,7 +223,8 @@ static int ad7192_setup(struct ad7192_state *st, id &= AD7192_ID_MASK; if (id != st->devid) - dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X)\n", id); + dev_warn(&st->sd.spi->dev, "device ID query failed (0x%X)\n", + id); switch (pdata->clock_source_sel) { case AD7192_CLK_EXT_MCLK1_2: diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c index d215edf66af2..4d4870787eed 100644 --- a/drivers/staging/iio/adc/ad7280a.c +++ b/drivers/staging/iio/adc/ad7280a.c @@ -188,7 +188,7 @@ static void ad7280_delay(struct ad7280_state *st) if (st->readback_delay_us < 50) udelay(st->readback_delay_us); else - msleep(1); + usleep_range(250, 500); } static int __ad7280_read32(struct ad7280_state *st, unsigned *val) diff --git a/drivers/staging/iio/adc/ad7606_spi.c b/drivers/staging/iio/adc/ad7606_spi.c index 6a8ecd73a1a7..7303983e64a7 100644 --- a/drivers/staging/iio/adc/ad7606_spi.c +++ b/drivers/staging/iio/adc/ad7606_spi.c @@ -23,7 +23,7 @@ static int ad7606_spi_read_block(struct device *dev, int i, ret; unsigned short *data = buf; - ret = spi_read(spi, (u8 *)buf, count * 2); + ret = spi_read(spi, buf, count * 2); if (ret < 0) { dev_err(&spi->dev, "SPI read error\n"); return ret; diff --git a/drivers/staging/iio/adc/ad7816.c b/drivers/staging/iio/adc/ad7816.c index 734a7e4886a0..48b1c3740030 100644 --- a/drivers/staging/iio/adc/ad7816.c +++ b/drivers/staging/iio/adc/ad7816.c @@ -152,7 +152,8 @@ static ssize_t ad7816_show_available_modes(struct device *dev, return sprintf(buf, "full\npower-save\n"); } -static IIO_DEVICE_ATTR(available_modes, S_IRUGO, ad7816_show_available_modes, NULL, 0); +static IIO_DEVICE_ATTR(available_modes, S_IRUGO, ad7816_show_available_modes, + NULL, 0); static ssize_t ad7816_show_channel(struct device *dev, struct device_attribute *attr, diff --git a/drivers/staging/iio/adc/lpc32xx_adc.c b/drivers/staging/iio/adc/lpc32xx_adc.c index 4708e9a41633..5331c442fcfc 100644 --- a/drivers/staging/iio/adc/lpc32xx_adc.c +++ b/drivers/staging/iio/adc/lpc32xx_adc.c @@ -116,7 +116,7 @@ static const struct iio_chan_spec lpc32xx_adc_iio_channels[] = { static irqreturn_t lpc32xx_adc_isr(int irq, void *dev_id) { - struct lpc32xx_adc_info *info = (struct lpc32xx_adc_info *) dev_id; + struct lpc32xx_adc_info *info = dev_id; /* Read value and clear irq */ info->value = __raw_readl(LPC32XX_ADC_VALUE(info->adc_base)) & diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c index 51931045bedd..f053535385bf 100644 --- a/drivers/staging/iio/adc/mxs-lradc.c +++ b/drivers/staging/iio/adc/mxs-lradc.c @@ -455,7 +455,8 @@ static void mxs_lradc_setup_ts_channel(struct mxs_lradc *lradc, unsigned ch) * SoC's delay unit and start the conversion later * and automatically. */ - mxs_lradc_reg_wrt(lradc, LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC */ + mxs_lradc_reg_wrt(lradc, + LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC */ LRADC_DELAY_TRIGGER_DELAYS(1 << 3) | /* trigger DELAY unit#3 */ LRADC_DELAY_KICK | LRADC_DELAY_DELAY(lradc->settling_delay), @@ -513,7 +514,8 @@ static void mxs_lradc_setup_ts_pressure(struct mxs_lradc *lradc, unsigned ch1, * SoC's delay unit and start the conversion later * and automatically. */ - mxs_lradc_reg_wrt(lradc, LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC */ + mxs_lradc_reg_wrt(lradc, + LRADC_DELAY_TRIGGER(0) | /* don't trigger ADC */ LRADC_DELAY_TRIGGER_DELAYS(1 << 3) | /* trigger DELAY unit#3 */ LRADC_DELAY_KICK | LRADC_DELAY_DELAY(lradc->settling_delay), LRADC_DELAY(2)); diff --git a/drivers/staging/iio/adc/spear_adc.c b/drivers/staging/iio/adc/spear_adc.c index 750697832b96..8ad71691fc09 100644 --- a/drivers/staging/iio/adc/spear_adc.c +++ b/drivers/staging/iio/adc/spear_adc.c @@ -98,7 +98,7 @@ static void spear_adc_set_clk(struct spear_adc_state *st, u32 val) u32 clk_high, clk_low, count; u32 apb_clk = clk_get_rate(st->clk); - count = (apb_clk + val - 1) / val; + count = DIV_ROUND_UP(apb_clk, val); clk_low = count / 2; clk_high = count - clk_low; st->current_clk = apb_clk / count; @@ -226,7 +226,7 @@ static const struct iio_chan_spec spear_adc_iio_channels[] = { static irqreturn_t spear_adc_isr(int irq, void *dev_id) { - struct spear_adc_state *st = (struct spear_adc_state *)dev_id; + struct spear_adc_state *st = dev_id; /* Read value to clear IRQ */ st->value = spear_adc_get_average(st); diff --git a/drivers/staging/iio/addac/Kconfig b/drivers/staging/iio/addac/Kconfig index e6795e0bed1d..0ed7e13e2283 100644 --- a/drivers/staging/iio/addac/Kconfig +++ b/drivers/staging/iio/addac/Kconfig @@ -10,6 +10,9 @@ config ADT7316 Say yes here to build support for Analog Devices ADT7316, ADT7317, ADT7318 and ADT7516, ADT7517, ADT7519 temperature sensors, ADC and DAC. + To compile this driver as a module, choose M here: the module will + be called adt7316. + config ADT7316_SPI tristate "support SPI bus connection" depends on SPI && ADT7316 @@ -18,6 +21,9 @@ config ADT7316_SPI Say yes here to build SPI bus support for Analog Devices ADT7316/7/8 and ADT7516/7/9. + To compile this driver as a module, choose M here: the module will + be called adt7316_spi. + config ADT7316_I2C tristate "support I2C bus connection" depends on I2C && ADT7316 @@ -25,4 +31,7 @@ config ADT7316_I2C Say yes here to build I2C bus support for Analog Devices ADT7316/7/8 and ADT7516/7/9. + To compile this driver as a module, choose M here: the module will + be called adt7316_i2c. + endmenu diff --git a/drivers/staging/iio/addac/adt7316.h b/drivers/staging/iio/addac/adt7316.h index ec50bf34628d..ec40fbb698a6 100644 --- a/drivers/staging/iio/addac/adt7316.h +++ b/drivers/staging/iio/addac/adt7316.h @@ -30,6 +30,7 @@ extern const struct dev_pm_ops adt7316_pm_ops; #else #define ADT7316_PM_OPS NULL #endif -int adt7316_probe(struct device *dev, struct adt7316_bus *bus, const char *name); +int adt7316_probe(struct device *dev, struct adt7316_bus *bus, + const char *name); #endif diff --git a/drivers/staging/iio/gyro/Kconfig b/drivers/staging/iio/gyro/Kconfig index 88b199bb2926..f62f68fd6f3f 100644 --- a/drivers/staging/iio/gyro/Kconfig +++ b/drivers/staging/iio/gyro/Kconfig @@ -7,7 +7,10 @@ config ADIS16060 tristate "Analog Devices ADIS16060 Yaw Rate Gyroscope with SPI driver" depends on SPI help - Say yes here to build support for Analog Devices adis16060 wide bandwidth + Say Y (yes) here to build support for Analog Devices adis16060 wide bandwidth yaw rate gyroscope with SPI. + To compile this driver as a module, say M here: the module will be + called adis16060. If unsure, say N. + endmenu diff --git a/drivers/staging/iio/light/tsl2x7x_core.c b/drivers/staging/iio/light/tsl2x7x_core.c index e0d88fa2a5b5..423f96bdf595 100644 --- a/drivers/staging/iio/light/tsl2x7x_core.c +++ b/drivers/staging/iio/light/tsl2x7x_core.c @@ -1040,8 +1040,8 @@ static ssize_t tsl2x7x_als_persistence_show(struct device *dev, y = (TSL2X7X_MAX_TIMER_CNT - (u8)chip->tsl2x7x_settings.als_time) + 1; z = y * TSL2X7X_MIN_ITIME; filter_delay = z * (chip->tsl2x7x_settings.persistence & 0x0F); - y = (filter_delay / 1000); - z = (filter_delay % 1000); + y = filter_delay / 1000; + z = filter_delay % 1000; return snprintf(buf, PAGE_SIZE, "%d.%03d\n", y, z); } @@ -1086,8 +1086,8 @@ static ssize_t tsl2x7x_prox_persistence_show(struct device *dev, y = (TSL2X7X_MAX_TIMER_CNT - (u8)chip->tsl2x7x_settings.prx_time) + 1; z = y * TSL2X7X_MIN_ITIME; filter_delay = z * ((chip->tsl2x7x_settings.persistence & 0xF0) >> 4); - y = (filter_delay / 1000); - z = (filter_delay % 1000); + y = filter_delay / 1000; + z = filter_delay % 1000; return snprintf(buf, PAGE_SIZE, "%d.%03d\n", y, z); } @@ -1573,8 +1573,7 @@ static struct attribute *tsl2x7x_ALS_device_attrs[] = { &dev_attr_power_state.attr, &dev_attr_in_illuminance0_calibscale_available.attr, &dev_attr_in_illuminance0_integration_time.attr, - &iio_const_attr_in_illuminance0_integration_time_available\ - .dev_attr.attr, + &iio_const_attr_in_illuminance0_integration_time_available.dev_attr.attr, &dev_attr_in_illuminance0_target_input.attr, &dev_attr_in_illuminance0_calibrate.attr, &dev_attr_in_illuminance0_lux_table.attr, @@ -1591,8 +1590,7 @@ static struct attribute *tsl2x7x_ALSPRX_device_attrs[] = { &dev_attr_power_state.attr, &dev_attr_in_illuminance0_calibscale_available.attr, &dev_attr_in_illuminance0_integration_time.attr, - &iio_const_attr_in_illuminance0_integration_time_available\ - .dev_attr.attr, + &iio_const_attr_in_illuminance0_integration_time_available.dev_attr.attr, &dev_attr_in_illuminance0_target_input.attr, &dev_attr_in_illuminance0_calibrate.attr, &dev_attr_in_illuminance0_lux_table.attr, @@ -1611,8 +1609,7 @@ static struct attribute *tsl2x7x_ALSPRX2_device_attrs[] = { &dev_attr_power_state.attr, &dev_attr_in_illuminance0_calibscale_available.attr, &dev_attr_in_illuminance0_integration_time.attr, - &iio_const_attr_in_illuminance0_integration_time_available\ - .dev_attr.attr, + &iio_const_attr_in_illuminance0_integration_time_available.dev_attr.attr, &dev_attr_in_illuminance0_target_input.attr, &dev_attr_in_illuminance0_calibrate.attr, &dev_attr_in_illuminance0_lux_table.attr, diff --git a/drivers/staging/iio/meter/Kconfig b/drivers/staging/iio/meter/Kconfig index e53274b64ae1..64cd3704ec6e 100644 --- a/drivers/staging/iio/meter/Kconfig +++ b/drivers/staging/iio/meter/Kconfig @@ -10,6 +10,9 @@ config ADE7753 Say yes here to build support for Analog Devices ADE7753 Single-Phase Multifunction Metering IC with di/dt Sensor Interface. + To compile this driver as a module, choose M here: the + module will be called ade7753. + config ADE7754 tristate "Analog Devices ADE7754 Polyphase Multifunction Energy Metering IC Driver" depends on SPI @@ -17,6 +20,9 @@ config ADE7754 Say yes here to build support for Analog Devices ADE7754 Polyphase Multifunction Energy Metering IC Driver. + To compile this driver as a module, choose M here: the + module will be called ade7754. + config ADE7758 tristate "Analog Devices ADE7758 Poly Phase Multifunction Energy Metering IC Driver" depends on SPI @@ -26,6 +32,9 @@ config ADE7758 Say yes here to build support for Analog Devices ADE7758 Polyphase Multifunction Energy Metering IC with Per Phase Information Driver. + To compile this driver as a module, choose M here: the + module will be called ade7758. + config ADE7759 tristate "Analog Devices ADE7759 Active Energy Metering IC Driver" depends on SPI @@ -33,6 +42,9 @@ config ADE7759 Say yes here to build support for Analog Devices ADE7758 Active Energy Metering IC with di/dt Sensor Interface. + To compile this driver as a module, choose M here: the + module will be called ade7759. + config ADE7854 tristate "Analog Devices ADE7854/58/68/78 Polyphase Multifunction Energy Metering IC Driver" depends on SPI || I2C @@ -40,6 +52,9 @@ config ADE7854 Say yes here to build support for Analog Devices ADE7854/58/68/78 Polyphase Multifunction Energy Metering IC Driver. + To compile this driver as a module, choose M here: the + module will be called ade7854. + config ADE7854_I2C tristate "support I2C bus connection" depends on ADE7854 && I2C diff --git a/drivers/staging/iio/trigger/Kconfig b/drivers/staging/iio/trigger/Kconfig index 2fd18c60323d..710a2f3e787e 100644 --- a/drivers/staging/iio/trigger/Kconfig +++ b/drivers/staging/iio/trigger/Kconfig @@ -1,4 +1,4 @@ -# + # # Industrial I/O standalone triggers # comment "Triggers - standalone" @@ -12,6 +12,9 @@ config IIO_PERIODIC_RTC_TRIGGER Provides support for using periodic capable real time clocks as IIO triggers. + To compile this driver as a module, choose M here: the + module will be called iio-trig-periodic-rtc. + config IIO_BFIN_TMR_TRIGGER tristate "Blackfin TIMER trigger" depends on BLACKFIN diff --git a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c index 82c2e6d3f5a7..a24caf73ae0b 100644 --- a/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c +++ b/drivers/staging/iio/trigger/iio-trig-periodic-rtc.c @@ -72,7 +72,8 @@ static ssize_t iio_trig_periodic_write_freq(struct device *dev, if (val > 0) { ret = rtc_irq_set_freq(trig_info->rtc, &trig_info->task, val); if (ret == 0 && trig_info->state && trig_info->frequency == 0) - ret = rtc_irq_set_state(trig_info->rtc, &trig_info->task, 1); + ret = rtc_irq_set_state(trig_info->rtc, + &trig_info->task, 1); } else if (val == 0) { ret = rtc_irq_set_state(trig_info->rtc, &trig_info->task, 0); } else |