Commit Graph

2033 Commits

Author SHA1 Message Date
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
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
Ksenija Stanojevic 4c3577db3e Staging: iio: impedance-analyzer: Fix sparse warning
Fix following sparse endian warning:

drivers/staging/iio/impedance-analyzer/ad5933.c:671:34: warning: cast to restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:671:34: warning: cast to restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:671:34: warning: cast to restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:671:34: warning: cast to restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:672:34: warning: cast to restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:672:34: warning: cast to restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:672:34: warning: cast to restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:672:34: warning: cast to restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:674:34: warning: cast to restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:674:34: warning: cast to restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:674:34: warning: cast to restricted __be16
drivers/staging/iio/impedance-analyzer/ad5933.c:674:34: 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
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
Alison Schofield 4b60c887d4 staging: iio: dummy: replace block comment with single line comment
Replace one block comment with a single line comment. Follow style of
previous comment and omit word channel, since it's clear the topic is
channels.

Addresses checkpatch.pl:
WARNING: Block comments use * on subsequent lines

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 14:49:09 +09:00
Alison Schofield f8087abc45 staging: iio: dummy: use uppercase descriptors for enum names
Replace lower case names in the enum dummy_scan_elements with
uppercase names and a descriptive prefix: DUMMY_INDEX_

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 14:49:09 +09:00
Cristina Moraru 31a99443a5 staging: iio: adis16060_core: Fix error handling
We need to check adis16060_spi_read return code to avoid feeding user
space with bogus data.
While, at it introduce out_unlock label in order to simplify locking
on error path.

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 14:49:09 +09:00
Cristina Moraru 1c58f0eb9c staging: iio: Remove unused variable
Remove variable that is initialized but not used.

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 14:49:09 +09:00
Greg Kroah-Hartman cf516d08ec Merge 4.3-rc7 into staging-next
We want the other staging patches in this branch as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 09:13:38 +09:00
Vladimir Zapolskiy 01bb70ae0b iio: lpc32xx_adc: fix warnings caused by enabling unprepared clock
If common clock framework is configured, the driver generates a warning,
which is fixed by this change:

    root@devkit3250:~# cat /sys/bus/iio/devices/iio\:device0/in_voltage0_raw
    ------------[ cut here ]------------
    WARNING: CPU: 0 PID: 724 at drivers/clk/clk.c:727 clk_core_enable+0x2c/0xa4()
    Modules linked in: sc16is7xx snd_soc_uda1380
    CPU: 0 PID: 724 Comm: cat Not tainted 4.3.0-rc2+ #198
    Hardware name: LPC32XX SoC (Flattened Device Tree)
    Backtrace:
    [<>] (dump_backtrace) from [<>] (show_stack+0x18/0x1c)
    [<>] (show_stack) from [<>] (dump_stack+0x20/0x28)
    [<>] (dump_stack) from [<>] (warn_slowpath_common+0x90/0xb8)
    [<>] (warn_slowpath_common) from [<>] (warn_slowpath_null+0x24/0x2c)
    [<>] (warn_slowpath_null) from [<>] (clk_core_enable+0x2c/0xa4)
    [<>] (clk_core_enable) from [<>] (clk_enable+0x24/0x38)
    [<>] (clk_enable) from [<>] (lpc32xx_read_raw+0x38/0x80)
    [<>] (lpc32xx_read_raw) from [<>] (iio_read_channel_info+0x70/0x94)
    [<>] (iio_read_channel_info) from [<>] (dev_attr_show+0x28/0x4c)
    [<>] (dev_attr_show) from [<>] (sysfs_kf_seq_show+0x8c/0xf0)
    [<>] (sysfs_kf_seq_show) from [<>] (kernfs_seq_show+0x2c/0x30)
    [<>] (kernfs_seq_show) from [<>] (seq_read+0x1c8/0x440)
    [<>] (seq_read) from [<>] (kernfs_fop_read+0x38/0x170)
    [<>] (kernfs_fop_read) from [<>] (do_readv_writev+0x16c/0x238)
    [<>] (do_readv_writev) from [<>] (vfs_readv+0x50/0x58)
    [<>] (vfs_readv) from [<>] (default_file_splice_read+0x1a4/0x308)
    [<>] (default_file_splice_read) from [<>] (do_splice_to+0x78/0x84)
    [<>] (do_splice_to) from [<>] (splice_direct_to_actor+0xc8/0x1cc)
    [<>] (splice_direct_to_actor) from [<>] (do_splice_direct+0xa0/0xb8)
    [<>] (do_splice_direct) from [<>] (do_sendfile+0x1a8/0x30c)
    [<>] (do_sendfile) from [<>] (SyS_sendfile64+0x104/0x10c)
    [<>] (SyS_sendfile64) from [<>] (ret_fast_syscall+0x0/0x38)

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-10-25 12:21:59 +00:00
Arnd Bergmann aea545fa90 staging: iio: select IRQ_WORK for IIO_DUMMY_EVGEN
The iio dummy code was recently changed to use irq_work_queue, but
that code is compiled into the kernel only if IRQ_WORK is set, so
we can get a link error here:

