Commit Graph

145 Commits

Author SHA1 Message Date
Okan Sahin 04c9a8eb72 iio: adc: max77541: Add ADI MAX77541 ADC Support
The MAX77541 has an 8-bit Successive Approximation Register (SAR) ADC
with four multiplexers for supporting the telemetry feature.

Signed-off-by: Okan Sahin <okan.sahin@analog.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230412111256.40013-4-okan.sahin@analog.com
Signed-off-by: Lee Jones <lee@kernel.org>
2023-06-28 15:18:11 +01:00
Mike Looijmans 541880542f iio: adc: Add TI ADS1100 and ADS1000
The ADS1100 is a 16-bit ADC (at 8 samples per second).
The ADS1000 is similar, but has a fixed data rate.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230307065535.7927-2-mike.looijmans@topic.nl
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-03-12 14:56:02 +00:00
Haibo Chen 7d02296ac8 iio: adc: add imx93 adc support
The ADC in i.mx93 is a total new ADC IP, add a driver to support
this ADC.

Currently, only support one shot normal conversion triggered by
software. For other mode, will add in future.

Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
Link: https://lore.kernel.org/r/20230117135137.1735536-2-haibo.chen@nxp.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-22 17:16:57 +00:00
Hugo Villeneuve 4d82b2f98a iio: adc: ti-ads7924: add Texas Instruments ADS7924 driver
The Texas Instruments ADS7924 is a 4 channels, 12-bit analog to
digital converter (ADC) with an I2C interface.

Datasheet: https://www.ti.com/lit/gpn/ads7924
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://lore.kernel.org/r/20230115170623.3680647-2-hugo@hugovil.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-01-21 18:19:49 +00:00
Leonard Göhrs 6271989426 iio: adc: add ADC driver for the TI LMP92064 controller
The TI LMP92064 is a dual 12 Bit ADC connected via SPI.
The two channels are intended for simultaneous measurements of the voltage
across- and current through a load to allow accurate instantaneous power
measurements.
The driver does not yet take advantage of this feature, as buffering is not
yet implemented.

Signed-off-by: Leonard Göhrs <l.goehrs@pengutronix.de>
Link: https://lore.kernel.org/r/20221128133503.1355898-2-l.goehrs@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-12-28 17:19:44 +00:00
Cosmin Tanislav 62094060cf iio: adc: ad4130: add AD4130 driver
AD4130-8 is an ultra-low power, high precision, measurement solution for
low bandwidth battery operated applications.

The fully integrated AFE (Analog Front-End) includes a multiplexer for up
to 16 single-ended or 8 differential inputs, PGA (Programmable Gain
Amplifier), 24-bit Sigma-Delta ADC, on-chip reference and oscillator,
selectable filter options, smart sequencer, sensor biasing and excitation
options, diagnostics, and a FIFO buffer.

Signed-off-by: Cosmin Tanislav <cosmin.tanislav@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20221021104115.1812486-3-demonsingur@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-11-23 19:44:01 +00:00
ChiaEn Wu c1404d1b65 iio: adc: mt6370: Add MediaTek MT6370 support
MediaTek MT6370 is a SubPMIC consisting of a single cell battery charger
with ADC monitoring, RGB LEDs, dual channel flashlight, WLED backlight
driver, display bias voltage supply, one general purpose LDO, and the
USB Type-C & PD controller complies with the latest USB Type-C and PD
standards.

Add support for the MT6370 ADC driver for system monitoring, including
charger current, voltage, and temperature.

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: ChiaEn Wu <chiaen_wu@richtek.com>
Link: https://lore.kernel.org/r/81ec58ae89030e48508d6810396de2679c40d26c.1665488982.git.chiaen_wu@richtek.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-11-23 19:43:59 +00:00
Ibrahim Tilki a44ef7c460 iio: adc: add max11410 adc driver
Adding support for max11410 24-bit, 1.9ksps delta-sigma adc which
has 3 differential reference and 10 differential channel inputs.
Inputs and references can be buffered internally. Inputs can also
be amplified with internal PGA.

Device has four digital filter modes: FIR50/60, FIR50, FIR60 and SINC4.
FIR 50Hz and 60Hz rejections can be enabled/disabled separately.
Digital filter selection affects sampling frequency range so driver
has to consider the configured filter when configuring sampling frequency.

Signed-off-by: Ibrahim Tilki <Ibrahim.Tilki@analog.com>
Link: https://lore.kernel.org/r/20221003105903.229-2-Ibrahim.Tilki@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-11-23 19:43:59 +00:00
Ramona Bolboaca 0fea1007f0 iio: adc: add max11205 adc driver
Adding support for max11205 16-bit single-channel ultra-low power
delta-sigma adc.
The MAX11205 is compatible with the 2-wire interface and uses
SCLK and RDY/DOUT for serial communications. In this mode, all
controls are implemented by timing the high or low phase of the SCLK.
The 2-wire serial interface only allows for data to be read out through
the RDY/DOUT output.

Datasheet: https://datasheets.maximintegrated.com/en/ds/MAX11205.pdf
Signed-off-by: Ramona Bolboaca <ramona.bolboaca@analog.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220831133021.215625-2-ramona.bolboaca@analog.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-09-05 18:08:34 +01:00
William Breathitt Gray 955c2aa9cf iio: stx104: Move to addac subdirectory
The stx104 driver supports both ADC and DAC functionality.

Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
Link: https://lore.kernel.org/r/20220815222921.138945-1-william.gray@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-08-20 13:09:38 +01:00
ChiYuan Huang 4396f45d21 iio: adc: Add rtq6056 support
Add Richtek rtq6056 supporting.

It can be used for the system to monitor load current and power with 16-bit
resolution.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/1658242365-27797-3-git-send-email-u0084500@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-08-15 22:29:57 +01:00
Caleb Connolly 72c7df8505 iio: adc: qcom-spmi-rradc: introduce round robin adc
The Round Robin ADC is responsible for reading data about the rate of
charge from the USB or DC input ports, it can also read the battery
ID (resistence), skin temperature and the die temperature of the pmic.
It is found on the PMI8998 and PM660 Qualcomm PMICs.

Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>
Link: https://lore.kernel.org/r/20220429220904.137297-6-caleb.connolly@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2022-06-18 14:14:29 +01:00
Jonathan Cameron cf890fe8ae iio:adc:ad7280a: Move out of staging
This is a rather unusual device (in IIO anyway).  However, it has
a near to standard userspace ABI.

