1
0
Fork 0
Commit Graph

2171 Commits (b3b8e99984a4eace91bc097e8f8cec71441cae16)

Author SHA1 Message Date
Alison Schofield a6634f8340 staging: iio: use kernel preferred block commenting style
Use * on subsequent lines and trailing */ on a separate
line in block comments.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Sandhya Bankar 7df7ee9be9 Staging: iio: ad5933: Remove unnecessary space after cast.
Remove unnecessary space after cast.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Sandhya Bankar 04e1f7b9b0 Staging: iio: ade7758: Fix open parentheses alignment issues.
Fix open parentheses alignment issues.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Sandhya Bankar 93636775b9 Staging: iio: ade7758: Use a blank line after function/struct declarations.
Use a blank line after function/struct declarations.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Sandhya Bankar 929d2691f2 Staging: iio: ade7758_core: Remove unnecessary blank line.
Remove unnecessary blank line.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Sandhya Bankar 0eea4ce3f4 Staging: iio: ade7758_core: Fix open parentheses alignment issues.
Fix open parentheses alignment issues.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Alison Schofield 5359ada246 staging: iio: ad5933: remove unused #includes
Remove #includes no longer used in this module.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Alison Schofield f5d82ad9bc staging: iio: ad5933: move contents of header file to source file
The contents of the header file are used only by this single
source file.  Move content into .c and remove .h.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Alison Schofield e279ee89d3 staging: iio: io-trig-bfin-timer: use dev_get_platdata()
Use dev_get_platdata() for retrieving the platform data instead of
accessing dev->platform_data directly. Move the assignment out of
the declaration (avoid lines over 80 char and put it close to
usage).

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Alison Schofield 7b58e2402f staging: iio: ad5933: use dev_get_platdata()
Use dev_get_platdata() for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Alison Schofield 5e3d1d520f staging: iio: meter: remove fixme comment on device remove
This comment was in place in the original drafts of these drivers
when the remove function did a whole lot of work: flushed queues,
unregistered interrupts, uninitialized rings, unconfigured rings,
and a few kfree's.

The remove functions have since been reduced to unregistering and
stopping the device.  This is the inverse of what was done during
probe and is correct. Time to remove the comment.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Eva Rachel Retuya b026338289 staging: iio: tsl2x7x_core: add blank line after struct declaration
Add the missing blank line after struct declaration. Checkpatch found
this issue.

CHECK: Please use a blank line after function/struct/union/enum
declarations

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Eva Rachel Retuya 95066a028b staging: iio: tsl2x7x_core: add spaces around operators
Address the checkpatch check by adding the necessary whitespace around
operators:

CHECK: spaces preferred around that '/' (ctx:VxV)

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Eva Rachel Retuya 54a0cd3e57 staging: iio: tsl2x7x_core: remove space after a cast
Delete unneeded space after a cast as suggested by checkpatch.

CHECK: No space is necessary after a cast.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Eva Rachel Retuya 2cbc8b34ef staging: iio: tsl2x7x_core: use preferred comment style
Adjust block comments by adding the necessary trailing */ on a separate
line. Checkpatch found this issue.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Eva Rachel Retuya 437ba274b5 staging: iio: tsl2x7x_core: adjust alignment to match open parenthesis
Align the parameters to match open parenthesis. Issue detected using
checkpatch.

CHECK: Alignment should match open parenthesis

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Alison Schofield 51fadb9857 staging: iio: convert bare unsigned usage to unsigned int
Use kernel preferred unsigned int declaration style.

Patch created using:
git ls-files drivers/staging/iio | \
xargs ./scripts/checkpatch.pl -f --fix-inplace --types=unspecified_int

Hand edits restored columns in structure definitions.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-03-28 09:37:41 +01:00
Alison Schofield 722fc31663 staging: iio: isl29028: use regmap to retrieve struct device
Driver includes struct regmap and struct device in its global data.
Remove the struct device and use regmap API to retrieve device info.

Simplified version of Coccinelle semantic patch used:

@ a @
identifier drvdata, r;
position p;
@@
  struct drvdata@p {
  ...
  struct regmap *r;
  ...
  };

@ b @
identifier a.drvdata, d;
position a.p;
@@
  struct drvdata@p {
  ...
- struct device *d;
  ...
  };

@ passed depends on b @
identifier a.drvdata, a.r, b.d, i, f;
@@
  f (..., struct drvdata *i ,...) {
+ struct device *dev = regmap_get_device(i->r);
   <+...
-	   i->d
+	   dev
   ...+>
  }

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-03-20 10:27:25 +00:00
Alison Schofield 1c118b7230 staging: iio: ad7192: use iio_device_{claim|release}_direct_mode()
Replace the code that guarantees the device stays in direct mode with
iio_device_{claim|release}_direct_mode() which does same.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-03-12 18:09:54 +00:00
Bhaktipriya Shridhar 09971adc33 staging: iio: addac: Remove unnecessary else after return
This patch fixes the checkpatch warning that else is not generally
useful after a break or return.

This was done using Coccinelle:
@@
expression e2;
statement s1;
@@
if(e2) { ... return ...; }
-else
         s1
Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Georgiana Chelu 0d9363c5f7 Staging: iio: Fixed block comments warning
Fixed the following warning:
WARNING: Block comments use a trailing */ on a separate line

Signed-off-by: Georgiana Chelu <georgiana.chelu93@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Sandhya Bankar 63ac41f5d8 Staging: iio: ade7854: Remove unnecessary goto.
Remove unnecessary goto.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Sandhya Bankar 3949d9292a Staging: iio: ade7758_core: Remove unnecessary goto.
Remove unnecessary goto.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Sandhya Bankar 78731a01f4 Staging: iio: ade7754: Remove unnecessary goto.
Remove unnecessary goto.

Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Amitoj Kaur Chawla 09b9da3399 staging: iio: adc: Replace of_iomap() with devm_ioremap_resource()
The adc driver uses of_iomap() which doesn't request the resource and
isn't device managed so error handling is needed. of_iomap() is mainly
used in cases where there is no driver or struct device so a switch to
devm_ functions is required.

This patch switches to use devm_ioremap_resource() instead which
automatically requests the resource and is freed when the driver
detaches.

Removed the error handling to unmap I/O registers i.e.
iounmap() in probe and remove functions of this driver and
consequently removed an unnecessary label.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Alison Schofield a04b4e5005 staging: iio: ade7854: use devm_iio_device_register
Replace iio_device_register with the device managed version.
This change is safe because it does not change the order of
any device removal actions. Unregistering the device was the
only removal action. The newly emptied .remove functions are
deleted.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Alison Schofield 8f27f7323f staging: iio: adt7316: remove useless initialization
Remove the initialization of a variable that is immediately
reassigned.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Alison Schofield e3f9555202 staging: iio: light: tsl2x7x: remove useless initialization
Remove the initialization of a variable that is immediately
reassigned.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Lars-Peter Clausen 2bcdb3f2e0 staging:iio:adis16220: Remove adis16220 driver
The ADIS16220 part has been obsoleted, which makes it hard to get the
hardware to even test the driver. Considering this there is no expectation
that the driver will be cleaned up and be able to move out of staging, so
remove the driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-03-09 21:08:50 +00:00
Lars-Peter Clausen 88ae3aedb8 staging:iio:adis16204: Remove adis16204 driver
The ADIS16204 part has been obsoleted, which makes it hard to get the
hardware to even test the driver. Considering this there is no expectation
that the driver will be cleaned up and be able to move out of staging, so
remove the driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-03-09 21:06:02 +00:00
Greg Kroah-Hartman ec3c13e4ac Third set of IIO new device support, features and cleanups for the 4.6 cycle.
Good to see several new contributors in this set - and more generally a
 number of new 'faces' over this whole cycle.
 
 Staging movements
 * hmc5843
   - out of staging.
 * periodic RTC trigger
   - driver dropped.  This is an ancient driver (brings back some memories ;)
   that was always somewhat of a bodge. Originally there was a driver that
   never went into mainline that supported large numbers of periodict timers
   on the PXA270 via this route. Discussions to have a generic periodic
   timer subsystem never went anywhere.  At the time RTC periodic
   interrupts were real - now they are emulated using high resolution
   timers so with the HRT driver this has become pointless.
 
 New device support
 * mpu6050 driver
   - Add support for the mpu6500.
 * TI tpl0102 potentiometer
   - new driver.
 * Vybrid SoC DAC
   - new driver.  The ADC on this SoC has been supported for a while, this
     adds a separate driver for the DAC.
 
 New Features
 * hmc5844
   - Attributes to configure the bias current (typically part of a self test)
     This could be done before via a somewhat obscure custom interface.
     This at least makes it easy to tell what is going on.
   - Document all custom attributes.
 * mpu6050
   - Add support for calibration offset control and readback.
 * ms5611
   - power regulator support.  This is always one that gets added the
     first time someone has a board that needs it.  Here it was needed,
     hence it was added.
 
 Cleanups / minor fixes
 * tree wide
   - clean up all the myriad different return values in response to a
     failure of i2c_check_functionality.  After discussions everyone seemed
     happy wiht -EOPNOTSUPP which seems to describe the situation well.
     I encouraged a tree wide cleanup to set a good example in future for
     this.
 * core
   - Typos in the iio_event_spec documentation in iio.h
 * afe4403
   - select REGMAP_SPI to avoid dependency issues
   - mark suspend/resume as __maybe_unused to avoid warnings
 * afe4404
   - mark suspend/resume as __maybe_unused to avoid warnings
 * atlas-ph-sensor
   - switch the regmap cache type from linear to rbtree to gain reading of
     registers on initial startup.  It's not immediately obvious, but
     regmap flat is meant for high performances cases so doesn't read these
     registers.
   - use regmap_bulk_read in one case where it was using
     i2c_smbus_read_i2c_block_data directly (unlike everything else that was
     through regmap).
 * ina2xx
   - stype cleanups (lots of them!)
 * isl29018
   - Get the struct device back from regmap rather than storing another
     copy of it in the private data.  This cleanup makes sense in a number
     of other drivers so patches may well follow.
 * mpu6050
   - style cleanups (lots of them!)
   - improved return value handling
   - use usleep_range to avoid the usual issues with very short msleeps.
   - add some missing documentation.
 * ms5611
   - use the probed device name for the device rather than the driver name.
   - select IIO_BUFFER to avoid dependency issues
 * palmas
   - drop IRQF_EARLY_RESUME as no longer needed after genirq changes.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJW0ygBAAoJEFSFNJnE9BaIJDQP/RpVwCxgxgUi0QyuLFAfQ0Ab
 FJFZznvmK6aGtGBAt/uKwBD5K/JcX9zGgm82j10+rVCtnLxFmusNXB180jUjvknu
 ZAEzJ58IWX+FqEsbVUZsx8qpef+yCCLP/HHvyctqXhtVTrlVlyoGSfn6+xzP3766
 PxkXpdWSd3IEdITYZrZo7BsZ6h6Tjz9c4i40f3RdnEce48nNnzM5IKMNbvU2puRs
 NxGDXflKKkA5N4uIW2n6pLxIyyW/LdwChmHkR+U7dxxj3/wUK9BC46qvhyqtgC3I
 U6uYCI+p2up22bfQsZ+p/CKRRhhrOtBs9//wSMapK96CVbI3HGcJLZP1yJENwfW8
 5sWEypaZNlpZVnjtREQpk5oz2hOsunxI+7FHSqUjLe+wwON79WXVFZz2qx3NcIle
 YPZFIQiYZTVauE/PsPy22I2vBoHxpgsD+A8M1d4+nQAH8SkRqvnnu5WVgd3ftm/u
 kXUjj+s+M1Pn84EIWYlEaIypAnhaNgIDW8M269rRdC0hH6yAxjJ9PXm45TGcRxr/
 qmkUKfD5wfPgE3FwYoyH8da22dc7dRSgLdizxtSS7rInmFH1HJ3xb566VszXsPVH
 tJjM2KtIC16czGUh5V+MmCpdSfOT1wR0wFPdUhGoJGm7sGkTsuoQRkQzgHwJM/aF
 ITuCZWLR/2YXw0bx4MKM
 =rDIQ
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-4.6c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Third set of IIO new device support, features and cleanups for the 4.6 cycle.

