Commit Graph

858 Commits

Author SHA1 Message Date
Chanwoo Choi
adb4e3f4cf iio: adc: exynos_adc: Control special clock of ADC to support Exynos3250 ADC
This patch control special clock for ADC in Exynos series's FSYS block.
If special clock of ADC is registerd on clock list of common clk framework,
Exynos ADC drvier have to control this clock.

Exynos3250/Exynos4/Exynos5 has 'adc' clock as following:
- 'adc' clock: bus clock for ADC

Exynos3250 has additional 'sclk_adc' clock as following:
- 'sclk_adc' clock: special clock for ADC which provide clock to internal ADC

Exynos 4210/4212/4412 and Exynos5250/5420 has not included 'sclk_adc' clock
in FSYS_BLK. But, Exynos3250 based on Cortex-A7 has only included 'sclk_adc'
clock in FSYS_BLK.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-23 21:58:26 +01:00
Chanwoo Choi
e49d99e0ec iio: adc: exynos_adc: Add exynos_adc_data structure to improve readability
This patchset add 'exynos_adc_data' structure which includes some functions
to control ADC operation and specific data according to ADC version (v1 or v2).

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-23 21:55:47 +01:00
Peter Meerwald
f4e2f94d8c iio:kxcjk-1013: Fix endianness in scan_type
driver uses i2c_smbus_read_word_data() to the data in the trigger handler and hence
already does endianness conversion; the I2C chip has data in little endian, but the
value is provides in CPU endianness

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-20 17:52:15 +01:00
Srinivas Pandruvada
c1288b8338 iio: accel: kxcjk-1013: Increment ref counter for indio_dev->trig
Assigning indio_dev->trig is not a good idea, as this can result in
wrong reference count for trigger device. If assigned, it is better to
increment reference counter by calling iio_trigger_get.
Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion
with Jonathan.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-20 16:37:52 +01:00
Srinivas Pandruvada
59bfeaba3b iio: accel: kxcjk-1013: Use try_reenable to ack intr
This chip needs explicit interrupt ack, introducing try_reenable
callback. Also removed separate function to ack interrupt as this
doesn't add any value.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-20 16:24:22 +01:00
Srinivas Pandruvada
f0ca974920 iio: accel: kxcjk-1013: Fix setting frequency
Fix issue with setting of 12.5 and 6.25 HZ. The match of val2 fails.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-20 16:18:58 +01:00
Reyad Attiyat
abea9c62c3 iio: hid-sensor-magn-3d: Add support for rotation from north
Add the HID usage attribute ID's and IIO channel info for rotation
from north support.

Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-20 13:39:35 +01:00
Reyad Attiyat
2a96540a5c iio: hid-sensor-magn-3d: Scan for usage attributes before setting up iio channels
Scan for and count the HID usage attributes supported by the driver.
This allows for the driver to only setup the IIO channels for the
sensor usages present in the HID USB reports.

Changes from v5
-Fixed kernel panic from invalid pointer dereference
-Fixed variable assignment style

Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-20 13:37:52 +01:00
Reyad Attiyat
11b8ddab81 iio: types: Added support for rotation from north usage attributes
Added the rotation from north usage attributes to the iio modifier enum and to the iio modifier names array.

Signed-off-by: Reyad Attiyat <reyad.attiyat@gmail.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-20 13:34:45 +01:00
Peter Meerwald
3008d082f2 iio:adc:ad799x: Allow writing of event config
Allows explicity enabling of events

