Commit graph

76 commits

Author SHA1 Message Date
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
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
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
Andrew F. Davis 3821a065f5 spi: Drop owner assignment from spi_drivers
An spi_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Andrew F. Davis <afd@ti.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-28 10:30:17 +09:00
Shraddha Barke 3a1d9489e9 Staging: iio: Remove exceptional & on function name
In this file, function names are otherwise used as pointers without &.

A simplified version of the Coccinelle semantic patch that makes this
change is as follows:

// <smpl>
@r@
identifier f;
@@

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

- &f
+ f
// </smpl>

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-13 10:11:03 -07:00
Ioana Ciornei 877cdf9115 staging: iio: resolver: replace iio_device_register by devm_iio_device_register
Use devm_iio_device_register instead of iio_device_register when the remove
function is only used to call iio_device_unregister in order to ease the error path.
Since resource managed functions implicitly call unregister at driver detach also remove
iio_device_unregister

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 08:31:07 +01:00
Geert Uytterhoeven 9291766476 Staging: iio: Allow compile test of GPIO consumers if !GPIOLIB
The GPIO subsystem provides dummy GPIO consumer functions if GPIOLIB is
not enabled. Hence drivers that depend on GPIOLIB, but use GPIO consumer
functionality only, can still be compiled if GPIOLIB is not enabled.

Relax the dependency on GPIOLIB if COMPILE_TEST is enabled, where
appropriate.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org
Cc: devel@driverdev.osuosl.org
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-05-10 20:31:43 +01:00
Greg Kroah-Hartman dc5f2c5f6a First set of new drivers, cleanups and functionality for IIO in the 4.1 cycle.
New drivers
 * CM3323 color sensor.
 * MS5611 pressure and temperature sensor.
 
 New functionality
 * mup6050 - create mux clients for devices described via ACPI. The reasoning
      and approach taken in this patch are complex.  Basically there is no
      otherway of finding out what is there than by some esoteric look ups in
      the ACPI data.
 * cm3232 - PM support
 * itg3200 - suspend/resume support
 * mcp320x - add more ADCs to the kconfig to reflect what the driver supports
      (this patch and the bindings got left behind when the support was added
       a while back).
 
 Docs / utils
 * ti-adc128s052 - DT bindings.
 * mcp3422 - DT bindings.
 * mcp320x - DT bindings
 * ABI docs for event threshold scale attributes, in_magn_offset, proximity
   scan_element and thresh falling/rising values for accelerometers.  All
   elements long in use that have slipped by being explicitly documented.
 * Tidy up the tools previously in drivers/staging/iio/Documentation and move
   them out to /tools/iio. Yet another move that should have happened long ago.
   This time Roberta Dobrescu did the leg work.  Thanks!
 
 Core Cleanups
 * Export userspace IIO headers.  We should have done the appropriate header
   splitting a long time ago. Thanks to Daniel for sorting this out.
 
 * Refactor the registring of attributes for buffers to move all non-custom
   ones to a vector allowing easier additions to the current set in the future.
 
 Driver Cleanups
 * gpiod related cleanups.  Make use of the additional parameter to specify
   	initial direciton to avoid extra code.
 * bmc150 - Various refactorings to reduce code repitition and prepare for
            hardware buffer support.  Some of these cleanups are good even
 	   without the new functionality.
 * kmx61 - direct use of index to an array avoiding a structure element which
           was always the index to an element in an array of that structure.
 * vf610 - avoid incorrect type for return from wait_for_completion_timeout.
 * gp2ap020a00f - use put_unaligned_le32 for slight code simplification.
 * ade7754 - improve error handling including suppressing some build warnings.
 * ade7759 - improve error handling including suppressing some build warnings.
 * hmc5843 - Long line and indentation fixes. Also some constifying of various
       constant data.
 * ade7854 - 80+ character line splitting.
 * ad2s1210 - fix wrong printf format string.
 * mxs-lradc - fix wrong printf format string.
 * ade7954-i2c - code alignment fixes and other trivial but worthwhile bits.
 * periodic rtc trigger - make the frequency type an unsigned int as it
   is always treated as such.
 * jsa1212 - constify struct regmap_config as it is constant.
 * ad7793 - typo in the MODULE_DESCRIPTION
 * mma9551 - check gpiod_to_irq errors.  Note that this doesn't actually cause
     any trouble but is worth tidying up as obviously incorrect.
 * mlx90614 - refactor the register symbols to make it clear which reads are to
     RAM not PROM.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJVBe4zAAoJEFSFNJnE9BaISXAP+wcVdU9PyiLdpjh7D73qbbV0
 KnKJHdO+aKe4hCv6Xl0fWIbJcsxTn8ALPHkkxHnu06hd2Q9zANgdJ5dER5XB34fX
 vw+EjsIdiyCDmoOVGzP5SsmbSoO3gNoR5GdWmjKFKjr0eSxinh3AmAesTVSC2T9Y
 vHkjgDj3KaqN735brd2GneeG/s3jY8ZZaiTZ0jFotCtSmBAiPi8uYwIwMLmVpsVu
 M3tcUPWKithRoyKBmO4tiDg2Qwnj0IhN8zyIYiUBftxCIIY7tSlQkYgRzDmrxGG2
 HCITf33Ss87UH0IF1BOm5PXjQ3ClI3idtCwqCeXscAo6IXmoe/+BsXR/m2JqUTdp
 EOrORyzsHc0WkJK8dnp1h1XfiBR4UQpiwce5xGFbni2ycfNBw1/J0l7QTi45D6Z7
 SdGXTgt1AWd8MoWxcxMhWMPQlHsxK/XMPh10O5wD5icxo5EHvnPP0ObZ15Ax6T/V
 kcO+NEJCEHH2Q/kna2M6h4FdUVBxvzjjwhdZVs8PGGfJNDij2cVwspT81lKMauwf
 07S0KHEjhqbRSM0TvsMyf2li1Xwv5eu+G2FTkopESJ4a2zyaLobt/QgTu9dzg4Gh
 QDJFx4xdmNv4OQ+psZuoDznjM/EV+eQR+swH7P6UDyef0jghLwVkqHxM/HYChiyP
 OvZCCnHDB4EiC8jx+c43
 =BmiY
 -----END PGP SIGNATURE-----

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