Good to see several new contributors in this set - and more generally a
number of new 'faces' over this whole cycle.

Staging movements
* hmc5843
  - out of staging.
* periodic RTC trigger
  - driver dropped.  This is an ancient driver (brings back some memories ;)
  that was always somewhat of a bodge. Originally there was a driver that
  never went into mainline that supported large numbers of periodict timers
  on the PXA270 via this route. Discussions to have a generic periodic
  timer subsystem never went anywhere.  At the time RTC periodic
  interrupts were real - now they are emulated using high resolution
  timers so with the HRT driver this has become pointless.

New device support
* mpu6050 driver
  - Add support for the mpu6500.
* TI tpl0102 potentiometer
  - new driver.
* Vybrid SoC DAC
  - new driver.  The ADC on this SoC has been supported for a while, this
    adds a separate driver for the DAC.

New Features
* hmc5844
  - Attributes to configure the bias current (typically part of a self test)
    This could be done before via a somewhat obscure custom interface.
    This at least makes it easy to tell what is going on.
  - Document all custom attributes.
* mpu6050
  - Add support for calibration offset control and readback.
* ms5611
  - power regulator support.  This is always one that gets added the
    first time someone has a board that needs it.  Here it was needed,
    hence it was added.

Cleanups / minor fixes
* tree wide
  - clean up all the myriad different return values in response to a
    failure of i2c_check_functionality.  After discussions everyone seemed
    happy wiht -EOPNOTSUPP which seems to describe the situation well.
    I encouraged a tree wide cleanup to set a good example in future for
    this.
* core
  - Typos in the iio_event_spec documentation in iio.h
* afe4403
  - select REGMAP_SPI to avoid dependency issues
  - mark suspend/resume as __maybe_unused to avoid warnings
* afe4404
  - mark suspend/resume as __maybe_unused to avoid warnings
* atlas-ph-sensor
  - switch the regmap cache type from linear to rbtree to gain reading of
    registers on initial startup.  It's not immediately obvious, but
    regmap flat is meant for high performances cases so doesn't read these
    registers.
  - use regmap_bulk_read in one case where it was using
    i2c_smbus_read_i2c_block_data directly (unlike everything else that was
    through regmap).
* ina2xx
  - stype cleanups (lots of them!)
* isl29018
  - Get the struct device back from regmap rather than storing another
    copy of it in the private data.  This cleanup makes sense in a number
    of other drivers so patches may well follow.
* mpu6050
  - style cleanups (lots of them!)
  - improved return value handling
  - use usleep_range to avoid the usual issues with very short msleeps.
  - add some missing documentation.
* ms5611
  - use the probed device name for the device rather than the driver name.
  - select IIO_BUFFER to avoid dependency issues
* palmas
  - drop IRQF_EARLY_RESUME as no longer needed after genirq changes.
2016-03-01 16:31:55 -08:00
Lars-Peter Clausen c720842e36 staging:iio: Remove periodic RTC trigger driver
With the recently introduced hrtimer based trigger we have a fully
functional replacement for the RTC timer trigger that is more flexible and
has a better interface to instantiate and manage the trigger instances. The
RTC trigger timer could only be instantiated using platform devices which
makes it unsuitable for modern devicetree based platforms, while the
hrtimer trigger has a configfs based interface that allows creating and
deletion of triggers at runtime.

In addition since a few years the periodic RTC timer is internally always
emulated using a hrtimer using the hrtimer interface directly will yield
the same timing precision. So using the RTC timer won't have any advantages
on this front either.

There is also no evidence that the periodic RTC trigger is currently
actually being used on any system. So considering all this remove the
driver. Also remove the related item from the TODO list.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-27 17:18:38 +00:00
Alison Schofield 646708693e staging: iio: isl29018: use regmap to retrieve struct device
Remove struct device from drivers global data and use regmap
API to retrieve device info instead.

This replacement can be done for drivers that include regmap
in their global data.

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-24 21:15:24 +00:00
Cristina Moraru 7247645f68 iio: hmc5843: Move hmc5843 out of staging
This patch moves hmc5843 driver from staging/iio/magnetometer
to iio/magnetometer, updates the corresponding Makefiles and
moves the hmc5843* entries to the 'Industrial I/O support ->
Magnetometer sensors' menu.

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Cc: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-24 20:40:39 +00:00
Cristina Moraru 1c7be4c260 iio: hmc5843: Add attributes for measurement config of bias current
Change static attribute meas_conf for bias current configuration
to channel attribute in_magn_meas_conf and also add
in_magn_meas_conf_available attribute to view available configurations.

This patch solves functionality bug: driver was using same function
hmc5843_set_measurement_configuration for setting bias current config
for all device types but the function was returning -EINVAL for any
setting >= 0x03 although, for sensor HMC5983, value 3 is valid.

API for setting bias measurement configuration:

normal - 	Normal measurement configuration (default):
		In normal measurement configuration the device
		follows normal measurement flow. Pins BP and BN
		are left floating and high impedance.

positivebias - 	Positive bias configuration: In positive bias
		configuration, a positive current is forced across
		the resistive load on pins BP and BN.

negativebias - 	Negative bias configuration. In negative bias
		configuration, a negative current is forced across
		the resistive load on pins BP and BN.

disabled     - 	Only available on HMC5983. Magnetic sensor is disabled.
		Temperature sensor is enabled.

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Cc: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-21 20:22:21 +00:00
Eva Rachel Retuya b5b6e7beb0 staging: iio: resolver: fix comparison to NULL
Remove comparison of spi->dev.platform_data to NULL by replacing it with
'!spi->dev.platform_data' as checkpatch suggested:

CHECK: Comparison to NULL could be written "!spi->dev.platform_data"

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:46:35 -08:00
Eva Rachel Retuya c7e426d1c5 staging: iio: resolver: remove unnecessary blank line
Delete the excess newline. Issue found by checkpatch.

CHECK: Please don't use multiple blank lines

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:46:35 -08:00
Eva Rachel Retuya c3f63dd6fe staging: iio: resolver: delete space after a cast
Delete unwanted whitespace after casting. Issue pointed out by
checkpatch.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:46:35 -08:00
Eva Rachel Retuya 84681c7c85 staging: iio: resolver: add missing braces on if-else statements
Add braces around the else clause to adhere to kernel coding style. This
clears the following checkpatch issue:

CHECK: braces {} should be used on all arms of this statement

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:46:35 -08:00
Eva Rachel Retuya 8d80ccbb1e staging: iio: resolver: use blank line after array declaration
Add a blank line after array declaration. This clears the checkpatch
check:

CHECK: Please use a blank line after function/struct/union/enum
declarations

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:46:35 -08:00
Eva Rachel Retuya cdd6dee0f1 staging: iio: resolver: add spaces around operators
Add spaces around operators to improve readability and to address the
checkpatch issue:

CHECK: spaces preferred around that '/' (ctx:VxV)

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:46:35 -08:00
Eva Rachel Retuya ae6394aaf1 staging: iio: resolver: align to match open parenthesis
Use a combination of tabs and spaces to align parameters to its
corresponding open parenthesis. Checkpatch found this issue.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:46:35 -08:00
Eva Rachel Retuya ddab4a02c4 staging: iio: light: fix multiple assignments in a single line
Rewrite the multiple assignments to clear checkpatch check:

CHECK: multiple assignments should be avoided

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:45:56 -08:00
Eva Rachel Retuya e537daa198 staging: iio: light: add space around '*"
Address checkpatch check pointing out the lack of space around the
operator '*'.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:45:56 -08:00
Eva Rachel Retuya 7f3829a354 staging: iio: light: fix block comments according to kernel coding style
Add the trailing */ accordingly to suit the preferred way of placing
block comments.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:45:56 -08:00
Eva Rachel Retuya 79783b31d5 staging: iio: light: omit space after a cast
Remove the unneeded space as pointed out by checkpatch:
CHECK: No space is necessary after a cast

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:45:56 -08:00
Eva Rachel Retuya ca52c88cac staging: iio: light: indent to match open parenthesis
Indent the parameters to match open parenthesis as suggested by checkpatch.

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:45:56 -08:00
Janani Ravichandran 911568be45 staging: iio: accel: Remove unnecessary else after goto in if block
This patch removes the unnecessary else following an if block with a
goto statement.

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:45:05 -08:00
Amitoj Kaur Chawla 0fd736f9f4 staging: iio: adc: Remove unnecessary test from if conditions
Remove unnecessary test condition on ret variable which has been
previously tested and returns its value if the value is non zero.