Previously, events were always reported as enabled, but actually only
implicitly enabled when updating the buffer scan mode

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-13 21:59:40 +01:00
Peter Meerwald
1d15330a39 iio:adc:ad799x: Return more meaningful event enabled state
only report an event as enabled if it actually is enabled

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-13 21:58:59 +01:00
Peter Meerwald
8235841b95 iio:adc:ad799x: Set conversion channels and rename ad7997_8_update_scan_mode()
rename since function is used by all chips with ALERT pin, not just ad7997/8

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-13 21:57:56 +01:00
Peter Meerwald
0f7ddcc1bf iio:adc:ad799x: Write default config on probe and reset alert status on probe
writing ALERT_EN and BUSY_ALERT to the chip config register clears
pending alerts, BUSY_ALERT is cleared when reading back the register

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-13 21:57:35 +01:00
Peter Meerwald
89ca79afe5 iio:adc:ad799x: Add helper function to read/write config register
16-bit on ad7997/ad7998, 8-bit elsewhere

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-13 21:57:09 +01:00
Peter Meerwald
ef0bf6f82d iio:adc:ad799x: Make chan_spec const in ad799x_chip_config struct
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-13 21:56:49 +01:00
Peter Meerwald
91556c6939 iio:adc:ad799x: Only expose event interface when IRQ is available
an IRQ is necessary to handle the ALERT condition; without
IRQ, the IIO event interface serves no purpose

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-13 21:56:14 +01:00
Peter Meerwald
e1c6e2a217 iio:adc:ad799x: Use BIT() and GENMASK()
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-13 21:55:42 +01:00
Peter Meerwald
bd3bd4328a iio:adc:ad799x: Save some lines in ad7997_8_update_scan_mode() exit handling
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-13 21:48:43 +01:00
Peter Meerwald
541544712e iio:adc:ad799x: Drop I2C access helper functions
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-13 21:46:54 +01:00
Greg Kroah-Hartman
db7c17ecbf 3rd round of IIO new drivers, cleanups and functionality for the 3.17 cycle.
New drivers
 * isl29125 digital color light sensor driver
 * TAOS/AMS tcs3414 digital color sensor
 
 Staging graduation
 * ad7291 ADC driver.
 
 New functionality
 * st_sensors - device tree support and bindings
 * mma8452 - device tree support
 
 Cleanups
 * Drop redundant variables in a number of drivers.
 * Reorder a structure definition to ealy wiht a warning about static
   not being at the beginning in the hid-sensors driver.
 * Switch a few more drivers away from using explicit sampling_frequency
   attribute to providing this through the core.
 * Make hid_sensor_get_reporting_interval static as only used within a single
   file.
 * Drop a redundant check for negative values in an unsigned variable from
   ad9832
 * Drop some duplicate case labels in the event monitor example code.
 * Use devm_ioremap_resource to simplify error handling.
 * Use devm_kzalloc within the blackfin timer driver to simplify error
   handling and removal.
 * A number of cleanups of the ad7291 from Hartmut Knaack in response
   to a patch moving it out of staging.
 * Core support for the period info element about events.  It has been
   in the abi for a while, but not added until now to the newer handling
   of information related to events.
 * Add HAS_IOMEM dependency to mxs_lradc to avoid build issues when testing
   enabled.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJTwtZlAAoJEFSFNJnE9BaIwk0P/AjNATwzEb+ODIeYdQXbliKJ
 ntQlUXhGa1ronrSD/iDsgW7JUbSDcVDKLfZFtmO0oqdJ8Mofb03jUJqRgivpIlq9
 8cbgNZd5Ef4LARHjEsfySAEgZB6x1nnmJkspwcvdAiGqXvooe9HYQuWUkX/e9CYK
 QSb9BpisaPqvuDV3OfGlzshJIm6ntO9O842xrZdvJDAwi4IAyfabGslflA/AGWU1
 ty3duPJvJzNHfq7iJiLhbGcc4yOmtc16lPKdVcpGC8BPdjdQdrw9axFrE0aoCZwF
 zYTUeQnoZGt9ervGaYRdi6rmcoyu/waRZvJUwIbXpHE4JNgB4waU/4iGqTqfQQnd
 tV/0RRKcke4QgQ0k9lZZCHUgedW1LSFpXWFWGXezlHyCieCicrx4WVkH4wEFheC1
 6fb4OeBQY6nwkAdMOwzzHYEkieeYgKA269uKEeyJ4rMhyS36hoQNpSzMqz31c43w
 Ct0iaZdlFIEjoXkx8OumGojJ67oOGJECzfuXSn3xkNFAT2enyy/LzTyGvxGxwaMq
 r3accTdYqd00Z1Jje2MV1KRIcrn9pDJS9obFdesFQj9aV00FSSD8ZyckeHrgLxqV
 zQN567YGpyr2/q3WEW3ecJksnre1tYSwagRmfGheJIcYV/n4qiXO0R/VbSZbnFIz
 68w07E9URklroJn/3wek
 =n+vY
 -----END PGP SIGNATURE-----

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