Note the work to move this out of staging was done against a minimal
QEMU model, which doesn't model all the features of the device.
I have no intention to upstream the QEMU model as it was developed
just to enable this driver cleanup.

https://github.com/jic23/qemu/tree/ad7280a-hacks

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Link: https://lore.kernel.org/r/20220206190328.333093-21-jic23@kernel.org
2022-02-21 19:33:05 +00:00
Anand Ashok Dumbre d5c70627a7 iio: adc: Add Xilinx AMS driver
The AMS includes an ADC as well as on-chip sensors that can be used to
sample external voltages and monitor on-die operating conditions, such
as temperature and supply voltage levels. The AMS has two SYSMON blocks.
PL-SYSMON block is capable of monitoring off chip voltage and
temperature.

PL-SYSMON block has DRP, JTAG and I2C interface to enable monitoring
from an external master. Out of these interfaces currently only DRP is
supported. Other block PS-SYSMON is memory mapped to PS.

The AMS can use internal channels to monitor voltage and temperature as
well as one primary and up to 16 auxiliary channels for measuring
external voltages.

The voltage and temperature monitoring channels also have event capability
which allows to generate an interrupt when their value falls below or
raises above a set threshold.

Co-developed-by: Manish Narani <manish.narani@xilinx.com>
Signed-off-by: Manish Narani <manish.narani@xilinx.com>
Signed-off-by: Anand Ashok Dumbre <anand.ashok.dumbre@xilinx.com>
Link: https://lore.kernel.org/r/20211203212358.31444-4-anand.ashok.dumbre@xilinx.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-12-21 15:10:09 +00:00
Cai Huoqing 1e23dcaa1a iio: imx8qxp-adc: Add driver support for NXP IMX8QXP ADC
The NXP i.MX 8QuadXPlus SOC has a new ADC IP, so add
driver support for this ADC.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Reviewed-by: Fabio Estevam <festevam@gmail.com>
Link: https://lore.kernel.org/r/20210925020555.129-2-caihuoqing@baidu.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-10-19 08:27:32 +01:00
Lad Prabhakar d484c21bac iio: adc: Add driver for Renesas RZ/G2L A/D converter
Add ADC driver support for Renesas RZ/G2L A/D converter in SW
trigger mode.

A/D Converter block is a successive approximation analog-to-digital
converter with a 12-bit accuracy and supports a maximum of 8 input
channels.

Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20210804202118.25745-3-prabhakar.mahadev-lad.rj@bp.renesas.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-08-15 17:03:13 +01:00
Oleksij Rempel 9374e8f5a3 iio: adc: add ADC driver for the TI TSC2046 controller
Basically the TI TSC2046 touchscreen controller is 8 channel ADC optimized for
the touchscreen use case. By implementing it as an IIO ADC device, we can
make use of resistive-adc-touch and iio-hwmon drivers.

Polled readings are currently not implemented to keep this patch small, so
iio-hwmon will not work out of the box for now.

So far, this driver was tested with a custom version of resistive-adc-touch driver,
since it needs to be extended to make use of Z1 and Z2 channels. The X/Y
are working without additional changes.

Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20210428073208.19570-4-o.rempel@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-05-17 13:49:11 +01:00
Tomislav Denis d935eddd27 iio: adc: Add driver for Texas Instruments ADS131E0x ADC family
The ADS131E0x are a family of multichannel, simultaneous sampling,
24-bit, delta-sigma, analog-to-digital converters (ADCs) with a
built-in programmable gain amplifier (PGA), internal reference
and an onboard oscillator.

Datasheet: https://www.ti.com/lit/ds/symlink/ads131e08.pdf
Signed-off-by: Tomislav Denis <tomislav.denis@avl.com>
Link: https://lore.kernel.org/r/20210202084107.3260-2-tomislav.denis@avl.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-03-11 20:46:58 +00:00
Gene Chen 1f4877218f iio: adc: mt6360: Add ADC driver for MT6360
Add MT6360 ADC driver including Charger Current, Voltage, and
Temperature.

Signed-off-by: Gene Chen <gene_chen@richtek.com>
Link: https://lore.kernel.org/r/1603181267-15610-4-git-send-email-gene.chen.richtek@gmail.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-11-08 16:20:18 +00:00
Linus Torvalds 80ef846e99 Staging/IIO driver patches for 5.8-rc1
Here is the large set of staging and IIO driver changes for 5.8-rc1
 
 Nothing major, but a lot of new IIO drivers are included in here, along
 with other core iio cleanups and changes.
 
 On the staging driver front, again, nothing noticable.  No new deletions
 or additions, just a ton of tiny cleanups all over the tree done by a
 lot of different people.  Most coding style, but many actual real fixes
 and cleanups that are nice to see.
 
 All of these have been in linux-next for a while with no reported
 issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCXtzoAQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ym9FwCgkW8WZJGnvHLjuuG8C01azCEh/KUAoJRji8jK
 4zCG8NxAPFsQ1QP2SZPq
 =jEyw
 -----END PGP SIGNATURE-----

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

Pull staging/IIO driver updates from Greg KH:
 "Here is the large set of staging and IIO driver changes for 5.8-rc1

  Nothing major, but a lot of new IIO drivers are included in here,
  along with other core iio cleanups and changes.

  On the staging driver front, again, nothing noticable. No new
  deletions or additions, just a ton of tiny cleanups all over the tree
  done by a lot of different people. Most coding style, but many actual
  real fixes and cleanups that are nice to see.

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

* tag 'staging-5.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (618 commits)
  staging: rtl8723bs: Use common packet header constants
  staging: sm750fb: Add names to proc_setBLANK args
  staging: most: usb: init return value in default path of switch/case expression
  staging: vchiq: Get rid of VCHIQ_SERVICE_OPENEND callback reason
  staging: vchiq: move vchiq_release_message() into vchiq
  staging: vchi: Get rid of C++ guards
  staging: vchi: Get rid of not implemented function declarations
  staging: vchi: Get rid of vchiq_status_to_vchi()
  staging: vchi: Get rid of vchi_service_set_option()
  staging: vchi: Merge vchi_msg_queue() into vchi_queue_kernel_message()
  staging: vchiq: Move copy callback handling into vchiq
  staging: vchi: Get rid of vchi_queue_user_message()
  staging: vchi: Get rid of vchi_service_destroy()
  staging: most: usb: use function sysfs_streq
  staging: most: usb: add missing put_device calls
  staging: most: usb: use correct error codes
  staging: most: usb: replace code to calculate array index
  staging: most: usb: don't use error path to exit function on success
  staging: most: usb: move allocation of URB out of critical section
  staging: most: usb: return 0 instead of variable
  ...
