linux_dsm_epyc7002/drivers/iio
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
..
accel iio: Drop timestamp parameter from buffer store_to callback 2012-09-08 10:14:34 +01:00
adc iio: adc: add new lp8788 adc driver 2012-09-22 10:29:19 +01:00
amplifiers iio: amplifiers: New driver for AD8366 Dual-Digital Variable Gain Amplifier 2012-05-14 13:15:39 -07:00
common iio: hid-sensors: Prevent crash during hot-unplug 2012-09-22 10:07:34 +01:00
dac iio: dac/ad5755: signedness bug in ad5755_setup_pdata() 2012-09-22 10:09:40 +01:00
frequency iio: frequency: ADF4350: Fix potential reference div factor overflow. 2012-08-16 20:24:33 +01:00
gyro iio: Drop timestamp parameter from buffer store_to callback 2012-09-08 10:14:34 +01:00
light iio: Drop timestamp parameter from buffer store_to callback 2012-09-08 10:14:34 +01:00
magnetometer iio: Drop timestamp parameter from buffer store_to callback 2012-09-08 10:14:34 +01:00
iio_core_trigger.h IIO: Move the core files to drivers/iio 2012-04-25 11:11:38 -07:00
iio_core.h IIO: Move the core files to drivers/iio 2012-04-25 11:11:38 -07:00
industrialio-buffer.c iio: Drop timestamp parameter from buffer store_to callback 2012-09-08 10:14:34 +01:00
industrialio-core.c iio: Introduce a new fractional value type 2012-09-15 10:12:22 +01:00
industrialio-event.c iio: Fix unitialized use of list 2012-07-08 20:02:24 +01:00
industrialio-trigger.c iio:trigger: Register sysfs file statically 2012-07-08 10:39:58 +01:00
industrialio-triggered-buffer.c iio: Add helper function for initializing triggered buffers 2012-06-18 17:26:09 -07:00
inkern.c iio: inkern: clean up error return code 2012-09-22 10:13:33 +01:00
Kconfig iio: hid-sensors: Added ALS 2012-09-06 19:24:15 +01:00
kfifo_buf.c iio: Drop timestamp parameter from buffer store_to callback 2012-09-08 10:14:34 +01:00
Makefile iio: hid-sensors: Added ALS 2012-09-06 19:24:15 +01:00