Jonathan writes:

3rd round of IIO new drivers, cleanups and functionality for the 3.17 cycle.

New drivers
* isl29125 digital color light sensor driver
* TAOS/AMS tcs3414 digital color sensor

Staging graduation
* ad7291 ADC driver.

New functionality
* st_sensors - device tree support and bindings
* mma8452 - device tree support

Cleanups
* Drop redundant variables in a number of drivers.
* Reorder a structure definition to ealy wiht a warning about static
  not being at the beginning in the hid-sensors driver.
* Switch a few more drivers away from using explicit sampling_frequency
  attribute to providing this through the core.
* Make hid_sensor_get_reporting_interval static as only used within a single
  file.
* Drop a redundant check for negative values in an unsigned variable from
  ad9832
* Drop some duplicate case labels in the event monitor example code.
* Use devm_ioremap_resource to simplify error handling.
* Use devm_kzalloc within the blackfin timer driver to simplify error
  handling and removal.
* A number of cleanups of the ad7291 from Hartmut Knaack in response
  to a patch moving it out of staging.
* Core support for the period info element about events.  It has been
  in the abi for a while, but not added until now to the newer handling
  of information related to events.
* Add HAS_IOMEM dependency to mxs_lradc to avoid build issues when testing
  enabled.
2014-07-13 12:31:47 -07:00
Martin Fuzzey
a3fb96a8c0 iio: mma8452: add DT support
Allow the mma8452 to be described in the device tree.

Since no device specific binding attributes exist the trivial
I2C binding is sufficient to describe the compatible string.

Signed-off-by: Martin Fuzzey <mfuzzey@parkeon.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-13 10:14:44 +01:00
Srinivas Pandruvada
77a533c73f iio: core : events ABI for specifying period
The iio sysfs ABI defines a way to specify period for roc and thresholds.
What:		/sys/.../events/in_accel_x_thresh_rising_period
What:		/sys/.../events/in_accel_x_thresh_falling_period
what:		/sys/.../events/in_accel_x_roc_rising_period
What:		/sys/.../events/in_accel_x_roc_falling_period

But there is no way to add period with the current event info enum.

Added IIO_EV_INFO_PERIOD and corresponding string.

Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-11 21:20:59 +01:00
Linus Walleij
2d7768a872 iio: st_sensors: add devicetree probing support
The I2C devices that make up the STMicroelectronics MEMS sensors
may be sneakily enabled by cleverly giving the device node the same
name as a string match from the platform device ID table. However
the right method is to use the compatible string.

On detection, the ST sensors use the ID string to probe and
instatiate the right sensor driver, so pass the kernel-internal ID
string in the .data field of the OF match table, and set the I2C
client name to this name when a compatible match is used.

This avoids having misc Linux-specific strings floating around in
the device tree.

Cc: Lee Jones <lee.jones@linaro.org>
Cc: Denis CIOCCA <denis.ciocca@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-11 21:09:49 +01:00
Lars-Peter Clausen
3b1cae7c2c staging:iio:ad7291: Move out of staging
The ad7291 driver is in a reasonable shape. It does not use non-standard API/ABI
and there are no major style issues with the driver. So this patch moves it out
of staging.