2020-06-07 10:45:08 -07:00
Saravanan Sekar 7abd9fb646 iio: adc: mp2629: Add support for mp2629 ADC driver
Add support for 8-bit resolution ADC readings for input power
supply and battery charging measurement. Provides voltage, current
readings to mp2629 power supply driver.

Signed-off-by: Saravanan Sekar <sravanhome@gmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2020-05-26 10:41:47 +01:00
Greg Kroah-Hartman 4e1d96306d First set of new IIO device support, features and cleanup for the 5.8 cycle
Usual mix of new drivers, new support in old drivers and lots of minor
 cleanup. Yaml conversions also continue to trickle in (plenty more to go!)
 
 New device support
 * ad7476
   - Add ad7091 support (ID only)
 * ad9467
   - New driver for this 200/250 MSPS adi-axi-adc and SPI attached ADC.
 * adi-axi-adc
   - New driver to support ADIs generic AXI ADC IP core, used to provide
     high speed interfaces to ADCs (JESD204B/C or parallel interfaces). Usually
     paired with a device using a slow configuration interface (spi etc)
     Includes DT bindings and some fixes for fpga headers.
 * bmg160
   - Add support for BMI088 (ID only)
 * max1241
   - New driver for this ADC.
 * st_sensors
   - Add support for LIS2HH12 accelerometer
 * sx9310
   - New driver supporting sx9310 and sx9311 proximity sensors.
 
 Yaml DT binding conversions
 * rockchip-saradc (including adding some missing parts)
 * stm32-dac
 * tsl2563
 * vcnl4000
 
 Features
 * st_lsm6dsx
   - Add LIS3MDL as a possible sensor hub device.
 * vcnl4000
   - Add new concept of near level (from DT) to provide to userspace which
     often needs to have some calibrated concept of 'near'.
 
 Cleanups, minor fixes etc.
 * core
   - Use snprintf for functions where strings are built and there is
     potential for overflow.
   - Correct docs to indicate mlock should not be used directly by drivers.
   - Fix up accidental dropping of a patch to use bitmap_zalloc.
   - Stop allowing enabling of buffers with no channels enabled.
   - Drop unused 'stufftoread' from iio_buffer.
   - Drop scan_el_attrs form iio_buffer as unused.
   - Reorder sanity checks in __iio_device_register to fail earlier.
   - Drop all the devm_ runregister / free functions from IIO as they
     were never used and encourage poor design.
 * dma-buffer
   - Tidy up includes.
 * dma-engine-buffer
   - Provide dev-managed allocator.
   - Fix an issue with printing a size_t
 * cross subsystem (kxsd9, bmg160, mpu3050, bmi160, mpu6050, bmc150)
   - Replace some unnecessary casts of error ptrs and whilst there.
     use the %pe printf parameter to print them in a more useful fashion.
 * cross subsystem
   - Drop casts in calls to regmap_bulk_read as they make no sense.
   - Use devm_platform_ioremap_resource to reduce boilerplate.
   - Fix typos in Analog Devices.
 * counters/104-quad
   - Add Syed Nayyar Waris as an additional maintainer.
 * ad7476
   - Generate CONVST signal internally rather than requiring external
     trigger.  Add sysfs read back as can now do so.
   - use devm_add_action_or_reset to tidy up error and remove handling.
 * ad7793
   - Switch to read_avail from explicit attribute. Mostly done to avoid
     confusing people with a - sign (without surounding spaces) that
     was correct but checkpatch didn't like.
 * adis library
   - Add missing newlines at end of error messages.
 * adis16400
   - Use DEFINE_DEBUGS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTR.
 * adis16460
   - Use DEFINE_DEBUGS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTR.
 * ad_sigma_delta
   - Move some channel definitions into individual drivers to avoid
     having to deal with complex options.
 * ak8974
   - Silence an error on deffered probe.
 * bmp280
   - Harden against IRQ before registration.
   - Convert to read_avail instead of opencoding the equivalent.
   - Explicitly mark GPIO as optional.
   - Cleanup casts.
   - Remove line breaks from strings.
 * htts221
   - Replace direct access to platform_data with dev_get_platdata().
   - Use device properties rather than device tree ones to allow ACPI
     probing.
   - Casting cleanups.
 * intel_mrfld_adc
   - Don't use unaligned accessor for aligned data.
 * isl29125
   - Reorder buer pre and post hooks to allow for coming core rework.
 * ltc2983
   - Remove comp to bool.
 * max1363
   - Stop using mlock from the iio_dev directly in favour of a local lock
     with clearly defined scope.
 * max30100
   - Use generic device properties to allow ACPI probe.
 * mpu6050
   - Convert to i2c_new_client_device.
   - Add debugfs register access.
 * st_lsm6dsx
   - Provide means of configuring full scale on slave device if supported.
   - Drop include of st_sensors header to get one value. Its not otherwise
     used by this driver.
 * st-sensors
   - Replace direct access to platform_data with dev_get_platdata().
   - Casting cleanups.
   - Avoid splitting strings.
 * st_uvis25
   - Casting cleanups.
 * tsl2563
   - Typo fix.
 * tsl2772
   - scnprintf in a non obvious string building usecase. Note also 'fixes'
     a wrong calculation of remaining space that couldn't actually cause
     any trouble as there was lots of room.
 * xilinx-xadc
   - Fix Lars-Peter spelling his own name wrong :) + additional typos.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEbilms4eEBlKRJoGxVIU0mcT0FogFAl6gicARHGppYzIzQGtl
 cm5lbC5vcmcACgkQVIU0mcT0Foj3ig//XRAAHRSfzXFpvYxITVKDIGwP/giYdp91
 OflGw/0aOZFExr72ENLmCArXZPOT2qAZyNNoDNvuJ9SkcVDf4bT3w9gYwWtJ1sd7
 Hhh+1JpPspSo6vS85FMjm37UDfSbmYqB6wC57cZ5pKQIiJwi6W2hGsyOoOXmfLLc
 57d3mlg4g3KLl9Hl4UTU84gE1ushKQgNxVH21Y71pOTa8p+xbWWcspWjR2Jf+kVZ
 qPr2+2rP/AjeAVLu9SKfdBiczYQCNR3uFWKkOKsBE9fq3sbcN6NT5DktrSJUH+qU
 zfUGmShCEP908/9fARazXQZcTOX1tIUOnrpHG9l54GNPh3S2Qk9xGaZxvQy5sguC
 AmC4p+MaIMrMcgWMk9po+nE5INJq7HBV/0jnADG307wEhFrKrjh/2PtP4f9k/Mcv
 sHB7K1+dcJAUwFb5gccdDBfmKMnwfnGS8OFGLXZZKBIDqSvptmIs/pmavjEPgqhV
 GwGTDPyZKeyDnyhTXGafxii03Q2I62Zte5l4jcZ+q8Q4UMxQovEkX6IvUpXwA0Kk
 eoxedbgdvzxrDNiNrXa0k6CLzqSQW+aVHgJG+HEig4IXQse8zXb11HCs35zq5r4j
 JI2UjLk3zUHLiNR/Ir9fKAbPwWSWv3IWkfmFEEUWvUFjM+Xot1Hg+61vBTFKo4iK
 EIqqPZmd5Mk=
 =DyTF
 -----END PGP SIGNATURE-----

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

