diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-13 13:13:36 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-13 13:13:36 -0500 |
| commit | 39272dde8ffcfd1322209e05f3f8fa4d14f796de (patch) | |
| tree | 1c06907119d0ae484319379ec4404edf95ac37b5 /include/linux/mfd | |
| parent | 67ad058d97b8cff441211b791d97e5f776b81210 (diff) | |
| parent | 841e3ed977e0284e3680d6345d880a64e8072573 (diff) | |
Merge tag 'staging-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH:
"Here is the big staging driver pull request for 4.5-rc1.
Lots of cleanups and fixes here, not as many as some releases, but
800+ isn't that bad. Full details in the shortlog. All of these have
been in linux-next for a while"
* tag 'staging-4.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (843 commits)
Revert "arm64: dts: Add dts files to enable ION on Hi6220 SoC."
staging: gdm724x: constify tty_port_operations structs
staging: gdm72xx: add userspace data struct
staging: gdm72xx: Replace timeval with ktime_t
iio: adc: ina2xx: Fix incorrect report of data endianness to userspace.
iio: light: us5182d: Refactor read_raw function
iio: light: us5182d: Add interrupt support and events
iio: light: us5182d: Fix enable status inconcistency
iio: Make IIO value formating function globally available.
staging: emxx_udc: use list_first_entry_or_null()
staging/emxx_udc: fix 64-bit warnings
STAGING: COMEDI: Using kernel types in plx9080.h
STAGING: COMEDI: Added spaces around binary operators in plx9080.h
STAGING: COMEDI: Fixed format of comments in plx9080.h
staging: comedi: comedilib.h: Coding style warning fix for block comments
staging: comedi: s526: add macros for counter control reg values
staging: comedi: s526: replace counter mode bitfield struct
staging: comedi: check for more errors for zero-length write
staging: comedi: simplify returned errors for comedi_write()
staging: comedi: return error on "write" if no command set up
...
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 { | |||
| 134 | struct regulator_config config); | 134 | struct regulator_config config); |
| 135 | }; | 135 | }; |
| 136 | 136 | ||
| 137 | struct palmas_adc_wakeup_property { | ||
| 138 | int adc_channel_number; | ||
| 139 | int adc_high_threshold; | ||
| 140 | int adc_low_threshold; | ||
| 141 | }; | ||
| 142 | |||
| 137 | struct palmas_gpadc_platform_data { | 143 | struct palmas_gpadc_platform_data { |
| 138 | /* Channel 3 current source is only enabled during conversion */ | 144 | /* Channel 3 current source is only enabled during conversion */ |
| 139 | int ch3_current; | 145 | int ch3_current; /* 0: off; 1: 10uA; 2: 400uA; 3: 800 uA */ |
| 140 | 146 | ||
| 141 | /* Channel 0 current source can be used for battery detection. | 147 | /* Channel 0 current source can be used for battery detection. |
| 142 | * If used for battery detection this will cause a permanent current | 148 | * If used for battery detection this will cause a permanent current |
| 143 | * consumption depending on current level set here. | 149 | * consumption depending on current level set here. |
| 144 | */ | 150 | */ |
| 145 | int ch0_current; | 151 | int ch0_current; /* 0: off; 1: 5uA; 2: 15uA; 3: 20 uA */ |
| 152 | bool extended_delay; /* use extended delay for conversion */ | ||
| 146 | 153 | ||
| 147 | /* default BAT_REMOVAL_DAT setting on device probe */ | 154 | /* default BAT_REMOVAL_DAT setting on device probe */ |
| 148 | int bat_removal; | 155 | int bat_removal; |
| 149 | 156 | ||
| 150 | /* Sets the START_POLARITY bit in the RT_CTRL register */ | 157 | /* Sets the START_POLARITY bit in the RT_CTRL register */ |
| 151 | int start_polarity; | 158 | int start_polarity; |
| 159 | |||
| 160 | int auto_conversion_period_ms; | ||
| 161 | struct palmas_adc_wakeup_property *adc_wakeup1_data; | ||
| 162 | struct palmas_adc_wakeup_property *adc_wakeup2_data; | ||
| 152 | }; | 163 | }; |
| 153 | 164 | ||
| 154 | struct palmas_reg_init { | 165 | struct palmas_reg_init { |
| @@ -405,28 +416,7 @@ struct palmas_gpadc_calibration { | |||
| 405 | s32 offset_error; | 416 | s32 offset_error; |
| 406 | }; | 417 | }; |
| 407 | 418 | ||
| 408 | struct palmas_gpadc { | 419 | #define PALMAS_DATASHEET_NAME(_name) "palmas-gpadc-chan-"#_name |
| 409 | struct device *dev; | ||
| 410 | struct palmas *palmas; | ||
| 411 | |||
| 412 | int ch3_current; | ||
| 413 | int ch0_current; | ||
| 414 | |||
| 415 | int gpadc_force; | ||
| 416 | |||
| 417 | int bat_removal; | ||
| 418 | |||
| 419 | struct mutex reading_lock; | ||
| 420 | struct completion irq_complete; | ||
| 421 | |||
| 422 | int eoc_sw_irq; | ||
| 423 | |||
| 424 | struct palmas_gpadc_calibration *palmas_cal_tbl; | ||
| 425 | |||
| 426 | int conv0_channel; | ||
| 427 | int conv1_channel; | ||
| 428 | int rt_channel; | ||
| 429 | }; | ||
| 430 | 420 | ||
| 431 | struct palmas_gpadc_result { | 421 | struct palmas_gpadc_result { |
| 432 | s32 raw_code; | 422 | s32 raw_code; |
| @@ -520,6 +510,43 @@ enum palmas_irqs { | |||
| 520 | PALMAS_NUM_IRQ, | 510 | PALMAS_NUM_IRQ, |
| 521 | }; | 511 | }; |
| 522 | 512 | ||
| 513 | /* Palmas GPADC Channels */ | ||
| 514 | enum { | ||
| 515 | PALMAS_ADC_CH_IN0, | ||
| 516 | PALMAS_ADC_CH_IN1, | ||
| 517 | PALMAS_ADC_CH_IN2, | ||
| 518 | PALMAS_ADC_CH_IN3, | ||
| 519 | PALMAS_ADC_CH_IN4, | ||
| 520 | PALMAS_ADC_CH_IN5, | ||
| 521 | PALMAS_ADC_CH_IN6, | ||
| 522 | PALMAS_ADC_CH_IN7, | ||
| 523 | PALMAS_ADC_CH_IN8, | ||
| 524 | PALMAS_ADC_CH_IN9, | ||
| 525 | PALMAS_ADC_CH_IN10, | ||
| 526 | PALMAS_ADC_CH_IN11, | ||
| 527 | PALMAS_ADC_CH_IN12, | ||
| 528 | PALMAS_ADC_CH_IN13, | ||
| 529 | PALMAS_ADC_CH_IN14, | ||
| 530 | PALMAS_ADC_CH_IN15, | ||
| 531 | PALMAS_ADC_CH_MAX, | ||
| 532 | }; | ||
| 533 | |||
| 534 | /* Palmas GPADC Channel0 Current Source */ | ||
| 535 | enum { | ||
| 536 | PALMAS_ADC_CH0_CURRENT_SRC_0, | ||
| 537 | PALMAS_ADC_CH0_CURRENT_SRC_5, | ||
| 538 | PALMAS_ADC_CH0_CURRENT_SRC_15, | ||
| 539 | PALMAS_ADC_CH0_CURRENT_SRC_20, | ||
| 540 | }; | ||
| 541 | |||
| 542 | /* Palmas GPADC Channel3 Current Source */ | ||
| 543 | enum { | ||
| 544 | PALMAS_ADC_CH3_CURRENT_SRC_0, | ||
| 545 | PALMAS_ADC_CH3_CURRENT_SRC_10, | ||
| 546 | PALMAS_ADC_CH3_CURRENT_SRC_400, | ||
| 547 | PALMAS_ADC_CH3_CURRENT_SRC_800, | ||
| 548 | }; | ||
| 549 | |||
| 523 | struct palmas_pmic { | 550 | struct palmas_pmic { |
| 524 | struct palmas *palmas; | 551 | struct palmas *palmas; |
| 525 | struct device *dev; | 552 | struct device *dev; |