There is one small warning from checkpatch which is also fixed in this patch.
The patch also sorts the #include directives in alphabetical order.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-08 21:17:30 +01:00
Greg Kroah-Hartman
c1a567d31b Merge 3.16-rc4 into staging-next
We want the staging tree fixes in here as well.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-07 17:59:07 -07:00
Daniel Baluta
fb123a6b6b iio: hid-sensors: make hid_sensor_get_reporting_interval static
This fixes the following sparse warning:

  CHECK   drivers/iio/common/hid-sensors/hid-sensor-attributes.c
drivers/iio/common/hid-sensors/hid-sensor-attributes.c:346:5: warning:
symbol 'hid_sensor_get_reporting_interval' was not declared. Should it be static?

Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-07 13:29:49 +01:00
Linus Walleij
3ce85cc4fb iio: st_sensors: get platform data from device tree
Currently the STMicroelectronics sensors only support one single
platform data item: configuration of the DRDY (data ready) pin
for a particular design. Augment the core to prioritize and take
this information from the device tree if the parent device has an
assigned device node, else fall back to passed in platform data
(usually the default data).

Cc: Lee Jones <lee.jones@linaro.org>
Cc: Denis CIOCCA <denis.ciocca@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-07 13:11:28 +01:00
Jonathan Cameron
e4f9593901 iio: imu: adis16480 switch sampling frequency attr to core support
By using the info_mask_shared_by_all element of the channel spec, access
to the sampling frequency becomes available to in kernel users of the
driver.  It also shortens and simplifies the code.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2014-07-07 10:00:59 +01:00
Jonathan Cameron
a07a97d049 iio: imu: adis16400 switch sampling frequency attr to core support.
By using the info_mask_shared_by_all element of the channel spec, access
to the sampling frequency becomes available to in kernel users of the
driver.  It also shortens and simplifies the code.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2014-07-07 09:49:43 +01:00
Jonathan Cameron
82695ef549 iio: adis: Switch sampling frequency attr to core support.
By using the info_mask_shared_by_all element of the channel spec, acce
to the sampling frequency becomes available to in kernel users of the
driver.  It also shortens and simplifies the code.

This particular conversion was made more complicated by the shared library
and the fact that a number of the drivers do not actually have support for
setting or reading the sampling frequency.  The hardware, in those cases
investigated supports it. It's just never been implemented.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
2014-07-07 09:44:17 +01:00
Jonathan Cameron
95bb8918f9 iio: gyro: itg3200 switch sampling frequency attr to core support.
By using the info_mask_shared_by_all element of the channel spec, access
to the sampling frequency becomes available to in kernel users of the
driver.  It also shortens and simplifies the code a little.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
Cc: Manuel Stahl <manuel.stahl@iis.fraunhofer.de>
Cc: Thorsten Nowak <thorsten.nowak@iis.fraunhofer.de>
Cc: Christian Strobel <christian.strobel@iis.fraunhofer.de>
2014-07-07 09:41:32 +01:00
Jonathan Cameron
2d239c9e92 iio:st sensors: remove custom sampling frequence attribute in favour of core support.
This allows in kernel client drivers to access this

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: Denis Ciocca <denis.ciocca@st.com>
Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
2014-07-07 09:39:57 +01:00
Peter Meerwald
a244e7b57f iio: Add driver for AMS/TAOS tcs3414 digital color sensor
16-bit digital color sensor with red, green, blue and clear channel

