aboutsummaryrefslogtreecommitdiff
path: root/include/linux/iio/adc
AgeCommit message (Collapse)AuthorFilesLines
2024-06-25iio: adc: ad_sigma_delta: add disable_one callbackDumitru Ceclan1-0/+14
Sigma delta ADCs with a sequencer need to disable the previously enabled channel when reading using ad_sigma_delta_single_conversion(). This was done manually in drivers for devices with sequencers. This patch implements handling of single channel disabling after a single conversion. Reviewed-by: Nuno Sa <[email protected]> Signed-off-by: Dumitru Ceclan <[email protected]> Reviewed-by: David Lechner <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-03-25iio: adc: ad_sigma_delta: Add optional irq selectionDumitru Ceclan1-0/+3
Add optional irq_num attribute to ad_sigma_delta_info structure for selecting the used interrupt line for ADC's conversion completion. Signed-off-by: Dumitru Ceclan <[email protected]> Reviewed-by: Nuno Sa <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2024-02-25Merge tag 'iio-for-6.9a' of ↵Greg Kroah-Hartman1-68/+0
http://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into char-misc-next Jonathan writes: IIO: 1st set of new device support, features and cleanup for 6.9 IIO Backend support =================== New approach from Nuno Sa to the problem of reuse of drivers with IIO devices that are actually the combination of a highspeed chip and an FPGA core handling the data capture and flows. It will hopefully also apply to some other split designs. The ad9467 and axi-adi drivers are converted over to this framework. New device support ================== adi,admfm2000 - New driver for this dual microwave down converter. ams,as73211 - Add support for as7331 UV sensor. richtek,rtq6056 - Add support for related parts RTQ6053 and RTQ6059 st,lsm6dsx - Add ASM330LHHXG1 accelerometer and gyro support (mainly IDs) ti,ads1298 - New driver for this medical ADC. Features ======== tests - Unit tests for the gain-time-scale helper library. bosch,bmi088 - I2C support. bosh,bmi160 - Add 10EC5280 ACPI ID. Used in a number of devices that won't get fixed. The ID is actually a PCI ID belonging to realtech. No response was received to earlier attempts to notify them of this. The manufacturers of some devices have replied to say they will not fix this incorrect ID. Add the ID and hope it isn't a problem. bosch,bmi323 - Add BOSC0200 ACPI ID. Note this is a duplicate of one in the bmc150 driver (it appears these parts share a windows driver). Both drivers perform an ID check that is safe on the other part before successfully probing. hid-sensors-als - Add color temperature and chromaticity support. Note this is a replacement for the series reverted in 6.8 that correctly handles all the potential channel combinations. honeywell,hsc030pa - Triggered buffer support (after driver cleanup). honeywell,mprls00025pa - Improved error handling. - New DT binding to allow use of part number triplet as provided in data sheet to specify equivalent of most of the binding more efficiently. - SPI support. memsic,mxc4005 - ACPI ID MDA6655 as seen in the Chuwi Minibook X 2023 ti,hdc3020 - Add threshold event support (after some driver cleanup) veml,vcnl4000 - Switch to high resolution proximity measurement. Cleanup ======= Various minor typo fixes and better use of defines etc. Treewide - Stop using ACPI_PTR(). The savings in space are small and not worth the complexity of __maybe_unused of ifdef guards. To avoid use in new IIO drivers based on copy and paste, clean it out. - cleanup.h based handling of iio_device_claim_direct_mode()/ iio_device_release_direct_mode() using scope_cond_guard(). In many drivers this is combined with other automated cleanup to give maximum simplifications. An initial set of drivers are converted over to this infrastructure. Tools - Use rewinddir() instead of seekdir() to return to start of file. core - Make iio_bus_type constant. adi,ad16475 - Use irq_get_trigger_type() instead of opencoding. adi,ad16480 - Use irq_get_trigger_type() instead of opencoding. adi,ad-sigma-delta - Avoid overwriting IRQ flags if provided by firmware. ams,as73211 - Use IIO_VAL_FRACTIONAL for scales to simplify the code and potentially improve accuracy. gts-library - Use a div64_u64() instead of a loop to do a division. honeywell,mprls00025pa - Clean up dt-binding doc. - Drop defaults when DT binding not providing values. Very unlikely these were useful given they were wrong for vast majority of supported devices. - Whitespace cleanup miramems,da280 - Use i2c_get_match_data() to replace hand rolled ACPI matching code. semtech,sx9324 - Avoid unnecessary copying of property strings. st,lsm6dsx - Improve docs, particularly wrt to making addition of new device support less noisy. st,lsm9ds0 - Use dev_err_probe() in all probe() error handling. - Improved header includes. - Tidy up termination of ID tables. ti,ads1014 - Correct upper bound on PGA (wrong value had no actual impact) ti,afe4403/4404 - devm_ useage to simplify error handling in probe() and allow() remove to be dropped. voltage-divider - Add dt-binding for io-channel-cells to allow such a device to be both an IIO consumer and IIO producer at the same time. * tag 'iio-for-6.9a' of http://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (106 commits) iio: imu: bmi323: Add ACPI Match Table iio: accel: bmc150: Document duplicate ACPI entries with bmi323 driver iio: adc: ti-ads1298: Add driver dt-bindings: iio: adc: ti-ads1298: Add bindings iio: pressure: hsc030pa add triggered buffer iio: pressure: hsc030pa add mandatory delay iio: pressure: hsc030pa: update datasheet URLs iio: pressure: hsc030pa: include cleanup iio: pressure: hsc030pa: use signed type to hold div_64() result dt-bindings: iio: pressure: honeywell,hsc030pa.yaml add spi props iio: st_sensors: lsm9ds0: Use common style for terminator in ID tables iio: st_sensors: lsm9ds0: Don't use "proxy" headers iio: st_sensors: lsm9ds0: Use dev_err_probe() everywhere iio: adc: adi-axi-adc: move to backend framework iio: adc: ad9467: convert to backend framework iio: add the IIO backend framework iio: buffer-dmaengine: export buffer alloc and free functions of: property: add device link support for io-backends dt-bindings: adc: axi-adc: update bindings for backend framework dt-bindings: adc: ad9467: add new io-backend property ...
2024-02-19iio: adc: adi-axi-adc: move to backend frameworkNuno Sa1-68/+0
Move to the IIO backend framework. Devices supported by adi-axi-adc now register themselves as backend devices. Signed-off-by: Nuno Sa <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2024-01-22iio: adc: ad_sigma_delta: ensure proper DMA alignmentNuno Sa1-1/+3
Aligning the buffer to the L1 cache is not sufficient in some platforms as they might have larger cacheline sizes for caches after L1 and thus, we can't guarantee DMA safety. That was the whole reason to introduce IIO_DMA_MINALIGN in [1]. Do the same for the sigma_delta ADCs. [1]: https://lore.kernel.org/linux-iio/[email protected]/ Fixes: 0fb6ee8d0b5e ("iio: ad_sigma_delta: Don't put SPI transfer buffer on the stack") Signed-off-by: Nuno Sa <[email protected]> Link: https://lore.kernel.org/r/20240117-dev_sigma_delta_no_irq_flags-v1-1-db39261592cf@analog.com Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2023-12-10iio: adc: ad9467: fix scale settingNuno Sa1-0/+4
When reading in_voltage_scale we can get something like: root@analog:/sys/bus/iio/devices/iio:device2# cat in_voltage_scale 0.038146 However, when reading the available options: root@analog:/sys/bus/iio/devices/iio:device2# cat in_voltage_scale_available 2000.000000 2100.000006 2200.000007 2300.000008 2400.000009 2500.000010 which does not make sense. Moreover, when trying to set a new scale we get an error because there's no call to __ad9467_get_scale() to give us values as given when reading in_voltage_scale. Fix it by computing the available scales during probe and properly pass the list when .read_available() is called. While at it, change to use .read_available() from iio_info. Also note that to properly fix this, adi-axi-adc.c has to be changed accordingly. Fixes: ad6797120238 ("iio: adc: ad9467: add support AD9467 ADC") Signed-off-by: Nuno Sa <[email protected]> Reviewed-by: David Lechner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2022-06-03Merge tag 'char-misc-5.19-rc1' of ↵Linus Torvalds1-0/+38
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc Pull char / misc / other smaller driver subsystem updates from Greg KH: "Here is the large set of char, misc, and other driver subsystem updates for 5.19-rc1. The merge request for this has been delayed as I wanted to get lots of linux-next testing due to some late arrivals of changes for the habannalabs driver. Highlights of this merge are: - habanalabs driver updates for new hardware types and fixes and other updates - IIO driver tree merge which includes loads of new IIO drivers and cleanups and additions - PHY driver tree merge with new drivers and small updates to existing ones - interconnect driver tree merge with fixes and updates - soundwire driver tree merge with some small fixes - coresight driver tree merge with small fixes and updates - mhi bus driver tree merge with lots of updates and new device support - firmware driver updates - fpga driver updates - lkdtm driver updates (with a merge conflict, more on that below) - extcon driver tree merge with small updates - lots of other tiny driver updates and fixes and cleanups, full details in the shortlog. All of these have been in linux-next for almost 2 weeks with no reported problems" * tag 'char-misc-5.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (387 commits) habanalabs: use separate structure info for each error collect data habanalabs: fix missing handle shift during mmap habanalabs: remove hdev from hl_ctx_get args habanalabs: do MMU prefetch as deferred work habanalabs: order memory manager messages habanalabs: return -EFAULT on copy_to_user error habanalabs: use NULL for eventfd habanalabs: update firmware header habanalabs: add support for notification via eventfd habanalabs: add topic to memory manager buffer habanalabs: handle race in driver fini habanalabs: add device memory scrub ability through debugfs habanalabs: use unified memory manager for CB flow habanalabs: unified memory manager new code for CB flow habanalabs/gaudi: set arbitration timeout to a high value habanalabs: add put by handle method to memory manager habanalabs: hide memory manager page shift habanalabs: Add separate poll interval value for protocol habanalabs: use get_task_pid() to take PID habanalabs: add prefetch flag to the MAP operation ...
2022-05-19iio: adc: qcom-vadc-common: add reverse scaling for PMIC5 Gen2 ADC_TMJishnu Prakash1-0/+2
Add reverse scaling function for PMIC5 Gen2 ADC_TM, to convert temperature to raw ADC code, for setting thresholds for thermistor channels. Signed-off-by: Jishnu Prakash <[email protected]> Acked-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Daniel Lezcano <[email protected]>
2022-04-04iio: adc: ad_sigma_delta: Add sequencer supportLars-Peter Clausen1-0/+38
Some sigma-delta chips support sampling of multiple channels in continuous mode. When the operating with more than one channel enabled, the channel sequencer cycles through the enabled channels in sequential order, from first channel to the last one. If a channel is disabled, it is skipped by the sequencer. If more than one channel is used in continuous mode, instruct the device to append the status to the SPI transfer (1 extra byte) every time we receive a sample. All sigma-delta chips possessing a sampling sequencer have this ability. Inside the status register there will be the number of the converted channel. In this way, even if the CPU won't keep up with the sampling rate, it won't send to userspace wrong channel samples. When multiple channels are enabled in continuous mode, the device needs to perform a measurement on all slots before we can push to userspace the sample. If, during sequencing and data reading, a channel measurement is lost, a desync occurred. In this case, ad_sigma_delta drops the incomplete sample and waits for the device to send the measurement on the first active slot. Co-developed-by: Alexandru Tachici <[email protected]> Signed-off-by: Alexandru Tachici <[email protected]> Signed-off-by: Lars-Peter Clausen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2022-01-30iio: adc: qcom-vadc-common: Re-use generic struct u32_fractAndy Shevchenko1-12/+3
Instead of custom data type re-use generic struct u32_fract. No changes intended. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2021-06-13iio: adc: ad_sigma_delta: remove ad_sd_{setup,cleanup}_buffer_and_trigger()Alexandru Ardelean1-3/+0
Since all AD Sigma-Delta drivers now use the devm_ad_sd_setup_buffer_and_trigger() function, we can remove the old ad_sd_{setup,cleanup}_buffer_and_trigger() functions. This way we can discourage new drivers that use the ad_sigma_delta lib-driver to use these (older functions). Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2021-06-13iio: adc: ad_sigma_delta: introduct devm_ad_sd_setup_buffer_and_trigger()Alexandru Ardelean1-0/+3
This is a version of ad_sd_setup_buffer_and_trigger() with all underlying functions (that are used) being replaced with their device-managed variants. One thing to take care here is with {devm_}iio_trigger_alloc(), where both functions take a parent-device object as the first parameter. To make sure nothing quirky is happening, the devm_ad_sd_probe_trigger() function is checking that the provided 'dev' reference is the same as the one stored on the 'struct ad_sigma_delta' driver data. Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2021-03-11iio: adc: adi-axi-adc: fix typo in doc-stringAlexandru Ardelean1-1/+1
The channels are of type iio_chan_spec, not axi_adc_chan_spec. They were in some earlier version, but forgot to rename in the doc-string. Fixes: ef04070692a21 ("iio: adc: adi-axi-adc: add support for AXI ADC IP core") Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2021-02-15thermal: qcom: add support for adc-tm5 PMIC thermal monitorDmitry Baryshkov1-0/+3
Add support for Thermal Monitoring part of PMIC5. This part is closely coupled with ADC, using it's channels directly. ADC-TM support generating interrupts on ADC value crossing low or high voltage bounds, which is used to support thermal trip points. Signed-off-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Daniel Lezcano <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2021-01-16iio: adc: qcom-vadc-common: rewrite vadc7 die temp calculationDmitry Baryshkov1-5/+0
qcom_vadc7_scale_hw_calib_die_temp() uses a table format different from the rest of volt/temp conversion functions in this file. Also the conversion functions results in non-monothonic values conversion, which seems wrong. Rewrite qcom_vadc7_scale_hw_calib_die_temp() to use qcom_vadc_map_voltage_temp() directly, like the rest of conversion functions do. Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2021-01-16iio: adc: move vadc_map_pt from header to the source fileDmitry Baryshkov1-11/+0
struct vadc_map_pt is not used outside of qcom-vadc-common.c, so move it there from the global header file. Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2021-01-16iio: adc: move qcom-vadc-common.h to include dirDmitry Baryshkov1-0/+187
qcom-vadc-common module will be used by ADC thermal monitoring driver, so move it to global include dir. Signed-off-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
2020-12-03iio: ad_sigma_delta: Don't put SPI transfer buffer on the stackLars-Peter Clausen1-1/+5
Use a heap allocated memory for the SPI transfer buffer. Using stack memory can corrupt stack memory when using DMA on some systems. This change moves the buffer from the stack of the trigger handler call to the heap of the buffer of the state struct. The size increases takes into account the alignment for the timestamp, which is 8 bytes. The 'data' buffer is split into 'tx_buf' and 'rx_buf', to make a clearer separation of which part of the buffer should be used for TX & RX. Fixes: af3008485ea03 ("iio:adc: Add common code for ADI Sigma Delta devices") Signed-off-by: Lars-Peter Clausen <[email protected]> Signed-off-by: Alexandru Ardelean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2020-04-19iio: adc: adi-axi-adc: add support for AXI ADC IP coreMichael Hennerich1-0/+64
This change adds support for the Analog Devices Generic AXI ADC IP core. The IP core is used for interfacing with analog-to-digital (ADC) converters that require either a high-speed serial interface (JESD204B/C) or a source synchronous parallel interface (LVDS/CMOS). Usually, some other interface type (i.e SPI) is used as a control interface for the actual ADC, while the IP core (controlled via this driver), will interface to the data-lines of the ADC and handle the streaming of data into memory via DMA. Because of this, the AXI ADC driver needs the other SPI-ADC driver to register with it. The SPI-ADC needs to be register via the SPI framework, while the AXI ADC registers as a platform driver. The two cannot be ordered in a hierarchy as both drivers have their own registers, and trying to organize this [in a hierarchy becomes] problematic when trying to map memory/registers. There are some modes where the AXI ADC can operate as standalone ADC, but those will be implemented at a later point in time. DocLink: https://wiki.analog.com/resources/fpga/docs/axi_adc_ip Signed-off-by: Michael Hennerich <[email protected]> Signed-off-by: Lars-Peter Clausen <[email protected]> Signed-off-by: Alexandru Ardelean <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2020-04-19iio: ad_sigma_delta: remove unused IIO channel macrosAlexandru Ardelean1-58/+0
Now that all channel SigmaDelta IIO channel macros have been localized, remove the generic ones. Signed-off-by: Alexandru Ardelean <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2020-01-18iio: adc: ad-sigma-delta: Allow custom IRQ flagsAlexandru Tachici1-0/+2
Before this patch the ad_sigma_delta implementation hardcoded the irq trigger type to low, assuming that all Sigma-Delta ADCs have the same interrupt-type. This patch allows all drivers using the ad_sigma_delta layer to set the irq trigger type to the one specified in the datasheet. Signed-off-by: Alexandru Tachici <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2019-09-08iio: adc: ad_sigma_delta: Export ad_sd_calibrateMircea Caprioru1-0/+2
This patch exports the ad_sd_calibrate function in order to be able to call it from outside ad_sigma_delta. There are cases where the option to calibrate one channel at a time is necessary (ex. system calibration for zero scale and full scale). Signed-off-by: Mircea Caprioru <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2019-05-30treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 177Thomas Gleixner1-2/+1
Based on 1 normalized pattern(s): licensed under the gpl 2 extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 135 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Richard Fontana <[email protected]> Reviewed-by: Alexios Zavras <[email protected]> Reviewed-by: Steve Winslow <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-04-04iio: ad_sigma_delta: Properly handle SPI bus locking vs CS assertionLars-Peter Clausen1-0/+1
For devices from the SigmaDelta family we need to keep CS low when doing a conversion, since the device will use the MISO line as a interrupt to indicate that the conversion is complete. This is why the driver locks the SPI bus and when the SPI bus is locked keeps as long as a conversion is going on. The current implementation gets one small detail wrong though. CS is only de-asserted after the SPI bus is unlocked. This means it is possible for a different SPI device on the same bus to send a message which would be wrongfully be addressed to the SigmaDelta device as well. Make sure that the last SPI transfer that is done while holding the SPI bus lock de-asserts the CS signal. Signed-off-by: Lars-Peter Clausen <[email protected]> Signed-off-by: Alexandru Ardelean <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2018-11-17iio: ad_sigma_delta: Allow to provide custom data register addressLars-Peter Clausen1-0/+3
Some newer devices from the Sigma-Delta ADC family do have their data register at a different address than the current default address. Add a parameter to the ad_sigma_delta_info struct which allows to override the default address. Signed-off-by: Lars-Peter Clausen <[email protected]> Signed-off-by: Stefan Popa <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2018-05-20iio: adc: stm32-dfsdm: include stm32-dfsdm-adc.hFabrice Gasnier1-0/+2
Fix the following sparse warnings: CHECK drivers/iio/adc/stm32-dfsdm-adc.c symbol 'stm32_dfsdm_get_buff_cb' was not declared. Should it be static? symbol 'stm32_dfsdm_release_buff_cb' was not declared. Should it be static? BTW, move interrupt.h to sort headers alphabetically. Signed-off-by: Fabrice Gasnier <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2018-03-17iio: adc: ad7780: remove IIO_CHAN_INFO_SAMP_FREQ supportAlexandru Ardelean1-7/+17
The `ad7780` driver does not implement setting/getting the sampling frequency. For the ad7780/ad7781 devices, the control is done via an external pin, and the ad7170/ad7171 devices have a fixed sampling rate (so, no control). For these devices, and similar other that may be added later on, a AD_SD_CHANNEL_NO_SAMPLE_FREQ() macro has been added, which doesn't set the IIO_CHAN_INFO_SAMP_FREQ flag. Signed-off-by: Alexandru Ardelean <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2018-01-10IIO: ADC: add stm32 DFSDM support for PDM microphoneArnaud Pouliquen1-0/+18
This code offers a way to handle PDM audio microphones in ASOC framework. Audio driver should use consumer API. A specific management is implemented for DMA, with a callback, to allows to handle audio buffers efficiently. Signed-off-by: Arnaud Pouliquen <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2017-09-24iio: ad_sigma_delta: Implement a dedicated reset functionDragos Bogdan1-0/+3
Since most of the SD ADCs have the option of reseting the serial interface by sending a number of SCLKs with CS = 0 and DIN = 1, a dedicated function that can do this is usefull. Needed for the patch: iio: ad7793: Fix the serial interface reset Signed-off-by: Dragos Bogdan <[email protected]> Acked-by: Lars-Peter Clausen <[email protected]> Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2016-10-11staging: iio: ad7192: implement IIO_CHAN_INFO_SAMP_FREQEva Rachel Retuya1-0/+1
This driver predates the availability of IIO_CHAN_INFO_SAMP_FREQ attribute wherein usage has some advantages like it can be accessed by in-kernel consumers as well as reduces the code size. Therefore, use IIO_CHAN_INFO_SAMP_FREQ to implement the sampling_frequency attribute instead of using IIO_DEV_ATTR_SAMP_FREQ() macro. Move code from the functions associated with IIO_DEV_ATTR_SAMP_FREQ() into respective read and write hooks with the mask set to IIO_CHAN_INFO_SAMP_FREQ. Signed-off-by: Eva Rachel Retuya <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
2013-03-17iio:adc:ad_sigma_delta move to info_mask_(shared_by_type/separate)Jonathan Cameron1-3/+3
The original info_mask is going away in favour of the broken out versions. Signed-off-by: Jonathan Cameron <[email protected]> Acked-by: Lars-Peter Clausen <[email protected]>
2012-08-27iio:adc: Add common code for ADI Sigma Delta devicesLars-Peter Clausen1-0/+173
Most devices from the Analog Devices Sigma Delta family use a similar scheme for communication with the device. This includes register access, as well as trigger handling. But each device sub-family has different features and different register layouts (some even have no registers at all) and thus it is impractical to try to support all of the devices by the same driver. This patch adds a common base library for Sigma Delta converter devices. It will be used by individual drivers. This code is mostly based on the three existing Sigma Delta drivers the AD7192, AD7780 and AD7793, but has been improved for more robustness and flexibility. Signed-off-by: Lars-Peter Clausen <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>