summaryrefslogtreecommitdiffstats
path: root/drivers/iio/adc
Commit message (Collapse)AuthorAgeFilesLines
* tree-wide: use reinit_completion instead of INIT_COMPLETIONWolfram Sang2013-11-152-4/+4
| | | | | | | | | | | | Use this new function to make code more comprehensible, since we are reinitialzing the completion, not initializing. [akpm@linux-foundation.org: linux-next resyncs] Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13) Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* iio: adc: twl6030-gpadc: Remove redundant codeSachin Kamat2013-10-241-3/+1
| | | | | | | | | The if check is redundant as the value obtained from iio_device_register() is already in the required format. Hence return the function directly. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: adc: ti_am335x_adc: Remove redundant of_match_ptrSachin Kamat2013-10-231-1/+1
| | | | | | | | ti_adc_dt_ids is always compiled in. Hence of_match_ptr is not needed. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: adc: nau7802: Remove redundant of_match_ptrSachin Kamat2013-10-231-1/+1
| | | | | | | | | nau7802_dt_ids is always compiled in. Hence of_match_ptr is not needed. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: adc: twl6030-gpadc: Remove redundant of_match_ptrSachin Kamat2013-10-231-1/+1
| | | | | | | | of_twl6030_match_tbl is always compiled in. Hence of_match_ptr is not necessary. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:adc:max1363 support SMBus for 8-bit devicesVivien Didelot2013-10-201-19/+57
| | | | | | | | | | | | | | | | The driver currently supports only I2C access. But supported devices with an accuracy of 8-bit are compatible with the SMBus byte access routines. This patch wraps the send and receive routines depending on the chip accuracy and fonctionnalities of its adapter. For instance, this allows us to use a MAX11603 on a ICH7 controller. This patch also simplifies the max1363_write_basic_config() routine to use the struct max1363_state fields directly. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: adc: ti-adc081c: Include linux/of.h headerSachin Kamat2013-10-181-0/+1
| | | | | | | | 'of_match_ptr' is defined in linux/of.h. Include it explicitly to avoid build breakage in the future. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: adc: nau7802: Include linux/of.h headerSachin Kamat2013-10-181-0/+1
| | | | | | | | | 'of_match_ptr' is defined in linux/of.h. Include it explicitly to avoid build breakage in the future. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: adc: mcp3422: Include linux/of.h headerSachin Kamat2013-10-181-0/+1
| | | | | | | | 'of_match_ptr' is defined in linux/of.h. Include it explicitly to avoid build breakage in the future. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: at91: introduce touch screen support in iio adc driverJosh Wu2013-10-171-24/+364
| | | | | | | | | | | | | | | | | | | AT91 ADC hardware integrate touch screen support. So this patch add touch screen support for at91 adc iio driver. To enable touch screen support in adc, you need to add the dt parameters: 1. which type of touch are used? (4 or 5 wires), sample period time. 2. correct pressure detect threshold value. In the meantime, since touch screen will use a interal period trigger of adc, so it is conflict to other hardware triggers. Driver will disable the hardware trigger support if touch screen is enabled. This driver has been tested in AT91SAM9X5-EK and SAMA5D3x-EK. Signed-off-by: Josh Wu <josh.wu@atmel.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> CC: devicetree@vger.kernel.org Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:ti_am335x: Remove redundant call to iio_sw_buffer_preenable()Lars-Peter Clausen2013-10-161-1/+1
| | | | | | | | | The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core, so there is no need to do this from the driver anymore. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Zubair Lutfullah <zubair.lutfullah@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:ad_sigma_delta: Remove redundant call to iio_sw_buffer_preenable().Lars-Peter Clausen2013-10-161-1/+0
| | | | | | | | The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core, so there is no need to do this from the driver anymore. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:ad7887: Remove redundant call to iio_sw_buffer_preenable().Lars-Peter Clausen2013-10-161-5/+0
| | | | | | | | The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core, so there is no need to do this from the driver anymore. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:ad7266: Remove redundant call to iio_sw_preenable()Lars-Peter Clausen2013-10-161-11/+1
| | | | | | | | The equivalent of iio_sw_buffer_preenable() is now done in the IIO buffer core, so there is no need to do this from the driver anymore. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:max1363: Switch to new event config interfaceLars-Peter Clausen2013-10-121-90/+110
| | | | | | | | Switch the max1363 driver to the new IIO event config interface as the old one is going to be removed. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: at91: move the num_channels from DT to driver itselfJosh Wu2013-10-091-7/+5
| | | | | | | CC: devicetree@vger.kernel.org Signed-off-by: Josh Wu <josh.wu@atmel.com> Acked-by: Ludovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: at91: ADC start-up time calculation changed since at91sam9x5Josh Wu2013-10-091-7/+46
| | | | | | | | | | Since in at91sam9x5, sama5d3x chip. the start up time calucation is changed. This patch can choose different start up time calculation formula for different chips. Signed-off-by: Josh Wu <josh.wu@atmel.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:max1363: Report scale as fractional valueLars-Peter Clausen2013-10-011-5/+3
| | | | | | | Move the complexity of calculating the fixed point scale to the core. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:at91: Report scale as fractional valueLars-Peter Clausen2013-10-011-3/+3
| | | | | | | | Move the complexity of calculating the fixed point scale to the core. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Josh Wu <josh.wu@atmel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:ad7791: Report scale as fractional valueLars-Peter Clausen2013-10-011-8/+10
| | | | | | | Move the complexity of calculating the fixed point scale to the core. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:ad7476: Report scale as fractional valueLars-Peter Clausen2013-10-011-4/+3
| | | | | | | Move the complexity of calculating the fixed point scale to the core. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio:ad7266: Report scale as fractional valueLars-Peter Clausen2013-10-011-11/+10
| | | | | | | Move the complexity of calculating the fixed point scale to the core. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Merge tag 'iio-for-3.13b' of ↵Greg Kroah-Hartman2013-09-291-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Jonathan writes: Second set of new functionality for IIO in the 3.13 cycle - with bug fixes for first set. This is a small, mainly to get a couple of compile bug related fixes into the tree ASAP. New device support: 1) Add ad5446 dac support to the ad5641 driver. New functionality and cleanups: 1) Optional power supply regulators for the st pressure sensors drivers using the new optional regulator interface. 2) Bit of tidying up of naming in the sysfs trigger. Bug fixes from the previous series: 1) Missing select IIO_BUFFER for ti_am335x_adc 2) Drop a bonus bracket in iio-trig-bfin-timmer
| * iio:ti_am335x_adc ensure that IIO_KFIFO_BUF is not selected witout IIO_BUFFERJonathan Cameron2013-09-281-0/+1
| | | | | | | | | | | | | | This avoids build problems such iio_push_to_buffers* not being defined. Signed-off-by: Jonathan Cameron <jic23@kernel.org> Reported-by: kbuild test robot <fengguang.wu@intel.com>
* | Merge 3.12-rc2 into staging-next.Greg Kroah-Hartman2013-09-251-5/+6
|\ \ | |/ |/| | | | | | | | | | | This resolves the merge problem with two iio drivers that Stephen Rothwell pointed out. Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| * iio: at91: fix adc_clk overflowJosh Wu2013-09-181-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The adc_clk variable is currently defined using a 32-bits unsigned integer, which will overflow under some very valid range of operations. Such overflow will occur if, for example, the parent clock is set to a 20MHz frequency and the ADC startup time is larger than 215ns. To fix this, introduce an intermediate variable holding the clock rate in kHz. Signed-off-by: Josh Wu <josh.wu@atmel.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: ti_am335x_adc: cleanup error caseZubair Lutfullah2013-09-221-10/+0
| | | | | | | | | | | | | | Driver is functional without this error case. Cleaned up. Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: ti_am335x_adc: cleanup trigger related codeZubair Lutfullah2013-09-221-4/+0
| | | | | | | | | | | | | | | | Trigger related headers and variables are not needed as driver is now based on INDIO_BUFFER_HARDWARE mode Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: ti_am335x_adc: fix static in function headerZubair Lutfullah2013-09-221-1/+1
| | | | | | | | | | | | | | | | Static is missing in function header. Corrected. Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com> Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio:max1363: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-6/+1
| | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio:at91_adc: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-7/+1
| | | | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Josh Wu <josh.wu@atmel.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio:ad_sigma_delta: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-5/+1
| | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio:ad7923: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-8/+2
| | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio:ad7887: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-8/+2
| | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio:ad7476: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-7/+2
| | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio:ad7298: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-8/+2
| | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio:ad7266: Use iio_push_to_buffers_with_timestamp()Lars-Peter Clausen2013-09-211-3/+2
| | | | | | | | | | | | | | Makes the code a bit shorter and less ugly. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: ti_am335x_adc: Add continuous sampling supportZubair Lutfullah2013-09-212-5/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously the driver had only one-shot reading functionality. This patch adds continuous sampling support to the driver. Continuous sampling starts when buffer is enabled. HW IRQ wakes worker thread that pushes samples to userspace. Sampling stops when buffer is disabled by userspace. Patil Rachna (TI) laid the ground work for ADC HW register access. Russ Dill (TI) fixed bugs in the driver relevant to FIFOs and IRQs. I fixed channel scanning so multiple ADC channels can be read simultaneously and pushed to userspace. Restructured the driver to fit IIO ABI. And added INDIO_BUFFER_HARDWARE mode. Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Russ Dill <Russ.Dill@ti.com> Acked-by: Lee Jones <lee.jones@linaro.org> Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: ti_am335x_adc: optimize memory usageZubair Lutfullah2013-09-211-2/+2
| | | | | | | | | | | | | | | | 12 bit ADC data is stored in 32 bits of storage. Change from u32 to u16 to reduce wasted memory. Signed-off-by: Zubair Lutfullah <zubair.lutfullah@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: at91_adc: Cocci spatch "noderef"Thomas Meyer2013-09-201-1/+1
| | | | | | | | | | | | | | | | | | sizeof when applied to a pointer typed expression gives the size of the pointer. Found by coccinelle spatch "misc/noderef.cocci" Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: Make available scan_masks const in ad7266Peter Meerwald2013-09-181-4/+4
| | | | | | | | | | | | Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio:max1361: Use default triggered buffer setup opsLars-Peter Clausen2013-09-161-7/+1
| | | | | | | | | | | | | | | | | | The max1361 driver uses the same callbacks as the triggered buffer default buffer setup ops, so just remove the max1361 specific ops and let it use the default ops. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: Remove unnecessary casts for iio_push_to_buffers()Lars-Peter Clausen2013-09-155-5/+5
| | | | | | | | | | | | | | | | Now that iio_push_to_buffers() takes a void pointer for the data parameter we can remove those casts to u8*. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* | iio: adc: Add driver for Microchip MCP3422/3/4 high resolution ADCAngelo Compagnucci2013-09-073-0/+420
|/ | | | | | | Sysfs access to all channels. Signed-off-by: Angelo Compagnucci <angelo.compagnucci@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: at91: Use different prescal, startup mask in MR for different IPJosh Wu2013-08-291-2/+9
| | | | | | | | | For at91 boards, there are different IPs for adc. Different IPs has different STARTUP & PRESCAL mask in ADC_MR. Signed-off-by: Josh Wu <josh.wu@atmel.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: at91: introduce the multiple compatible string for different IPs.Josh Wu2013-08-291-38/+41
| | | | | | | | | As use the multiple compatible string, we can remove hardware register in dt. CC: devicetree@vger.kernel.org Signed-off-by: Josh Wu <josh.wu@atmel.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: adc: twl6030-gpadc: fix error return code in twl6030_gpadc_read_raw()Wei Yongjun2013-08-281-1/+1
| | | | | | | | | | Fix to return -EINTR in the error handling case instead of 0 (ret is assigned after goto, which has no effect), as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: adc: twl6030-gpadc: Use devm_* API familyOleksandr Kozaruk2013-08-191-26/+10
| | | | | | | | Using devm_iio_device_alloc and devm_request_threaded_irq makes code simpler. Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* iio: twl6030-gpadc: TWL6030, TWL6032 GPADC driverOleksandr Kozaruk2013-08-173-0/+1044
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GPADC is general purpose ADC found on TWL6030, and TWL6032 PMIC, known also as Phoenix and PhoenixLite. The TWL6030 and TWL6032 have GPADC with 17 and 19 channels respectively. Some channels have current source and are used for measuring voltage drop on resistive load for detecting battery ID resistance, or measuring voltage drop on NTC resistors for external temperature measurements. Some channels measure voltage, (i.e. battery voltage), and have voltage dividers, thus, capable to scale voltage. Some channels are dedicated for measuring die temperature. Some channels are calibrated in 2 points, having offsets from ideal values kept in trim registers. This is used to correct measurements. The differences between GPADC in TWL6030 and TWL6032: - 10 bit vs 12 bit ADC; - 17 vs 19 channels; - channels have different purpose(i.e. battery voltage channel 8 vs channel 18); - trim values are interpreted differently. Based on the driver patched from Balaji TK, Graeme Gregory, Ambresh K, Girish S Ghongdemath. Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Oleksandr Kozaruk <oleksandr.kozaruk@ti.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
* Merge 3.11-rc5 into staging-nextGreg Kroah-Hartman2013-08-121-8/+22
|\ | | | | | | | | | | We want the staging fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
OpenPOWER on IntegriCloud