Commit Graph

11 Commits

Author SHA1 Message Date
Patil, Rachna 5e53a69b44 IIO : ADC: tiadc: Add support of TI's ADC driver
This patch adds support for TI's ADC driver.
This is a multifunctional device.
Analog input lines are provided on which
voltage measurements can be carried out.
You can have upto 8 input lines.

Signed-off-by: Patil, Rachna <rachna@ti.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-11-05 23:50:27 +01:00
Kim, Milo f0347c36cc iio: adc: add new lp8788 adc driver
TI LP8788 PMU provides regulators, battery charger, ADC,
 RTC, backlight driver and current sinks.

 This patch enables the LP8788 ADC functions.

 The LP8788 ADC has several ADC input selection and supports 12bit resolution.
 Internal operation of getting ADC is access to registers of LP8788.
 The LP8788 ADC uses exported functions for accessing these registers.
 (exported by LP8788 MFD device driver)

 This driver supports IIO_CHAN_INFO_RAW and SCALE.
 So the IIO consumer can calculate the value with raw and scale.
 The unit of scale is micro.

 (ADC Input Selection)

 Voltage: battery voltage (MAX 5.0, 5.5 and 6.0V)
          charger input voltage
          four general ADC inputs
          coin cell voltage
 Current: battery charging current
 Temperature: IC temperature

 (The IIO map for the IIO consumer)

 The ADC input is configurable in the platform side.
 Even though this platform data is not defined,
 the default IIO map is created for supporting the power supply driver.
 The battery voltage and temperature are used inside this driver.

 (History)

 Patch v6.
 (a) Fix scale value for each ADC input selection
 Voltage and current type are mili unit and temperature is degree.
 To calculate the IC temperature,
 temp = raw * scaleint + (raw * scalepart)/ 1000000, scaleint is always 0.
      = raw * 0.061050, raw: 0 ~ 4095
 Then range of IC temperature(ADC result) is 0 ~ 250'C

 (b) Reorganization of the IIO channel Spec
 Remove address, scan_type and scan_index and rollback the datasheet name.
 The reason why 'address' field is unnecessary is no relation with each channel.
 Moreover, to get the raw ADC value, the address info is not only one register
 but also several registers.
 Therefore specific function(lp8788_get_adc_result) is called rather than
 using one 'address' field.

 (c) Fix coding style
 Remove duplicated checking routine while unregistering the IIO map.
 Fix code for space and parenthesis.

 Patch v5.
 Fix default consumer name as 'lp8788-charger'.
 Add mutex for ADC read operation.
 Reorganization on lp8788_adc_read_raw().

 Patch v4.
 Fix adc_raw function: support RAW and SCALE channel info.
 Change LP8788 ADC platform data - iio map.
 Enables the default IIO map.

 Patch v3.
 Fix wrong size of allocating iio private data.
 Fix coding styles.

 Patch v2.
 Support RAW and SCALE interface for IIO consumer.
 Clean up the iio channel spec macro.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-22 10:29:19 +01:00
Lars-Peter Clausen c26cc89e8d iio:ad7476: Add support for ad7273/ad7274/ad7276/ad7277/ad7278
The ad7276/ad7277/ad7278 are similar to the ad7476/ad7477/ad7478 but have the
same number of leading zeros as the ad7940. The ad7273/ad7274 have a extra pin
for VREF where as for the ad7276/ad7277/ad7278 VREF is taken from VDD, but
otherwise they are compatible to the ad7276/ad7277.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-15 10:02:16 +01:00
Lars-Peter Clausen 4c337de870 iio:ad7476: Add ad7940 support
The AD7940 is a single channel 14 bit ADC similar to the ADCs already supported
by the ad7476 driver, but it does have a different shift factor.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-15 10:02:15 +01:00
Lars-Peter Clausen ac5332b147 iio:ad7476: Add ad7910/ad7920 device table entries
The ad7910/ad7920 are software compatible to the ad7467/ad7466.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-15 10:02:15 +01:00
Lars-Peter Clausen 968f3d5ba0 iio: Move ad7476 driver out of staging
The ad7476 driver is a driver for simple single channel ADCs. The driver does
not export any experimental or custom ABI files nor do the static code check
tools report any issues, so move the driver out of staging.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-15 10:02:14 +01:00
Lars-Peter Clausen 7b123c85bb staging:iio:adc: Add AD7791 driver
This patch adds support for the Analog Devices AD7787, AD7788, AD7789, AD7790
and AD7791 Sigma Delta Analog-to-Digital converters.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-09-08 10:20:09 +01:00
Lars-Peter Clausen af3008485e iio:adc: Add common code for ADI Sigma Delta devices
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 <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-08-27 17:53:12 +01:00
Lars-Peter Clausen 8ec4cf5303 iio:adc: Add AD7265/AD7266 support
This patch adds support for the Analog Devices AD7265 and AD7266
Analog-to-Digital converters.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2012-06-30 10:15:07 +01:00
Lars-Peter Clausen 90032e4e9c iio:adc:at91: Use new triggered buffer setup helper
Use the new triggered buffer setup helper function to allocate and register
buffer and pollfunc.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18 17:26:09 -07:00
Maxime Ripard 0e589d5fb3 ARM: AT91: IIO: Add AT91 ADC driver.
Add the ADC driver for Atmel's AT91SAM9G20-EK, AT91SAM9M10G45-EK
and AT91SAM9X5 family boards.

It has support for both software and hardware triggers.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-14 13:24:09 -07:00