Commit graph

985 commits

Author SHA1 Message Date
Linus Torvalds dab363f938 Staging patches for 3.19-rc1
Here's the big staging tree pull request for 3.19-rc1.
 
 We continued to delete more lines than were added, always a good thing,
 but not at a huge rate this release, only about 70k lines removed
 overall mostly from removing the horrid bcm driver.
 
 Lots of normal staging driver cleanups and fixes all over the place,
 well over a thousand of them, the shortlog shows all the horrid details.
 
 The "contentious" thing here is the movement of the Android binder code
 out of staging into the "real" part of the kernel.  This is code that
 has been stable for a few years now and is working as-is in the tens of
 millions of devices with no issues.  Yes, the code is horrid, and the
 userspace api leaves a lot to be desired, but it's not going to change
 due to legacy issues that we have no control over.  Because so many
 devices and companies rely on this, and the code is stable, might as
 well promote it out of staging.
 
 This was all discussed at the Linux Plumbers conference, and everyone
 participating agreed that this was the best way forward.
 
 There is work happening to replace the binder code with something new
 that is happening right now, but I don't expect to see the results of
 that work for another year at the earliest.  If that ever happens, and
 Android switches over to it, I'll gladly remove this version.
 
 As for maintainers, I'll be glad to maintain this code, I've been doing
 it for the past few years with no problems.  I'll send a MAINTAINERS
 entry for it before 3.19-final is out, still need to talk to the Google
 developers about if they are willing to help with it or not, last I
 checked they were, which was good.
 
 All of these patches have been in linux-next for a while with no
 reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlSPICkACgkQMUfUDdst+yksdwCfSLE9VUy1o2sAPDRe+J3bQced
 EWEAoL3RtnejKbo5tHS2IT69pLrwiIDS
 =YXyM
 -----END PGP SIGNATURE-----

Merge tag 'staging-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver updates from Greg KH:
 "Here's the big staging tree pull request for 3.19-rc1.

  We continued to delete more lines than were added, always a good
  thing, but not at a huge rate this release, only about 70k lines
  removed overall mostly from removing the horrid bcm driver.

  Lots of normal staging driver cleanups and fixes all over the place,
  well over a thousand of them, the shortlog shows all the horrid
  details.

  The "contentious" thing here is the movement of the Android binder
  code out of staging into the "real" part of the kernel.  This is code
  that has been stable for a few years now and is working as-is in the
  tens of millions of devices with no issues.  Yes, the code is horrid,
  and the userspace api leaves a lot to be desired, but it's not going
  to change due to legacy issues that we have no control over.  Because
  so many devices and companies rely on this, and the code is stable,
  might as well promote it out of staging.

  This was all discussed at the Linux Plumbers conference, and everyone
  participating agreed that this was the best way forward.

  There is work happening to replace the binder code with something new
  that is happening right now, but I don't expect to see the results of
  that work for another year at the earliest.  If that ever happens, and
  Android switches over to it, I'll gladly remove this version.

  As for maintainers, I'll be glad to maintain this code, I've been
  doing it for the past few years with no problems.  I'll send a
  MAINTAINERS entry for it before 3.19-final is out, still need to talk
  to the Google developers about if they are willing to help with it or
  not, last I checked they were, which was good.

  All of these patches have been in linux-next for a while with no
  reported issues"