Jonathan writes:

First set of new IIO device support, features and cleanup for the 5.8 cycle

Usual mix of new drivers, new support in old drivers and lots of minor
cleanup. Yaml conversions also continue to trickle in (plenty more to go!)

New device support
* ad7476
  - Add ad7091 support (ID only)
* ad9467
  - New driver for this 200/250 MSPS adi-axi-adc and SPI attached ADC.
* adi-axi-adc
  - New driver to support ADIs generic AXI ADC IP core, used to provide
    high speed interfaces to ADCs (JESD204B/C or parallel interfaces). Usually
    paired with a device using a slow configuration interface (spi etc)
    Includes DT bindings and some fixes for fpga headers.
* bmg160
  - Add support for BMI088 (ID only)
* max1241
  - New driver for this ADC.
* st_sensors
  - Add support for LIS2HH12 accelerometer
* sx9310
  - New driver supporting sx9310 and sx9311 proximity sensors.

Yaml DT binding conversions
* rockchip-saradc (including adding some missing parts)
* stm32-dac
* tsl2563
* vcnl4000

Features
* st_lsm6dsx
  - Add LIS3MDL as a possible sensor hub device.
* vcnl4000
  - Add new concept of near level (from DT) to provide to userspace which
    often needs to have some calibrated concept of 'near'.

Cleanups, minor fixes etc.
* core
  - Use snprintf for functions where strings are built and there is
    potential for overflow.
  - Correct docs to indicate mlock should not be used directly by drivers.
  - Fix up accidental dropping of a patch to use bitmap_zalloc.
  - Stop allowing enabling of buffers with no channels enabled.
  - Drop unused 'stufftoread' from iio_buffer.
  - Drop scan_el_attrs form iio_buffer as unused.
  - Reorder sanity checks in __iio_device_register to fail earlier.
  - Drop all the devm_ runregister / free functions from IIO as they
    were never used and encourage poor design.
* dma-buffer
  - Tidy up includes.
* dma-engine-buffer
  - Provide dev-managed allocator.
  - Fix an issue with printing a size_t
* cross subsystem (kxsd9, bmg160, mpu3050, bmi160, mpu6050, bmc150)
  - Replace some unnecessary casts of error ptrs and whilst there.
    use the %pe printf parameter to print them in a more useful fashion.
* cross subsystem
  - Drop casts in calls to regmap_bulk_read as they make no sense.
  - Use devm_platform_ioremap_resource to reduce boilerplate.
  - Fix typos in Analog Devices.
* counters/104-quad
  - Add Syed Nayyar Waris as an additional maintainer.
* ad7476
  - Generate CONVST signal internally rather than requiring external
    trigger.  Add sysfs read back as can now do so.
  - use devm_add_action_or_reset to tidy up error and remove handling.
* ad7793
  - Switch to read_avail from explicit attribute. Mostly done to avoid
    confusing people with a - sign (without surounding spaces) that
    was correct but checkpatch didn't like.
* adis library
  - Add missing newlines at end of error messages.
* adis16400
  - Use DEFINE_DEBUGS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTR.
* adis16460
  - Use DEFINE_DEBUGS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTR.
* ad_sigma_delta
  - Move some channel definitions into individual drivers to avoid
    having to deal with complex options.
* ak8974
  - Silence an error on deffered probe.
* bmp280
  - Harden against IRQ before registration.
  - Convert to read_avail instead of opencoding the equivalent.
  - Explicitly mark GPIO as optional.
  - Cleanup casts.
  - Remove line breaks from strings.
* htts221
  - Replace direct access to platform_data with dev_get_platdata().
  - Use device properties rather than device tree ones to allow ACPI
    probing.
  - Casting cleanups.
* intel_mrfld_adc
  - Don't use unaligned accessor for aligned data.
* isl29125
  - Reorder buer pre and post hooks to allow for coming core rework.
* ltc2983
  - Remove comp to bool.
* max1363
  - Stop using mlock from the iio_dev directly in favour of a local lock
    with clearly defined scope.
* max30100
  - Use generic device properties to allow ACPI probe.
* mpu6050
  - Convert to i2c_new_client_device.
  - Add debugfs register access.
* st_lsm6dsx
  - Provide means of configuring full scale on slave device if supported.
  - Drop include of st_sensors header to get one value. Its not otherwise
    used by this driver.
* st-sensors
  - Replace direct access to platform_data with dev_get_platdata().
  - Casting cleanups.
  - Avoid splitting strings.
* st_uvis25
  - Casting cleanups.
* tsl2563
  - Typo fix.
* tsl2772
  - scnprintf in a non obvious string building usecase. Note also 'fixes'
    a wrong calculation of remaining space that couldn't actually cause
    any trouble as there was lots of room.
* xilinx-xadc
  - Fix Lars-Peter spelling his own name wrong :) + additional typos.