datasheet: http://ams.com/eng/content/download/250258/975997/TCS3414_Datasheet_EN_v1.pdf

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-07 09:34:36 +01:00
Peter Meerwald
6c25539cbc iio: Add Intersil isl29125 digital color light sensor driver
datasheet: http://www.intersil.com/content/dam/Intersil/documents/isl2/isl29125.pdf

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-07 09:06:50 +01:00
Sachin Kamat
a034234277 iio: hid-sensors: Fix compilation warning
Move the 'static' keyword to beginning of definition to silence the
following compilation warning:
drivers/iio/common/hid-sensors/hid-sensor-attributes.c:34:1: warning: ‘static’ is not at beginning of declaration [-Wold-style-declaration]

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-05 11:21:09 +01:00
Sachin Kamat
fc96d25ad0 iio: xilinx-xadc: Remove unused variable
'offset’ is not used in the function. Remove it.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Cc: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-03 22:00:40 +01:00
Sachin Kamat
10215d8689 iio: ad5686: Remove redundant variable
‘regdone’ is not used in the function. Remove it.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Cc: Michael Hennerich <hennerich@blackfin.uclinux.org>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-03 21:59:56 +01:00
Sachin Kamat
0d3a9b2dad iio: ad5504: Remove redundant variable
By re-arranging the code, 'ret' can be removed from this
function.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-03 21:58:26 +01:00
Sachin Kamat
15255c6b4d iio: ad5624r_spi: Remove redundant variable
By re-arranging the code, 'ret' can be removed from this
function.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-03 21:56:35 +01:00
Sachin Kamat
a9fbbbd7d2 iio: adis16400: Remove unused variable
'rx' is not used in this function. Remove it.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-07-03 21:47:01 +01:00
Greg Kroah-Hartman
3dc50c1af3 Second round of new drivers and cleanups for IIO in the 3.17 cycle.
New drivers
 * mcp4902, mcp4912 and mcp4922 SPI DAC driver.
 * max1027, max1029 and max1031 SPI ADC driver.
 
 Cleanups
 * cm32181 - use devm APIs to simplify error paths.
 * ak8975 - use devm APIs to simplify error paths.
 * ad9850 - drop some unused defines and an unnecessary goto.
 * hmc5843 - add missing devices to the device id table and the documentation.
 * ad9832 - small formatting cleanups.
 * sca3000 - hide direct use of the stufftoread element by adding a
     data_available function.  This is a precursor for the addition of buffer
     watermarks to the subsystem but stands as a good cleanup on its own.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJTsCi1AAoJEFSFNJnE9BaIncoP/i6vgt+l+jM7qCvD8xCa4Kto
 hwwXrtYEmAekAYcdcKesR/xBMw6Y1njjtPvnuOOXkxNcqLLhDUvvCGPvC2hsqNs1
 sZfq/KdzmgLNiy6FlprnVYAtoWL8yWiSdPa/aG7FAD/swOnrjQ+Dch/Kw0ha82dF
 CaoTLzLwwBr4V0m8XY4c6Uvgb+ywjYGsVspu69WKlMxnP9gGsb/e9QnqZteGwwxa
 D3ooy3dXdKzl3lc5y9HXqVDwFaennBxSiWtEHJZWUWt9QTeomeoSQuEa/6sJU9Fd
 MjOHiFuiiHF+fSCzvOKKudi3PFW//ztJjQQHlFbf7AojUH6uAnKuHzQ6mCM7dkH2
 h3pCidScC+nnPvJ4rF9uKHtj7kbch2vS0eT38BK04pCUiEOhv/55xIzFxLO58xFf
 d1a7Jlfyx498x0AVffPe+R/4a4/2cJWThB1lpPPKjq0Mm9Q5hdvHLTwloGCWfmVT
 k6y43xw0fC1DoNrXRe5aH8j7ih8CF1RaZowyWeEplIWDTrLixFqiZsVB6LwFjNxN
 ggTLK2rHfGlKEumqq7RlZGPSpkBs5a86KsuREEd169QCZYt2KCu5sZhW7+XKYPqa
 yIuGBfYXYAaaz71kK621jxKUhB3V61blUOX2/R1Cu4Mg02i441FibR04LquVReFy
 YNIGv95sgAsqXnfXHqfV
 =3Fhy
 -----END PGP SIGNATURE-----

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