drivers/built-in.o: In function `iio_evgen_poke':
(.text+0x208a04): undefined reference to `irq_work_queue'

This changes the Kconfig file to match what other drivers do.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: fd2bb310ca ("Staging: iio: Move evgen interrupt generation to irq_work")
Acked-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-10-25 12:15:36 +00:00
Cristina Moraru cd857a158a staging: iio: magnetometer: Remove explicit comparisons
Remove comparisons to 0 or NULL

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:32:09 -07:00
Cristina Moraru 05824120e4 staging: iio: gyro: Remove explicit comparisons
Remove comparisons to 0 or NULL

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:32:09 -07:00
Cristina Moraru ac1640fbd8 staging: iio: trigger: Remove explicit comparisons
Remove comparisons to 0 or NULL

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:32:09 -07:00
Cristina Moraru 97deb1bc11 staging: iio: frequency: Remove explicit comparisons
Remove comparisons to 0 or NULL

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:32:09 -07:00
Cristina Moraru e6e65f97db staging: iio: cdc: Remove explicit comparisons
Remove comparisons to 0 or NULL

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:32:09 -07:00
Cristina Moraru eee587ea87 staging: iio: accel: Remove explicit comparisons
Remove comparisons to 0 or NULL

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:32:09 -07:00
Cristina Moraru 062f782b37 staging: iio: meter: Remove explicit comparisons
Remove comparisons to 0 or NULL

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:32:09 -07:00
Cristina Moraru d59b7b6834 staging: iio: light: Remove explicit comparisons
Remove comparisons to 0 or NULL

Signed-off-by: Cristina Moraru <cristina.moraru09@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:32:09 -07:00
Shivani Bhardwaj 561e296734 Staging: iio: tsl2x7x_core: Remove unrequired parentheses from DIV_ROUND_UP
Remove parentheses surrounding the first argument of the macro
DIV_ROUND_UP as they are not required.
Semantic patch used:

@@
expression e1,e2;
@@
DIV_ROUND_UP(
- (
  e1
- )
  ,e2)

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:48:19 -07:00
Shivani Bhardwaj 3c6b71a503 Staging: iio: ad7192: Remove unnecessary NULL test
The variable pdata is already NULL tested before so, any further tests
should be removed.

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:48:19 -07:00
Shraddha Barke 859ba4684e Staging: iio: cdc: Remove unused macros
Remove the macros since they are not used anywhere throughout the
kernel.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:48:19 -07:00
Ioana Ciornei 5f7e280f5a staging: iio: adc: remove the use of CamelCase
Remove the use of CamelCase to follow the kernel naming conventions

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:47:28 -07:00
Ioana Ciornei 253ed6848f staging: iio: adc: remove multiple blank lines
Remove multiple blank lines since there is no practical reason
to have it

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:47:28 -07:00
Ioana Ciornei 779c123e1a staging: iio: adc: add blank line after declarations
Insert a blank line after declarations

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:47:28 -07:00
Ioana Ciornei 5feb8c51db staging: iio: adc: add spaces around binary operators
Add spaces around binary operators like -, +, * etc
in order to improve readability

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:47:28 -07:00
Ioana Ciornei c30685c67c staging: iio: adc: remove space after cast
Remove the space after an explicit cast because there is no
point in having it

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:47:28 -07:00
Ioana Ciornei 603f102f78 staging: iio: adc: remove explicit comparison to NULL
Use !condition instead off condition == NULL when comparing with NULL

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:47:28 -07:00
Ioana Ciornei e8ef49f09b staging: iio: adc: properly indent to match open paranthesis
Indent parameters and arguments passed to function calls to match
open paranthesis

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:47:28 -07:00
Ioana Ciornei 0e4f007500 staging: iio: adc: use kernel types u32 and u64
Convert uint32_t to u32 and uint64_t to u64 in order to
follow the kernel best practice

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Reviewed-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:47:28 -07:00
Ioana Ciornei 4a737ec350 staging: iio: cdc: simplify return flow
Simplify return flow ad7150_write_event_params in order to reduce code length.
Since i2c_smbus_write_word_data only returns a negative value or 0 the change is safe.