Jonathan writes:

First set of new drivers, cleanups and functionality for IIO in the 4.1 cycle.

New drivers
* CM3323 color sensor.
* MS5611 pressure and temperature sensor.

New functionality
* mup6050 - create mux clients for devices described via ACPI. The reasoning
     and approach taken in this patch are complex.  Basically there is no
     otherway of finding out what is there than by some esoteric look ups in
     the ACPI data.
* cm3232 - PM support
* itg3200 - suspend/resume support
* mcp320x - add more ADCs to the kconfig to reflect what the driver supports
     (this patch and the bindings got left behind when the support was added
      a while back).

Docs / utils
* ti-adc128s052 - DT bindings.
* mcp3422 - DT bindings.
* mcp320x - DT bindings
* ABI docs for event threshold scale attributes, in_magn_offset, proximity
  scan_element and thresh falling/rising values for accelerometers.  All
  elements long in use that have slipped by being explicitly documented.
* Tidy up the tools previously in drivers/staging/iio/Documentation and move
  them out to /tools/iio. Yet another move that should have happened long ago.
  This time Roberta Dobrescu did the leg work.  Thanks!

Core Cleanups
* Export userspace IIO headers.  We should have done the appropriate header
  splitting a long time ago. Thanks to Daniel for sorting this out.

* Refactor the registring of attributes for buffers to move all non-custom
  ones to a vector allowing easier additions to the current set in the future.

Driver Cleanups
* gpiod related cleanups.  Make use of the additional parameter to specify
  	initial direciton to avoid extra code.
* bmc150 - Various refactorings to reduce code repitition and prepare for
           hardware buffer support.  Some of these cleanups are good even
	   without the new functionality.
* kmx61 - direct use of index to an array avoiding a structure element which
          was always the index to an element in an array of that structure.
* vf610 - avoid incorrect type for return from wait_for_completion_timeout.
* gp2ap020a00f - use put_unaligned_le32 for slight code simplification.
* ade7754 - improve error handling including suppressing some build warnings.
* ade7759 - improve error handling including suppressing some build warnings.
* hmc5843 - Long line and indentation fixes. Also some constifying of various
      constant data.
