diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-04 20:32:24 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-04 20:32:24 -0400 |
| commit | 2521129a6d2fd8a81f99cf95055eddea3df914ff (patch) | |
| tree | f8b7879979f656669ce31cbc247b97ae702291fb /include/linux | |
| parent | 98a96f202203fecad65b44449077c695686ad4db (diff) | |
| parent | 16eb2bfc65ef86d3ac6420d50ddc2c48f0023cee (diff) | |
Merge tag 'char-misc-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char / misc driver patches from Greg KH:
"Here's the big driver misc / char pull request for 3.17-rc1.
Lots of things in here, the thunderbolt support for Apple laptops,
some other new drivers, testing fixes, and other good things. All
have been in linux-next for a long time"
* tag 'char-misc-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (119 commits)
misc: bh1780: Introduce the use of devm_kzalloc
Lattice ECP3 FPGA: Correct endianness
drivers/misc/ti-st: Load firmware from ti-connectivity directory.
dt-bindings: extcon: Add support for SM5502 MUIC device
extcon: sm5502: Change internal hardware switch according to cable type
extcon: sm5502: Detect cable state after completing platform booting
extcon: sm5502: Add support new SM5502 extcon device driver
extcon: arizona: Get MICVDD against extcon device
extcon: Remove unnecessary OOM messages
misc: vexpress: Fix sparse non static symbol warnings
mei: drop unused hw dependent fw status functions
misc: bh1770glc: Use managed functions
pcmcia: remove DEFINE_PCI_DEVICE_TABLE usage
misc: remove DEFINE_PCI_DEVICE_TABLE usage
ipack: Replace DEFINE_PCI_DEVICE_TABLE macro use
drivers/char/dsp56k.c: drop check for negativity of unsigned parameter
mei: fix return value on disconnect timeout
mei: don't schedule suspend in pm idle
mei: start disconnect request timer consistently
mei: reset client connection state on timeout
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/extcon/sm5502.h | 287 | ||||
| -rw-r--r-- | include/linux/mfd/arizona/pdata.h | 3 | ||||
| -rw-r--r-- | include/linux/mfd/max77693-private.h | 54 | ||||
| -rw-r--r-- | include/linux/mic_bus.h | 110 | ||||
| -rw-r--r-- | include/linux/pci.h | 12 |
5 files changed, 455 insertions, 11 deletions
diff --git a/include/linux/extcon/sm5502.h b/include/linux/extcon/sm5502.h new file mode 100644 index 000000000000..030526bf8d79 --- /dev/null +++ b/include/linux/extcon/sm5502.h | |||
| @@ -0,0 +1,287 @@ | |||
| 1 | /* | ||
| 2 | * sm5502.h | ||
| 3 | * | ||
| 4 | * Copyright (c) 2014 Samsung Electronics Co., Ltd | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify it | ||
| 7 | * under the terms of the GNU General Public License as published by the | ||
| 8 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 9 | * option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | */ | ||
| 16 | |||
| 17 | #ifndef __LINUX_EXTCON_SM5502_H | ||
| 18 | #define __LINUX_EXTCON_SM5502_H | ||
| 19 | |||
| 20 | enum sm5502_types { | ||
| 21 | TYPE_SM5502, | ||
| 22 | }; | ||
| 23 | |||
| 24 | /* SM5502 registers */ | ||
| 25 | enum sm5502_reg { | ||
| 26 | SM5502_REG_DEVICE_ID = 0x01, | ||
| 27 | SM5502_REG_CONTROL, | ||
| 28 | SM5502_REG_INT1, | ||
| 29 | SM5502_REG_INT2, | ||
| 30 | SM5502_REG_INTMASK1, | ||
| 31 | SM5502_REG_INTMASK2, | ||
| 32 | SM5502_REG_ADC, | ||
| 33 | SM5502_REG_TIMING_SET1, | ||
| 34 | SM5502_REG_TIMING_SET2, | ||
| 35 | SM5502_REG_DEV_TYPE1, | ||
| 36 | SM5502_REG_DEV_TYPE2, | ||
| 37 | SM5502_REG_BUTTON1, | ||
| 38 | SM5502_REG_BUTTON2, | ||
| 39 | SM5502_REG_CAR_KIT_STATUS, | ||
| 40 | SM5502_REG_RSVD1, | ||
| 41 | SM5502_REG_RSVD2, | ||
| 42 | SM5502_REG_RSVD3, | ||
| 43 | SM5502_REG_RSVD4, | ||
| 44 | SM5502_REG_MANUAL_SW1, | ||
| 45 | SM5502_REG_MANUAL_SW2, | ||
| 46 | SM5502_REG_DEV_TYPE3, | ||
| 47 | SM5502_REG_RSVD5, | ||
| 48 | SM5502_REG_RSVD6, | ||
| 49 | SM5502_REG_RSVD7, | ||
| 50 | SM5502_REG_RSVD8, | ||
| 51 | SM5502_REG_RSVD9, | ||
| 52 | SM5502_REG_RESET, | ||
| 53 | SM5502_REG_RSVD10, | ||
| 54 | SM5502_REG_RESERVED_ID1, | ||
| 55 | SM5502_REG_RSVD11, | ||
| 56 | SM5502_REG_RSVD12, | ||
| 57 | SM5502_REG_RESERVED_ID2, | ||
| 58 | SM5502_REG_RSVD13, | ||
| 59 | SM5502_REG_OCP, | ||
| 60 | SM5502_REG_RSVD14, | ||
| 61 | SM5502_REG_RSVD15, | ||
| 62 | SM5502_REG_RSVD16, | ||
| 63 | SM5502_REG_RSVD17, | ||
| 64 | SM5502_REG_RSVD18, | ||
| 65 | SM5502_REG_RSVD19, | ||
| 66 | SM5502_REG_RSVD20, | ||
| 67 | SM5502_REG_RSVD21, | ||
| 68 | SM5502_REG_RSVD22, | ||
| 69 | SM5502_REG_RSVD23, | ||
| 70 | SM5502_REG_RSVD24, | ||
| 71 | SM5502_REG_RSVD25, | ||
| 72 | SM5502_REG_RSVD26, | ||
| 73 | SM5502_REG_RSVD27, | ||
| 74 | SM5502_REG_RSVD28, | ||
| 75 | SM5502_REG_RSVD29, | ||
| 76 | SM5502_REG_RSVD30, | ||
| 77 | SM5502_REG_RSVD31, | ||
| 78 | SM5502_REG_RSVD32, | ||
| 79 | SM5502_REG_RSVD33, | ||
| 80 | SM5502_REG_RSVD34, | ||
| 81 | SM5502_REG_RSVD35, | ||
| 82 | SM5502_REG_RSVD36, | ||
| 83 | SM5502_REG_RESERVED_ID3, | ||
| 84 | |||
| 85 | SM5502_REG_END, | ||
| 86 | }; | ||
| 87 | |||
| 88 | /* Define SM5502 MASK/SHIFT constant */ | ||
| 89 | #define SM5502_REG_DEVICE_ID_VENDOR_SHIFT 0 | ||
| 90 | #define SM5502_REG_DEVICE_ID_VERSION_SHIFT 3 | ||
| 91 | #define SM5502_REG_DEVICE_ID_VENDOR_MASK (0x3 << SM5502_REG_DEVICE_ID_VENDOR_SHIFT) | ||
| 92 | #define SM5502_REG_DEVICE_ID_VERSION_MASK (0x1f << SM5502_REG_DEVICE_ID_VERSION_SHIFT) | ||
| 93 | |||
| 94 | #define SM5502_REG_CONTROL_MASK_INT_SHIFT 0 | ||
| 95 | #define SM5502_REG_CONTROL_WAIT_SHIFT 1 | ||
| 96 | #define SM5502_REG_CONTROL_MANUAL_SW_SHIFT 2 | ||
| 97 | #define SM5502_REG_CONTROL_RAW_DATA_SHIFT 3 | ||
| 98 | #define SM5502_REG_CONTROL_SW_OPEN_SHIFT 4 | ||
| 99 | #define SM5502_REG_CONTROL_MASK_INT_MASK (0x1 << SM5502_REG_CONTROL_MASK_INT_SHIFT) | ||
| 100 | #define SM5502_REG_CONTROL_WAIT_MASK (0x1 << SM5502_REG_CONTROL_WAIT_SHIFT) | ||
| 101 | #define SM5502_REG_CONTROL_MANUAL_SW_MASK (0x1 << SM5502_REG_CONTROL_MANUAL_SW_SHIFT) | ||
| 102 | #define SM5502_REG_CONTROL_RAW_DATA_MASK (0x1 << SM5502_REG_CONTROL_RAW_DATA_SHIFT) | ||
| 103 | #define SM5502_REG_CONTROL_SW_OPEN_MASK (0x1 << SM5502_REG_CONTROL_SW_OPEN_SHIFT) | ||
| 104 | |||
| 105 | #define SM5502_REG_INTM1_ATTACH_SHIFT 0 | ||
| 106 | #define SM5502_REG_INTM1_DETACH_SHIFT 1 | ||
| 107 | #define SM5502_REG_INTM1_KP_SHIFT 2 | ||
| 108 | #define SM5502_REG_INTM1_LKP_SHIFT 3 | ||
| 109 | #define SM5502_REG_INTM1_LKR_SHIFT 4 | ||
| 110 | #define SM5502_REG_INTM1_OVP_EVENT_SHIFT 5 | ||
| 111 | #define SM5502_REG_INTM1_OCP_EVENT_SHIFT 6 | ||
| 112 | #define SM5502_REG_INTM1_OVP_OCP_DIS_SHIFT 7 | ||
| 113 | #define SM5502_REG_INTM1_ATTACH_MASK (0x1 << SM5502_REG_INTM1_ATTACH_SHIFT) | ||
| 114 | #define SM5502_REG_INTM1_DETACH_MASK (0x1 << SM5502_REG_INTM1_DETACH_SHIFT) | ||
| 115 | #define SM5502_REG_INTM1_KP_MASK (0x1 << SM5502_REG_INTM1_KP_SHIFT) | ||
| 116 | #define SM5502_REG_INTM1_LKP_MASK (0x1 << SM5502_REG_INTM1_LKP_SHIFT) | ||
| 117 | #define SM5502_REG_INTM1_LKR_MASK (0x1 << SM5502_REG_INTM1_LKR_SHIFT) | ||
| 118 | #define SM5502_REG_INTM1_OVP_EVENT_MASK (0x1 << SM5502_REG_INTM1_OVP_EVENT_SHIFT) | ||
| 119 | #define SM5502_REG_INTM1_OCP_EVENT_MASK (0x1 << SM5502_REG_INTM1_OCP_EVENT_SHIFT) | ||
| 120 | #define SM5502_REG_INTM1_OVP_OCP_DIS_MASK (0x1 << SM5502_REG_INTM1_OVP_OCP_DIS_SHIFT) | ||
| 121 | |||
| 122 | #define SM5502_REG_INTM2_VBUS_DET_SHIFT 0 | ||
| 123 | #define SM5502_REG_INTM2_REV_ACCE_SHIFT 1 | ||
| 124 | #define SM5502_REG_INTM2_ADC_CHG_SHIFT 2 | ||
| 125 | #define SM5502_REG_INTM2_STUCK_KEY_SHIFT 3 | ||
| 126 | #define SM5502_REG_INTM2_STUCK_KEY_RCV_SHIFT 4 | ||
| 127 | #define SM5502_REG_INTM2_MHL_SHIFT 5 | ||
| 128 | #define SM5502_REG_INTM2_VBUS_DET_MASK (0x1 << SM5502_REG_INTM2_VBUS_DET_SHIFT) | ||
| 129 | #define SM5502_REG_INTM2_REV_ACCE_MASK (0x1 << SM5502_REG_INTM2_REV_ACCE_SHIFT) | ||
| 130 | #define SM5502_REG_INTM2_ADC_CHG_MASK (0x1 << SM5502_REG_INTM2_ADC_CHG_SHIFT) | ||
| 131 | #define SM5502_REG_INTM2_STUCK_KEY_MASK (0x1 << SM5502_REG_INTM2_STUCK_KEY_SHIFT) | ||
| 132 | #define SM5502_REG_INTM2_STUCK_KEY_RCV_MASK (0x1 << SM5502_REG_INTM2_STUCK_KEY_RCV_SHIFT) | ||
| 133 | #define SM5502_REG_INTM2_MHL_MASK (0x1 << SM5502_REG_INTM2_MHL_SHIFT) | ||
| 134 | |||
| 135 | #define SM5502_REG_ADC_SHIFT 0 | ||
| 136 | #define SM5502_REG_ADC_MASK (0x1f << SM5502_REG_ADC_SHIFT) | ||
| 137 | |||
| 138 | #define SM5502_REG_TIMING_SET1_KEY_PRESS_SHIFT 4 | ||
| 139 | #define SM5502_REG_TIMING_SET1_KEY_PRESS_MASK (0xf << SM5502_REG_TIMING_SET1_KEY_PRESS_SHIFT) | ||
| 140 | #define TIMING_KEY_PRESS_100MS 0x0 | ||
| 141 | #define TIMING_KEY_PRESS_200MS 0x1 | ||
| 142 | #define TIMING_KEY_PRESS_300MS 0x2 | ||
| 143 | #define TIMING_KEY_PRESS_400MS 0x3 | ||
| 144 | #define TIMING_KEY_PRESS_500MS 0x4 | ||
| 145 | #define TIMING_KEY_PRESS_600MS 0x5 | ||
| 146 | #define TIMING_KEY_PRESS_700MS 0x6 | ||
| 147 | #define TIMING_KEY_PRESS_800MS 0x7 | ||
| 148 | #define TIMING_KEY_PRESS_900MS 0x8 | ||
| 149 | #define TIMING_KEY_PRESS_1000MS 0x9 | ||
| 150 | #define SM5502_REG_TIMING_SET1_ADC_DET_SHIFT 0 | ||
| 151 | #define SM5502_REG_TIMING_SET1_ADC_DET_MASK (0xf << SM5502_REG_TIMING_SET1_ADC_DET_SHIFT) | ||
| 152 | #define TIMING_ADC_DET_50MS 0x0 | ||
| 153 | #define TIMING_ADC_DET_100MS 0x1 | ||
| 154 | #define TIMING_ADC_DET_150MS 0x2 | ||
| 155 | #define TIMING_ADC_DET_200MS 0x3 | ||
| 156 | #define TIMING_ADC_DET_300MS 0x4 | ||
| 157 | #define TIMING_ADC_DET_400MS 0x5 | ||
| 158 | #define TIMING_ADC_DET_500MS 0x6 | ||
| 159 | #define TIMING_ADC_DET_600MS 0x7 | ||
| 160 | #define TIMING_ADC_DET_700MS 0x8 | ||
| 161 | #define TIMING_ADC_DET_800MS 0x9 | ||
| 162 | #define TIMING_ADC_DET_900MS 0xA | ||
| 163 | #define TIMING_ADC_DET_1000MS 0xB | ||
| 164 | |||
| 165 | #define SM5502_REG_TIMING_SET2_SW_WAIT_SHIFT 4 | ||
| 166 | #define SM5502_REG_TIMING_SET2_SW_WAIT_MASK (0xf << SM5502_REG_TIMING_SET2_SW_WAIT_SHIFT) | ||
| 167 | #define TIMING_SW_WAIT_10MS 0x0 | ||
| 168 | #define TIMING_SW_WAIT_30MS 0x1 | ||
| 169 | #define TIMING_SW_WAIT_50MS 0x2 | ||
| 170 | #define TIMING_SW_WAIT_70MS 0x3 | ||
| 171 | #define TIMING_SW_WAIT_90MS 0x4 | ||
| 172 | #define TIMING_SW_WAIT_110MS 0x5 | ||
| 173 | #define TIMING_SW_WAIT_130MS 0x6 | ||
| 174 | #define TIMING_SW_WAIT_150MS 0x7 | ||
| 175 | #define TIMING_SW_WAIT_170MS 0x8 | ||
| 176 | #define TIMING_SW_WAIT_190MS 0x9 | ||
| 177 | #define TIMING_SW_WAIT_210MS 0xA | ||
| 178 | #define SM5502_REG_TIMING_SET2_LONG_KEY_SHIFT 0 | ||
| 179 | #define SM5502_REG_TIMING_SET2_LONG_KEY_MASK (0xf << SM5502_REG_TIMING_SET2_LONG_KEY_SHIFT) | ||
| 180 | #define TIMING_LONG_KEY_300MS 0x0 | ||
| 181 | #define TIMING_LONG_KEY_400MS 0x1 | ||
| 182 | #define TIMING_LONG_KEY_500MS 0x2 | ||
| 183 | #define TIMING_LONG_KEY_600MS 0x3 | ||
| 184 | #define TIMING_LONG_KEY_700MS 0x4 | ||
| 185 | #define TIMING_LONG_KEY_800MS 0x5 | ||
| 186 | #define TIMING_LONG_KEY_900MS 0x6 | ||
| 187 | #define TIMING_LONG_KEY_1000MS 0x7 | ||
| 188 | #define TIMING_LONG_KEY_1100MS 0x8 | ||
| 189 | #define TIMING_LONG_KEY_1200MS 0x9 | ||
| 190 | #define TIMING_LONG_KEY_1300MS 0xA | ||
| 191 | #define TIMING_LONG_KEY_1400MS 0xB | ||
| 192 | #define TIMING_LONG_KEY_1500MS 0xC | ||
| 193 | |||
| 194 | #define SM5502_REG_DEV_TYPE1_AUDIO_TYPE1_SHIFT 0 | ||
| 195 | #define SM5502_REG_DEV_TYPE1_AUDIO_TYPE2_SHIFT 1 | ||
| 196 | #define SM5502_REG_DEV_TYPE1_USB_SDP_SHIFT 2 | ||
| 197 | #define SM5502_REG_DEV_TYPE1_UART_SHIFT 3 | ||
| 198 | #define SM5502_REG_DEV_TYPE1_CAR_KIT_CHARGER_SHIFT 4 | ||
| 199 | #define SM5502_REG_DEV_TYPE1_USB_CHG_SHIFT 5 | ||
| 200 | #define SM5502_REG_DEV_TYPE1_DEDICATED_CHG_SHIFT 6 | ||
| 201 | #define SM5502_REG_DEV_TYPE1_USB_OTG_SHIFT 7 | ||
| 202 | #define SM5502_REG_DEV_TYPE1_AUDIO_TYPE1_MASK (0x1 << SM5502_REG_DEV_TYPE1_AUDIO_TYPE1_SHIFT) | ||
| 203 | #define SM5502_REG_DEV_TYPE1_AUDIO_TYPE1__MASK (0x1 << SM5502_REG_DEV_TYPE1_AUDIO_TYPE2_SHIFT) | ||
| 204 | #define SM5502_REG_DEV_TYPE1_USB_SDP_MASK (0x1 << SM5502_REG_DEV_TYPE1_USB_SDP_SHIFT) | ||
| 205 | #define SM5502_REG_DEV_TYPE1_UART_MASK (0x1 << SM5502_REG_DEV_TYPE1_UART_SHIFT) | ||
| 206 | #define SM5502_REG_DEV_TYPE1_CAR_KIT_CHARGER_MASK (0x1 << SM5502_REG_DEV_TYPE1_CAR_KIT_CHARGER_SHIFT) | ||
| 207 | #define SM5502_REG_DEV_TYPE1_USB_CHG_MASK (0x1 << SM5502_REG_DEV_TYPE1_USB_CHG_SHIFT) | ||
| 208 | #define SM5502_REG_DEV_TYPE1_DEDICATED_CHG_MASK (0x1 << SM5502_REG_DEV_TYPE1_DEDICATED_CHG_SHIFT) | ||
| 209 | #define SM5502_REG_DEV_TYPE1_USB_OTG_MASK (0x1 << SM5502_REG_DEV_TYPE1_USB_OTG_SHIFT) | ||
| 210 | |||
| 211 | #define SM5502_REG_DEV_TYPE2_JIG_USB_ON_SHIFT 0 | ||
| 212 | #define SM5502_REG_DEV_TYPE2_JIG_USB_OFF_SHIFT 1 | ||
| 213 | #define SM5502_REG_DEV_TYPE2_JIG_UART_ON_SHIFT 2 | ||
| 214 | #define SM5502_REG_DEV_TYPE2_JIG_UART_OFF_SHIFT 3 | ||
| 215 | #define SM5502_REG_DEV_TYPE2_PPD_SHIFT 4 | ||
| 216 | #define SM5502_REG_DEV_TYPE2_TTY_SHIFT 5 | ||
| 217 | #define SM5502_REG_DEV_TYPE2_AV_CABLE_SHIFT 6 | ||
| 218 | #define SM5502_REG_DEV_TYPE2_JIG_USB_ON_MASK (0x1 << SM5502_REG_DEV_TYPE2_JIG_USB_ON_SHIFT) | ||
| 219 | #define SM5502_REG_DEV_TYPE2_JIG_USB_OFF_MASK (0x1 << SM5502_REG_DEV_TYPE2_JIG_USB_OFF_SHIFT) | ||
| 220 | #define SM5502_REG_DEV_TYPE2_JIG_UART_ON_MASK (0x1 << SM5502_REG_DEV_TYPE2_JIG_UART_ON_SHIFT) | ||
| 221 | #define SM5502_REG_DEV_TYPE2_JIG_UART_OFF_MASK (0x1 << SM5502_REG_DEV_TYPE2_JIG_UART_OFF_SHIFT) | ||
| 222 | #define SM5502_REG_DEV_TYPE2_PPD_MASK (0x1 << SM5502_REG_DEV_TYPE2_PPD_SHIFT) | ||
| 223 | #define SM5502_REG_DEV_TYPE2_TTY_MASK (0x1 << SM5502_REG_DEV_TYPE2_TTY_SHIFT) | ||
| 224 | #define SM5502_REG_DEV_TYPE2_AV_CABLE_MASK (0x1 << SM5502_REG_DEV_TYPE2_AV_CABLE_SHIFT) | ||
| 225 | |||
| 226 | #define SM5502_REG_MANUAL_SW1_VBUSIN_SHIFT 0 | ||
| 227 | #define SM5502_REG_MANUAL_SW1_DP_SHIFT 2 | ||
| 228 | #define SM5502_REG_MANUAL_SW1_DM_SHIFT 5 | ||
| 229 | #define SM5502_REG_MANUAL_SW1_VBUSIN_MASK (0x3 << SM5502_REG_MANUAL_SW1_VBUSIN_SHIFT) | ||
| 230 | #define SM5502_REG_MANUAL_SW1_DP_MASK (0x7 << SM5502_REG_MANUAL_SW1_DP_SHIFT) | ||
| 231 | #define SM5502_REG_MANUAL_SW1_DM_MASK (0x7 << SM5502_REG_MANUAL_SW1_DM_SHIFT) | ||
| 232 | #define VBUSIN_SWITCH_OPEN 0x0 | ||
| 233 | #define VBUSIN_SWITCH_VBUSOUT 0x1 | ||
| 234 | #define VBUSIN_SWITCH_MIC 0x2 | ||
| 235 | #define VBUSIN_SWITCH_VBUSOUT_WITH_USB 0x3 | ||
| 236 | #define DM_DP_CON_SWITCH_OPEN 0x0 | ||
| 237 | #define DM_DP_CON_SWITCH_USB 0x1 | ||
| 238 | #define DM_DP_CON_SWITCH_AUDIO 0x2 | ||
| 239 | #define DM_DP_CON_SWITCH_UART 0x3 | ||
| 240 | #define DM_DP_SWITCH_OPEN ((DM_DP_CON_SWITCH_OPEN <<SM5502_REG_MANUAL_SW1_DP_SHIFT) \ | ||
| 241 | | (DM_DP_CON_SWITCH_OPEN <<SM5502_REG_MANUAL_SW1_DM_SHIFT)) | ||
| 242 | #define DM_DP_SWITCH_USB ((DM_DP_CON_SWITCH_USB <<SM5502_REG_MANUAL_SW1_DP_SHIFT) \ | ||
| 243 | | (DM_DP_CON_SWITCH_USB <<SM5502_REG_MANUAL_SW1_DM_SHIFT)) | ||
| 244 | #define DM_DP_SWITCH_AUDIO ((DM_DP_CON_SWITCH_AUDIO <<SM5502_REG_MANUAL_SW1_DP_SHIFT) \ | ||
| 245 | | (DM_DP_CON_SWITCH_AUDIO <<SM5502_REG_MANUAL_SW1_DM_SHIFT)) | ||
| 246 | #define DM_DP_SWITCH_UART ((DM_DP_CON_SWITCH_UART <<SM5502_REG_MANUAL_SW1_DP_SHIFT) \ | ||
| 247 | | (DM_DP_CON_SWITCH_UART <<SM5502_REG_MANUAL_SW1_DM_SHIFT)) | ||
| 248 | |||
| 249 | /* SM5502 Interrupts */ | ||
| 250 | enum sm5502_irq { | ||
| 251 | /* INT1 */ | ||
| 252 | SM5502_IRQ_INT1_ATTACH, | ||
| 253 | SM5502_IRQ_INT1_DETACH, | ||
| 254 | SM5502_IRQ_INT1_KP, | ||
| 255 | SM5502_IRQ_INT1_LKP, | ||
| 256 | SM5502_IRQ_INT1_LKR, | ||
| 257 | SM5502_IRQ_INT1_OVP_EVENT, | ||
| 258 | SM5502_IRQ_INT1_OCP_EVENT, | ||
| 259 | SM5502_IRQ_INT1_OVP_OCP_DIS, | ||
| 260 | |||
| 261 | /* INT2 */ | ||
| 262 | SM5502_IRQ_INT2_VBUS_DET, | ||
| 263 | SM5502_IRQ_INT2_REV_ACCE, | ||
| 264 | SM5502_IRQ_INT2_ADC_CHG, | ||
| 265 | SM5502_IRQ_INT2_STUCK_KEY, | ||
| 266 | SM5502_IRQ_INT2_STUCK_KEY_RCV, | ||
| 267 | SM5502_IRQ_INT2_MHL, | ||
| 268 | |||
| 269 | SM5502_IRQ_NUM, | ||
| 270 | }; | ||
| 271 | |||
| 272 | #define SM5502_IRQ_INT1_ATTACH_MASK BIT(0) | ||
| 273 | #define SM5502_IRQ_INT1_DETACH_MASK BIT(1) | ||
| 274 | #define SM5502_IRQ_INT1_KP_MASK BIT(2) | ||
| 275 | #define SM5502_IRQ_INT1_LKP_MASK BIT(3) | ||
| 276 | #define SM5502_IRQ_INT1_LKR_MASK BIT(4) | ||
| 277 | #define SM5502_IRQ_INT1_OVP_EVENT_MASK BIT(5) | ||
| 278 | #define SM5502_IRQ_INT1_OCP_EVENT_MASK BIT(6) | ||
| 279 | #define SM5502_IRQ_INT1_OVP_OCP_DIS_MASK BIT(7) | ||
| 280 | #define SM5502_IRQ_INT2_VBUS_DET_MASK BIT(0) | ||
| 281 | #define SM5502_IRQ_INT2_REV_ACCE_MASK BIT(1) | ||
| 282 | #define SM5502_IRQ_INT2_ADC_CHG_MASK BIT(2) | ||
| 283 | #define SM5502_IRQ_INT2_STUCK_KEY_MASK BIT(3) | ||
| 284 | #define SM5502_IRQ_INT2_STUCK_KEY_RCV_MASK BIT(4) | ||
| 285 | #define SM5502_IRQ_INT2_MHL_MASK BIT(5) | ||
| 286 | |||
| 287 | #endif /* __LINUX_EXTCON_SM5502_H */ | ||
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h index 12a5c135c746..4578c72c9b86 100644 --- a/include/linux/mfd/arizona/pdata.h +++ b/include/linux/mfd/arizona/pdata.h | |||
| @@ -127,6 +127,9 @@ struct arizona_pdata { | |||
| 127 | /** Internal pull on GPIO5 is disabled when used for jack detection */ | 127 | /** Internal pull on GPIO5 is disabled when used for jack detection */ |
| 128 | bool jd_gpio5_nopull; | 128 | bool jd_gpio5_nopull; |
| 129 | 129 | ||
| 130 | /** set to true if jackdet contact opens on insert */ | ||
| 131 | bool jd_invert; | ||
| 132 | |||
| 130 | /** Use the headphone detect circuit to identify the accessory */ | 133 | /** Use the headphone detect circuit to identify the accessory */ |
| 131 | bool hpdet_acc_id; | 134 | bool hpdet_acc_id; |
| 132 | 135 | ||
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h index 3e050b933dd0..c466ff3e16b8 100644 --- a/include/linux/mfd/max77693-private.h +++ b/include/linux/mfd/max77693-private.h | |||
| @@ -262,6 +262,41 @@ enum max77693_irq_source { | |||
| 262 | MAX77693_IRQ_GROUP_NR, | 262 | MAX77693_IRQ_GROUP_NR, |
| 263 | }; | 263 | }; |
| 264 | 264 | ||
| 265 | #define LED_IRQ_FLED2_OPEN BIT(0) | ||
| 266 | #define LED_IRQ_FLED2_SHORT BIT(1) | ||
| 267 | #define LED_IRQ_FLED1_OPEN BIT(2) | ||
| 268 | #define LED_IRQ_FLED1_SHORT BIT(3) | ||
| 269 | #define LED_IRQ_MAX_FLASH BIT(4) | ||
| 270 | |||
| 271 | #define TOPSYS_IRQ_T120C_INT BIT(0) | ||
| 272 | #define TOPSYS_IRQ_T140C_INT BIT(1) | ||
| 273 | #define TOPSYS_IRQ_LOWSYS_INT BIT(3) | ||
| 274 | |||
| 275 | #define CHG_IRQ_BYP_I BIT(0) | ||
| 276 | #define CHG_IRQ_THM_I BIT(2) | ||
| 277 | #define CHG_IRQ_BAT_I BIT(3) | ||
| 278 | #define CHG_IRQ_CHG_I BIT(4) | ||
| 279 | #define CHG_IRQ_CHGIN_I BIT(6) | ||
| 280 | |||
| 281 | #define MUIC_IRQ_INT1_ADC BIT(0) | ||
| 282 | #define MUIC_IRQ_INT1_ADC_LOW BIT(1) | ||
| 283 | #define MUIC_IRQ_INT1_ADC_ERR BIT(2) | ||
| 284 | #define MUIC_IRQ_INT1_ADC1K BIT(3) | ||
| 285 | |||
| 286 | #define MUIC_IRQ_INT2_CHGTYP BIT(0) | ||
| 287 | #define MUIC_IRQ_INT2_CHGDETREUN BIT(1) | ||
| 288 | #define MUIC_IRQ_INT2_DCDTMR BIT(2) | ||
| 289 | #define MUIC_IRQ_INT2_DXOVP BIT(3) | ||
| 290 | #define MUIC_IRQ_INT2_VBVOLT BIT(4) | ||
| 291 | #define MUIC_IRQ_INT2_VIDRM BIT(5) | ||
| 292 | |||
| 293 | #define MUIC_IRQ_INT3_EOC BIT(0) | ||
| 294 | #define MUIC_IRQ_INT3_CGMBC BIT(1) | ||
| 295 | #define MUIC_IRQ_INT3_OVP BIT(2) | ||
| 296 | #define MUIC_IRQ_INT3_MBCCHG_ERR BIT(3) | ||
| 297 | #define MUIC_IRQ_INT3_CHG_ENABLED BIT(4) | ||
| 298 | #define MUIC_IRQ_INT3_BAT_DET BIT(5) | ||
| 299 | |||
| 265 | enum max77693_irq { | 300 | enum max77693_irq { |
| 266 | /* PMIC - FLASH */ | 301 | /* PMIC - FLASH */ |
| 267 | MAX77693_LED_IRQ_FLED2_OPEN, | 302 | MAX77693_LED_IRQ_FLED2_OPEN, |
| @@ -282,6 +317,10 @@ enum max77693_irq { | |||
| 282 | MAX77693_CHG_IRQ_CHG_I, | 317 | MAX77693_CHG_IRQ_CHG_I, |
| 283 | MAX77693_CHG_IRQ_CHGIN_I, | 318 | MAX77693_CHG_IRQ_CHGIN_I, |
| 284 | 319 | ||
| 320 | MAX77693_IRQ_NR, | ||
| 321 | }; | ||
| 322 | |||
| 323 | enum max77693_irq_muic { | ||
| 285 | /* MUIC INT1 */ | 324 | /* MUIC INT1 */ |
| 286 | MAX77693_MUIC_IRQ_INT1_ADC, | 325 | MAX77693_MUIC_IRQ_INT1_ADC, |
| 287 | MAX77693_MUIC_IRQ_INT1_ADC_LOW, | 326 | MAX77693_MUIC_IRQ_INT1_ADC_LOW, |
| @@ -304,7 +343,7 @@ enum max77693_irq { | |||
| 304 | MAX77693_MUIC_IRQ_INT3_CHG_ENABLED, | 343 | MAX77693_MUIC_IRQ_INT3_CHG_ENABLED, |
| 305 | MAX77693_MUIC_IRQ_INT3_BAT_DET, | 344 | MAX77693_MUIC_IRQ_INT3_BAT_DET, |
| 306 | 345 | ||
| 307 | MAX77693_IRQ_NR, | 346 | MAX77693_MUIC_IRQ_NR, |
| 308 | }; | 347 | }; |
| 309 | 348 | ||
| 310 | struct max77693_dev { | 349 | struct max77693_dev { |
| @@ -319,7 +358,10 @@ struct max77693_dev { | |||
| 319 | struct regmap *regmap_muic; | 358 | struct regmap *regmap_muic; |
| 320 | struct regmap *regmap_haptic; | 359 | struct regmap *regmap_haptic; |
| 321 | 360 | ||
| 322 | struct irq_domain *irq_domain; | 361 | struct regmap_irq_chip_data *irq_data_led; |
| 362 | struct regmap_irq_chip_data *irq_data_topsys; | ||
| 363 | struct regmap_irq_chip_data *irq_data_charger; | ||
| 364 | struct regmap_irq_chip_data *irq_data_muic; | ||
| 323 | 365 | ||
| 324 | int irq; | 366 | int irq; |
| 325 | int irq_gpio; | 367 | int irq_gpio; |
| @@ -332,14 +374,6 @@ enum max77693_types { | |||
| 332 | TYPE_MAX77693, | 374 | TYPE_MAX77693, |
| 333 | }; | 375 | }; |
| 334 | 376 | ||
| 335 | extern int max77693_read_reg(struct regmap *map, u8 reg, u8 *dest); | ||
| 336 | extern int max77693_bulk_read(struct regmap *map, u8 reg, int count, | ||
| 337 | u8 *buf); | ||
| 338 | extern int max77693_write_reg(struct regmap *map, u8 reg, u8 value); | ||
| 339 | extern int max77693_bulk_write(struct regmap *map, u8 reg, int count, | ||
| 340 | u8 *buf); | ||
| 341 | extern int max77693_update_reg(struct regmap *map, u8 reg, u8 val, u8 mask); | ||
| 342 | |||
| 343 | extern int max77693_irq_init(struct max77693_dev *max77686); | 377 | extern int max77693_irq_init(struct max77693_dev *max77686); |
| 344 | extern void max77693_irq_exit(struct max77693_dev *max77686); | 378 | extern void max77693_irq_exit(struct max77693_dev *max77686); |
| 345 | extern int max77693_irq_resume(struct max77693_dev *max77686); | 379 | extern int max77693_irq_resume(struct max77693_dev *max77686); |
diff --git a/include/linux/mic_bus.h b/include/linux/mic_bus.h new file mode 100644 index 000000000000..d5b5f76d57ef --- /dev/null +++ b/include/linux/mic_bus.h | |||
| @@ -0,0 +1,110 @@ | |||
| 1 | /* | ||
| 2 | * Intel MIC Platform Software Stack (MPSS) | ||
| 3 | * | ||
| 4 | * Copyright(c) 2014 Intel Corporation. | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License, version 2, as | ||
| 8 | * published by the Free Software Foundation. | ||
| 9 | * | ||
| 10 | * This program is distributed in the hope that it will be useful, but | ||
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 13 | * General Public License for more details. | ||
| 14 | * | ||
| 15 | * The full GNU General Public License is included in this distribution in | ||
| 16 | * the file called "COPYING". | ||
| 17 | * | ||
| 18 | * Intel MIC Bus driver. | ||
| 19 | * | ||
| 20 | * This implementation is very similar to the the virtio bus driver | ||
| 21 | * implementation @ include/linux/virtio.h. | ||
| 22 | */ | ||
| 23 | #ifndef _MIC_BUS_H_ | ||
| 24 | #define _MIC_BUS_H_ | ||
| 25 | /* | ||
| 26 | * Everything a mbus driver needs to work with any particular mbus | ||
| 27 | * implementation. | ||
| 28 | */ | ||
| 29 | #include <linux/interrupt.h> | ||
| 30 | #include <linux/dma-mapping.h> | ||
| 31 | |||
| 32 | struct mbus_device_id { | ||
| 33 | __u32 device; | ||
| 34 | __u32 vendor; | ||
| 35 | }; | ||
| 36 | |||
| 37 | #define MBUS_DEV_DMA_HOST 2 | ||
| 38 | #define MBUS_DEV_DMA_MIC 3 | ||
| 39 | #define MBUS_DEV_ANY_ID 0xffffffff | ||
| 40 | |||
| 41 | /** | ||
| 42 | * mbus_device - representation of a device using mbus | ||
| 43 | * @mmio_va: virtual address of mmio space | ||
| 44 | * @hw_ops: the hardware ops supported by this device. | ||
| 45 | * @id: the device type identification (used to match it with a driver). | ||
| 46 | * @dev: underlying device. | ||
| 47 | * be used to communicate with. | ||
| 48 | * @index: unique position on the mbus bus | ||
| 49 | */ | ||
| 50 | struct mbus_device { | ||
| 51 | void __iomem *mmio_va; | ||
| 52 | struct mbus_hw_ops *hw_ops; | ||
| 53 | struct mbus_device_id id; | ||
| 54 | struct device dev; | ||
| 55 | int index; | ||
| 56 | }; | ||
| 57 | |||
| 58 | /** | ||
| 59 | * mbus_driver - operations for a mbus I/O driver | ||
| 60 | * @driver: underlying device driver (populate name and owner). | ||
| 61 | * @id_table: the ids serviced by this driver. | ||
| 62 | * @probe: the function to call when a device is found. Returns 0 or -errno. | ||
| 63 | * @remove: the function to call when a device is removed. | ||
| 64 | */ | ||
| 65 | struct mbus_driver { | ||
| 66 | struct device_driver driver; | ||
| 67 | const struct mbus_device_id *id_table; | ||
| 68 | int (*probe)(struct mbus_device *dev); | ||
| 69 | void (*scan)(struct mbus_device *dev); | ||
| 70 | void (*remove)(struct mbus_device *dev); | ||
| 71 | }; | ||
| 72 | |||
| 73 | /** | ||
| 74 | * struct mic_irq - opaque pointer used as cookie | ||
| 75 | */ | ||
| 76 | struct mic_irq; | ||
| 77 | |||
| 78 | /** | ||
| 79 | * mbus_hw_ops - Hardware operations for accessing a MIC device on the MIC bus. | ||
| 80 | */ | ||
| 81 | struct mbus_hw_ops { | ||
| 82 | struct mic_irq* (*request_threaded_irq)(struct mbus_device *mbdev, | ||
| 83 | irq_handler_t handler, | ||
| 84 | irq_handler_t thread_fn, | ||
| 85 | const char *name, void *data, | ||
| 86 | int intr_src); | ||
| 87 | void (*free_irq)(struct mbus_device *mbdev, | ||
| 88 | struct mic_irq *cookie, void *data); | ||
| 89 | void (*ack_interrupt)(struct mbus_device *mbdev, int num); | ||
| 90 | }; | ||
| 91 | |||
| 92 | struct mbus_device * | ||
| 93 | mbus_register_device(struct device *pdev, int id, struct dma_map_ops *dma_ops, | ||
| 94 | struct mbus_hw_ops *hw_ops, void __iomem *mmio_va); | ||
| 95 | void mbus_unregister_device(struct mbus_device *mbdev); | ||
| 96 | |||
| 97 | int mbus_register_driver(struct mbus_driver *drv); | ||
| 98 | void mbus_unregister_driver(struct mbus_driver *drv); | ||
| 99 | |||
| 100 | static inline struct mbus_device *dev_to_mbus(struct device *_dev) | ||
| 101 | { | ||
| 102 | return container_of(_dev, struct mbus_device, dev); | ||
| 103 | } | ||
| 104 | |||
| 105 | static inline struct mbus_driver *drv_to_mbus(struct device_driver *drv) | ||
| 106 | { | ||
| 107 | return container_of(drv, struct mbus_driver, driver); | ||
| 108 | } | ||
| 109 | |||
| 110 | #endif /* _MIC_BUS_H */ | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index 6ed3647b38df..61978a460841 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -1477,8 +1477,9 @@ enum pci_fixup_pass { | |||
| 1477 | pci_fixup_final, /* Final phase of device fixups */ | 1477 | pci_fixup_final, /* Final phase of device fixups */ |
| 1478 | pci_fixup_enable, /* pci_enable_device() time */ | 1478 | pci_fixup_enable, /* pci_enable_device() time */ |
| 1479 | pci_fixup_resume, /* pci_device_resume() */ | 1479 | pci_fixup_resume, /* pci_device_resume() */ |
| 1480 | pci_fixup_suspend, /* pci_device_suspend */ | 1480 | pci_fixup_suspend, /* pci_device_suspend() */ |
| 1481 | pci_fixup_resume_early, /* pci_device_resume_early() */ | 1481 | pci_fixup_resume_early, /* pci_device_resume_early() */ |
| 1482 | pci_fixup_suspend_late, /* pci_device_suspend_late() */ | ||
| 1482 | }; | 1483 | }; |
| 1483 | 1484 | ||
| 1484 | /* Anonymous variables would be nice... */ | 1485 | /* Anonymous variables would be nice... */ |
| @@ -1519,6 +1520,11 @@ enum pci_fixup_pass { | |||
| 1519 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1520 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
| 1520 | suspend##hook, vendor, device, class, \ | 1521 | suspend##hook, vendor, device, class, \ |
| 1521 | class_shift, hook) | 1522 | class_shift, hook) |
| 1523 | #define DECLARE_PCI_FIXUP_CLASS_SUSPEND_LATE(vendor, device, class, \ | ||
| 1524 | class_shift, hook) \ | ||
| 1525 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend_late, \ | ||
| 1526 | suspend_late##hook, vendor, device, \ | ||
| 1527 | class, class_shift, hook) | ||
| 1522 | 1528 | ||
| 1523 | #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ | 1529 | #define DECLARE_PCI_FIXUP_EARLY(vendor, device, hook) \ |
| 1524 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ | 1530 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_early, \ |
| @@ -1544,6 +1550,10 @@ enum pci_fixup_pass { | |||
| 1544 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1550 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
| 1545 | suspend##hook, vendor, device, \ | 1551 | suspend##hook, vendor, device, \ |
| 1546 | PCI_ANY_ID, 0, hook) | 1552 | PCI_ANY_ID, 0, hook) |
| 1553 | #define DECLARE_PCI_FIXUP_SUSPEND_LATE(vendor, device, hook) \ | ||
| 1554 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend_late, \ | ||
| 1555 | suspend_late##hook, vendor, device, \ | ||
| 1556 | PCI_ANY_ID, 0, hook) | ||
| 1547 | 1557 | ||
| 1548 | #ifdef CONFIG_PCI_QUIRKS | 1558 | #ifdef CONFIG_PCI_QUIRKS |
| 1549 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); | 1559 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); |