* tag 'staging-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1382 commits)
  Staging: slicoss: Fix long line issues in slicoss.c
  staging: rtl8712: remove unnecessary else after return
  staging: comedi: change some printk calls to pr_err
  staging: rtl8723au: hal: Removed the extra semicolon
  lustre: Deletion of unnecessary checks before three function calls
  staging: lustre: fix sparse warnings: static function declaration
  staging: lustre: fixed sparse warnings related to static declarations
  staging: unisys: remove duplicate header
  staging: unisys: remove unneeded structure
  staging: ft1000 : replace __attribute ((__packed__) with __packed
  drivers: staging: rtl8192e: Include "asm/unaligned.h" instead of "access_ok.h" in "rtl819x_BAProc.c"
  Drivers:staging:rtl8192e: Fixed checkpatch warning
  Drivers:staging:clocking-wizard: Added a newline
  staging: clocking-wizard: check for a valid clk_name pointer
  staging: rtl8723au: Hal_InitPGData() avoid unnecessary typecasts
  staging: rtl8723au: _DisableAnalog(): Avoid zero-init variables unnecessarily
  staging: rtl8723au: Remove unnecessary wrapper _ResetDigitalProcedure1()
  staging: rtl8723au: _ResetDigitalProcedure1_92C() reduce code obfuscation
  staging: rtl8723au: Remove unnecessary wrapper _DisableRFAFEAndResetBB()
  staging: rtl8723au: _DisableRFAFEAndResetBB8192C(): Reduce code obfuscation
  ...
2014-12-15 18:06:13 -08:00
Linus Torvalds e6b5be2be4 Driver core patches for 3.19-rc1
Here's the set of driver core patches for 3.19-rc1.
 
 They are dominated by the removal of the .owner field in platform
 drivers.  They touch a lot of files, but they are "simple" changes, just
 removing a line in a structure.
 
 Other than that, a few minor driver core and debugfs changes.  There are
 some ath9k patches coming in through this tree that have been acked by
 the wireless maintainers as they relied on the debugfs changes.
 
 Everything has been in linux-next for a while.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlSOD20ACgkQMUfUDdst+ylLPACg2QrW1oHhdTMT9WI8jihlHVRM
 53kAoLeteByQ3iVwWurwwseRPiWa8+MI
 =OVRS
 -----END PGP SIGNATURE-----

Merge tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core update from Greg KH:
 "Here's the set of driver core patches for 3.19-rc1.

  They are dominated by the removal of the .owner field in platform
  drivers.  They touch a lot of files, but they are "simple" changes,
  just removing a line in a structure.

  Other than that, a few minor driver core and debugfs changes.  There
  are some ath9k patches coming in through this tree that have been
  acked by the wireless maintainers as they relied on the debugfs
  changes.

  Everything has been in linux-next for a while"

* tag 'driver-core-3.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (324 commits)
  Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
  fs: debugfs: add forward declaration for struct device type
  firmware class: Deletion of an unnecessary check before the function call "vunmap"
  firmware loader: fix hung task warning dump
  devcoredump: provide a one-way disable function
  device: Add dev_<level>_once variants
  ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries
  ath: use seq_file api for ath9k debugfs files
  debugfs: add helper function to create device related seq_file
  drivers/base: cacheinfo: remove noisy error boot message
  Revert "core: platform: add warning if driver has no owner"
  drivers: base: support cpu cache information interface to userspace via sysfs
  drivers: base: add cpu_device_create to support per-cpu devices
  topology: replace custom attribute macros with standard DEVICE_ATTR*
  cpumask: factor out show_cpumap into separate helper function
  driver core: Fix unbalanced device reference in drivers_probe
  driver core: fix race with userland in device_add()
  sysfs/kernfs: make read requests on pre-alloc files use the buffer.
  sysfs/kernfs: allow attributes to request write buffer be pre-allocated.
  fs: sysfs: return EGBIG on write if offset is larger than file size
  ...
2014-12-14 16:10:09 -08:00
Rafael J. Wysocki e3d857e1ae Merge branch 'pm-runtime'
* pm-runtime: (25 commits)
  i2c-omap / PM: Drop CONFIG_PM_RUNTIME from i2c-omap.c
  dmaengine / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  drivers: sh / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  e1000e / igb / PM: Eliminate CONFIG_PM_RUNTIME
  MMC / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  MFD / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  misc / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  media / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  input / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  iio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  hsi / OMAP / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  i2c-hid / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  drm / exynos / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  gpio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  hwrandom / exynos / PM: Use CONFIG_PM in #ifdef
  block / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
  USB / PM: Drop CONFIG_PM_RUNTIME from the USB core
  PM: Merge the SET*_RUNTIME_PM_OPS() macros
  PM / Kconfig: Do not select PM directly from Kconfig files
  PCI / PM: Drop CONFIG_PM_RUNTIME from the PCI core
  ...
2014-12-08 20:00:44 +01:00
Rafael J. Wysocki 5996d93054 Merge branches 'acpi-video' and 'acpi-pmic'
* acpi-video:
  ACPI / video: Run _BCL before deciding registering backlight

* acpi-pmic:
  ACPI / PMIC: AXP288: support virtual GPIO in ACPI table
  ACPI / PMIC: support PMIC operation region for XPower AXP288
  ACPI / PMIC: support PMIC operation region for CrystalCove
  iio/axp288_adc: remove THIS_MODULE owner
  mfd/axp20x: avoid irq numbering collision
  iio: adc: Add module device table for autoloading
  iio: adc: Add support for axp288 adc
  mfd: axp20x: Extend axp20x to support axp288 pmic
2014-12-08 19:54:45 +01:00
Rafael J. Wysocki 6f0a13f25e iio / PM: Replace CONFIG_PM_RUNTIME with CONFIG_PM
After commit b2b49ccbdd (PM: Kconfig: Set PM_RUNTIME if PM_SLEEP is
selected) PM_RUNTIME is always set if PM is set, so #ifdef blocks
depending on CONFIG_PM_RUNTIME may now be changed to depend on
CONFIG_PM.

Replace CONFIG_PM_RUNTIME with CONFIG_PM everywhere under
drivers/iio/.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
2014-12-04 01:08:13 +01:00
Greg Kroah-Hartman deef2a118a Merge 3.18-rc7 into staging-work.
We want those staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-12-02 16:20:59 -08:00
Rafael J. Wysocki a26033a1f5 Merge branch 'ib-mfd-iio-3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into acpi-pmic
Pull MFD changes that the ACPI PMIC changes depend on from Lee Jones.
2014-11-25 02:18:58 +01:00
Jacob Pan 8019f69627 iio/axp288_adc: remove THIS_MODULE owner
This is no longer needed in that platform driver_register will do it.

Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-11-18 15:34:22 +00:00
Aaron Lu 29ec0a25c8 iio: adc: Add module device table for autoloading
Add the module device id table so that the driver can be automatically
loaded once the platform device is created.

Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-11-18 15:33:52 +00:00
Srinivas Pandruvada 9e8e228f2b iio: accel: bmc150: set low default thresholds
Set the threshold to low by default. With this thresholds any movement
on the device with this sensor will generate event.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-16 20:25:00 +00:00
Srinivas Pandruvada 1174124c45 iio: accel: bmc150: Fix iio_event_spec direction
Change event spec direction from
IIO_EV_DIR_RISING | IIO_EV_DIR_FALLING
to
IIO_EV_DIR_EITHER

Suggested-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-16 20:23:48 +00:00
Srinivas Pandruvada 8d5a978192 iio: accel: bmc150: Send x, y and z motion separately
This chip is capable to identify motion across x, y and z axes. So
send different events.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-16 20:22:39 +00:00
Srinivas Pandruvada aaeecd8044 iio: accel: bmc150: Error handling when mode set fails
When mode set fails due to some transient failures, it will atleast
reset the state of runtime usage count and also let the runtime
suspend retry from the driver framework.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-16 20:22:34 +00:00
Srinivas Pandruvada 6896ab3a8c iio: gyro: bmg160: Fix iio_event_spec direction
Change event spec direction from
IIO_EV_DIR_RISING | IIO_EV_DIR_FALLING
to
IIO_EV_DIR_EITHER

Suggested-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-16 20:19:25 +00:00
Srinivas Pandruvada cb80f6a36b iio: gyro: bmg160: Send x, y and z motion separately
This chip is capable to identify motion across x, y and z axes. So
send different events.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-16 20:19:22 +00:00
Srinivas Pandruvada 5af6b30788 iio: gyro: bmg160: Don't let interrupt mode to be open drain
Change the mode to push/pull type instead of open drain as some
platforms fails to drive the GPIO pin with open drain.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-16 20:19:20 +00:00
Srinivas Pandruvada 10bef28973 iio: gyro: bmg160: Error handling when mode set fails
When mode set fails due to some transient failures, it will atleast
reset the state of runtime usage count and also let the runtime
suspend retry from the driver framework.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-16 20:19:18 +00:00
Axel Lin fbbba1f89e iio: adc: men_z188_adc: Add terminating entry for men_z188_ids
The mcb_device_id table is supposed to be zero-terminated.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-15 16:12:04 +00:00
Daniel Baluta e90dea6aaf iio: accel: kxcjk-1013: Fix kxcjk10013_set_range
Currently, we get the new GSEL bits by OR-ing the old values
with the new ones. This only works first time when the old
values are 0.

Startup:
	* GSEL0 = 0, GSEL1 = 0

Set range to 4G: (GSEL0 = 1, GSEL1 = 0)
	* GSEL0 = 0 | 1 = 1
	* GSEL1 = 0 | 0 = 0
	* correct

Change range to 2G: (GSEL0 = 0, GSEL1 = 0)
	* GSEL0 = 1 | 0 = 1
	* GSEL1 = 0 | 0 = 0
	* wrong, GSEL0 should be 0

This has the nice effect that we can use the full scale range,
exported in in_accel_scale_available.

Fixes: a735e3d7f0 (iio: accel: kxcjk-1013: Set adjustable range)
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-15 16:11:28 +00:00
Greg Kroah-Hartman cc03f9bc26 Merge 3.18-rc4 into staging-next
We want the staging fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-10 12:24:26 +09:00
Greg Kroah-Hartman be61a0d784 First round of new drivers, features and cleanups for IIO in the 3.19 cycle.
New drivers / supported parts
 * rockchip - rk3066-tsadc variant
 * si7020 humidity and temperature sensor
 * mcp320x - add mcp3001, mcp3002, mcp3004, mcp3008, mcp3201, mcp3202
 * bmp280 pressure and temperature sensor
 * Qualcomm SPMI PMIC current ADC driver
 * Exynos_adc - support exynos7
 
 New features
 * vf610-adc - add temperature sensor support
 * Documentation of current attributes, scaled pressure, offset and
   scaled humidity, RGBC intensity gain factor and scale applied to
   differential voltage channels.
 * Bring iio_event_monitor up to date with newer modifiers.
 * Add of_xlate function to allow for complex channel mappings from the
   device tree.
 * Add -g parameter to generic_buffer example to allow for devices with
   directly fed (no trigger) buffers.
 * Move exynos driver over to syscon for PMU register access.
 
 Cleanups, fixes for new drivers
 * lis3l02dq drop an unneeded else.
 * st sensors - renam st_sensors to st_sensor_settings (for clarity)
 * st sensors - drop an unused parameter from all the probe utility
   functions.
 * vf610 better error handling and tidy up.
 * si7020 - cleanups following merge
 * as3935 - drop some unnecessary semicolons.
 * bmp280 - fix the pressure calculation.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJUWnZBAAoJEFSFNJnE9BaIZAAQAJpkot0ZAYPwtIkmtV1JqrLQ
 EZRkBN+cIf3q5zp/TnQTqfyhKbpHbJ9/Pnb0zHvn7Yh3WpZod2tyoC3xb8JAlX2h
 3tJRrA7plkdMjtwO/ryOxrVJYrm6rCeqKpciwMpDf4E/4fhU5CU++TpmWbhn04qB
 7PEZJN5dkmdnQYSIyNle11MYN+NpCAB4zqDvRJoJHpqZV6zAqygJy03H1PqXFS/S
 iNBL3jS8/PTbeUURUFOQTiqnJw5KuDke7OoXxUfvCpUwQfNLD8mOTrVrEoId1cM0
 Y2fmasfHteh83KP34/MOTwNA3EezM8iQOMzJnXtOpxpySPDrDSP68FDAJs15TUJm
 je8E1xxxdjOWuzgSd9djNm9qhlBkoYgbRwzc8wSAHMK7mCV7pP485WZk5E8rRX2z
 gMFgUmu4LkiZ2V9glGTAcHqnjhLNDTRCp1Nl/sMVgssFBBNjgR5+nZjUFqDR2QpD
 eo4ReIzev7Rzxe2lACRjnRrCnO+KKcjiDkyCdM3X2zdTddQRVrP5Uz+jgnvGAeMO
 hCYDHSOiMzV/r5emVfmNG9w8P9a6rZqu4KqcM/KjSzAfHFQTqmfr4Tkfn/hbeUjY
 h/zzB18EM4kUSxm3E6+CbFRWcfC7b/PLcUOwSitdujb9cYaX72gdesO2/P3jNFAK
 2bjoLRr5l4M4n/DeHae4
 =BDOo
 -----END PGP SIGNATURE-----

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

Jonathan writes:

First round of new drivers, features and cleanups for IIO in the 3.19 cycle.

New drivers / supported parts
* rockchip - rk3066-tsadc variant
* si7020 humidity and temperature sensor
* mcp320x - add mcp3001, mcp3002, mcp3004, mcp3008, mcp3201, mcp3202
* bmp280 pressure and temperature sensor
* Qualcomm SPMI PMIC current ADC driver
* Exynos_adc - support exynos7

New features
* vf610-adc - add temperature sensor support
* Documentation of current attributes, scaled pressure, offset and
  scaled humidity, RGBC intensity gain factor and scale applied to
  differential voltage channels.
* Bring iio_event_monitor up to date with newer modifiers.
* Add of_xlate function to allow for complex channel mappings from the
  device tree.
* Add -g parameter to generic_buffer example to allow for devices with
  directly fed (no trigger) buffers.
* Move exynos driver over to syscon for PMU register access.

Cleanups, fixes for new drivers
* lis3l02dq drop an unneeded else.
* st sensors - renam st_sensors to st_sensor_settings (for clarity)
* st sensors - drop an unused parameter from all the probe utility
  functions.
* vf610 better error handling and tidy up.
* si7020 - cleanups following merge
* as3935 - drop some unnecessary semicolons.
* bmp280 - fix the pressure calculation.
2014-11-05 11:42:48 -08:00
George McCollister f73cde600d iio: as3935: allocate correct iio_device size
Signed-off-by: George McCollister <george.mccollister@gmail.com>
Acked-by: Hartmut Knaack <knaack.h@gmx.de>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-05 18:33:46 +00:00
Daniel Baluta 25afffe16d io: accel: kxcjk-1013: Fix iio_event_spec direction
Because IIO_EV_DIR_* are not bitmasks but enums,
IIO_EV_DIR_RISING | IIO_EV_DIR_FALLING is not equal
with IIO_EV_DIR_EITHER.

This could lead to potential misformatted sysfs attributes
like:
	* in_accel_x_thresh_(null)_en
	* in_accel_x_thresh_(null)_period
	* in_accel_x_thresh_(null)_value

or even memory corruption.

Fixes: b4b491c083 (iio: accel: kxcjk-1013: Support threshold)
Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-05 18:33:46 +00:00
Dan Murphy 03045bcf31 iio: tsl4531: Fix compiler error when CONFIG_PM_OPS is not defined
Fix the compiler error when the CONFIG_PM_OPS flag is not set.

drivers/iio/light/tsl4531.c:235:8: error: ‘tsl4531_suspend’ undeclared here (not in a function)
drivers/iio/light/tsl4531.c:235:8: error: ‘tsl4531_resume’ undeclared here (not in a function)

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-05 18:33:45 +00:00
Robin van der Gracht c6b4cac2d9 iio: st_sensors: Fix buffer copy
Use byte_for_channel as iterator to properly initialize the buffer.

Signed-off-by: Robin van der Gracht <robin@protonic.nl>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: <Stable@vger.kernel.org>
2014-11-05 18:33:43 +00:00
Hartmut Knaack 81ebe850a0 iio:pressure:bmp280: fix pressure calculation
According to the datasheet and as defined in struct bmp280_comp_press, dig_p1 is
of type u16, while dig_p2 to dig_p9 are of type s16. In
bmp280_read_compensation_press(), values read from the device were treated as
the wrong type.
In bmp280_read_press() the fractional part of the measured pressure is
calculated wrong. A better way is to use *val for the raw pressure and *val2 for
the quotient and let the core do the proper conversion using IIO_VAL_FRACTIONAL.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Acked-by: Vlad Dogaru <vlad.dogaru@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-05 15:58:35 +00:00
Abhilash Kesavan c1b501564c iio: adc: exynos_adc: Add support for exynos7
The ADC on exynos7 is quite similar to ADCv2. The differences are as
follows:
	- exynos7-adc has 8 input channels (as against 10 in ADCv2).
	- exynos7 does not include an ADC PHY control register.
	- Some ADC_CON2 register bits being used in ADCv2 are listed as
	  reserved in exynos7-adc. This results in a different init_hw
	  function for exynos7.

Signed-off-by: Abhilash Kesavan <a.kesavan@samsung.com>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-05 15:38:25 +00:00
Naveen Krishna Chatradhi fafb37cfae iio: exyno-adc: use syscon for PMU register access
This patch updates the IIO based ADC driver to use syscon and regmap
APIs to access and use PMU registers instead of remapping the PMU
registers in the driver.

Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
To: linux-iio@vger.kernel.org
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-05 15:30:09 +00:00
George McCollister 455f0049e0 iio: as3935: Remove unnecessary semicolons
Signed-off-by: George McCollister <george.mccollister@gmail.com>
Acked-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-11-05 13:47:42 +00:00
Greg Kroah-Hartman a8a93c6f99 Merge branch 'platform/remove_owner' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux into driver-core-next
Remove all .owner fields from platform drivers
2014-11-03 19:53:56 -08:00
Ivan T. Ivanov ce0694841e iio: iadc: Qualcomm SPMI PMIC current ADC driver
The current ADC is peripheral of Qualcomm SPMI PMIC chips. It has
16 bits resolution and register space inside PMIC accessible across
SPMI bus.

The driver registers itself through IIO interface.

Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-25 21:03:22 +01:00
Hartmut Knaack e0922e5e3c iio:humidity:si7020: fix pointer to i2c client
In si7020_read_raw() the pointer to the i2c client was obtained as second level
pointer, although a simple pointer is appropriate.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-25 20:55:56 +01:00
Hartmut Knaack 345b48307d iio:humidity:si7020: cleanup read_raw and probe
When reading temperature or humidity values, a shift of two bits to the right
needs to be applied, and only for the humidity channel a mask of the lower
12 bits needs to be applied. This reduces code repetition.
During probe, i2c_set_clientdata() was used, although its counterpart was not,
so drop it.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-25 20:55:56 +01:00
Ivan T. Ivanov acd8256723 iio: inkern: Add of_xlate function to struct iio_info
When #iio-cells is greater than '0', the driver could provide
a custom of_xlate function that reads the *args* and returns
the appropriate index in registered IIO channels array.

Add simple translation function, suitable for the most 1:1
mapped channels in IIO chips, and use it when driver did not
provide custom implementation.

Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-25 11:03:40 +01:00
Vlad Dogaru 46ee98a206 bmp280: use correct routine for division
The proper way to divide two signed 64-bit values is to use div64_s64.

Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-25 10:44:54 +01:00
Greg Kroah-Hartman 7e74783a9d First round of IIO fixes for the 3.18 cycle.
* ad5933 - fix a null pointer dereference due to an old change that prevents
   different channels being registered for the buffer and used for sysfs
   interfaces.
 * ad5933 - Drop a bonus _raw from attribute names.
 * st-sensors - Makes sure the correct number of elements are copied when
   filling a local buffer copy.
 * mxs-lradc - Disable clocks in a failure path during probe so they aren't
   left running.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJUPWESAAoJEFSFNJnE9BaI/TAP/2EZp7NR+k3CRZVRLuXxeSrD
 voMS3zNtYMC2E56W0l89gOZdR4rCXzJlhUdRHcGkl7qw1r6stjEBMKIJmd3NVEc4
 dOZ4tCsb/kTmF+66QitL73ioZqoLMrpaGubf8l10t8V3wSsOqnf3wYUftGcdl4NK
 uXAIDmUYgAm4zUUZCKE95o2Npkotm5ftRQqgdChuK7vGVJikN8blzRDokGcZTAh6
 CR04tktxhkg/E+Nq67h9zXPnMOTbw4onNGKD3cztGKZ2bBN+4W/ywEnUrTOu35Eg
 zKMkwYnlBKMTOkTwzml4izHlZw/yFXTXHSPwm1a2fxcVuLuGUBuxX5Pa+kCpLOJo
 2aewUhnwlXhvCrDcFq/rTeqUsOV8mfZxuxqVOQ/utbyUgX5LtHCgQ8aPf0GBbty7
 l8SzxTkCXyogUc4PbNh8DqqksKGkMn/AtC3MfWeEvAYdCZpMXROb4RTAAMVvqytl
 34DMKVaRUy8eiUfcJ+8cH9LvH3Gri7OIbXeLD7iatZ7anaXlQB/EzjTc8yw7+t+C
 EBa7s90XhbRCkE5cadZm76deSscyGgX1cCQS6eStzn1AF0LY/Cj1KMkkJjtFFN31
 Cc7SOAa7rY0BwotwVRV5id4tihyxU9b/Dxi1StoioP4Rjp0B3Y9WsN+EuvPGjFYo
 4JrfV0JYhHktQF+rEmM0
 =TYUO
 -----END PGP SIGNATURE-----

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

Jonathan writes:

First round of IIO fixes for the 3.18 cycle.

* ad5933 - fix a null pointer dereference due to an old change that prevents
  different channels being registered for the buffer and used for sysfs
  interfaces.
* ad5933 - Drop a bonus _raw from attribute names.
* st-sensors - Makes sure the correct number of elements are copied when
  filling a local buffer copy.
* mxs-lradc - Disable clocks in a failure path during probe so they aren't
  left running.
2014-10-25 10:09:39 +08:00
Vlad Dogaru d5c94568cc iio: add bmp280 pressure and temperature driver
Minimal implementation, can read temperature and data using direct mode.

Datasheet available at
<http://ae-bst.resource.bosch.com/media/products/dokumente/bmp280/BST-BMP280-DS001-09.pdf>

Signed-off-by: Vlad Dogaru <vlad.dogaru@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-22 20:28:27 +01:00
Fabio Estevam 8552befa30 iio: adc: vf610: Propagate the real error when platform_get_irq() fails
There is no need to pass a 'fake' return value when platform_get_irq() fails.

Propagate the real error instead.

While at it, only consider negative numbers returned by platform_get_irq()
as error.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-22 20:28:11 +01:00
Wolfram Sang 770ca15c03 iio: adc: drop owner assignment from platform_drivers
A platform_driver does not need to set an owner, it will be populated by the
driver core.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-10-20 16:20:39 +02:00
Søren Andersen b12206e917 iio: adc: mcp320x. Add support for more ADCs
Signed-off-by: Soeren Andersen <san at rosetechnology.dk>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-09 20:14:03 +01:00
Jacob Pan de89bd7f21 iio: adc: Add support for axp288 adc
Platform driver for X-Powers AXP288 ADC, which is a sub-device of the
customized AXP288 PMIC for Intel Baytrail-CR platforms. GPADC device
enumerates as one of the MFD cell devices. It uses IIO infrastructure
to communicate with userspace and consumer drivers.

Usages of ADC channels include battery charging and thermal sensors.

Based on initial work by:
Ramakrishna Pallala <ramakrishna.pallala@intel.com>

Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2014-10-07 09:30:08 +01:00
David Barksdale 064a74637c IIO: add si7020 driver
This patch adds support to the Industrial IO subsystem
for the Silicon Labs Si7013/20/21 Relative Humidity and
Temperature Sensors.

Website: http://www.silabs.com/products/sensors/humidity-sensors/Pages/si7013-20-21.aspx

These are i2c devices which measure relative humidity
and temperature and all use the same protocol. The
Si7013 has an additional input with programmable
linearization which is not supported because that's
complicated and I didn't need it.

Signed-off-by: David Barksdale <dbarksdale@uplogix.com>

--
Changes since v1:
* Renamed to si7020 and replaced Si701x/2x with Si7013/20/21.
* Removed unneeded mutex.
* Pre-computed floating-point constant expressions.
* Removed address_list and I2C_CLASS_HWMON.

Changes since v2:
* Return correct raw sensor values.
* Rename dev variable to indio_dev.
* Issue a software reset command during probe.
* Un-broke string literal.

Changes since v3:
* enum changed to #define
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-04 12:43:30 +01:00
Fabio Estevam ef0d545493 iio: adc: vf610: SIMPLE_DEV_PM_OPS can fit on a single line
No need to call the SIMPLE_DEV_PM_OPS() macro in several lines.

It can fit into the 80-column range.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-04 12:31:05 +01:00
Fabio Estevam 9da64c25ff iio: adc: vf610: Disable the regulator on error
If clk_prepare_enable() fails we should disable the regulator that was
previously enabled.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-04 12:30:26 +01:00
Fabio Estevam 2e3d6675dc iio: adc: vf610: Return the error code directly
There is no need to pass the error clock code to the variable 'ret'.

Just return the error directly.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-04 12:28:02 +01:00
Robin van der Gracht 4250c90b30 iio: st_sensors: Fix buffer copy
Use byte_for_channel as iterator to properly initialize the buffer.

Signed-off-by: Robin van der Gracht <robin@protonic.nl>
Acked-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: <Stable@vger.kernel.org>
2014-10-04 12:10:57 +01:00
Denis CIOCCA 7be178bb48 iio:common: Set the device pointer into ST common sensors library
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-04 11:26:21 +01:00
Denis CIOCCA a1dcf42927 iio:pressure: Changed pressure data variable name to press_data
This patch fix pressure data variable name. Usually pdata name
it is used for platform data.

Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-04 11:26:09 +01:00
Denis CIOCCA 0baa3fc1b6 iio:pressure: Removed unnecessary parameter on common_probe function
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-04 11:25:38 +01:00
Denis CIOCCA 2109eb4c0c iio:magnetometer: Removed unnecessary parameter on common_probe function
Signed-off-by: Denis Ciocca <denis.ciocca@st.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-10-04 11:25:19 +01:00