* ade7854 - 80+ character line splitting.
* ad2s1210 - fix wrong printf format string.
* mxs-lradc - fix wrong printf format string.
* ade7954-i2c - code alignment fixes and other trivial but worthwhile bits.
* periodic rtc trigger - make the frequency type an unsigned int as it
  is always treated as such.
* jsa1212 - constify struct regmap_config as it is constant.
* ad7793 - typo in the MODULE_DESCRIPTION
* mma9551 - check gpiod_to_irq errors.  Note that this doesn't actually cause
    any trouble but is worth tidying up as obviously incorrect.
* mlx90614 - refactor the register symbols to make it clear which reads are to
    RAM not PROM.
2015-03-24 22:53:52 +01:00
Haneen Mohammed 8ac7f9b37e Staging: iio: replace pr_* with dev_*
dev_* is prefered over pr_* when appropriate device stuct is present.
This patch replace pr_err and pr_warn with its dev_ counterpart.

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18 11:21:33 +01:00
Haneen Mohammed 92371df8a9 Staging: iio: replace pr_err with dev_err
This patch replace pr_err with dev_err, when appropriate device structre
is found.
Issue found using the following Coccinelle script:

@r exists@
identifier f, s, i;
position p;
@@

f(...,struct s *i,...) {
<+...
when != i == NULL
pr_err@p(...);
...+>
}

@rr@
identifier r.s, fld;
@@

struct s {
	...
	struct device *fld;
	...
};

@@
identifier r.i, rr.fld;
position r.p;
@@
-pr_err@p
+dev_err
   (
+ i->fld,
...)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18 11:16:36 +01:00
Greg Kroah-Hartman 355a73f07d Merge 4.0-rc3 into staging-next
We want the staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-09 08:13:01 +01:00
Cristina Opriceana 37e3be9de3 Staging: iio: Added define guards where needed
The following files were added define guards to prevent multiple
inclusion.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 09:54:33 -08:00
Rickard Strandqvist 31a3dda648 staging: iio: resolver: ad2s1210: Change type in printf format string
Wrong type in printf format string, requires 'int'
but the argument type is 'unsigned int'

This was found using a static code analysis program called cppcheck

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-02-08 12:05:44 +00:00
Rasmus Villemoes f7067a5ad7 staging: iio: ad2s1200: Fix sign extension
The line above makes vel a 12-bit quantity (st->rx[] is u8). The
intention is to sign-extend vel using bit 11 as the sign bit. But
because of C's promotion rules "vel = (vel << 4) >> 4;" is actually a
no-op, since vel is promoted to int before the inner
shift. sign_extend32 works equally well for 8 and 16 bits types, so
use that.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-01-26 21:04:27 +00:00
Roberta Dobrescu 97088bb3f7 staging: iio: resolver: Annotate Kconfig entries with module name information
This fixes the following checkpatch.pl warning:
WARNING: please write a paragraph that describes the config symbol fully

Signed-off-by: Roberta Dobrescu <roberta.dobrescu@gmail.com>
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-02 10:06:10 -07:00
Aybuke Ozdemir 8a689c1147 Staging: iio: resolver: Missing a blank line after declarations
This patch fixes these warning messages found by checkpatch.pl:
WARNING : Missing a blank line after declarations

Signed-off-by: Aybuke Ozdemir <aybuke.147@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-19 16:24:43 -07:00
Teodora Baluta 7557138a94 staging: iio: adis16240: fix sparse warnings regarding incorrect argument type
Silence the following sparse warnings by changing cast from u16 to
__be16:

  CHECK   drivers/staging/iio/accel/adis16240_core.c
drivers/staging/iio/accel/adis16240_core.c:128:51: warning: incorrect
type in argument 3 (different signedness)
drivers/staging/iio/accel/adis16240_core.c:128:51:    expected unsigned
short [usertype] *val
drivers/staging/iio/accel/adis16240_core.c:128:51:    got signed short
*<noident>
drivers/staging/iio/accel/adis16240_core.c:142:51: warning: incorrect
type in argument 3 (different signedness)
drivers/staging/iio/accel/adis16240_core.c:142:51:    expected unsigned
short [usertype] *val
drivers/staging/iio/accel/adis16240_core.c:142:51:    got signed short
*<noident>