This fixes the following smatch warnings:
drivers/staging/iio/adc/ad7816.c:299 ad7816_set_oti() warn: we tested
'ret' before and it was 'false'
drivers/staging/iio/adc/ad7816.c:306 ad7816_set_oti() warn: we tested
'ret' before and it was 'false'

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 14:43:48 -08:00
Bhumika Goyal 343af6379e Staging: iio: magnetometer: remove exceptional & on function name
In this file,function names are otherwise used as pointers without &.
Found using coccinelle.
// <smpl>
@r@
identifier f;
@@

f(...) { ... }
@@
identifier r.f;
@@

- &f
+ f
// </smpl>

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:44:06 -08:00
Bhumika Goyal df27103469 Staging: iio: light: remove exceptional & on function name
In this file,function names are otherwise used as pointers without &.
Found using coccinelle.
// <smpl>
@r@
identifier f;
@@

f(...) { ... }
@@
identifier r.f;
@@

- &f
+ f
// </smpl>

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:44:06 -08:00
Bhumika Goyal 6d9b10c866 Staging: iio: light: remove exceptional & on function name
In this file,function names are otherwise used as pointers without &.
Found using coccinelle.
// <smpl>
@r@
identifier f;
@@

f(...) { ... }
@@
identifier r.f;
@@

- &f
+ f
// </smpl>

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-14 16:44:06 -08:00
Greg Kroah-Hartman d9750a2f9e 2nd round of new IIO device support, features and cleanups for the 4.6 cycle.
New Device Support
 * Apex stx104 DAC
   - new driver for this PC104 board. Right now DAC support only.
 * ADI ad5064
   - Add support for ad5625, ad5627, ad5645, ad5665, ad5667 DACs.
   - Add support for Linear Technology ltc2606, ltc2607, ltc2609, ltc2616,
     ltc2617, ltc2619, ltc2626, ltc2627 and ltc2629.
 * ADI ad7192
   - add support for the ad7193
 * Invensense mpu6050
   - substantial rework of driver to use regmap allowing SPI support extending
     the now split driver to cover the MPU6000.
 * TI adc0832
   - new driver supporting ADC0831, ADC0832, ADC0834 and ADC0838 ADCs.
 * TI ads1015
   - new driver, note that there is an existing hwmon driver. The long term
     intention is to probably remove the hwmon driver but for now we just have
     guards in place to ensure this driver is not built if that one is enabled.
 * TI afe4403
   - new driver for this heart rate monitor / pulse oximeter front end chip.
 * TI afe4404
   - new driver for this heart rate monitor / pulse oximeter front end chip.
 
 Staging Graduations
 * mxs-lradc
   - A combined general purpose and touch screen (input) device driver.
     Originally held in staging to allow reworking into and MFD but as
     that wasn't happening and isn't an absolute requirement we are moving
     it out of staging.
 
 Driver new features
 * ms5611
   - triggered buffer support
   - IIO_CHAN_INFO_SCALE to aid the triggered buffer support.
 
 Driver cleanups / reworks / fixes
 * ad5064
   - Use an enum for the register map layout to allow support of additional
     chips (precursor to the new support listed above).
   - Structural driver changes to allow support of the slightly different
     handling for the ltc parts above.
 * ad5933
   - drop an exceptional & unnecessary for a function pointer.
 * ad7606
   - Cleanup the repeated copies of pm ops.
   - consolidate the various channels specs via a sport of rearranging so only
     one version is needed.
 * atlas ph sensor
   - add select IRQ_WORK
 * hmc8543 (soon to move out of staging)
   - Comment style fixes
   - functionality of suspend and resume was swapped.
 * spear-adc
   - use devm_clk_dev instead of managing the clk lifetime by hand.
 
 Core
 * Use new dmaengine_terminate_sync call to avoid a theoretical race.
 * Fix docs for mlock in struct iio_dev as it is correctly taken in some
   drivers (docs used to say for core only).
 * Add a helper function for calculating the scan index storage size within
   the core cutting out some cut and paste versions of the same code.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJWwJeMAAoJEFSFNJnE9BaI9N8P/3nvhVTXXTkwl8UF22dAyRhP
 l6Szj8vk6M9yJ0z8sBPPzKRoPOESuZU/N8BndN5w17Em3fU9k3Qe6CaUYGTKziFt
 hzuL1ySpnrGphKZR6AfONKR6m+yfk+PYVPJlMG1EEdop2nkMyezoZxh9yjNXfm9H
 gekh41rz8LrAluG4n88XdJMzIGBRfup7PPt+sJ5Ao6AMrrQVrx4DA+dTaoVJ50ED
 rvh1DIwUDH158a27Wgc5QgxyA2dSL+65KiD6HR69XKq3exUZ6AlvXHCHwOZR8/xp
 /MtBNP7V9C0vO7PBNIxRQWIdsLRQdfaiCJSWEHH1lqxQK2S6DFYzSXFCA8lQ448Q
 1qH8G2JiYzbzPVX9noXvuQJJYnGa1xsKvdOGFzi/mRXEGTaygPVYEjn2JN4WzRho
 zgAdLdI6RkPVuqDp7Mliu8lsC9giQoLD22Ln2z9AzF1PDMrCD+p2Ff+q+1xQip/q
 8B8AMniPkK8Bn5mMAGPrN6FqUt5cqtnRkECC/Yzg8B21qLcefeFmcwSecmOrd331
 +7PWWDOWCmHVMweo9whZhaS3yZFNerl7G2DzwDI76So+eeBFikFvgitTMbuWWlyG
 SXMqUqfelBs3SpftKlAKXxZ4PK/MEo45LzNSfbi0J69zpIFTqICR9nnN8/rN9ew0
 KhZtcL9Q1H6yJwGuefdp
 =LIQe
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-4.6b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

2nd round of new IIO device support, features and cleanups for the 4.6 cycle.

New Device Support
* Apex stx104 DAC
  - new driver for this PC104 board. Right now DAC support only.
* ADI ad5064
  - Add support for ad5625, ad5627, ad5645, ad5665, ad5667 DACs.
  - Add support for Linear Technology ltc2606, ltc2607, ltc2609, ltc2616,
    ltc2617, ltc2619, ltc2626, ltc2627 and ltc2629.
* ADI ad7192
  - add support for the ad7193
* Invensense mpu6050
  - substantial rework of driver to use regmap allowing SPI support extending
    the now split driver to cover the MPU6000.
* TI adc0832
  - new driver supporting ADC0831, ADC0832, ADC0834 and ADC0838 ADCs.
* TI ads1015
  - new driver, note that there is an existing hwmon driver. The long term
    intention is to probably remove the hwmon driver but for now we just have
    guards in place to ensure this driver is not built if that one is enabled.
* TI afe4403
  - new driver for this heart rate monitor / pulse oximeter front end chip.
* TI afe4404
  - new driver for this heart rate monitor / pulse oximeter front end chip.

Staging Graduations
* mxs-lradc
  - A combined general purpose and touch screen (input) device driver.
    Originally held in staging to allow reworking into and MFD but as
    that wasn't happening and isn't an absolute requirement we are moving
    it out of staging.

Driver new features
* ms5611
  - triggered buffer support
  - IIO_CHAN_INFO_SCALE to aid the triggered buffer support.

Driver cleanups / reworks / fixes
* ad5064
  - Use an enum for the register map layout to allow support of additional
    chips (precursor to the new support listed above).
  - Structural driver changes to allow support of the slightly different
    handling for the ltc parts above.
* ad5933
  - drop an exceptional & unnecessary for a function pointer.
* ad7606
  - Cleanup the repeated copies of pm ops.
  - consolidate the various channels specs via a sport of rearranging so only
    one version is needed.
* atlas ph sensor
  - add select IRQ_WORK
* hmc8543 (soon to move out of staging)
  - Comment style fixes
  - functionality of suspend and resume was swapped.
* spear-adc
  - use devm_clk_dev instead of managing the clk lifetime by hand.

Core
* Use new dmaengine_terminate_sync call to avoid a theoretical race.
* Fix docs for mlock in struct iio_dev as it is correctly taken in some
  drivers (docs used to say for core only).
* Add a helper function for calculating the scan index storage size within
  the core cutting out some cut and paste versions of the same code.
2016-02-14 11:10:38 -08:00
Janani Ravichandran 77cb59a42b staging: iio: Remove parentheses on the right hand side of assignment
Remove parentheses on the right hand side of assignment as they are not
needed. Semantic patch used:

@@
expression a, b, c, d;
@@

(
  a = (c == d)
|
  a =
- (
  b
- )
)
Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11 19:37:15 -08:00
Ksenija Stanojevic f836c45922 iio: adc: Move mxs-lradc out of staging
Move mxs-lradc driver from drivers/staging/iio/adc to drivers/iio/adc.

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-10 19:29:37 +00:00
Janani Ravichandran 8c79c49c80 staging: iio: Remove parantheses around right hand side of assignment
Remove parantheses on the right hand side of assignments as they are not
needed. Coccinelle patch used:
@@
expression a, b, c, d;
@@

(
  a = (c == d)
|
  a =
- (
  b
- )
)

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-09 17:51:57 -08:00
Cristina Moraru 4630adb8ec iio: hmc5843: Fix comment style warnings
Fix comment style warnings in order to comply with Coding Style
standard provided by Documentation/CodingStyle.