This patch fixes the following coccicheck warning:

drivers/staging/iio/cdc/ad7150.c:182:2-5: WARNING: end returns can be simpified if negative or 0 value

Signed-off-by: Ioana Ciornei <ciorneiioana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:46:48 -07:00
Greg Kroah-Hartman 5da654541b Second set of new drivers, functionality and cleanups for IIO in the 4.4 cycle.
Core stuff
 * adjust resistance documentation to allow for output devices.
 
 New device support:
 * bmc150
  - split the i2c driver up into a core and i2c_regmap part including regmap
    conversion.
  - add spi support.
 * mcp4531 digitial potentiometer driver.
 * Measurement Specialties set of drivers with a core library module providing
   common functionality.  Note that the htu21 has a driver in hwmon, but the
   view from that side was that, given the range of devices the same silicon
   turns up in are not all typical hwmon material, that driver would be
   deprecated in favour of this new support.
  - ms8607 temperature, pressure and humidty sensor
  - ms5637 temperature and pressure sensor
  - htu21 temperature and humidity sensor
  - tsys02d temperature sensor
  - tsys01 temperature sensor
 
 Cleanups
 * tree wide.
  - squish cases where irq 0 is still considered valid.
 * apds9960
  - sparse endian warning cleanups by making endianness explicit.
 * ad5504
  - leave group naming to the core.
 * ad7746
  - cleanup comment style.
  - drop an unnecessary bit of dev_info
  - add some appropriate uses of the BIT macro.
 * ad799x
  - leave group naming to the core.
 * hdc100x - introduced this cycle,.
  - fix a wrong offset value.
 * lidar
  - add missing MODULE_DEVICE_TABLE for dt.
 * max1363
  - leave sysfs group naming to the core.
 * m62332 got the Harmut treatment and as ever he found a 'few' bits the
   rest of us had missed!
  - Share scale and offset attributes across channels.
  - Shutdown the device on driver remove
  - Use ARRAY_SIZE rather than a hard coded count for channels.
  - Return more directly in the write_raw callback dropping a local variable
    along the way.
  - a few style issues
  - move to reading the regulator voltage for each use allowing for dynamic
    regulators.  This is a common feature across drivers so we might end
    up with more fixes throughout the tree for this.
 * mlx96014 - introduced this cycle.
  - fixed up a spot of error handling.
 * vz89x - introduced this cycle.
  - work around a hardware quirk.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABCAAGBQJWG/HnAAoJEFSFNJnE9BaI3skQAJa/x5iZKRfR15pbYcYrgfUl
 P0yOh2l5+PufKUQVqKla9wmYjoriXoKLvC2UtFyvnCj72H8zPt24N+Fx9kab/Wy0
 YXnq/KgppQ9NFat3mYUxQoRFg7tlNkEj1jDF0iynNCSGUW6TJYxvHkto0oZOzi0O
 b9oejTci+1+8mreShiobALp12bappQVBWy3TUmcEnGr/RmOPi+YQaYO+YGcPUx6R
 YPCHw6/QpDukUJ82gnWtvarHFuf8LwmZ9lz+OzMY9Xy1ytglwHOnhnimWai0qEGz
 TSaFqM/HKFB8f9hY08srfqaAz1q+Gx56yQQsGlhGtwvVELKn5HhDpgiAJImc0ZG/
 B7hUB9Gi7TWbGlE/VvCGRPjFkVVnDibtNd9OJaeQPZD8KwRR320bA+6o49RVAa92
 0tFfybEe8I2y3577QkH7enYr+5CV/RtvWxBjwxzODAwWypzPWNTyfgsd9JKxnDYH
 cL9DejGQhGDgyM47Q8FEKTJovTc6ueP/1/5v4p6Qeg8WsaAC18bl3zKGJ3jywIiR
 Ec/8icxdxmT+UUDJAPKOMSBraOnUDa/q1blaNtMb9bqSlbMmE9vz3w71uBvfpzE5
 /snq1j4yAyomE74x6lfb6Amzv1q6VVI72ewOtGng0kgYAV5t6+m2oVz8p+hYShZO
 Q7d1RqBZrEtsjYyg9qNn
 =LXV9
 -----END PGP SIGNATURE-----

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