* tag 'iio-for-5.8a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (101 commits)
  iio: magnetometer: ak8974: Silence deferred-probe error
  Documentation: ABI: document IIO in_proximity_nearlevel file
  iio: vcnl4000: Export near level property for proximity sensor
  dt-bindings: iio: light: vcnl4000: Add proximity-near-level
  dt-bindings: iio: Introduce common properties for iio sensors
  dt-bindings: iio: vcnl4000: convert bindings to YAML format
  iio: Fix misspellings of "Analog Devices"
  iio: light: isl29125: fix iio_triggered_buffer_{predisable,postenable} positions
  iio: adc: fsl-imx25-gcq: Use devm_platform_ioremap_resource
  iio: adc: at91-adc: Use devm_platform_ioremap_resource
  iio: adc: sun4i-gpadc-iio: Use devm_platform_ioremap_resource
  iio:light:ltr501: Drop unnecessary cast of parameter in regmap_bulk_read
  iio:magn:mmc35240: Drop unnecessary casts of val parameter in regmap_bulk*
  iio:imu:mpu6050: Tidy up parameters to regmap_bulk functions.
  iio:chemical:bme680: Tidy up parameters to regmap_bulk_read
  iio:chemical:atlas-sensor: Drop unnecessary explicit casts in regmap_bulk_read calls
  iio:accel:mxc4005: Drop unnecessary explicit casts in regmap_bulk_read calls
  iio: imu: st_lsm6dsx: drop huge include in sensor-hub driver
  iio: buffer: drop devm_iio_kfifo_free() API call
  iio: buffer: drop devm_iio_hw_consumer_free() API call
  ...
2020-04-23 11:06:48 +02:00
Alexandru Lazar 8a80a71d90 iio: adc: Add MAX1241 driver
Add driver for the Maxim MAX1241 12-bit, single-channel ADC.

Datasheet: https://datasheets.maximintegrated.com/en/ds/MAX1240-MAX1241.pdf
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Alexandru Lazar <alazar@startmail.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:31 +01:00
Michael Hennerich ad67971202 iio: adc: ad9467: add support AD9467 ADC
The AD9467 is a 16-bit, monolithic, IF sampling analog-to-digital converter
(ADC). It is optimized for high performanceover wide bandwidths and ease of
use. The product operates at a 250 MSPS conversion rate and is designed for
wireless receivers, instrumentation, and test equipment that require a high
dynamic range. The ADC requires 1.8 V and 3.3 V power supplies and a low
voltage differential input clock for full performance operation. No
external reference or driver components are required for many applications.
Data outputs are LVDS compatible (ANSI-644 compatible) and include the
means to reduce the overall current needed for short trace distances.

Since the chip can operate at such high sample-rates (much higher than
classical interfaces), it requires that a DMA controller be used to
interface directly to the chip and push data into memory.
Typically, the AXI ADC IP core is used to interface with it.

Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/AD9467.pdf

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:23 +01:00
Michael Hennerich ef04070692 iio: adc: adi-axi-adc: add support for AXI ADC IP core
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 <michael.hennerich@analog.com>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-04-19 16:56:22 +01:00
Linus Torvalds 8645f09bad - New Drivers
- Add support for IQS620A/621/622/624/625 Azoteq IQS62X Sensors
 
  - New Device Support
    - Add support for ADC, IRQ, Regulator, RTC and WDT to Ricoh RN5T618 PMIC
    - Add support for Comet Lake to Intel LPSS
 
  - New Functionality
    - Add support for Charger Detection to Spreadtrum SC27xx PMICs
    - Add support for Interrupt Polarity to Dialog Semi DA9062/61 PMIC
    - Add ACPI enumeration support to Diolan DLN2 USB Adaptor
 
  - Fix-ups
    - Device Tree; iqs62x, rn5t618, cros_ec_dev, stm32-lptimer, rohm,bd71837, rohm,bd71847
    - I2C registration; rn5t618
    - Kconfig; MFD_CPCAP, AB8500_CORE, MFD_WM8994, MFD_WM97xx, MFD_STPMIC1
    - Use flexible-array members; omap-usb-tll, qcom-pm8xxx
    - Remove unnecessary casts; omap-usb-host, omap-usb-tll
    - Power (suspend/resume/poweroff) enhancements; rk808
    - Improve error/sanity checking; dln2
    - Use snprintf(); aat2870-core
 
  - Bug Fixes
    - Fix PCI IDs; intel-lpss-pci
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAl6MSwsACgkQUa+KL4f8
 d2GklhAAk1e0tYu1w4yS0IE40mReDk5ycOE1O8Q75qWw5Af2dK48qvSHGDwaU4ES
 WNYZ3Mr/OUrvd+/XU8EXI6NXAi9W75ye2J2KmmDDL6yXnDuHbzBZF8ifEtXQKSOp
 rElzCJVnXehpjSfwa4cp5f1Msox/rFg1Kpmaas48j8U2JYCmn51GsQCCG6qMIx2i
 0ZvXNZuz+eTY3V7l6pRLfTYqwR8E5Y11ryWJaeliyDcVpUlZaykiXuxD7pbqLjJo
 8v9ISm67rzf6X5zmi6YhdvpIAzpomdRaaxHfVDkeCKqDgpuWGiq0xXA86vDKwjah
 qVx6rK/wg4YM5uSEomxIgVj9uvvLSytDqvRlPe7vFKgkR0Xhl5SdkiwadI4P9zkr
 zrRGNRAUHsZ4ZrlObD0QJWOQYnIg5oCmRouRKcHtQVZYP3rSdRz/1oC6FN8LVqUw
 3NfLB/S6uBCJ3uahckrgnjQughnvmsAzlflcNV2t+P8di8Cwyh2A5N9qkT/oI67o
 Xf7NODSdu0JzzTgsM+EJ2JphSLMYaekWs06qAXyibPrrS2SoThE79igCmNOkyyR7
 obJfN2SM5k4LkhMGlYbPfbRT2Hoa+9OJozBe3WgiW3kwTdFVB9aen2U230tHplbB
 g/NuVS+PrReR5lfzT+O8dodH7lj5/GhmGsapdguFVhXYIE+2CMg=
 =hJ2o
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull mfd updates from Lee Jones:
 "New Drivers:
   - Add support for IQS620A/621/622/624/625 Azoteq IQS62X Sensors

  New Device Support:
   - Add support for ADC, IRQ, Regulator, RTC and WDT to Ricoh RN5T618 PMIC
   - Add support for Comet Lake to Intel LPSS

  New Functionality:
   - Add support for Charger Detection to Spreadtrum SC27xx PMICs
   - Add support for Interrupt Polarity to Dialog Semi DA9062/61 PMIC
   - Add ACPI enumeration support to Diolan DLN2 USB Adaptor

  Fix-ups:
   - Device Tree; iqs62x, rn5t618, cros_ec_dev, stm32-lptimer, rohm,bd71837, rohm,bd71847
   - I2C registration; rn5t618
   - Kconfig; MFD_CPCAP, AB8500_CORE, MFD_WM8994, MFD_WM97xx, MFD_STPMIC1
   - Use flexible-array members; omap-usb-tll, qcom-pm8xxx
   - Remove unnecessary casts; omap-usb-host, omap-usb-tll
   - Power (suspend/resume/poweroff) enhancements; rk808
   - Improve error/sanity checking; dln2
   - Use snprintf(); aat2870-core

  Bug Fixes:
   - Fix PCI IDs in intel-lpss-pci"