Signed-off-by: Teodora Baluta <teodora.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-08-02 17:42:00 +01:00
Jimmy Li c60e5760b0 staging:iio:ad2s1200 fix missing parenthesis in a for statment.
Signed-off-by: Jimmy Li <coder.liss@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-04-26 10:51:14 +01:00
Greg Kroah-Hartman 8b425aa193 First found of IIO fixes for the 3.15 cycle.
* Fix the platform data support for the at91 adc driver.
 * A couple of related follow up patches get the support working again
   for at91sam9260 and at91sam9g45 as the earlier patch results in a device
   name change.
 * A default timer value in the at91 adc driver was bonkers.  Make it sane.
 * Fix incorrect reporting of the integration time for the cm32181 light sensor
 * Fix a missing break in the ad2s1200 driver which would have give a false
   error return.
 * Make sure buffer scan mask queries from userspace return 0/1 rather than
   a fairly random value depending on their implementation of test_bit
 * Fix leak of the i2c client and a null pointer dereference in the cm36651
   driver.
 * Fix a build warning on avr32 for the mxs-lradc (not exactly a critical
   combination - but the issue was real).
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.22 (GNU/Linux)
 
 iQIcBAABAgAGBQJTSX1HAAoJEFSFNJnE9BaIGkoQAIotGana51TXPo9KYnQJaCYH
 +xBfaaXEaR69lARoXT8SDGzyXPCQNOEbVfsXRwrVQ4Wl8x2hP8n9YdUrAHzZ/8O/
 Wf8Z0jb81Q+KNJ+SMMgcy4kK5OU71EMMk5fbocPzD+WfQ+WlDr+My1F3yZ5UIvOM
 nOUF6QCcYA0MN7dopEVIqyP8HZhrxR1YUvgzqOmp1fteYL4gFCU006WPSI30GxEv
 fMM8MiWbbn9xjOsR7SBzaLEo0Hv3YC92zwSAuJxGClH/+9cKogWAaE/PiNUO3y6A
 +2D0KQnGRopKy4j/QCjdPZsTmYDBxQ9vMlUOtRlOf1XAVjL6pZu2EJ2/ereShLW6
 B4rev23tqgk9nyNk/Li4n+5krzvPqqOcbWNW1la769DkEt7LU+YU+hiShkDm1+0M
 6hwxPd6gQxg0QUjuusi1+B5JqweAv+mEcCsQ+ga6ZK61X9bNJ6c/4YF451rkNhc6
 mlC3ZqBvDALmNSVdCas0GOGHLaeWxfoT7E9G6p62h9uBVerqZ6epvlAUC6JOHotc
 /qz/D1VL1+ptPAawXiFSNOb8RMJogdBfjPB9bOlYQSSHV3eF0RVNK6FQiqvc4mFX
 or1pPG6lDLGm6g3NcDEjxEEVThevQpEwKmpM0TCEUMiIuxSHYN/M//P2PSeDvYwk
 9k8x3fJae7dWNsGIT92y
 =HMr3
 -----END PGP SIGNATURE-----

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

Jonathan writes:

First found of IIO fixes for the 3.15 cycle.

* Fix the platform data support for the at91 adc driver.
* A couple of related follow up patches get the support working again
  for at91sam9260 and at91sam9g45 as the earlier patch results in a device
  name change.
* A default timer value in the at91 adc driver was bonkers.  Make it sane.
* Fix incorrect reporting of the integration time for the cm32181 light sensor
* Fix a missing break in the ad2s1200 driver which would have give a false
  error return.
* Make sure buffer scan mask queries from userspace return 0/1 rather than
  a fairly random value depending on their implementation of test_bit
* Fix leak of the i2c client and a null pointer dereference in the cm36651
  driver.
* Fix a build warning on avr32 for the mxs-lradc (not exactly a critical
  combination - but the issue was real).