Jonathan writes:

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

Core stuff
* adjust resistance documentation to allow for output devices.

New device support:
* bmc150
 - split the i2c driver up into a core and i2c_regmap part including regmap
   conversion.
 - add spi support.
* mcp4531 digitial potentiometer driver.
* Measurement Specialties set of drivers with a core library module providing
  common functionality.  Note that the htu21 has a driver in hwmon, but the
  view from that side was that, given the range of devices the same silicon
  turns up in are not all typical hwmon material, that driver would be
  deprecated in favour of this new support.
 - ms8607 temperature, pressure and humidty sensor
 - ms5637 temperature and pressure sensor
 - htu21 temperature and humidity sensor
 - tsys02d temperature sensor
 - tsys01 temperature sensor

Cleanups
* tree wide.
 - squish cases where irq 0 is still considered valid.
* apds9960
 - sparse endian warning cleanups by making endianness explicit.
* ad5504
 - leave group naming to the core.
* ad7746
 - cleanup comment style.
 - drop an unnecessary bit of dev_info
 - add some appropriate uses of the BIT macro.
* ad799x
 - leave group naming to the core.
* hdc100x - introduced this cycle,.
 - fix a wrong offset value.
* lidar
 - add missing MODULE_DEVICE_TABLE for dt.
* max1363
 - leave sysfs group naming to the core.
* m62332 got the Harmut treatment and as ever he found a 'few' bits the
  rest of us had missed!
 - Share scale and offset attributes across channels.
 - Shutdown the device on driver remove
 - Use ARRAY_SIZE rather than a hard coded count for channels.
 - Return more directly in the write_raw callback dropping a local variable
   along the way.
 - a few style issues
 - move to reading the regulator voltage for each use allowing for dynamic
   regulators.  This is a common feature across drivers so we might end
   up with more fixes throughout the tree for this.
* mlx96014 - introduced this cycle.
 - fixed up a spot of error handling.
* vz89x - introduced this cycle.
 - work around a hardware quirk.
2015-10-16 21:28:55 -07: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
Alexandre Belloni b94e22805a iio: mxs-lradc: Fix temperature offset
0° Kelvin is actually −273.15°C, not -272.15°C. Fix the temperature offset.
Also improve the comment explaining the calculation.

Reported-by: Janusz Użycki <j.uzycki@elpromaelectronics.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Acked-by: Marek Vasut <marex@denx.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-10-11 15:02:02 +01:00
Hugo Camboulive 18a16b5e26 staging: iio: adc: fix comment block coding style issue
This patch to ad7746.c makes the comment blocks end with a */
on a separate line, and start with a /* on an empty line.

Signed-off-by: Hugo Camboulive <hugo.camboulive@gmail.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2015-10-11 10:21:22 +01:00
Hugo Camboulive bdddc22f07 staging: iio: adc: fix comment block coding style issue
This patch to ad7746.c makes the comment block end with a */
on a separate line.

Signed-off-by: Hugo Camboulive <hugo.camboulive@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04 08:31:07 +01: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
Ioana Ciornei 86727e30d1 staging: iio: light: use devm_iio_device_register instead iio_device_register
Replace iio_device_register with resource managed devm_iio_device_register in order
to ease the error path. Also delete the remove function since there is no need after
this change.

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
Ioana Ciornei 252fb58ceb staging: iio: cdc: use devm_iio_device_register instead iio_device_register
Replace iio_device_register with resource managed devm_iio_device_register in order
to ease the error path. Also delete de remove function since there is no need after
this change.

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