* tag 'mfd-next-5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (33 commits)
  mfd: intel-lpss: Fix Intel Elkhart Lake LPSS I2C input clock
  mfd: aat2870: Use scnprintf() for avoiding potential buffer overflow
  mfd: dln2: Allow to be enumerated via ACPI
  mfd: da9062: Add support for interrupt polarity defined in device tree
  dt-bindings: bd718x7: Yamlify and add BD71850
  mfd: dln2: Fix sanity checking for endpoints
  mfd: intel-lpss: Add Intel Comet Lake PCH-V PCI IDs
  mfd: sc27xx: Add USB charger type detection support
  dt-bindings: mfd: Document STM32 low power timer bindings
  mfd: rk808: Convert RK805 to shutdown/suspend hooks
  mfd: rk808: Reduce shutdown duplication
  mfd: rk808: Stop using syscore ops
  mfd: rk808: Ensure suspend/resume hooks always work
  mfd: rk808: Always use poweroff when requested
  mfd: omap: Remove useless cast for driver.name
  mfd: Kconfig: Fix some misspelling of the word functionality
  mfd: pm8xxx: Replace zero-length array with flexible-array member
  mfd: omap-usb-tll: Replace zero-length array with flexible-array member
  mfd: cpcap: Fix compile if MFD_CORE is not selected
  mfd: cros_ec: Check DT node for usbpd-notify add
  ...
2020-04-07 19:48:52 -07:00
Andreas Kemnade 87a25333c8 iio: adc: rn5t618: Add ADC driver for RN5T618/RC5T619
Both chips have an A/D converter capable of measuring
things like VBAT, VUSB and analog inputs.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2020-03-27 09:42:37 +00:00
Alexandru Tachici b581f748cc staging: iio: adc: ad7192: move out of staging
Move ad7192 ADC driver out of staging into mainline.

Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2020-03-08 17:28:33 +00:00
Uwe Kleine-König e4c5c4dfaa iio: adc: new driver to support Linear technology's ltc2496
This chip is similar to the LTC2497 ADC, it just uses SPI instead of I2C
and so has a slightly different protocol. Only the actual hardware
access is different. The spi protocol is different enough to not be able
to map the differences via a regmap.

Also generalize the entry in MAINTAINER to cover the newly introduced
file.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-12-15 12:15:19 +00:00
Uwe Kleine-König 69548b7c2c iio: adc: ltc2497: split protocol independent part in a separate module
This allows to share most of this driver for the ltc2496 driver added in
the next commit that is an SPI variant of the ltc2497. Initially I named
the generic part ltc249x, but wild card names are frowned upon, so the
generic part is called ltc2497-core even though it's not obvious that
this is then to be reused for the ltc2496 driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-12-15 12:15:19 +00:00
Beniamin Bia 7c93f54e5b iio: adc: Move AD7091R5 entry in a alphabetical order in Makefile
Ad7091R5 was added in a non alphabetical order after AD7124 in Makefile and
KConfig. This patch fixes that and place Ad7091R5 before AD7124.

Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-12-15 11:42:16 +00:00
Paul Cercueil ca69300173 iio: adc: Add support for AD7091R5 ADC
AD7091R5 is 4-Channel, I2C, Ultra Low Power,12-Bit ADC.

This driver will also support AD7091R2/4/8 in the future.

Datasheet:
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7091r-5.pdf

Signed-off-by: Paul Cercueil <paul.cercueil@analog.com>
Co-developed-by: Beniamin Bia <beniamin.bia@analog.com>
Signed-off-by: Beniamin Bia <beniamin.bia@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-16 17:01:00 +00:00
Marcelo Schmitt 506d2e317a iio: adc: Add driver support for AD7292
The AD7292 is a 10-bit monitor and control system with ADC, DACs,
temperature sensor, and GPIOs.

Configure AD7292 devices in direct access mode, enabling single-ended
ADC readings.

Datasheet:
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7292.pdf

Signed-off-by: Marcelo Schmitt <marcelo.schmitt1@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-11-10 17:09:36 +00:00
Jonathan Cameron 16922ffee1 Merge branch 'ib-ab8500-5.4-rc1' into HEAD
Immutable branch as considerable overlap with mfd, power and hwmon.
2019-10-18 19:46:10 +01:00
Linus Walleij 07063bbfa9 iio: adc: New driver for the AB8500 GPADC
This is a new driver for the ST-Ericsson AB8500 GPADC, which
replaces the old driver in drivers/mfd/ab8500-gpadc.c and
thus gets rid of another necessarily different custom driver
from the times before IIO existed.

The AB8500 GPADC can convert 10 different channels and these
are used for monitoring voltages in the U8500 chipset, some
are used for battery charging, some for temperature
monitoring.

As this is very core functionality that a lot of drivers
depend on and was formerly compiled in with the AB8500 core
driver, we deafault it to 'y' in Kconfig: it can be compiled
out but it is really not advisible: the platform can
for example overheat if we do.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-18 19:37:44 +01:00
Vincent Pelletier a711866273 iio: adc: intel_mrfld_adc: Add Basin Cove ADC driver
Exposes the ADC device present on, at least, Intel Merrifield platform.

Based on work done by:
  Yang Bin <bin.yang@intel.com>
  Huiquan Zhong <huiquan.zhong@intel.com>
  Sumeet Pawnikar <sumeet.r.pawnikar@intel.com>
  Pavan Kumar S <pavan.kumar.s@intel.com>

Though it has been heavily rewritten for upstream.

Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-10-15 21:11:07 +01:00
Gregory CLEMENT 8dd2d7c0fe iio: adc: Add driver for the TI ADS8344 A/DC chips
This adds support for the Texas Instruments ADS8344 ADC chip. This chip
has a 16-bit 8-Channel ADC and is access directly through SPI.

Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-22 11:34:13 +01:00
Renato Lui Geh 9fb27f807e staging: iio: ad7780: moving ad7780 out of staging
Move ad7780 ADC driver out of staging and into the mainline.