This patch solves following issue found with checkpatch:
WARNING: Block comments use a trailing */ on a separate line

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-09 22:17:21 +00:00
Cristina Moraru c099225f0a iio: hmc5843: Swap suspend and resume implementations
Swap implementations of hmc5843_common_suspend and
hmc5843_common_resume functions for they have been
inversed. Device should go on SLEEP mode on suspend
and on CONTINUOUS mode on resume.

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-09 22:10:51 +00:00
Lars-Peter Clausen d69051b401 staging:iio:ad7192: Add support for the AD7193
The AD7193 is mostly register map compatible to the AD7192. The main
difference is that it has 8 instead of 4 inputs, so the way the input
channels are selected is slightly different.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-09 22:03:43 +00:00
Lars-Peter Clausen 2c3a523632 staging:iio:ad7606: Consolidate PM ops
Both the SPI and platform device driver for the ad7606 use the same set of
PM ops. Consolidate them in the common part of the driver.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-08 18:30:51 +00:00
Greg Kroah-Hartman 5ba907a949 Merge 4.5-rc3 into staging-next
We want the upstream staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 17:34:04 -08:00
Gujulan Elango, Hari Prasath (H.) b8cc27ca4c staging: iio: replace clk_get() with devm_clk_get()
This patch replaces the clk_get() with devm_clk_get().Accordingly,modified
the error paths,rename error labels and removed clk_put() in probe() &
remove functions.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-06 18:42:54 +00:00
Bhumika Goyal 478375cedc Staging:iio:Remove exceptional & on function name
In this file,function names are otherwise used as pointers without &.
Found using coccinelle.
// <smpl>
@r@
identifier f;
@@

f(...) { ... }
@@
identifier r.f;
@@

