diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-12-01 09:13:29 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-12-01 09:13:29 -0800 |
commit | f3cf3fb7ec854c2b2429e5bb23186746e6511dae (patch) | |
tree | b4e71d2a6422ca33a95f9a1e0458ab90c3b89846 /include/linux/mfd | |
parent | f84a187019ccfce97fbf38fa9f3a8261fef91d8e (diff) | |
parent | 4ac4e086fd8c59e6b69089e6f7605500b63a6d17 (diff) |
Merge tag 'iio-for-4.5a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next
Jonathan writes:
First set of new device support, features and cleanups for IIO in the 4.5 cycle
Usual mixed bag, but the big item perhaps in this series is the DMA buffer
support added by Lars-Peter Clausen. It's been in the works for a long time
and it will be interesting to see what hardware support shows up now that
this is available.
New core features + associate cleanup.
* Add generic DMA buffer infrastructure
* Add a DMAengine framework based buffer
Also associated minor changes.
- Set the device buffer watermark based on the minimum watermark for all
attached buffers rather than just the 'primary' one.
- iio_buffer_init - only set the watermark default if one hasn't already
been provided. This allows simple support for devices with a fixed
watermark.
- read only attribute for watermark on fixed watermark devices.
- add explicit buffer enable/disable callbacks to allow the buffer to
do more than trivial actions when it is being turned on and off.
* IIO_VAL_INT support in write_raw_get_fmt function.
New device support
* Freescale MMA7455/7456L accelerometers
* Memsic MXC6255XC accelerometer
* ST lis2dh12 accelerometer
* TI ADS8688 ADC
* TI Palamas (twl6035/7) gpadc
New driver features
* mma8452
- support either of the available interrupt pins to cope with the case
where board layout has lead to a particular one being connected.
Staging graduation
* Dummy driver
- this driver acts as both an example and a test device for those with
out hardware to develop userspace code against.
Cleanups and minor bits and bobs.
* treewide
- Sort out the ordering of iio_device_register/unregister vs runtime
pm function calls so that it's all nice and consistent and not race
prone.
- Check sscanf return values. None of the cases will actually happen as
the strings are supplied internally, but best to be consistent on this.
* ad7780
- switch over to the gpio descriptor interface and remove the now unused
platform data which gets rid of a header entirely.
* ad7793
- drop a pointless else statement.
* at91_adc
- Swap kmalloc_array in for a kmalloc doing the same job.
* dummy
- get rid of some commented out lines that snuck in during the move of
the driver.
* lm3533-als
- Print an error message on provision of an invalid resistance.
* mcp320x
- Add compatible strings with vendor prefix and deprecate those with
no vendor prefix.
* mxs-lradc
- Use BIT macro in various places rather than shifted ones.
* pa12203001
- Power off the chip if the registration fails.
* pulsedlight-lidar-lite
- add runtime PM support.
* xilinx XADC
- constify an iio_buffer_setup_ops structure.
Diffstat (limited to 'include/linux/mfd')
-rw-r--r-- | include/linux/mfd/palmas.h | 75 |
1 files changed, 51 insertions, 24 deletions
diff --git a/include/linux/mfd/palmas.h b/include/linux/mfd/palmas.h index 13e1d96935ed..c800dbc42079 100644 --- a/include/linux/mfd/palmas.h +++ b/include/linux/mfd/palmas.h @@ -134,21 +134,32 @@ struct palmas_pmic_driver_data { struct regulator_config config); }; +struct palmas_adc_wakeup_property { + int adc_channel_number; + int adc_high_threshold; + int adc_low_threshold; +}; + struct palmas_gpadc_platform_data { /* Channel 3 current source is only enabled during conversion */ - int ch3_current; + int ch3_current; /* 0: off; 1: 10uA; 2: 400uA; 3: 800 uA */ /* Channel 0 current source can be used for battery detection. * If used for battery detection this will cause a permanent current * consumption depending on current level set here. */ - int ch0_current; + int ch0_current; /* 0: off; 1: 5uA; 2: 15uA; 3: 20 uA */ + bool extended_delay; /* use extended delay for conversion */ /* default BAT_REMOVAL_DAT setting on device probe */ int bat_removal; /* Sets the START_POLARITY bit in the RT_CTRL register */ int start_polarity; + + int auto_conversion_period_ms; + struct palmas_adc_wakeup_property *adc_wakeup1_data; + struct palmas_adc_wakeup_property *adc_wakeup2_data; }; struct palmas_reg_init { @@ -405,28 +416,7 @@ struct palmas_gpadc_calibration { s32 offset_error; }; -struct palmas_gpadc { - struct device *dev; - struct palmas *palmas; - - int ch3_current; - int ch0_current; - - int gpadc_force; - - int bat_removal; - - struct mutex reading_lock; - struct completion irq_complete; - - int eoc_sw_irq; - - struct palmas_gpadc_calibration *palmas_cal_tbl; - - int conv0_channel; - int conv1_channel; - int rt_channel; -}; +#define PALMAS_DATASHEET_NAME(_name) "palmas-gpadc-chan-"#_name struct palmas_gpadc_result { s32 raw_code; @@ -520,6 +510,43 @@ enum palmas_irqs { PALMAS_NUM_IRQ, }; +/* Palmas GPADC Channels */ +enum { + PALMAS_ADC_CH_IN0, + PALMAS_ADC_CH_IN1, + PALMAS_ADC_CH_IN2, + PALMAS_ADC_CH_IN3, + PALMAS_ADC_CH_IN4, + PALMAS_ADC_CH_IN5, + PALMAS_ADC_CH_IN6, + PALMAS_ADC_CH_IN7, + PALMAS_ADC_CH_IN8, + PALMAS_ADC_CH_IN9, + PALMAS_ADC_CH_IN10, + PALMAS_ADC_CH_IN11, + PALMAS_ADC_CH_IN12, + PALMAS_ADC_CH_IN13, + PALMAS_ADC_CH_IN14, + PALMAS_ADC_CH_IN15, + PALMAS_ADC_CH_MAX, +}; + +/* Palmas GPADC Channel0 Current Source */ +enum { + PALMAS_ADC_CH0_CURRENT_SRC_0, + PALMAS_ADC_CH0_CURRENT_SRC_5, + PALMAS_ADC_CH0_CURRENT_SRC_15, + PALMAS_ADC_CH0_CURRENT_SRC_20, +}; + +/* Palmas GPADC Channel3 Current Source */ +enum { + PALMAS_ADC_CH3_CURRENT_SRC_0, + PALMAS_ADC_CH3_CURRENT_SRC_10, + PALMAS_ADC_CH3_CURRENT_SRC_400, + PALMAS_ADC_CH3_CURRENT_SRC_800, +}; + struct palmas_pmic { struct palmas *palmas; struct device *dev; |