Jonathan writes:

Second round of new drivers and cleanups for IIO in the 3.17 cycle.

New drivers
* mcp4902, mcp4912 and mcp4922 SPI DAC driver.
* max1027, max1029 and max1031 SPI ADC driver.

Cleanups
* cm32181 - use devm APIs to simplify error paths.
* ak8975 - use devm APIs to simplify error paths.
* ad9850 - drop some unused defines and an unnecessary goto.
* hmc5843 - add missing devices to the device id table and the documentation.
* ad9832 - small formatting cleanups.
* sca3000 - hide direct use of the stufftoread element by adding a
    data_available function.  This is a precursor for the addition of buffer
    watermarks to the subsystem but stands as a good cleanup on its own.
2014-06-29 09:49:28 -07:00
Josselin Costanzi
9dd4694daf iio: staging: sca3000: hide stufftoread logic
Change sca3000_ring implementation so that it exports a data_available
function to iio.

Signed-off-by: Josselin Costanzi <josselin.costanzi@mobile-devices.fr>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-06-29 14:43:38 +01:00
Beomho Seo
a845a3aab8 iio: magnetometer: ak8975: Use devm_* APIs
This patch use devm_* APIs make driver simpler.

Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-06-29 12:03:45 +01:00
Philippe Reynes
fc167f6248 iio: add support of the max1027
This driver add partial support of the
maxim 1027/1029/1031. Differential mode is not
supported.

It was tested on armadeus apf27 board.

Signed-off-by: Philippe Reynes <tremyfr@yahoo.fr>
Reviewed-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-06-28 09:54:14 +01:00
Greg Kroah-Hartman
ef7994fa2a Merge 3.16-rc2 into staging-next
We want the staging fixes here as well.
2014-06-22 12:33:51 -04:00
Beomho Seo
b97855354a iio: light: cm32181: Use devm_* APIs
This patch changes API from iio_device_register() to devm_* API.
Using API make code simpler.

Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-06-21 12:40:37 +01:00
Adam Thomson
a2c12493ed iio: of_iio_channel_get_by_name() returns non-null pointers for error legs
Currently in the inkern.c code for IIO framework, the function
of_iio_channel_get_by_name() will return a non-NULL pointer when
it cannot find a channel using of_iio_channel_get() and when it
tries to search for 'io-channel-ranges' property and fails. This
is incorrect behaviour as the function which calls this expects
a NULL pointer for failure. This patch rectifies the issue.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Cc: Stable@vger.kernel.org
2014-06-21 12:31:38 +01:00
Michael Welling
1b791fadf3 iio: dac: mcp4902/mcp4912/mcp4922 dac driver
This patch provides an iio device driver for the Microchip
MCP49x2 series DACs.

Signed-off-by: Michael Welling <mwelling@ieee.org>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-06-21 11:50:33 +01:00
Peter Meerwald
361d795002 iio:adc:ad799x: Fix reading and writing of event values, apply shift
last two bits of ADC and limit values are zero and should not be reported
(ad7993, ad7997); compare with read_raw()