2014-04-22 21:29:20 -07:00
Jimmy Li 6b9da2e772 staging:iio:ad2s1200 fix a missing break
Signed-off-by: Jimmy Li <coder.liss@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-03-22 11:50:25 +00:00
Monam Agarwal 21d9fbcc4f Staging: iio/resolver: Fix prefer pr_warn over pr_warning in ad2s1210.c
This patch fixes following checkpatch.pl warning
WARNING: Prefer pr_warn(... to pr_warning(...

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-07 14:48:47 -08:00
Sachin Kamat 794a870e77 staging: iio: ad2s1200: Use devm_iio_device_register
devm_iio_device_register simplifies the code.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-11-24 21:07:22 +00:00
Sachin Kamat 6bba7983bd staging: iio: ad2s90: Use devm_iio_device_alloc
devm_iio_device_alloc makes code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Graff Yang <graff.yang@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-14 11:52:01 +01:00
Sachin Kamat 50711572c6 staging: iio: ad2s1210: Use devm_iio_device_alloc
devm_iio_device_alloc makes code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Graff Yang <graff.yang@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-14 11:51:46 +01:00
Sachin Kamat a20df3fe46 staging: iio: ad2s1200: Use dev_err instead of pr_err
dev_err is preferred over pr_err.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-14 11:47:17 +01:00
Sachin Kamat 8d1b0b4887 staging: iio: ad2s1200: Use devm_* APIs
devm_* APIs are device managed and make code simpler.
This patch also fixes the missing gpio_free call in remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Graff Yang <graff.yang@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-14 11:46:26 +01:00
Jingoo Han e5e26dd5bb staging: iio: replace strict_strto*() with kstrto*()
The usage of strict_strto*() is not preferred, because
strict_strto*() is obsolete. Thus, kstrto*() should be
used.

Previously, there were only strict_strtol(), strict_strtoul(),
strict_strtoull(), and strict_strtoll(). Thus, when converting
to the variables, only long, unsigned long, unsigned long long,
and long long can be used.

However, kstrto*() provides various functions handling all types
of variables. Therefore, the types of variables can be changed
properly.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-09-08 15:16:07 +01:00
Lars-Peter Clausen be8309d699 staging:iio:ad2s1210: Don't expose the chip reset to userspace
There is no reason why userspace should want to trigger a manual reset of the
device, so remove this functionality.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-08-03 18:40:36 +01:00
Linus Torvalds 5647ac0ad4 Removal of GENERIC_GPIO for v3.10
GENERIC_GPIO now synonymous with GPIOLIB. There are no longer any valid
 cases for enableing GENERIC_GPIO without GPIOLIB, even though it is
 possible to do so which has been causing confusion and breakage. This
 branch does the work to completely eliminate GENERIC_GPIO.
 
 However, it is not trivial to just create a branch to remove it. Over
 the course of the v3.9 cycle more code referencing GENERIC_GPIO has been
 added to linux-next that conflicts with this branch. The following must
 be done to resolve the conflicts when merging this branch into mainline:
 
 * "git grep CONFIG_GENERIC_GPIO" should return 0 hits. Matches should be
   replaced with CONFIG_GPIOLIB
 * "git grep '\bGENERIC_GPIO\b'" should return 1 hit in the Chinese
   documentation.
 * Selectors of GENERIC_GPIO should be turned into selectors of GPIOLIB
 * definitions of the option in architecture Kconfig code should be deleted.
 
 Stephen has 3 merge fixup patches[1] that do the above. They are currently
 applicable on mainline as of May 2nd.
 
 [1] http://www.mail-archive.com/linux-kernel@vger.kernel.org/msg428056.html
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJRifUnAAoJEEFnBt12D9kBs2YP/0U6+ia+xYvkVaJc28PDVIzn
 OReZNcJOYU8D5voxz0voaRD0EdcPwjbMu9Kp9aXMHlk4VxevF+8jCc/us0bIjtO1
 VcB5VmSCIhMhxdnBlum11Mk7Vr5MCweyl9NBsypnPt8cl4obMBZHf2yzoodFktNb
 wtyYlOb6FALtc6iDbOO6dG3w9F7FAOLvskUFzdv89m8mupTsBu9jw9NqFDbJHOex
 rxq0Sdd+kWF/nkJVcV5Y6jIdletRlhpipefMJ9diexreHvwqh+c4kJEYZaXgB5+m
 ha95cPbReK1d+RqzM3A8d4irzSVSmq4k7ijI6QkFOr48+AH7XsgKv5so885LKzMN
 IIXg2Phm9i0H8+ecEvhcc4oIYBHJiEKK54Y0qUD9dqbFoDGPTCSqMHdSSMbpAY+J
 bIIXlVzj1En3PPNUJLPt8q8Qz6WxCT9mDST3QSGYnD4o90HT+1R9j92RxGL6McOq
 rUOyJDwmzFvpBvKK4raGdOU435M+ps2NPKKNIRaIGQPPY9rM1kN4YqvhXukEsC9L
 3a3+3cQLh7iKxBHncxeQsJfethP1CPkJnzvF9r+ZZLf2rcPH4pbQIE2uO0XnX/nd
 5/DKi0nGgAJ//GMMzdo3RiOA5zGFjIZ/KMvfhQldpP6qFJRhqdGi6FPlAcwr1z1n
 YnCByPwwlvfC4LTXFOGL
 =xodc
 -----END PGP SIGNATURE-----

Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux

Pull removal of GENERIC_GPIO from Grant Likely:
 "GENERIC_GPIO now synonymous with GPIOLIB.  There are no longer any
  valid cases for enableing GENERIC_GPIO without GPIOLIB, even though it
  is possible to do so which has been causing confusion and breakage.
  This branch does the work to completely eliminate GENERIC_GPIO."

* tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux:
  gpio: update gpio Chinese documentation
  Remove GENERIC_GPIO config option
  Convert selectors of GENERIC_GPIO to GPIOLIB
  blackfin: force use of gpiolib
  m68k: coldfire: use gpiolib
  mips: pnx833x: remove requirement for GENERIC_GPIO
  openrisc: default GENERIC_GPIO to false
  avr32: default GENERIC_GPIO to false
  xtensa: remove explicit selection of GENERIC_GPIO
  sh: replace CONFIG_GENERIC_GPIO by CONFIG_GPIOLIB
  powerpc: remove redundant GENERIC_GPIO selection
  unicore32: default GENERIC_GPIO to false
  unicore32: remove unneeded select GENERIC_GPIO
  arm: plat-orion: use GPIO driver on CONFIG_GPIOLIB
  arm: remove redundant GENERIC_GPIO selection
  mips: alchemy: require gpiolib
  mips: txx9: change GENERIC_GPIO to GPIOLIB
  mips: loongson: use GPIO driver on CONFIG_GPIOLIB
  mips: remove redundant GENERIC_GPIO select
2013-05-09 09:59:16 -07:00
Alexandre Courbot 76ec9d18b8 Convert selectors of GENERIC_GPIO to GPIOLIB
GENERIC_GPIO is now equivalent to GPIOLIB and features that depended on
GENERIC_GPIO can now depend on GPIOLIB to allow removal of this option.

Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
2013-04-16 18:47:14 +09:00
Jonathan Cameron 3589ba9943 staging:iio:resolver:ad2s90 move to info_mask_(shared_by_type/separate)
The original info_mask is going away in favour of the broken out versions.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2013-03-17 19:49:42 +00:00
Jonathan Cameron 07d0f65491 staging:iio:resolver:ad2s1210 move to info_mask_(shared_by_type/separate)
The original info_mask is going away in favour of the broken out versions.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2013-03-17 19:49:42 +00:00
Jonathan Cameron 910b51f388 staging:iio:resolver:ad2s1200 move to info_mask_(shared_by_type/separate)
The original info_mask is going away in favour of the broken out versions.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
2013-03-17 19:49:42 +00:00
Lars-Peter Clausen ad6c46b0c7 staging:iio: Use spi_sync_transfer()
Use the new spi_sync_transfer() helper function instead of open-coding it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2013-02-09 11:10:43 +00:00
Bill Pemberton e543acf07d staging: iio: remove use of __devexit_p
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 15:02:23 -08:00
Bill Pemberton 447d4f29ee staging: iio: remove use of __devexit
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 14:59:37 -08:00
Bill Pemberton 4ae1c61ff2 staging: iio: remove use of __devinit
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 14:31:41 -08:00
Lars-Peter Clausen f4e4b9558b staging:iio: Constify static iio_chan_spec arrays
The per driver iio_chan_spec arrays are usually shared between multiple device
instances. So a single device instance may not modify the iio_chan_spec array
since this would also affect the other device instances. To make this restriction
explicit mark the per driver iio_chan_spec arrays as const.

Conversion was done automatically using the following coccinelle semantic patch:

// <smpl>
@disable optional_qualifier@
identifier channels;
@@
static
+const
struct iio_chan_spec channels[] = ...;
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-08-14 20:27:42 +01:00
Lars-Peter Clausen a651cf9b5f staging:iio:resolver: Use dev_to_iio_dev()
Replace open-coded instances of getting a iio_dev struct from a device struct
with dev_to_iio_dev().

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:39:22 -07:00
Lars-Peter Clausen 7cbb753701 staging:iio: Streamline API function naming
Currently we use two different naming schemes in the IIO API, iio_verb_object
and iio_object_verb. E.g iio_device_register and iio_allocate_device. This
patches renames instances of the later to the former. The patch also renames allocate to
alloc as this seems to be the preferred form throughout the kernel.

In particular the following renames are performed by the patch:
	iio_put_device -> iio_device_put
	iio_allocate_device -> iio_device_alloc
	iio_free_device -> iio_device_free
	iio_get_trigger -> iio_trigger_get
	iio_put_trigger -> iio_trigger_put
	iio_allocate_trigger -> iio_trigger_alloc
	iio_free_trigger -> iio_trigger_free

The conversion was done with the following coccinelle patch with manual fixes to
comments and documentation.

<smpl>
@@
@@
-iio_put_device
+iio_device_put
@@
@@
-iio_allocate_device
+iio_device_alloc
@@
@@
-iio_free_device
+iio_device_free
@@
@@
-iio_get_trigger
+iio_trigger_get
@@
@@
-iio_put_trigger
+iio_trigger_put
@@
@@
-iio_allocate_trigger
+iio_trigger_alloc
@@
@@
-iio_free_trigger
+iio_trigger_free
</smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-29 21:23:49 -04:00
Jonathan Cameron 06458e277e IIO: Move core headers to include/linux/iio
Step 1 in moving the IIO core out of staging.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-25 11:01:43 -07:00
Jonathan Cameron 6246577071 staging:iio:resolver Add IIO_CHAN_INFO_RAW entries to all drivers.
Precursor to making value read / write attribute optional.
No processed values in resolvers at the moment.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18 16:38:20 -07:00
Linus Torvalds 12e5550892 Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
* 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (466 commits)
  net/hyperv: Add support for jumbo frame up to 64KB
  net/hyperv: Add NETVSP protocol version negotiation
  net/hyperv: Remove unnecessary kmap_atomic in netvsc driver
  staging/rtl8192e: Register against lib80211
  staging/rtl8192e: Convert to lib80211_crypt_info
  staging/rtl8192e: Convert to lib80211_crypt_data and lib80211_crypt_ops
  staging/rtl8192e: Add lib80211.h to rtllib.h
  staging/mei: add watchdog device registration wrappers
  drm/omap: GEM, deal with cache
  staging: vt6656: int.c, int.h: Change return of function to void
  staging: usbip: removed unused definitions from header
  staging: usbip: removed dead code from receive function
  staging:iio: Drop {mark,unmark}_in_use callbacks
  staging:iio: Drop buffer mark_param_change callback
  staging:iio: Drop the unused buffer enable() and is_enabled() callbacks
  staging:iio: Drop buffer busy flag
  staging:iio: Make sure a device is only opened once at a time
  staging:iio: Disallow modifying buffer size when buffer is enabled
  staging:iio: Disallow changing scan elements in all buffered modes
  staging:iio: Use iio_buffer_enabled instead of open coding it
  ...

Fix up conflict in drivers/staging/iio/adc/ad799x_core.c (removal of
module_init due to using module_i2c_driver() helper, next to removal of
MODULE_ALIAS due to using MODULE_DEVICE_TABLE instead).
2012-01-09 12:18:17 -08:00
Lars-Peter Clausen 55e4390cb0 staging:iio: Add missing MODULE_DEVICE_TABLE and MODULE_ALIAS
Quite a few iio drivers provide no MODULE_DEVICE_TABLE or MODULE_ALIAS or only
provide a MODULE_ALIAS while they have support for multiple device ids. This
prevents auto module loading from working correctly.

This patch fixes it by adding the missing MODULE_DEVICE_TABLEs and
MODULE_ALIAS'.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 16:48:04 -08:00