- &f
+ f
// </smpl>

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-06 18:07:04 +00:00
Lars-Peter Clausen c89e2e2a0d staging:iio:ad7606: Consolidate channel specs
By slightly reordering the channels in the channel spec array we can reuse
the same array for all variant of the chip.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-02-06 11:23:19 +00:00
Greg Kroah-Hartman fec2f3335c First round of new IIO device support, features and cleanups for the 4.6 cycle.
Device Support
 * ad5761
   - new driver
 * at91_sama5d2 ADC.
   - new driver and MAINTAINERS entry.
   - minor cleanups followed.
 * atlas pH-SM
   - new driver (this has possibly the prettiest data sheet I've ever seen)
 * mcp3422
   - mcp3425 ADC added.
 * mcp4725
   - mcp4726 DAC added.
 * mma8452
   - mma8451q accelerometer added.
 * mpl115
   - mpl115a1 added (a lot bigger than it seems as this is an SPI part whereas
     previous parts were i2c).
 * si7005
   - Hoperf th02 (seems to be a repackaged part)
 * si7020
   - Hoperf th06 (seems to be a repackaged part)
 
 New features
 * Core
   - IIO_PH type. Does what it says on the tin.
 * max30100
   - LED current configuration support.
 * mcp320x
   - more differential measurement combinations.
 * mma8452
   - free fall deteciton
 - opt3001
   - enable operation without a IRQ line.
   - device tree docs.  Somehow the original docs have disappeared down
     a rabbit hole, so here is a new set.
 * st-sensors
   - Support active-low interrupts.
 
 Cleanups and minor / not so minor reworks
 * Documentation
   - drop some defunct ABI from the docs in staging.
 * presure / Kconfig
   - white space cleanup.
 * ad7150
   - BIT macro usage
   - Alignment fixes
 * ad7192
   - false indent fixed.
 * ak8975
   - constify the ak_def structures
 * axp288
   - drop a redundant double const.
 * dht11
   - substantial reliability improvements by being more tolerant
     of missing start bits.
   - simplify the decoding algorithm
 * mma8452
   - whitespace cleanup
 * mpl115
   - don't bother setting i2c_client_data as nothing uses it.
 * mpu6050
   - drop unused function parameter.
 * opt3001
   - extract integration time as constants.
   - trivial refactoring.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJWr8HEAAoJEFSFNJnE9BaIIWMP/A6hJdAi3QOipB75QYBHL3R2
 7fe7Bcd83i2to/Ohk9XirRwyP7kCqt1ZP7cnaIAevNxmwQ9fqIFgrxCK8BfF+lMk
 60PXfEdinPk1rWguqEMwaYq1xVAOTgWYl8F4GVG3nGIvTHovAYaZW0UcTUl5Gz+l
 WErEZQ5xgnf7e/29ds74eD3YaOti8E1mzhBLXFJH7lllsSMJttbp9Xb5J0QJrv4a
 Ly8Ru5DBRGZYKi0VplFIjncKLZgX/VUUSPNL+NXtPnGD2Qp2zx0bJ3eIqNmeEYZl
 isAGIc6l4XPXQLczyRaPbcQLobMxOHMP2uuXxY/OAbe2DX9/6ILcB2QigARAFHf2
 7vVcx3JlxXUtwS/bPpZSd5hHrvjWLR7+gyuZTA4b/scV4+GvknMl8e6IIh4Ux3/T
 d24V37bOIENrXCoyf81veap0xca6xQNSzCVuo8+1+QYqn6DxvoJw3p38Cmxb8eB8
 7M+nQJP9SwLtbSUak8g1KVrtWBNsMrMGwoiuZq5SkK1PQTSXnSaJPTL0OoPoefNi
 uIY5qD5FrUp9jlNbBP2M2E3CcG5CJcMElxyBgd7F5lEVxSWPOuyOcpJHIoCCCgIf
 o6vwOYXXfD4ytv/E6jg+Bbv3ZYCylFhcoZOqPgTC/sOnSI9RwhJ6XdAg6VU8sv07
 piH1AVWb91HKRN2dt2ZB
 =fgTH
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-4.6a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

First round of new IIO device support, features and cleanups for the 4.6 cycle.

Device Support
* ad5761
  - new driver
* at91_sama5d2 ADC.
  - new driver and MAINTAINERS entry.
  - minor cleanups followed.
* atlas pH-SM
  - new driver (this has possibly the prettiest data sheet I've ever seen)
* mcp3422
  - mcp3425 ADC added.
* mcp4725
  - mcp4726 DAC added.
* mma8452
  - mma8451q accelerometer added.
* mpl115
  - mpl115a1 added (a lot bigger than it seems as this is an SPI part whereas
    previous parts were i2c).
* si7005
  - Hoperf th02 (seems to be a repackaged part)
* si7020
  - Hoperf th06 (seems to be a repackaged part)

New features
* Core
  - IIO_PH type. Does what it says on the tin.
* max30100
  - LED current configuration support.
* mcp320x
  - more differential measurement combinations.
* mma8452
  - free fall deteciton
- opt3001
  - enable operation without a IRQ line.
  - device tree docs.  Somehow the original docs have disappeared down
    a rabbit hole, so here is a new set.
* st-sensors
  - Support active-low interrupts.

Cleanups and minor / not so minor reworks
* Documentation
  - drop some defunct ABI from the docs in staging.
* presure / Kconfig
  - white space cleanup.
* ad7150
  - BIT macro usage
  - Alignment fixes
* ad7192
  - false indent fixed.
* ak8975
  - constify the ak_def structures
* axp288
  - drop a redundant double const.
* dht11
  - substantial reliability improvements by being more tolerant
    of missing start bits.
  - simplify the decoding algorithm
* mma8452
  - whitespace cleanup
* mpl115
  - don't bother setting i2c_client_data as nothing uses it.
* mpu6050
  - drop unused function parameter.
* opt3001
  - extract integration time as constants.
  - trivial refactoring.
2016-02-01 13:10:03 -08:00
Greg Kroah-Hartman 5982557ac6 Second set of IIO fixes for the 4.5 cycle. These ones are mostly
dependent on patches from the recent merge cycle.
 
 * adc, imu and iio staging drivers
   - !HAS_IOMEM dependency fixes
 * dht11
   - use boottime clock for time measurement to avoid incorrect measurements
    due to clock updates.
 * lidar
   - correct a return value for short i2c transfers.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJWr72hAAoJEFSFNJnE9BaILWsP/3hVDegr+6TRoVgqqfk8USz2
 Jb3omDrxvb1LDlMgR5sbwYMQw3JKg9Dn6ACPtsFJ4kdOHvZ/xQ5dzwKXuUTe9MfB
 ij3gl1/wO6czUvdW0FYEKwMHORh/z5ILKaVS/lOPjeJnRPhFD4GNRo3nM6qQ/le8
 nl/Q1RB1ONml0EKzWgQrcFAzdRessPU3ALsvXrmJQVn6Ah1fYcig46/jn/PZ8/iO
 1/9lgROCo78vwHMvu1vuBI/pjfm0Ry/AB1WTGrjquMY4Q/kEwM18qE2I4lRfoQSd
 3N9DvGkfhkmLpnqag3ujC5uVtMJK/SUlK5DPaAsLT7PtTuQ75UQfFZpy0syANfbD
 lLVnKqMBbTWpetin8butW1OBgKaCWukq9zvFvsp1ZbbxJIEeYaIF6vdkcVyn66j/
 O3u45zdbL0WrhvPZrQRbTa3jdXLVMe4psaBWF1fhBW/+8tYEpPzddHuE2miyVHP8
 2uxg7H+UR7WRJyZ20BzF18G1AFjtAouzuVtWtPEAw2z8BbtMfAf9g+02xHhwYmVd
 USdPfVHhAmYgFsgfRLRZRmbiSlg/SzBHK0RVS9ZwXsh3nnPvuYflfT/bCXxGvBzI
 j8pVAAkfrnTItKuFQ2rTgQ23JUHdOdmwkYtrMa6bHuFCCN6kIH8BTVxwGexEhE5U
 tBTWNHQxx/N1VhtY7BQG
 =iF19
 -----END PGP SIGNATURE-----

Merge tag 'iio-fixes-for-4.5b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus

Jonathan writes:

Second set of IIO fixes for the 4.5 cycle.  These ones are mostly
dependent on patches from the recent merge cycle.

* adc, imu and iio staging drivers
  - !HAS_IOMEM dependency fixes
* dht11
  - use boottime clock for time measurement to avoid incorrect measurements
   due to clock updates.
* lidar
  - correct a return value for short i2c transfers.
2016-02-01 13:08:26 -08:00
Greg Kroah-Hartman 48436e82fd First set of IIO fixes for the 4.5 cycle.
This set comprises those not dependent on patches in the 4.5 merge cycle.
 A second set will follow shortly with ones that are.
 
 * core in kernel interfaces
   - fix a possible NULL dereference that is a theoretical possibility
     via odd usage of iio_channel_release. Pretty much a hardening of
     the interface, but observed in the wild with the twl4030_charger
     driver.
 * acpi-als
   - report the data as processed as it is in lux.  This fixes a wrong
     use of the IIO ABI.  However, old _raw version retained to avoid
     breaking any userspace in the wild that is relying on that (none
     known but it doesn't hurt us much to retain it)
 * ade7753
   - fix some error handling to avoid use of unitialized data.
 * ltr501
   - use a signed return type for ltr501_match_samp_freq so as to allow
     returning of an error code.
 * mcp4725
   - set name field of struct iio_dev to ensure the sysfs name attribute
     doesn't give NULL.
 * mpl115
   - temperature offset sign is wrong.
 * stk8ba50
   - IIO_TRIGGER dependency added
 * ti_am335x_adc
   - Label buffer as a software buffer. It's actually a hybrid of a
     true hardware buffer feeding a kfifo, but the meaning of these fields
     has changed a little recently and in this case it should be labeled
     a software buffer ensure it is allowed to use the kfifo.
 * vf610_adc
   - HAS_IOMEM dependency
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJWr7r1AAoJEFSFNJnE9BaIEu4QAIb4FPipmsRLbNlPpngtYL9k
 uH13UiZLdGRdZsif2S9B0S5L0+PG25UTzXbtgleUq4IxdY4LnSyfa+/V+Ifn3SPE
 +F3Vr5Uqd9S/uRNNwJjgvSMf60s9J8Vm3PqFJ7aH8glJ7CRR4IbDAPJ7GXhUx4mt
 o5VXYLIm178JbwC6zKu8AanYGtRADG6orLqMbjCEWksK0SAuCz772CLgUCLMFxHC
 z1n/mdG8nadTZZDbuaHda5C5r9Baiqt/Wl7e/3gg7gHBl5LjcGUejlyD2VKRilpO
 4exHIARkHqlx/fXBxUxRN9kDbRK+6cuxca8MHn01Kn/XM7D8XoeZ1orQm+bItyOL
 9aHIoV2szS+VQMDE1oB+eKU8KZRGD0rLNKJRNumho+0lFtdbSZ0VqeBqn/wGYEBa
 QyGjpjdVCltdZJ2BX4kaUGcCQeWnpqqLc6jrXuUN0qSzvHyspt3XsllCKrTWbvNu
 oV1uDM+R8+YSsDQmgTpGuoTmpRHq2ED2lAJqRVan/Zi+Yk6gjxyDcIe1V4LbLdTt
 asXxzxp/eYFfM/K5nJyyASp3jl66f8QoQaVDly5XjXsf400xQKa3PlahQLWx66JM
 YfGJfHwhyzamO+mgiyuX1O4C7CO7uvHZgC/H+p7bB03GdtcUzjT1ZlBrR0JJlojg
 crBzUtRyX26wUNTGxHXG
 =27Pv
 -----END PGP SIGNATURE-----

Merge tag 'iio-fixes-for-4.5a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus

Jonathan writes:

First set of IIO fixes for the 4.5 cycle.

This set comprises those not dependent on patches in the 4.5 merge cycle.
A second set will follow shortly with ones that are.

* core in kernel interfaces
  - fix a possible NULL dereference that is a theoretical possibility
    via odd usage of iio_channel_release. Pretty much a hardening of
    the interface, but observed in the wild with the twl4030_charger
    driver.
* acpi-als
  - report the data as processed as it is in lux.  This fixes a wrong
    use of the IIO ABI.  However, old _raw version retained to avoid
    breaking any userspace in the wild that is relying on that (none
    known but it doesn't hurt us much to retain it)
* ade7753
  - fix some error handling to avoid use of unitialized data.
* ltr501
  - use a signed return type for ltr501_match_samp_freq so as to allow
    returning of an error code.
* mcp4725
  - set name field of struct iio_dev to ensure the sysfs name attribute
    doesn't give NULL.
* mpl115
  - temperature offset sign is wrong.
* stk8ba50
  - IIO_TRIGGER dependency added
* ti_am335x_adc
  - Label buffer as a software buffer. It's actually a hybrid of a
    true hardware buffer feeding a kfifo, but the meaning of these fields
    has changed a little recently and in this case it should be labeled
    a software buffer ensure it is allowed to use the kfifo.
* vf610_adc
  - HAS_IOMEM dependency
2016-02-01 13:07:38 -08:00
Shraddha Barke 255ec44451 Staging: iio: Documentation: Remove unused sysfs attributes
This patch removes the unused sysfs attributes range, range_available,
adc_resolution and adc_resolution_available.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-01-30 16:27:11 +00:00
Arnd Bergmann 7e1da86339 iio: ade7753: avoid uninitialized data
The ade7753_spi_read_reg_16() will either successfully read a value
from SPI, or return a failure code without delivering data. However,
the ade7753_stop_device() and ade7753_reset() functions use the returned
data without checking for an error condition first. Gcc detects this
as a possible bug and warns about it:

drivers/staging/iio/meter/ade7753.c: In function 'ade7753_remove':
drivers/staging/iio/meter/ade7753.c:348:6: error: 'val' may be used uninitialized in this function [-Werror=maybe-uninitialized]
  val |= BIT(4);  /* AD converters can be turned off */
      ^
drivers/staging/iio/meter/ade7753.c:345:6: note: 'val' was declared here
  u16 val;
      ^
drivers/staging/iio/meter/ade7753.c: In function 'ade7753_probe':
drivers/staging/iio/meter/ade7753.c:222:6: error: 'val' may be used uninitialized in this function [-Werror=maybe-uninitialized]

In both cases, we can avoids the warning by checking the return code
before using the data.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-01-30 16:24:24 +00:00
Richard Weinberger e884cebf9e staging: iio: Fix dependencies for !HAS_IOMEM archs
Not every arch has io memory.
So, unbreak the build by fixing the dependencies.

Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-01-30 15:47:51 +00:00
Colin Ian King b6acb0cfc2 Staging: iio: adc: fix indent on break statement
Fix indent warning when building with gcc 6:
drivers/staging/iio/adc/ad7192.c:239:4: warning: statement is indented
  as if it were guarded by... [-Wmisleading-indentation]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-01-24 14:48:34 +00:00
Linus Torvalds d9569f003c Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
Pull kbuild updates from Michal Marek:
 - Make <modname>-m in makefiles work like <modname>-y and fix the
   fallout
 - Minor genksyms fix
 - Fix race with make -j install modules_install
 - Move -Wsign-compare from make W=1 to W=2
 - Other minor fixes

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kbuild: Demote 'sign-compare' warning to W=2
  Makefile: revert "Makefile: Document ability to make file.lst and file.S" partially
  kbuild: Do not run modules_install and install in paralel
  genksyms: Handle string literals with spaces in reference files
  fixdep: constify strrcmp arguments
  ath10k: Fix build with CONFIG_THERMAL=m
  Revert "drm: Hack around CONFIG_AGP=m build failures"
  kbuild: Allow to specify composite modules with modname-m
  staging/ad7606: Actually build the interface modules
2016-01-20 09:45:43 -08:00
Shraddha Barke c4f0ebd914 Staging: iio: cdc: ad7150: Fix alignment should match open parenthesis
Fix the checkpatch warning of alignment should match open
parenthesis.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-01-04 12:16:25 +00:00
Shraddha Barke c0559ae2fb Staging: iio: cdc: ad7150: Prefer using the BIT macro
Replace bit shifting on 1 with the BIT(x) macro

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2016-01-04 12:07:52 +00:00
Greg Kroah-Hartman 02c34ccc1d Third set of new stuff for IIO in the 4.5 cycle.
New driver features
 - us5182
   * Add interrupt support and rising / falling threshold events.
 
 Cleanups / fixes to new stuff / minor additions
 * Expose the IIO value formatting function for drivers to
   make use of internally.
 - ina2xx
    * Fix wrong channel order
    * Fix incorrect reporting of endianness
    * Adding documentation of ABI unique to this device
 - mma8452
   * Drop an unused register description
   * Use an enum for the channel index to aid readability
 - sca3000
   * Use standard NULL comparison style
 - us5182
   * fix an inconsistency in status of enable (a bug with no real effect until
     above patches are applied)
   * refactor the read_raw function to improve maintainability / readability.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJWeZ3IAAoJEFSFNJnE9BaIT2UP/3+VlQzBFrg1pBqLCR4xqMHB
 9gUBInzgBwmzpmAqD9pkvyG5f9fTz7hSqX2IGkAA1V6I91H2cunEROSGyhFd4VBW
 vhUhpz9WpRyx+8yLE3fQKUU/UmZJWTI7Xyladwrk3k87OOdcfn3wjtUdTuAhD5SW
 OWzW9txC5dAgSEC5yhqD8VdXN6tRL/eEOEFawHlf9f7bBr9DuyhECp6aIP79gKAS
 pynUPe3R5Uk/GuXdKX6zEWim4XZxhQR0oRmtrdCPIbauK6/ENDOWcaAvgS3mcN8i
 KJ/L27hQGc5zjR8VzysZzZw+7Edc4EqY2UvhA19+0RN93064s0qvR8hoEMp0bHP/
 MKGtwHv8MiqKfdCqIdimf6aT2GILTVWWx8WjyrM0O0+h444ba3ETRPGQ4mYNohuN
 Gt7FFv345aiFh2lQw8Rb54H2d19KV2hwUar3CTpRcl9OhOEnD3ulfDvQghzNlbXl
 nUh5dSOK+yDmXPPMEeZU4pYKG8rNaNZ1FxvVFy/yvUgytD1uqQDnWZ3b1gR0DiV9
 56ucUcrSg74LSqC8R/D6BXb+73LPBTmpu60iGvOQsUYcnmJSdnmEobWCnSXGjFXR
 I2e/H/ZOL4+dyHVpoyfQIiDpe6rGgYQHxyQ/kojWn2NxCJpgUufuR6jPTJ9GMF7k
 eckCq5cDb0nmmg45EQq0
 =aiE2
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-4.5c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Third set of new stuff for IIO in the 4.5 cycle.

New driver features
- us5182
  * Add interrupt support and rising / falling threshold events.

Cleanups / fixes to new stuff / minor additions
* Expose the IIO value formatting function for drivers to
  make use of internally.
- ina2xx
   * Fix wrong channel order
   * Fix incorrect reporting of endianness
   * Adding documentation of ABI unique to this device
- mma8452
  * Drop an unused register description
  * Use an enum for the channel index to aid readability
- sca3000
  * Use standard NULL comparison style
- us5182
  * fix an inconsistency in status of enable (a bug with no real effect until
    above patches are applied)
  * refactor the read_raw function to improve maintainability / readability.
2015-12-26 17:05:25 -08:00
Greg Kroah-Hartman 35ea984dac Second set of IIO new drivers, functionality and cleanups for the 4.5 cycle.
The big one here is the configfs support which has been a long time in the
 works but should allow for cleaner ways to do instantiation of those elements
 of IIO that aren't directly connected to specific hardware. Lots of cool new
 stuff we can use this for in the works!
 
 New core stuff (basically all configfs support related)
 * Configfs support
   - Core support (was waiting for a configfs patch that went in around 4.4rc2)
   - A little fixlet to add a configfs.h to contain a reference to the
     configfs_subsystem structure.
 * Some infrastructure to simplify handling of software based triggers
   (i.e. ones with no actual hardware associated with them)
 * A high resolution timer based trigger.  This has been around for years
     but until the configfs support was ready we didn't have a sensible way
     of instantiating instances of it (the method used for the sysfs_trigger
     has never been really satisfactory)
 
 New Device Support
 * AMS iAQ Volatile Organic Compounds sensor support.
 * Freescale imx7d ADC driver
 * Maxim MAX30100 oximeter driver (note that for these devices most of the
   smart stuff will be in userspace - effectively they are just light sensors
   with some interesting led synchronization as far as the kernel is concerned).
 * Microchip mcp3421 support added to the mcp3422 driver.
 * TI adc124s021 support added to the adc128s052 driver.
 * TI ina219, inda226 power monitors. Note that there is an existing hwmon driver
   for these parts, the usecase is somewhat different so it is unclear at this
   point if the hwmon driver will eventually be replaced by a bridge from
   this driver.  In the meantime the Kconfig dependencies should prevent both
   from being built.
 
 New driver functionality
 * us8152d power management support.
 
 Cleanups, fixups
 * Use list_for_each_entry_safe instead of list_for_each_safe with the entry
   bit coded longhand.
 * Select IRQ_WORK for IIO_DUMMY_EVGEN.  This is a fix that somehow got lost
   when the driver was moved so lets do it again.
 * st-accel - drop an unused define.
 * vz89x, lidar - optimize i2c transactions by using a single i2c tranfers
   instead of multiple calls where supported (fall back to smbus calls as
   before if not).
 * Use dev_get_platdata() in staging drivers: tsl2x7x, adcs and frequency
   drivers instead of direct access to the structure element.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJWbX6IAAoJEFSFNJnE9BaI6E4QAIvGXHn4ew8ZH+IF3UP+n47C
 WWtgeh7dEvhqpmXN3eWVo9bxA1JdwbE4/purWttszoJjzqowT0qAt6PuIUME+Md4
 3jOQ41Sc99YjttIwkLpWTqq3H5c3Tn3q9guZ3Imiz9rmpgHRePQ8aatMGUpOp53m
 AEY5JQHqCoWHLMEbEy/5w8RJdNf3cy3Re4kjtwrtp7CMynC4ob7dKE7kcZRvywEw
 6m4hVOQusLvygg1j235czwBDnf79qYOo96z93Pk/auQlqKX3ce/7yQW3GXvWl97a
 8FOmse3FNzX3jwWHELOdAZWIQSLBSqP9N4716qa4orVSihzqAZQ5CSEBPB0r2LS2
 cgK4BL6+xjDkwXn9ui4FiyLdUeUjz/zRhvwFZdjwP63hGf5n9ggZO3RuVslc6/8z
 DOHY5mLdg8CFlMlZUCnCc+1BjU8lgf90+a46Vx4ACJJiqIJrvNRxRKGQZyY/C9sO
 O8h0Ep5mWovcK1+SWdQSsfxdcWcdb0nJFG/VQeJVxMeJR+5mD5lCYmIj5xFkOxJU
 WP9xm+7rsCqSPW+vp8hlY3EWunIQB4gWROvLzWCTS2bKW7B12t1UapLZBrI1f6vK
 JuqHrjKkK7RBRAEldKz6cWCToEaHE+I/k+uIRhlp0of2IPEvGpnm3NoPN1XH3RID
 9boPy/eHuShq8EVg0WUt
 =54PR
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-4.5b' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Second set of IIO new drivers, functionality and cleanups for the 4.5 cycle.

The big one here is the configfs support which has been a long time in the
works but should allow for cleaner ways to do instantiation of those elements
of IIO that aren't directly connected to specific hardware. Lots of cool new
stuff we can use this for in the works!

New core stuff (basically all configfs support related)
* Configfs support
  - Core support (was waiting for a configfs patch that went in around 4.4rc2)
  - A little fixlet to add a configfs.h to contain a reference to the
    configfs_subsystem structure.
* Some infrastructure to simplify handling of software based triggers
  (i.e. ones with no actual hardware associated with them)
* A high resolution timer based trigger.  This has been around for years
    but until the configfs support was ready we didn't have a sensible way
    of instantiating instances of it (the method used for the sysfs_trigger
    has never been really satisfactory)

New Device Support
* AMS iAQ Volatile Organic Compounds sensor support.
* Freescale imx7d ADC driver
* Maxim MAX30100 oximeter driver (note that for these devices most of the
  smart stuff will be in userspace - effectively they are just light sensors
  with some interesting led synchronization as far as the kernel is concerned).
* Microchip mcp3421 support added to the mcp3422 driver.
* TI adc124s021 support added to the adc128s052 driver.
* TI ina219, inda226 power monitors. Note that there is an existing hwmon driver
  for these parts, the usecase is somewhat different so it is unclear at this
  point if the hwmon driver will eventually be replaced by a bridge from
  this driver.  In the meantime the Kconfig dependencies should prevent both
  from being built.

New driver functionality
* us8152d power management support.

Cleanups, fixups
* Use list_for_each_entry_safe instead of list_for_each_safe with the entry
  bit coded longhand.
* Select IRQ_WORK for IIO_DUMMY_EVGEN.  This is a fix that somehow got lost
  when the driver was moved so lets do it again.
* st-accel - drop an unused define.
* vz89x, lidar - optimize i2c transactions by using a single i2c tranfers
  instead of multiple calls where supported (fall back to smbus calls as
  before if not).
* Use dev_get_platdata() in staging drivers: tsl2x7x, adcs and frequency
  drivers instead of direct access to the structure element.
2015-12-26 17:03:33 -08:00
Bhaktipriya Shridhar 34708a0ce8 Staging: iio: accel: sca3000: Fixed NULL comparison style
The variable u8 **rx_p, is a pointer-to-pointer and hence the check
should
be "if (!*rx_p)" and not "if (!rx_p)".
In the earlier version, checkpatch.pl gave the following check, which
was incorrect:
CHECK: Comparison to NULL could be written "!rx_p"
+       if (*rx_p == NULL) {

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-12-19 16:40:55 +00:00
Jonathan Cameron f89c2b39ce staging:iio:mxs-lradc Fix large integer implicitly truncated to unsigned warning
The change to using BIT(20) for one of the bit shifts resulted
in a constant becoming unsigned. When combined with the existing
signed constants in a couple of places, this caused possible trouble,
hence the warnings:

drivers/staging/iio/adc/mxs-lradc.c: In function ‘mxs_lradc_complete_touch_event’:
drivers/staging/iio/adc/mxs-lradc.c:325:5: warning: large integer implicitly truncated to unsigned type [-Woverflow]
     (((x) << LRADC_DELAY_TRIGGER_LRADCS_OFFSET) & \
     ^
drivers/staging/iio/adc/mxs-lradc.c:734:7: note: in expansion of macro ‘LRADC_DELAY_TRIGGER’
       LRADC_DELAY_TRIGGER(1 << TOUCHSCREEN_VCHANNEL1) |
       ^
  LD [M]  drivers/staging/iio/accel/adis16201.o
drivers/staging/iio/adc/mxs-lradc.c: In function ‘mxs_lradc_buffer_preenable’:
drivers/staging/iio/adc/mxs-lradc.c:322:42: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 #define LRADC_DELAY_TRIGGER_LRADCS_MASK  (0xff << 24)
                                          ^
drivers/staging/iio/adc/mxs-lradc.c:1308:29: note: in expansion of macro ‘LRADC_DELAY_TRIGGER_LRADCS_MASK’
  mxs_lradc_reg_clear(lradc, LRADC_DELAY_TRIGGER_LRADCS_MASK |
                             ^
drivers/staging/iio/adc/mxs-lradc.c: In function ‘mxs_lradc_buffer_postdisable’:
drivers/staging/iio/adc/mxs-lradc.c:322:42: warning: large integer implicitly truncated to unsigned type [-Woverflow]
 #define LRADC_DELAY_TRIGGER_LRADCS_MASK  (0xff << 24)
                                          ^
drivers/staging/iio/adc/mxs-lradc.c:1327:29: note: in expansion of macro ‘LRADC_DELAY_TRIGGER_LRADCS_MASK’
  mxs_lradc_reg_clear(lradc, LRADC_DELAY_TRIGGER_LRADCS_MASK |

The simplest fix is to force LRADC_DELAY_TRIGGER_LRADCS_MASK to be
a shift of an unsigned 0xff rather than a signed one.

This is ugly considering it is the only constant in the driver which
is so forced, but it does deal with the issue.

Fixes: e0c961bdaf (iio: adc: mxs-lradc: Prefer using the BIT macro)
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-12-02 14:06:11 -08:00
Nizam Haider 7221819ac4 Staging: iio: frequency: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Nizam Haider <nijamh@cdac.in>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-12-02 18:42:06 +00:00
Nizam Haider a260527f83 Staging: iio: light: tsl2x7x_core: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Nizam Haider <nijamh@cdac.in>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-12-02 18:42:06 +00:00
Nizam Haider 22b19ab3e2 Staging: iio: adc: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Nizam Haider <nijamh@cdac.in>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-12-02 18:42:05 +00:00
Greg Kroah-Hartman f3cf3fb7ec First set of new device support, features and cleanups for IIO in the 4.5 cycle
Usual mixed bag, but the big item perhaps in this series is the DMA buffer
 support added by Lars-Peter Clausen. It's been in the works for a long time
 and it will be interesting to see what hardware support shows up now that
 this is available.
 
 New core features + associate cleanup.
 * Add generic DMA buffer infrastructure
 * Add a DMAengine framework based buffer
  Also associated minor changes.
    - Set the device buffer watermark based on the minimum watermark for all
      attached buffers rather than just the 'primary' one.
    - iio_buffer_init - only set the watermark default if one hasn't already
      been provided.  This allows simple support for devices with a fixed
      watermark.
    - read only attribute for watermark on fixed watermark devices.
    - add explicit buffer enable/disable callbacks to allow the buffer to
      do more than trivial actions when it is being turned on and off.
 * IIO_VAL_INT support in write_raw_get_fmt function.
 
 New device support
 * Freescale MMA7455/7456L accelerometers
 * Memsic MXC6255XC accelerometer
 * ST lis2dh12 accelerometer
 * TI ADS8688 ADC
 * TI Palamas (twl6035/7) gpadc
 
 New driver features
 * mma8452
   - support either of the available interrupt pins to cope with the case
     where board layout has lead to a particular one being connected.
 
 Staging graduation
 * Dummy driver
   - this driver acts as both an example and a test device for those with
     out hardware to develop userspace code against.
 
 Cleanups and minor bits and bobs.
 * treewide
   - Sort out the ordering of iio_device_register/unregister vs runtime
     pm function calls so that it's all nice and consistent and not race
     prone.
   - Check sscanf return values.  None of the cases will actually happen as
     the strings are supplied internally, but best to be consistent on this.
 * ad7780
   - switch over to the gpio descriptor interface and remove the now unused
     platform data which gets rid of a header entirely.
 * ad7793
   - drop a pointless else statement.
 * at91_adc
   - Swap kmalloc_array in for a kmalloc doing the same job.
 * dummy
   - get rid of some commented out lines that snuck in during the move of
     the driver.
 * lm3533-als
   - Print an error message on provision of an invalid resistance.
 * mcp320x
   - Add compatible strings with vendor prefix and deprecate those with
     no vendor prefix.
 * mxs-lradc
   - Use BIT macro in various places rather than shifted ones.
 * pa12203001
   - Power off the chip if the registration fails.
 * pulsedlight-lidar-lite
   - add runtime PM support.
 * xilinx XADC
   - constify an iio_buffer_setup_ops structure.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJWUcmhAAoJEFSFNJnE9BaIyjYP/0A+CZMUqIGbYG9qFxnq7yYZ
 977Wt/gGI8+Jq5RwNw6gTfhp2GrCN+5gzDbE2mBEn94c6SKBrj2Q9trW1FQ+Nhfx
 9bZoyq3ZPRCV+efEDGfeK/JWRwv+V6IWwAF2J/iCPWpRMTEsIW5kM1JSO3ISlnma
 diyil1hefGTJY8aCqGApthfX4fyZK98oCV6zojxpCZfFPdsa+vf5n1RQ143odnOk
 6NSfXHYLI+2e+mJ1lw4GdpZdF+rF+7jWsUYC5EDNmvlIJYiKmm13whSQeWO0NHo8
 oD0pYboSIWnmdXx4s3RbWF2+Y28O1+oJDKZfXabB8DjVwtvlGnmWBRhgKji2e6E6
 Hhct83YbDWtEpbNkXcWpnc5v5ynmAMTYTxADhinTGUtVQh3Q4wWduuoHK6IyeI4s
 dbfpO2Wh6N/5k3a4UoA69IcI2DzPzb2sIFWpdS8wuNv5xDhV2OmmY2PjTfq2w+Qz
 hEoMCNDUG6rQAYf4auXK5JjhI4CaG/mz/qjIibTUqGODYECzQQyvq+c2Gdq0S8O/
 CUHOgui6aHbyuhWmXlEzhhkjuvBQZYaTxCA+LGMzy8w7UY9m4n5L/fX9M9IfFsMH
 NFCPrUfmxKPQj/mHlhu7KHaTMUlQ0pTqV5flSwqsjstZ2QddvI5EAKiLwIEhg7/2
 RpnOZoiFIxykduEYLxeh
 =CfCl
 -----END PGP SIGNATURE-----

Merge tag 'iio-for-4.5a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

First set of new device support, features and cleanups for IIO in the 4.5 cycle

Usual mixed bag, but the big item perhaps in this series is the DMA buffer
support added by Lars-Peter Clausen. It's been in the works for a long time
and it will be interesting to see what hardware support shows up now that
this is available.

New core features + associate cleanup.
* Add generic DMA buffer infrastructure
* Add a DMAengine framework based buffer
 Also associated minor changes.
   - Set the device buffer watermark based on the minimum watermark for all
     attached buffers rather than just the 'primary' one.
   - iio_buffer_init - only set the watermark default if one hasn't already
     been provided.  This allows simple support for devices with a fixed
     watermark.
   - read only attribute for watermark on fixed watermark devices.
   - add explicit buffer enable/disable callbacks to allow the buffer to
     do more than trivial actions when it is being turned on and off.
* IIO_VAL_INT support in write_raw_get_fmt function.

New device support
* Freescale MMA7455/7456L accelerometers
* Memsic MXC6255XC accelerometer
* ST lis2dh12 accelerometer
* TI ADS8688 ADC
* TI Palamas (twl6035/7) gpadc

New driver features
* mma8452
  - support either of the available interrupt pins to cope with the case
    where board layout has lead to a particular one being connected.

Staging graduation
* Dummy driver
  - this driver acts as both an example and a test device for those with
    out hardware to develop userspace code against.

Cleanups and minor bits and bobs.
* treewide
  - Sort out the ordering of iio_device_register/unregister vs runtime
    pm function calls so that it's all nice and consistent and not race
    prone.
  - Check sscanf return values.  None of the cases will actually happen as
    the strings are supplied internally, but best to be consistent on this.
* ad7780
  - switch over to the gpio descriptor interface and remove the now unused
    platform data which gets rid of a header entirely.
* ad7793
  - drop a pointless else statement.
* at91_adc
  - Swap kmalloc_array in for a kmalloc doing the same job.
* dummy
  - get rid of some commented out lines that snuck in during the move of
    the driver.
* lm3533-als
  - Print an error message on provision of an invalid resistance.
* mcp320x
  - Add compatible strings with vendor prefix and deprecate those with
    no vendor prefix.
* mxs-lradc
  - Use BIT macro in various places rather than shifted ones.
* pa12203001
  - Power off the chip if the registration fails.
* pulsedlight-lidar-lite
  - add runtime PM support.
* xilinx XADC
  - constify an iio_buffer_setup_ops structure.
2015-12-01 09:13:29 -08:00
Michal Marek 0046a46a8f staging/ad7606: Actually build the interface modules
The ad7606_par and ad7606_spi drivers are not built if CONFIG_AD7606=m,
because kbuild does not currently support <objname>-m syntax. Even if we
add kbuild support, ad7606 fails to link, because of duplicate
module_init definitions. Make the two drivers separate modules, as the
Kconfig help text already suggests.

Also, CONFIG_IIO_BUFFER is a dependency of CONFIG_AD7606, so there is no
need to test for it in the Makefile.

Signed-off-by: Michal Marek <mmarek@suse.com>
2015-11-25 11:23:23 +01:00
Jonathan Cameron 438f13a283 staging:iio: Delete some commented out lines in Kconfig and Makefile.
These should have been removed with the driver move out of staging
but instead were commented out.  This was missed in reviews at the
time so fixing it up now.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-11-21 20:14:57 +00:00
Dragos Bogdan 8ffedc1b12 staging:iio:ad7780: Remove the ad7780_platform_data
The ad7780_platform_data contains just the reference voltage information.
Since the preferred way of specifying this information is using the Linux
regulator framework and the ad7780 platform_data is not used by other
users, it can be completely removed.

Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-11-21 17:52:42 +00:00
Ioana Ciornei 2e9fed4220 staging: iio: dummy: complete IIO events delivery to userspace
Starting with commit fd2bb310ca (Staging: iio: Move evgen interrupt
generation to irq_work) event processing is handled by calling
both the top half and the threaded part properly simulating real
hardware interrupts making use of threaded interrupts.
This way the processing is split in 2 parts:

* the IRQ handler that runs in IRQ context and only saves the event
timestamp
* the threaded handler that runs in process context, reads the events
and pushes the in the userspace.

If the IRQ handler returns IRQ_HANDLED the threaded handler is not
even being called since the interrupt is considered to be processed.
Because the iio dummy driver processes the events in the threaded
handler the IRQ handler must return IRQ_WAKE_THREAD so that the
threaded part would be awakened and called.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-11-21 15:56:44 +00:00
Greg Kroah-Hartman 819db468b2 First set of IIO fixes for the 4.4 cycle.
This set does not include those for issues introduced during the merge
 window.  Fixes of those will follow in a future series.
 
 * ad5064
   - Make sure the local i2c_write returns 0 on success rather than the
     number of bytes transfered.  Otherwise we report an error on all writes.
   - Fix a shift for ad5629 and ad5669 which gives incorrect DAC output on
     these parts.
 * ad7793
   - The product ID on the datasheet is wrong.  Fix it in the driver.
 * IIO_DUMMY_EVGEN
   - select IRQ_WORK as a dependency.
 * lpc32xx
   - make sure clock is prepared before enabling.
 * si7020
   - data byte order was reversed. Fix it.
 * vf610
   - Internal temperature calculation was wrong if a different
     reference voltage was used.  Now use a linear interpolation
     function to make it work over the full range.
   - Fix a division by zero in the case of a device tree property
     not being present (same issue two fixes).
 * xilinx XADC
   - VREFN scale was wrong - fix it.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJWSH0iAAoJEFSFNJnE9BaILcYP/Rb70yJE23oTx6iyMDLip/Im
 7yG+TMh/mFJCrwmpvloRX4IxQ20WApQPEQRaO6ivcoykQ/8eGDK3hrHWiHwYNs9z
 P+q1qxz0F0pnvWHPZ2UZ+p8ZNzuy9ovTSeeuAHQWMVSsPCgiQR3kq0hBVrvV4mVn
 4AQejD0M/x69TWdisZtGJqKBZs44mXHbgqC6Xw/6u0MLpA8ZLHO2XAr9vaSA042T
 PsYXbEMmb/ElRKwadbX4JCqrMsA3FhPx+qD7qPu14bsC8WR4tlNLIBzEmBQJotWf
 8wjK7AF7Af/HMO5KjO6uJe+EdypMq1UjlmqeRWUZIGUlLtmjmkhnRzO4Qahsbx2K
 6TEO1uNhOjg7JQGfeuL9fKMHI6QKkeFIJ/cl2ekRWRwbxS2kOmXA9HTCsxynrdAR
 qC49Eqkbfr/F1vdgDx61JAWgWuZNdxFg3tiD3wP2BMjOipKBuKRt9CvHuOORW7Tp
 aUPruyJduIpcVQBL+wbSElAc4XsjgL4+/KROcfG3x3zWKUjOux73G8WsgaSSQ4Fe
 rP2stYFmZUigIpSW/vTwbdcN8tIT9S/XZjxF/mlP7azIQHyafWTVl6CUlphtewtY
 YZVT2K+t07zQV2NgOi9J+H5yCPG39d1Fb1R4OsWF1Brq2QsQJwqR9Y1ERXiPEJzZ
 DvylTHu0lxP+xgE/Xjuz
 =362F
 -----END PGP SIGNATURE-----

Merge tag 'iio-fixes-for-4.4a' of ssh://ra.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus

Jonathan writes:

First set of IIO fixes for the 4.4 cycle.

This set does not include those for issues introduced during the merge
window.  Fixes of those will follow in a future series.

* ad5064
  - Make sure the local i2c_write returns 0 on success rather than the
    number of bytes transfered.  Otherwise we report an error on all writes.
  - Fix a shift for ad5629 and ad5669 which gives incorrect DAC output on
    these parts.
* ad7793
  - The product ID on the datasheet is wrong.  Fix it in the driver.
* IIO_DUMMY_EVGEN
  - select IRQ_WORK as a dependency.
* lpc32xx
  - make sure clock is prepared before enabling.
* si7020
  - data byte order was reversed. Fix it.
* vf610
  - Internal temperature calculation was wrong if a different
    reference voltage was used.  Now use a linear interpolation
    function to make it work over the full range.
  - Fix a division by zero in the case of a device tree property
    not being present (same issue two fixes).
* xilinx XADC
  - VREFN scale was wrong - fix it.
2015-11-18 13:15:50 -08:00
Dragos Bogdan 52555a5d10 staging:iio:ad7780: Switch to the gpio descriptor interface
Use the gpiod interface for the powerdown_gpio instead of the deprecated
old non-descriptor interface.

The powerdown pin can be tied high, so the gpio is optional.
Remove the gpio_pdrst platform_data member since the new interface is
used.

Signed-off-by: Dragos Bogdan <dragos.bogdan@analog.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-11-18 18:58:29 +00:00
Nizam Haider e0c961bdaf iio: adc: mxs-lradc: Prefer using the BIT macro
Replaces bit shifting on 1 with the BIT(x) macro

Signed-off-by: Nizam Haider <nijamh@cdac.in>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-11-15 11:11:43 +00:00
Linus Torvalds 75f5db39ff spi: Updates for v4.4
Quite a lot of activity in SPI this cycle, almost all of it in drivers
 with a few minor improvements and tweaks in the core.
 
  - Updates to pxa2xx to support Intel Broxton and multiple chip selects.
  - Support for big endian in the bcm63xx driver.
  - Multiple slave support for the mt8173
  - New driver for the auxiliary SPI controller in bcm2835 SoCs.
  - Support for Layerscale SoCs in the Freescale DSPI driver.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJWOehzAAoJECTWi3JdVIfQTPYH+wYMDG8gAIw2s0AJ4DvVe4qZ
 sOAm1UgUJZxssrEA6BNqbfM0dfRo+oQJKmRd0Dc5n7LEMsYHdI/5yKHk8PCS6ZzD
 iQyQCzbd0thDAqwuPaMP62cyPDHwyJX22VGTsgVnj6AZqAQ+9+g4SPKhFnm1Mlm4
 hmDi6fdSrsqo8k8gkpVN8RFOfVsjAV1dLtAauQRWDHrqMxXURSrKG76eqAqUa5bn
 BLPXBoj5PA0DMLPO2j+ADZwWN723LrI2mSSlc+ThjEX/OIt2OhAoiOTV5RPqaafy
 TIsCkh68q/gYAsL5HtvvmgZByl41FLYiO0Z+rXmWUyMMbnvhZTLws9S2BNpBLuk=
 =DgXG
 -----END PGP SIGNATURE-----

Merge tag 'spi-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi updates from Mark Brown:
 "Quite a lot of activity in SPI this cycle, almost all of it in drivers
  with a few minor improvements and tweaks in the core.

   - Updates to pxa2xx to support Intel Broxton and multiple chip selects.
   - Support for big endian in the bcm63xx driver.
   - Multiple slave support for the mt8173
   - New driver for the auxiliary SPI controller in bcm2835 SoCs.
   - Support for Layerscale SoCs in the Freescale DSPI driver"

* tag 'spi-v4.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: (87 commits)
  spi: pxa2xx: Rework self-initiated platform data creation for non-ACPI
  spi: pxa2xx: Add support for Intel Broxton
  spi: pxa2xx: Detect number of enabled Intel LPSS SPI chip select signals
  spi: pxa2xx: Add output control for multiple Intel LPSS chip selects
  spi: pxa2xx: Use LPSS prefix for defines that are Intel LPSS specific
  spi: Add DSPI support for layerscape family
  spi: ti-qspi: improve ->remove() callback
  spi/spi-xilinx: Fix race condition on last word read
  spi: Drop owner assignment from spi_drivers
  spi: Add THIS_MODULE to spi_driver in SPI core
  spi: Setup the master controller driver before setting the chipselect
  spi: dw: replace magic constant by DW_SPI_DR
  spi: mediatek: mt8173 spi multiple devices support
  spi: mediatek: handle controller_data in mtk_spi_setup
  spi: mediatek: remove mtk_spi_config
  spi: mediatek: Update document devicetree bindings to support multiple devices
  spi: fix kernel-doc warnings about missing return desc in spi.c
  spi: fix kernel-doc warnings about missing return desc in spi.h
  spi: pxa2xx: Align a few defines
  spi: pxa2xx: Save other reg_cs_ctrl bits when configuring chip select
  ...
2015-11-05 13:15:12 -08:00
Mark Brown 4c84518523 Merge remote-tracking branches 'spi/topic/omap-100k', 'spi/topic/omap-uwire', 'spi/topic/owner', 'spi/topic/pxa' and 'spi/topic/pxa2xx' into spi-next 2015-11-04 11:02:12 +00:00
Ioana Ciornei 806535b623 staging: iio: accel: add bracket on all branches of the if/else
This patch adds brackets on all of the conditional branches in
order to follow the linux coding style.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 08:53:42 +09:00
Ioana Ciornei 48948abe05 staging: iio: accel: place logical operators on the previous line
This patch moves the logical operators on the previous line in order
to follow the linux coding style.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 08:53:42 +09:00
Ioana Ciornei 663b03d8ae staging: iio: accel: remove unwanted blank lines
This patch removes unwanted blank lines in order to follow
the linux coding style.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 08:53:42 +09:00
Ioana Ciornei c50ea26641 staging: iio: accel: fix block comments alignment
This patch properly aligns the block comment in order
to follow the linux coding style convetions.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 08:53:42 +09:00
Ioana Ciornei 4a613ad42d staging: iio: accel: add blank lines after function definitions
This patch add blank lines after functions definitions in
order to follow the linux coding style.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 08:53:42 +09:00
Ioana Ciornei 89ea25c7ae staging: iio: accel: change uint8_t to u8
This patch changes uint8_t type to preferred kernel
type u8 in order to follow the linux coding style
conventions.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 08:53:42 +09:00
Ioana Ciornei 252b1d8466 staging: iio: accel: properly align function arguments
This patch properly aligns the function arguments or
its parameters in order to match the open bracket.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 08:53:42 +09:00
Ioana Ciornei 1abe0c9a72 staging: iio: accel: add spaces aroung binary operators
This patch adds spaces around binary operators such as '*',
'/', '+' in order to improve readability.

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 08:53:42 +09:00
Ksenija Stanojevic b8732dd2f5 Staging: iio: adc: Fix sparse warning
Fix following sparse endianness problems:

  CHECK   drivers/staging/iio/adc/ad7816.c
drivers/staging/iio/adc/ad7816.c:91:17: warning: cast to restricted
__be16
drivers/staging/iio/adc/ad7816.c:91:17: warning: cast to restricted
__be16
drivers/staging/iio/adc/ad7816.c:91:17: warning: cast to restricted
__be16
drivers/staging/iio/adc/ad7816.c:91:17: warning: cast to restricted
__be16

Signed-off-by: Ksenija Stanojevic <ksenija.stanojevic@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 07:55:17 +09:00