event values are 10 (ad7993, ad7997) or 12 bit max., check the range on write

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Cc: Stable@vger.kernel.org
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2014-06-21 10:43:13 +01:00
Greg Kroah-Hartman
f641f66784 First round of new drivers, cleanups and functionality for the 3.17 cycle.
New drivers
 * t5403 barometric pressure sensor
 * kxcjk1013 accelerometer (with a locking followup fix).
 * ak09911 digital compass
 
 Documentation
 * ABI docs for proximity added (interface has been there a long time but
   somehow snuck through without being documented)
 * Move iio-trig-sysfs documentation out of staging (got left behind when
   the driver moved some time ago).
 
 Cleanups
  * drop the timestamp argument from iio_trigger_poll(_chained) as
    nothing has been done with it for some time.
  * ad799x kerneldoc for ad799x_chip brought up to date.
  * replace a number of reimplementations of the GENMASK macro and
    use the BIT macro to cleanup a few locations.
  * bring the iio_event_monitor example program up to date with new
    device types.
  * fix some incorrect function prototypes in iio_utils.h example code.
  * INDIO_RING_TRIGGERED to INDIO_BUFFER_TRIGGERED fix in docs. This
    got left behind after we renamed it a long time back.
  * fix error handling in the generic_buffer example program.
  * small tidy ups in the iio-trig-periodic-rtc driver.
  * Allow reseting iio-trig-periodic-rtc frequency to 0 (default) after
    it has changed.
  * Trivial tidy ups in coding style in iio_simply_dummy
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iQIcBAABAgAGBQJToc7KAAoJEFSFNJnE9BaIs2wP/2dHUUs2SWtCBQZACBUVzFlt
 UXiyeUtk0W6KfcbqgWt7zRD4KjGnvoN9W6Tp2wT8YAcsDYP+nxroIiZcz3Zi+cMl
 9T1lsdZ2UAvz43OvGOem/FUx6eN6E4l6ZTs8TpT3OUGTWgsaxbrJ6E6jlJYKSBZQ
 LZOmqwF/+piTiJCw7mAT7AxbMJIU66Jt5jEStvrQC1V4gdaiBgpUnRDwyEycy2OY
 9qs9V1L5HNHdMew3hCB98rK5lW2Ty+F0GObZa9i16yswNqKIGB4iylZNpWA8V0TA
 LLXIwC6AxtjoKoIkiHzGBVUuSR7MLsIa+9IN+ZaHlOUdL1R95u8lIZopjZrk798W
 3nYQ1j9++Mz1eXjzolsvySPq+eBek7Sgc+8Wn3JgtkyZmXnS8ivmdyX+UWc/pC8K
 MQ1H3uJJiA6GyA1zvlWviYciIcWrZQQOYLPylhlVFqboDX86ymsewUZYSyN0ZzG5
 CeaDafB2UQiY7eHWNWjZsTkhlOTRTPGh29MoYtNG+Mo7FxYxu5IrjqUZJNar0R7z
 5vsMj8lRYz3JQLdEBTddZeZnCIXDTrlbcpDy9ERCBqWqQEBtb0ihgGz68RkfkpFm
 AQ975J5cFrJtDDmRsQlMPJEjV0tQ5bZkwrRMqn3eYDwY3qc6mTyHs6w4WQtwUoX2
 GYs2axH3ifj4lZCMQN5w
 =S0CY
 -----END PGP SIGNATURE-----

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

Jonathan writes:

First round of new drivers, cleanups and functionality for the 3.17 cycle.

New drivers
* t5403 barometric pressure sensor
* kxcjk1013 accelerometer (with a locking followup fix).
* ak09911 digital compass

Documentation
* ABI docs for proximity added (interface has been there a long time but
  somehow snuck through without being documented)
* Move iio-trig-sysfs documentation out of staging (got left behind when
  the driver moved some time ago).

Cleanups
 * drop the timestamp argument from iio_trigger_poll(_chained) as
   nothing has been done with it for some time.
 * ad799x kerneldoc for ad799x_chip brought up to date.
 * replace a number of reimplementations of the GENMASK macro and
   use the BIT macro to cleanup a few locations.
 * bring the iio_event_monitor example program up to date with new
   device types.
 * fix some incorrect function prototypes in iio_utils.h example code.
 * INDIO_RING_TRIGGERED to INDIO_BUFFER_TRIGGERED fix in docs. This
   got left behind after we renamed it a long time back.
 * fix error handling in the generic_buffer example program.
 * small tidy ups in the iio-trig-periodic-rtc driver.
 * Allow reseting iio-trig-periodic-rtc frequency to 0 (default) after
   it has changed.
 * Trivial tidy ups in coding style in iio_simply_dummy
2014-06-18 20:02:33 -07:00