The ad7780 is a sigma-delta analog to digital converter. This driver provides
reading voltage values and status bits from both the ad778x and ad717x series.
Its interface also allows writing on the FILTER and GAIN GPIO pins on the
ad778x.

Signed-off-by: Renato Lui Geh <renatogeh@gmail.com>
Signed-off-by: Giuliano Belinassi <giuliano.belinassi@usp.br>
Co-developed-by: Giuliano Belinassi <giuliano.belinassi@usp.br>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-04-04 20:20:06 +01:00
Linus Torvalds cf2e8c544c - New Drivers
- Add STMPE ADC Input driver
    - Add STMicroelectronics STPMIC1 Parent driver
    - Add STMicroelectronics STPMIC1 OnKey Misc driver
    - Add STMicroelectronics STPMIC1 Watchdog driver
    - Add Cirrus Logic Lochnagar Parent driver
    - Add TQ-Systems TQMX86 Parent driver
 
  - New Device Support
    - Add support for ADC to STMPE
 
  - New (or moved) Functionality
    - Move Lightbar functionality to its own driver; cros_ec_lightbar
    - Move VBC functionality to its own driver; cros_ec_vbc
    - Move VBC functionality to its own driver; cros_ec_vbc
    - Move DebugFS functionality to its own driver; cros_ec_debugfs
    - Move SYSFS functionality to its own driver; cros_ec_sysfs
    - Add support for input voltage options; tps65218
 
  - Fix-ups
    - Use devm_* managed resources; cros_ec
    - Device Tree documentation; stmpe, aspeed-lpc, lochnagar
    - Trivial Clean-ups; stmpe
    - Rip out broken modular code; aat2870-core, adp5520, as3711,
          db8500-prcmu, htc-i2cpld, max8925-core, rc5t583, sta2x11-mfd,
 	 syscon, tps65090, tps65910, tps68470 tps80031, wm831x-spi,
 	 wm831x-i2c, wm831x-core, wm8350-i2c, wm8350-core, wm8400-core
    - Kconfig fixups; INTEL_SOC_PMIC
    - Improve error path; sm501, sec-core
    - Use struct_size() helper; sm501
    - Constify; at91-usart
    - Use pointers instead of copying data; at91-usart
    - Deliver proper return value; cros_ec_dev
    - Trivial formatting/whitespace; sec-core
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAlyA5j4ACgkQUa+KL4f8
 d2EAyw/+N7N77ex5Ryxmyn61SWvgTL221tj+olw6RqC92Vfw6S2ZFP1CsM/E7tZb
 qCLYkkJSgBLKoOCI5OLiXsvWCPjyLU33nG/oS0SSiMJ1Fp9M0h7uRnOtOio3z31i
 w9MJAvEY3RN8I1bRGMO6aWUtT0q3AzHNtdl+7BqAkjjeXiUE0lGd5eARRS1zRWSa
 ki0OzUkJeszPk+6E6N0K+BQZxcL3cBEsR8ZAif903cMEbqsJIv4nmif4b5D63BKH
 PtOLn+6HVMG4bzqRRytVhcO/z2uj2jlLCHH9wBnyd4b7SoLFuz15yN5DhD4bKLt7
 0UMqiBlC2MeaTv3wyKjeNPQtaMY7zJNUpdFly1PHAYR4oy5kbqk2IAv30N/zRfPK
 zLmWWq7DYdazBxSSGKmpGEW63Dkr/MQY2oj4nUlcank/X0K7LvmXv7kIxp9jJhA5
 bE76f77uHneHvq5OTc5CZtaYNqZbE6tO8rqZ2QlfCqa0M8VxbcrYiym0fQFJBdsH
 eFtaTG162ssZq1npV759c4/2E3zQ3EW+rj89/AWp8ViJULQLyPY2nUYddx+w04Se
 kSdgYCvMI5byvF+Tuq/CbUWz7kyca3D+EFiYTkzIfrZr+4yiG2VO8wEO1knkEUVo
 9X/wnAD5hQJePEM8CyPZrnirndB0W6SAvSmRZlF/OAbuCBz1DkQ=
 =tUge
 -----END PGP SIGNATURE-----

Merge tag 'mfd-next-5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd

Pull MFD updates from Lee Jones:
 "New Drivers:
   - Add STMPE ADC Input driver
   - Add STMicroelectronics STPMIC1 Parent driver
   - Add STMicroelectronics STPMIC1 OnKey Misc driver
   - Add STMicroelectronics STPMIC1 Watchdog driver
   - Add Cirrus Logic Lochnagar Parent driver
   - Add TQ-Systems TQMX86 Parent driver

  New Device Support:
   - Add support for ADC to STMPE

  New (or moved) Functionality:
   - Move Lightbar functionality to its own driver; cros_ec_lightbar
   - Move VBC functionality to its own driver; cros_ec_vbc
   - Move VBC functionality to its own driver; cros_ec_vbc
   - Move DebugFS functionality to its own driver; cros_ec_debugfs
   - Move SYSFS functionality to its own driver; cros_ec_sysfs
   - Add support for input voltage options; tps65218

  Fixes:
   - Use devm_* managed resources; cros_ec
   - Device Tree documentation; stmpe, aspeed-lpc, lochnagar
   - Trivial Clean-ups; stmpe
   - Rip out broken modular code; aat2870-core, adp5520, as3711,
         db8500-prcmu, htc-i2cpld, max8925-core, rc5t583, sta2x11-mfd,
	 syscon, tps65090, tps65910, tps68470 tps80031, wm831x-spi,
	 wm831x-i2c, wm831x-core, wm8350-i2c, wm8350-core, wm8400-core
   - Kconfig fixups; INTEL_SOC_PMIC
   - Improve error path; sm501, sec-core
   - Use struct_size() helper; sm501
   - Constify; at91-usart
   - Use pointers instead of copying data; at91-usart
   - Deliver proper return value; cros_ec_dev
   - Trivial formatting/whitespace; sec-core"

* tag 'mfd-next-5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (53 commits)
  mfd: mxs-lradc: Mark expected switch fall-through
  mfd: sec-core: Cleanup formatting to a consistent style
  mfd: tqmx86: IO controller with I2C, Wachdog and GPIO
  mfd: intel-lpss: Move linux/pm.h to the local header
  mfd: cros_ec_dev: Return number of bytes read with CROS_EC_DEV_IOCRDMEM
  mfd: tps68470: Drop unused MODULE_DEVICE_TABLE
  mfd: at91-usart: No need to copy mfd_cell in probe
  mfd: at91-usart: Constify at91_usart_spi_subdev and at91_usart_serial_subdev
  mfd: lochnagar: Add support for the Cirrus Logic Lochnagar
  mfd: lochnagar: Add initial binding documentation
  dt-bindings: mfd: aspeed-lpc: Make parameter optional
  mfd: sec-core: Return gracefully instead of BUG() if device cannot match
  mfd: sm501: Use struct_size() in devm_kzalloc()
  mfd: sm501: Fix potential NULL pointer dereference
  mfd: Kconfig: Fix I2C_DESIGNWARE_PLATFORM dependencies
  mfd: tps65218.c: Add input voltage options
  mfd: wm8400-core: Make it explicitly non-modular
  mfd: wm8350-core: Drop unused module infrastructure from non-modular code
  mfd: wm8350-i2c: Make it explicitly non-modular
  mfd: wm831x-core: Drop unused module infrastructure from non-modular code
  ...
2019-03-08 10:02:58 -08:00
Artur Rojek 1a78daea10 IIO: add Ingenic JZ47xx ADC driver.
Add an IIO driver for the ADC hardware present on Ingenic JZ47xx SoCs.

Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-02-09 18:46:01 +00:00
Stefan Popa a5f8c7da3d iio: adc: Add AD7768-1 ADC basic support
The ad7768-1 is a single channel, precision 24-bit analog to digital
converter (ADC).

This basic patch configures the device in fast mode, with 32 kSPS and
leaves the default sinc5 filter.

Two data conversion modes are made available. When data is retrieved by
using the read_raw attribute, one shot single conversion mode is set.
The continuous conversion mode is enabled when the triggered buffer
mechanism is used. To assure correct data retrieval, the driver waits
for the interrupt triggered by the low to high transition of the DRDY
pin.

Datasheets:
Link: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7768-1.pdf

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-02-02 10:28:56 +00:00
Tomer Maimon 9bf85fbc9d iio: adc: add NPCM ADC driver
Add Nuvoton NPCM BMC Analog-to-Digital Converter(ADC) driver.

The NPCM ADC is a 10-bit converter for eight channel inputs.

Signed-off-by: Tomer Maimon <tmaimon77@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-01-19 18:58:54 +00:00
Stefan Agner 9f3d084965 iio: adc: add STMPE ADC driver using IIO framework
This adds an ADC driver for the STMPE device using the industrial
input/output interface. The driver supports raw reading of values.
The driver depends on the MFD STMPE driver. If the touchscreen
block is enabled too, only four of the 8 ADC channels are available.

Signed-off-by: Stefan Agner <stefan@agner.ch>
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2019-01-16 12:37:04 +00:00
Dan Murphy e717f8c6df iio: adc: Add the TI ads124s08 ADC code
Introduce the TI ADS124S08 and the ADS124S06 ADC
devices from TI.  The ADS124S08 is the 12 channel ADC
and the ADS124S06 is the 6 channel ADC device

These devices share a common datasheet:
http://www.ti.com/lit/gpn/ads124s08

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-01-12 18:42:39 +00:00
Stefan Popa 2985a5d884 staging: iio: adc: ad7606: Move out of staging
Move ad7606 ADC driver out of staging and into the mainline.

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2019-01-05 16:10:59 +00:00
Stefan Popa b3af341bbd iio: adc: Add ad7124 support
The ad7124-4 and ad7124-8 are a family of 4 and 8 channel sigma-delta ADCs
with 24-bit precision and reference.

Three power modes are available which in turn affect the output data rate:
 * Full power: 9.38 SPS to 19,200 SPS
 * Mid power: 2.34 SPS to 4800 SPS
 * Low power: 1.17 SPS to 2400 SPS

The ad7124-4 can be configured to have four differential inputs, while
ad7124-8 can have 8. Moreover, ad7124 also supports per channel
configuration. Each configuration consists of gain, reference source,
output data rate and bipolar/unipolar configuration.

Datasheets:
Link: http://www.analog.com/media/en/technical-documentation/data-sheets/AD7124-4.pdf
Link: http://www.analog.com/media/en/technical-documentation/data-sheets/ad7124-8.pdf

Signed-off-by: Stefan Popa <stefan.popa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-11-17 16:41:09 +00:00
Charles-Antoine Couret 7f40e06143 iio:adc:ad7949: Add AD7949 ADC driver family
Compatible with AD7682 and AD7689 chips.
It is a Analog Devices ADC driver 14/16 bits 4/8 channels
with SPI protocol

Datasheet of the device:
http://www.analog.com/media/en/technical-documentation/data-sheets/AD7949.pdf

Signed-off-by: Charles-Antoine Couret <charles-antoine.couret@essensium.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-11-03 09:44:34 +00:00
Marcus Folkesson 3a89b289df iio: adc: add support for mcp3911
MCP3911 is a dual channel Analog Front End (AFE) containing two
synchronous sampling delta-sigma Analog-to-Digital Converters (ADC).

Co-developed-by: Kent Gustavsson <kent@minoris.se>
Signed-off-by: Kent Gustavsson <kent@minoris.se>
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-08-19 20:02:48 +01:00
Siddartha Mohanadoss e13d757279 iio: adc: Add QCOM SPMI PMIC5 ADC driver
This patch adds support for QCOM SPMI PMIC5 family
of ADC driver that supports hardware based offset and
gain compensation. The ADC peripheral can measure both
voltage and current channels whose input signal is
connected to the PMIC ADC AMUX.

The register set and configuration has been refreshed
compared to the prior QCOM PMIC ADC family. Register
ADC5 as part of the IIO framework.

Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-08-18 18:11:43 +01:00
Freeman Liu 5df362a6cf iio: adc: Add Spreadtrum SC27XX PMICs ADC support
The Spreadtrum SC27XX PMICs ADC controller contains 32 channels,
which is used to sample voltages with 12 bits conversion.

[Baolin Wang did lots of improvements]

Signed-off-by: Freeman Liu <freeman.liu@spreadtrum.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2018-06-30 18:59:40 +01:00