aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mfd
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 16:57:13 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-02-21 16:57:13 -0500
commit7ed214ac2095f561a94335ca672b6c42a1ea40ff (patch)
treeda41901bff1d0d8d61170bf362384fdc61deb3ab /include/linux/mfd
parent21eaab6d19ed43e82ed39c8deb7f192134fb4a0e (diff)
parent29e5507ae4ab34397f538f06b7070c81a4e4a2bf (diff)
Merge tag 'char-misc-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver patches from Greg Kroah-Hartman: "Here's the big char/misc driver patches for 3.9-rc1. Nothing major here, just lots of different driver updates (mei, hyperv, ipack, extcon, vmci, etc.). All of these have been in the linux-next tree for a while." * tag 'char-misc-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (209 commits) w1: w1_therm: Add force-pullup option for "broken" sensors w1: ds2482: Added 1-Wire pull-up support to the driver vme: add missing put_device() after device_register() fails extcon: max8997: Use workqueue to check cable state after completing boot of platform extcon: max8997: Set default UART/USB path on probe extcon: max8997: Consolidate duplicate code for checking ADC/CHG cable type extcon: max8997: Set default of ADC debounce time during initialization extcon: max8997: Remove duplicate code related to set H/W line path extcon: max8997: Move defined constant to header file extcon: max77693: Make max77693_extcon_cable static extcon: max8997: Remove unreachable code extcon: max8997: Make max8997_extcon_cable static extcon: max77693: Remove unnecessary goto statement to improve readability extcon: max77693: Convert to devm_input_allocate_device() extcon: gpio: Rename filename of extcon-gpio.c according to kernel naming style CREDITS: update email and address of Harald Hoyer extcon: arizona: Use MICDET for final microphone identification extcon: arizona: Always take the first HPDET reading as the final one extcon: arizona: Clear _trig_sts bits after jack detection extcon: arizona: Don't HPDET magic when headphones are enabled ...
Diffstat (limited to 'include/linux/mfd')
-rw-r--r--include/linux/mfd/arizona/core.h4
-rw-r--r--include/linux/mfd/arizona/pdata.h21
-rw-r--r--include/linux/mfd/arizona/registers.h56
-rw-r--r--include/linux/mfd/max77693-private.h86
-rw-r--r--include/linux/mfd/max77693.h9
-rw-r--r--include/linux/mfd/max8997-private.h64
-rw-r--r--include/linux/mfd/max8997.h25
7 files changed, 249 insertions, 16 deletions
diff --git a/include/linux/mfd/arizona/core.h b/include/linux/mfd/arizona/core.h
index a580363a7d29..a710255528d7 100644
--- a/include/linux/mfd/arizona/core.h
+++ b/include/linux/mfd/arizona/core.h
@@ -75,8 +75,10 @@ enum arizona_type {
75#define ARIZONA_IRQ_DCS_HP_DONE 47 75#define ARIZONA_IRQ_DCS_HP_DONE 47
76#define ARIZONA_IRQ_FLL2_CLOCK_OK 48 76#define ARIZONA_IRQ_FLL2_CLOCK_OK 48
77#define ARIZONA_IRQ_FLL1_CLOCK_OK 49 77#define ARIZONA_IRQ_FLL1_CLOCK_OK 49
78#define ARIZONA_IRQ_MICD_CLAMP_RISE 50
79#define ARIZONA_IRQ_MICD_CLAMP_FALL 51
78 80
79#define ARIZONA_NUM_IRQ 50 81#define ARIZONA_NUM_IRQ 52
80 82
81struct snd_soc_dapm_context; 83struct snd_soc_dapm_context;
82 84
diff --git a/include/linux/mfd/arizona/pdata.h b/include/linux/mfd/arizona/pdata.h
index ec3e2a2a6d77..96d64f2b8d78 100644
--- a/include/linux/mfd/arizona/pdata.h
+++ b/include/linux/mfd/arizona/pdata.h
@@ -105,9 +105,30 @@ struct arizona_pdata {
105 */ 105 */
106 int max_channels_clocked[ARIZONA_MAX_AIF]; 106 int max_channels_clocked[ARIZONA_MAX_AIF];
107 107
108 /** GPIO5 is used for jack detection */
109 bool jd_gpio5;
110
111 /** Use the headphone detect circuit to identify the accessory */
112 bool hpdet_acc_id;
113
114 /** GPIO used for mic isolation with HPDET */
115 int hpdet_id_gpio;
116
108 /** GPIO for mic detection polarity */ 117 /** GPIO for mic detection polarity */
109 int micd_pol_gpio; 118 int micd_pol_gpio;
110 119
120 /** Mic detect ramp rate */
121 int micd_bias_start_time;
122
123 /** Mic detect sample rate */
124 int micd_rate;
125
126 /** Mic detect debounce level */
127 int micd_dbtime;
128
129 /** Force MICBIAS on for mic detect */
130 bool micd_force_micbias;
131
111 /** Headset polarity configurations */ 132 /** Headset polarity configurations */
112 struct arizona_micd_config *micd_configs; 133 struct arizona_micd_config *micd_configs;
113 int num_micd_configs; 134 int num_micd_configs;
diff --git a/include/linux/mfd/arizona/registers.h b/include/linux/mfd/arizona/registers.h
index 1f6fe31a4d5c..188d89abd963 100644
--- a/include/linux/mfd/arizona/registers.h
+++ b/include/linux/mfd/arizona/registers.h
@@ -119,6 +119,8 @@
119#define ARIZONA_ACCESSORY_DETECT_MODE_1 0x293 119#define ARIZONA_ACCESSORY_DETECT_MODE_1 0x293
120#define ARIZONA_HEADPHONE_DETECT_1 0x29B 120#define ARIZONA_HEADPHONE_DETECT_1 0x29B
121#define ARIZONA_HEADPHONE_DETECT_2 0x29C 121#define ARIZONA_HEADPHONE_DETECT_2 0x29C
122#define ARIZONA_HP_DACVAL 0x29F
123#define ARIZONA_MICD_CLAMP_CONTROL 0x2A2
122#define ARIZONA_MIC_DETECT_1 0x2A3 124#define ARIZONA_MIC_DETECT_1 0x2A3
123#define ARIZONA_MIC_DETECT_2 0x2A4 125#define ARIZONA_MIC_DETECT_2 0x2A4
124#define ARIZONA_MIC_DETECT_3 0x2A5 126#define ARIZONA_MIC_DETECT_3 0x2A5
@@ -1194,6 +1196,14 @@
1194/* 1196/*
1195 * R64 (0x40) - Wake control 1197 * R64 (0x40) - Wake control
1196 */ 1198 */
1199#define ARIZONA_WKUP_MICD_CLAMP_FALL 0x0080 /* WKUP_MICD_CLAMP_FALL */
1200#define ARIZONA_WKUP_MICD_CLAMP_FALL_MASK 0x0080 /* WKUP_MICD_CLAMP_FALL */
1201#define ARIZONA_WKUP_MICD_CLAMP_FALL_SHIFT 7 /* WKUP_MICD_CLAMP_FALL */
1202#define ARIZONA_WKUP_MICD_CLAMP_FALL_WIDTH 1 /* WKUP_MICD_CLAMP_FALL */
1203#define ARIZONA_WKUP_MICD_CLAMP_RISE 0x0040 /* WKUP_MICD_CLAMP_RISE */
1204#define ARIZONA_WKUP_MICD_CLAMP_RISE_MASK 0x0040 /* WKUP_MICD_CLAMP_RISE */
1205#define ARIZONA_WKUP_MICD_CLAMP_RISE_SHIFT 6 /* WKUP_MICD_CLAMP_RISE */
1206#define ARIZONA_WKUP_MICD_CLAMP_RISE_WIDTH 1 /* WKUP_MICD_CLAMP_RISE */
1197#define ARIZONA_WKUP_GP5_FALL 0x0020 /* WKUP_GP5_FALL */ 1207#define ARIZONA_WKUP_GP5_FALL 0x0020 /* WKUP_GP5_FALL */
1198#define ARIZONA_WKUP_GP5_FALL_MASK 0x0020 /* WKUP_GP5_FALL */ 1208#define ARIZONA_WKUP_GP5_FALL_MASK 0x0020 /* WKUP_GP5_FALL */
1199#define ARIZONA_WKUP_GP5_FALL_SHIFT 5 /* WKUP_GP5_FALL */ 1209#define ARIZONA_WKUP_GP5_FALL_SHIFT 5 /* WKUP_GP5_FALL */
@@ -2035,6 +2045,9 @@
2035/* 2045/*
2036 * R667 (0x29B) - Headphone Detect 1 2046 * R667 (0x29B) - Headphone Detect 1
2037 */ 2047 */
2048#define ARIZONA_HP_IMPEDANCE_RANGE_MASK 0x0600 /* HP_IMPEDANCE_RANGE - [10:9] */
2049#define ARIZONA_HP_IMPEDANCE_RANGE_SHIFT 9 /* HP_IMPEDANCE_RANGE - [10:9] */
2050#define ARIZONA_HP_IMPEDANCE_RANGE_WIDTH 2 /* HP_IMPEDANCE_RANGE - [10:9] */
2038#define ARIZONA_HP_STEP_SIZE 0x0100 /* HP_STEP_SIZE */ 2051#define ARIZONA_HP_STEP_SIZE 0x0100 /* HP_STEP_SIZE */
2039#define ARIZONA_HP_STEP_SIZE_MASK 0x0100 /* HP_STEP_SIZE */ 2052#define ARIZONA_HP_STEP_SIZE_MASK 0x0100 /* HP_STEP_SIZE */
2040#define ARIZONA_HP_STEP_SIZE_SHIFT 8 /* HP_STEP_SIZE */ 2053#define ARIZONA_HP_STEP_SIZE_SHIFT 8 /* HP_STEP_SIZE */
@@ -2069,6 +2082,21 @@
2069#define ARIZONA_HP_LVL_SHIFT 0 /* HP_LVL - [6:0] */ 2082#define ARIZONA_HP_LVL_SHIFT 0 /* HP_LVL - [6:0] */
2070#define ARIZONA_HP_LVL_WIDTH 7 /* HP_LVL - [6:0] */ 2083#define ARIZONA_HP_LVL_WIDTH 7 /* HP_LVL - [6:0] */
2071 2084
2085#define ARIZONA_HP_DONE_B 0x8000 /* HP_DONE */
2086#define ARIZONA_HP_DONE_B_MASK 0x8000 /* HP_DONE */
2087#define ARIZONA_HP_DONE_B_SHIFT 15 /* HP_DONE */
2088#define ARIZONA_HP_DONE_B_WIDTH 1 /* HP_DONE */
2089#define ARIZONA_HP_LVL_B_MASK 0x7FFF /* HP_LVL - [14:0] */
2090#define ARIZONA_HP_LVL_B_SHIFT 0 /* HP_LVL - [14:0] */
2091#define ARIZONA_HP_LVL_B_WIDTH 15 /* HP_LVL - [14:0] */
2092
2093/*
2094 * R674 (0x2A2) - MICD clamp control
2095 */
2096#define ARIZONA_MICD_CLAMP_MODE_MASK 0x000F /* MICD_CLAMP_MODE - [3:0] */
2097#define ARIZONA_MICD_CLAMP_MODE_SHIFT 0 /* MICD_CLAMP_MODE - [3:0] */
2098#define ARIZONA_MICD_CLAMP_MODE_WIDTH 4 /* MICD_CLAMP_MODE - [3:0] */
2099
2072/* 2100/*
2073 * R675 (0x2A3) - Mic Detect 1 2101 * R675 (0x2A3) - Mic Detect 1
2074 */ 2102 */
@@ -5239,6 +5267,14 @@
5239/* 5267/*
5240 * R3408 (0xD50) - AOD wkup and trig 5268 * R3408 (0xD50) - AOD wkup and trig
5241 */ 5269 */
5270#define ARIZONA_MICD_CLAMP_FALL_TRIG_STS 0x0080 /* MICD_CLAMP_FALL_TRIG_STS */
5271#define ARIZONA_MICD_CLAMP_FALL_TRIG_STS_MASK 0x0080 /* MICD_CLAMP_FALL_TRIG_STS */
5272#define ARIZONA_MICD_CLAMP_FALL_TRIG_STS_SHIFT 7 /* MICD_CLAMP_FALL_TRIG_STS */
5273#define ARIZONA_MICD_CLAMP_FALL_TRIG_STS_WIDTH 1 /* MICD_CLAMP_FALL_TRIG_STS */
5274#define ARIZONA_MICD_CLAMP_RISE_TRIG_STS 0x0040 /* MICD_CLAMP_RISE_TRIG_STS */
5275#define ARIZONA_MICD_CLAMP_RISE_TRIG_STS_MASK 0x0040 /* MICD_CLAMP_RISE_TRIG_STS */
5276#define ARIZONA_MICD_CLAMP_RISE_TRIG_STS_SHIFT 6 /* MICD_CLAMP_RISE_TRIG_STS */
5277#define ARIZONA_MICD_CLAMP_RISE_TRIG_STS_WIDTH 1 /* MICD_CLAMP_RISE_TRIG_STS */
5242#define ARIZONA_GP5_FALL_TRIG_STS 0x0020 /* GP5_FALL_TRIG_STS */ 5278#define ARIZONA_GP5_FALL_TRIG_STS 0x0020 /* GP5_FALL_TRIG_STS */
5243#define ARIZONA_GP5_FALL_TRIG_STS_MASK 0x0020 /* GP5_FALL_TRIG_STS */ 5279#define ARIZONA_GP5_FALL_TRIG_STS_MASK 0x0020 /* GP5_FALL_TRIG_STS */
5244#define ARIZONA_GP5_FALL_TRIG_STS_SHIFT 5 /* GP5_FALL_TRIG_STS */ 5280#define ARIZONA_GP5_FALL_TRIG_STS_SHIFT 5 /* GP5_FALL_TRIG_STS */
@@ -5267,6 +5303,12 @@
5267/* 5303/*
5268 * R3409 (0xD51) - AOD IRQ1 5304 * R3409 (0xD51) - AOD IRQ1
5269 */ 5305 */
5306#define ARIZONA_MICD_CLAMP_FALL_EINT1 0x0080 /* MICD_CLAMP_FALL_EINT1 */
5307#define ARIZONA_MICD_CLAMP_FALL_EINT1_MASK 0x0080 /* MICD_CLAMP_FALL_EINT1 */
5308#define ARIZONA_MICD_CLAMP_FALL_EINT1_SHIFT 7 /* MICD_CLAMP_FALL_EINT1 */
5309#define ARIZONA_MICD_CLAMP_RISE_EINT1 0x0040 /* MICD_CLAMP_RISE_EINT1 */
5310#define ARIZONA_MICD_CLAMP_RISE_EINT1_MASK 0x0040 /* MICD_CLAMP_RISE_EINT1 */
5311#define ARIZONA_MICD_CLAMP_RISE_EINT1_SHIFT 6 /* MICD_CLAMP_RISE_EINT1 */
5270#define ARIZONA_GP5_FALL_EINT1 0x0020 /* GP5_FALL_EINT1 */ 5312#define ARIZONA_GP5_FALL_EINT1 0x0020 /* GP5_FALL_EINT1 */
5271#define ARIZONA_GP5_FALL_EINT1_MASK 0x0020 /* GP5_FALL_EINT1 */ 5313#define ARIZONA_GP5_FALL_EINT1_MASK 0x0020 /* GP5_FALL_EINT1 */
5272#define ARIZONA_GP5_FALL_EINT1_SHIFT 5 /* GP5_FALL_EINT1 */ 5314#define ARIZONA_GP5_FALL_EINT1_SHIFT 5 /* GP5_FALL_EINT1 */
@@ -5295,6 +5337,12 @@
5295/* 5337/*
5296 * R3410 (0xD52) - AOD IRQ2 5338 * R3410 (0xD52) - AOD IRQ2
5297 */ 5339 */
5340#define ARIZONA_MICD_CLAMP_FALL_EINT2 0x0080 /* MICD_CLAMP_FALL_EINT2 */
5341#define ARIZONA_MICD_CLAMP_FALL_EINT2_MASK 0x0080 /* MICD_CLAMP_FALL_EINT2 */
5342#define ARIZONA_MICD_CLAMP_FALL_EINT2_SHIFT 7 /* MICD_CLAMP_FALL_EINT2 */
5343#define ARIZONA_MICD_CLAMP_RISE_EINT2 0x0040 /* MICD_CLAMP_RISE_EINT2 */
5344#define ARIZONA_MICD_CLAMP_RISE_EINT2_MASK 0x0040 /* MICD_CLAMP_RISE_EINT2 */
5345#define ARIZONA_MICD_CLAMP_RISE_EINT2_SHIFT 6 /* MICD_CLAMP_RISE_EINT2 */
5298#define ARIZONA_GP5_FALL_EINT2 0x0020 /* GP5_FALL_EINT2 */ 5346#define ARIZONA_GP5_FALL_EINT2 0x0020 /* GP5_FALL_EINT2 */
5299#define ARIZONA_GP5_FALL_EINT2_MASK 0x0020 /* GP5_FALL_EINT2 */ 5347#define ARIZONA_GP5_FALL_EINT2_MASK 0x0020 /* GP5_FALL_EINT2 */
5300#define ARIZONA_GP5_FALL_EINT2_SHIFT 5 /* GP5_FALL_EINT2 */ 5348#define ARIZONA_GP5_FALL_EINT2_SHIFT 5 /* GP5_FALL_EINT2 */
@@ -5379,6 +5427,10 @@
5379/* 5427/*
5380 * R3413 (0xD55) - AOD IRQ Raw Status 5428 * R3413 (0xD55) - AOD IRQ Raw Status
5381 */ 5429 */
5430#define ARIZONA_MICD_CLAMP_STS 0x0008 /* MICD_CLAMP_STS */
5431#define ARIZONA_MICD_CLAMP_STS_MASK 0x0008 /* MICD_CLAMP_STS */
5432#define ARIZONA_MICD_CLAMP_STS_SHIFT 3 /* MICD_CLAMP_STS */
5433#define ARIZONA_MICD_CLAMP_STS_WIDTH 1 /* MICD_CLAMP_STS */
5382#define ARIZONA_GP5_STS 0x0004 /* GP5_STS */ 5434#define ARIZONA_GP5_STS 0x0004 /* GP5_STS */
5383#define ARIZONA_GP5_STS_MASK 0x0004 /* GP5_STS */ 5435#define ARIZONA_GP5_STS_MASK 0x0004 /* GP5_STS */
5384#define ARIZONA_GP5_STS_SHIFT 2 /* GP5_STS */ 5436#define ARIZONA_GP5_STS_SHIFT 2 /* GP5_STS */
@@ -5395,6 +5447,10 @@
5395/* 5447/*
5396 * R3414 (0xD56) - Jack detect debounce 5448 * R3414 (0xD56) - Jack detect debounce
5397 */ 5449 */
5450#define ARIZONA_MICD_CLAMP_DB 0x0008 /* MICD_CLAMP_DB */
5451#define ARIZONA_MICD_CLAMP_DB_MASK 0x0008 /* MICD_CLAMP_DB */
5452#define ARIZONA_MICD_CLAMP_DB_SHIFT 3 /* MICD_CLAMP_DB */
5453#define ARIZONA_MICD_CLAMP_DB_WIDTH 1 /* MICD_CLAMP_DB */
5398#define ARIZONA_JD2_DB 0x0002 /* JD2_DB */ 5454#define ARIZONA_JD2_DB 0x0002 /* JD2_DB */
5399#define ARIZONA_JD2_DB_MASK 0x0002 /* JD2_DB */ 5455#define ARIZONA_JD2_DB_MASK 0x0002 /* JD2_DB */
5400#define ARIZONA_JD2_DB_SHIFT 1 /* JD2_DB */ 5456#define ARIZONA_JD2_DB_SHIFT 1 /* JD2_DB */
diff --git a/include/linux/mfd/max77693-private.h b/include/linux/mfd/max77693-private.h
index 1eeae5c07915..5b18ecde69b5 100644
--- a/include/linux/mfd/max77693-private.h
+++ b/include/linux/mfd/max77693-private.h
@@ -106,6 +106,92 @@ enum max77693_muic_reg {
106 MAX77693_MUIC_REG_END, 106 MAX77693_MUIC_REG_END,
107}; 107};
108 108
109/* MAX77693 MUIC - STATUS1~3 Register */
110#define STATUS1_ADC_SHIFT (0)
111#define STATUS1_ADCLOW_SHIFT (5)
112#define STATUS1_ADCERR_SHIFT (6)
113#define STATUS1_ADC1K_SHIFT (7)
114#define STATUS1_ADC_MASK (0x1f << STATUS1_ADC_SHIFT)
115#define STATUS1_ADCLOW_MASK (0x1 << STATUS1_ADCLOW_SHIFT)
116#define STATUS1_ADCERR_MASK (0x1 << STATUS1_ADCERR_SHIFT)
117#define STATUS1_ADC1K_MASK (0x1 << STATUS1_ADC1K_SHIFT)
118
119#define STATUS2_CHGTYP_SHIFT (0)
120#define STATUS2_CHGDETRUN_SHIFT (3)
121#define STATUS2_DCDTMR_SHIFT (4)
122#define STATUS2_DXOVP_SHIFT (5)
123#define STATUS2_VBVOLT_SHIFT (6)
124#define STATUS2_VIDRM_SHIFT (7)
125#define STATUS2_CHGTYP_MASK (0x7 << STATUS2_CHGTYP_SHIFT)
126#define STATUS2_CHGDETRUN_MASK (0x1 << STATUS2_CHGDETRUN_SHIFT)
127#define STATUS2_DCDTMR_MASK (0x1 << STATUS2_DCDTMR_SHIFT)
128#define STATUS2_DXOVP_MASK (0x1 << STATUS2_DXOVP_SHIFT)
129#define STATUS2_VBVOLT_MASK (0x1 << STATUS2_VBVOLT_SHIFT)
130#define STATUS2_VIDRM_MASK (0x1 << STATUS2_VIDRM_SHIFT)
131
132#define STATUS3_OVP_SHIFT (2)
133#define STATUS3_OVP_MASK (0x1 << STATUS3_OVP_SHIFT)
134
135/* MAX77693 CDETCTRL1~2 register */
136#define CDETCTRL1_CHGDETEN_SHIFT (0)
137#define CDETCTRL1_CHGTYPMAN_SHIFT (1)
138#define CDETCTRL1_DCDEN_SHIFT (2)
139#define CDETCTRL1_DCD2SCT_SHIFT (3)
140#define CDETCTRL1_CDDELAY_SHIFT (4)
141#define CDETCTRL1_DCDCPL_SHIFT (5)
142#define CDETCTRL1_CDPDET_SHIFT (7)
143#define CDETCTRL1_CHGDETEN_MASK (0x1 << CDETCTRL1_CHGDETEN_SHIFT)
144#define CDETCTRL1_CHGTYPMAN_MASK (0x1 << CDETCTRL1_CHGTYPMAN_SHIFT)
145#define CDETCTRL1_DCDEN_MASK (0x1 << CDETCTRL1_DCDEN_SHIFT)
146#define CDETCTRL1_DCD2SCT_MASK (0x1 << CDETCTRL1_DCD2SCT_SHIFT)
147#define CDETCTRL1_CDDELAY_MASK (0x1 << CDETCTRL1_CDDELAY_SHIFT)
148#define CDETCTRL1_DCDCPL_MASK (0x1 << CDETCTRL1_DCDCPL_SHIFT)
149#define CDETCTRL1_CDPDET_MASK (0x1 << CDETCTRL1_CDPDET_SHIFT)
150
151#define CDETCTRL2_VIDRMEN_SHIFT (1)
152#define CDETCTRL2_DXOVPEN_SHIFT (3)
153#define CDETCTRL2_VIDRMEN_MASK (0x1 << CDETCTRL2_VIDRMEN_SHIFT)
154#define CDETCTRL2_DXOVPEN_MASK (0x1 << CDETCTRL2_DXOVPEN_SHIFT)
155
156/* MAX77693 MUIC - CONTROL1~3 register */
157#define COMN1SW_SHIFT (0)
158#define COMP2SW_SHIFT (3)
159#define COMN1SW_MASK (0x7 << COMN1SW_SHIFT)
160#define COMP2SW_MASK (0x7 << COMP2SW_SHIFT)
161#define COMP_SW_MASK (COMP2SW_MASK | COMN1SW_MASK)
162#define CONTROL1_SW_USB ((1 << COMP2SW_SHIFT) \
163 | (1 << COMN1SW_SHIFT))
164#define CONTROL1_SW_AUDIO ((2 << COMP2SW_SHIFT) \
165 | (2 << COMN1SW_SHIFT))
166#define CONTROL1_SW_UART ((3 << COMP2SW_SHIFT) \
167 | (3 << COMN1SW_SHIFT))
168#define CONTROL1_SW_OPEN ((0 << COMP2SW_SHIFT) \
169 | (0 << COMN1SW_SHIFT))
170
171#define CONTROL2_LOWPWR_SHIFT (0)
172#define CONTROL2_ADCEN_SHIFT (1)
173#define CONTROL2_CPEN_SHIFT (2)
174#define CONTROL2_SFOUTASRT_SHIFT (3)
175#define CONTROL2_SFOUTORD_SHIFT (4)
176#define CONTROL2_ACCDET_SHIFT (5)
177#define CONTROL2_USBCPINT_SHIFT (6)
178#define CONTROL2_RCPS_SHIFT (7)
179#define CONTROL2_LOWPWR_MASK (0x1 << CONTROL2_LOWPWR_SHIFT)
180#define CONTROL2_ADCEN_MASK (0x1 << CONTROL2_ADCEN_SHIFT)
181#define CONTROL2_CPEN_MASK (0x1 << CONTROL2_CPEN_SHIFT)
182#define CONTROL2_SFOUTASRT_MASK (0x1 << CONTROL2_SFOUTASRT_SHIFT)
183#define CONTROL2_SFOUTORD_MASK (0x1 << CONTROL2_SFOUTORD_SHIFT)
184#define CONTROL2_ACCDET_MASK (0x1 << CONTROL2_ACCDET_SHIFT)
185#define CONTROL2_USBCPINT_MASK (0x1 << CONTROL2_USBCPINT_SHIFT)
186#define CONTROL2_RCPS_MASK (0x1 << CONTROL2_RCPS_SHIFT)
187
188#define CONTROL3_JIGSET_SHIFT (0)
189#define CONTROL3_BTLDSET_SHIFT (2)
190#define CONTROL3_ADCDBSET_SHIFT (4)
191#define CONTROL3_JIGSET_MASK (0x3 << CONTROL3_JIGSET_SHIFT)
192#define CONTROL3_BTLDSET_MASK (0x3 << CONTROL3_BTLDSET_SHIFT)
193#define CONTROL3_ADCDBSET_MASK (0x3 << CONTROL3_ADCDBSET_SHIFT)
194
109/* Slave addr = 0x90: Haptic */ 195/* Slave addr = 0x90: Haptic */
110enum max77693_haptic_reg { 196enum max77693_haptic_reg {
111 MAX77693_HAPTIC_REG_STATUS = 0x00, 197 MAX77693_HAPTIC_REG_STATUS = 0x00,
diff --git a/include/linux/mfd/max77693.h b/include/linux/mfd/max77693.h
index fe03b2d35d4f..3109a6c5c948 100644
--- a/include/linux/mfd/max77693.h
+++ b/include/linux/mfd/max77693.h
@@ -38,6 +38,15 @@ struct max77693_reg_data {
38struct max77693_muic_platform_data { 38struct max77693_muic_platform_data {
39 struct max77693_reg_data *init_data; 39 struct max77693_reg_data *init_data;
40 int num_init_data; 40 int num_init_data;
41
42 int detcable_delay_ms;
43
44 /*
45 * Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
46 * h/w path of COMP2/COMN1 on CONTROL1 register.
47 */
48 int path_usb;
49 int path_uart;
41}; 50};
42 51
43struct max77693_platform_data { 52struct max77693_platform_data {
diff --git a/include/linux/mfd/max8997-private.h b/include/linux/mfd/max8997-private.h
index 6ae21bf47d64..fb465dfbb59e 100644
--- a/include/linux/mfd/max8997-private.h
+++ b/include/linux/mfd/max8997-private.h
@@ -194,6 +194,70 @@ enum max8997_muic_reg {
194 MAX8997_MUIC_REG_END = 0xf, 194 MAX8997_MUIC_REG_END = 0xf,
195}; 195};
196 196
197/* MAX8997-MUIC STATUS1 register */
198#define STATUS1_ADC_SHIFT 0
199#define STATUS1_ADCLOW_SHIFT 5
200#define STATUS1_ADCERR_SHIFT 6
201#define STATUS1_ADC_MASK (0x1f << STATUS1_ADC_SHIFT)
202#define STATUS1_ADCLOW_MASK (0x1 << STATUS1_ADCLOW_SHIFT)
203#define STATUS1_ADCERR_MASK (0x1 << STATUS1_ADCERR_SHIFT)
204
205/* MAX8997-MUIC STATUS2 register */
206#define STATUS2_CHGTYP_SHIFT 0
207#define STATUS2_CHGDETRUN_SHIFT 3
208#define STATUS2_DCDTMR_SHIFT 4
209#define STATUS2_DBCHG_SHIFT 5
210#define STATUS2_VBVOLT_SHIFT 6
211#define STATUS2_CHGTYP_MASK (0x7 << STATUS2_CHGTYP_SHIFT)
212#define STATUS2_CHGDETRUN_MASK (0x1 << STATUS2_CHGDETRUN_SHIFT)
213#define STATUS2_DCDTMR_MASK (0x1 << STATUS2_DCDTMR_SHIFT)
214#define STATUS2_DBCHG_MASK (0x1 << STATUS2_DBCHG_SHIFT)
215#define STATUS2_VBVOLT_MASK (0x1 << STATUS2_VBVOLT_SHIFT)
216
217/* MAX8997-MUIC STATUS3 register */
218#define STATUS3_OVP_SHIFT 2
219#define STATUS3_OVP_MASK (0x1 << STATUS3_OVP_SHIFT)
220
221/* MAX8997-MUIC CONTROL1 register */
222#define COMN1SW_SHIFT 0
223#define COMP2SW_SHIFT 3
224#define COMN1SW_MASK (0x7 << COMN1SW_SHIFT)
225#define COMP2SW_MASK (0x7 << COMP2SW_SHIFT)
226#define COMP_SW_MASK (COMP2SW_MASK | COMN1SW_MASK)
227
228#define CONTROL1_SW_USB ((1 << COMP2SW_SHIFT) \
229 | (1 << COMN1SW_SHIFT))
230#define CONTROL1_SW_AUDIO ((2 << COMP2SW_SHIFT) \
231 | (2 << COMN1SW_SHIFT))
232#define CONTROL1_SW_UART ((3 << COMP2SW_SHIFT) \
233 | (3 << COMN1SW_SHIFT))
234#define CONTROL1_SW_OPEN ((0 << COMP2SW_SHIFT) \
235 | (0 << COMN1SW_SHIFT))
236
237#define CONTROL2_LOWPWR_SHIFT (0)
238#define CONTROL2_ADCEN_SHIFT (1)
239#define CONTROL2_CPEN_SHIFT (2)
240#define CONTROL2_SFOUTASRT_SHIFT (3)
241#define CONTROL2_SFOUTORD_SHIFT (4)
242#define CONTROL2_ACCDET_SHIFT (5)
243#define CONTROL2_USBCPINT_SHIFT (6)
244#define CONTROL2_RCPS_SHIFT (7)
245#define CONTROL2_LOWPWR_MASK (0x1 << CONTROL2_LOWPWR_SHIFT)
246#define CONTROL2_ADCEN_MASK (0x1 << CONTROL2_ADCEN_SHIFT)
247#define CONTROL2_CPEN_MASK (0x1 << CONTROL2_CPEN_SHIFT)
248#define CONTROL2_SFOUTASRT_MASK (0x1 << CONTROL2_SFOUTASRT_SHIFT)
249#define CONTROL2_SFOUTORD_MASK (0x1 << CONTROL2_SFOUTORD_SHIFT)
250#define CONTROL2_ACCDET_MASK (0x1 << CONTROL2_ACCDET_SHIFT)
251#define CONTROL2_USBCPINT_MASK (0x1 << CONTROL2_USBCPINT_SHIFT)
252#define CONTROL2_RCPS_MASK (0x1 << CONTROL2_RCPS_SHIFT)
253
254#define CONTROL3_JIGSET_SHIFT (0)
255#define CONTROL3_BTLDSET_SHIFT (2)
256#define CONTROL3_ADCDBSET_SHIFT (4)
257#define CONTROL3_JIGSET_MASK (0x3 << CONTROL3_JIGSET_SHIFT)
258#define CONTROL3_BTLDSET_MASK (0x3 << CONTROL3_BTLDSET_SHIFT)
259#define CONTROL3_ADCDBSET_MASK (0x3 << CONTROL3_ADCDBSET_SHIFT)
260
197enum max8997_haptic_reg { 261enum max8997_haptic_reg {
198 MAX8997_HAPTIC_REG_GENERAL = 0x00, 262 MAX8997_HAPTIC_REG_GENERAL = 0x00,
199 MAX8997_HAPTIC_REG_CONF1 = 0x01, 263 MAX8997_HAPTIC_REG_CONF1 = 0x01,
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h
index 1d4a4fe6ac33..cf815577bd68 100644
--- a/include/linux/mfd/max8997.h
+++ b/include/linux/mfd/max8997.h
@@ -78,21 +78,6 @@ struct max8997_regulator_data {
78 struct device_node *reg_node; 78 struct device_node *reg_node;
79}; 79};
80 80
81enum max8997_muic_usb_type {
82 MAX8997_USB_HOST,
83 MAX8997_USB_DEVICE,
84};
85
86enum max8997_muic_charger_type {
87 MAX8997_CHARGER_TYPE_NONE = 0,
88 MAX8997_CHARGER_TYPE_USB,
89 MAX8997_CHARGER_TYPE_DOWNSTREAM_PORT,
90 MAX8997_CHARGER_TYPE_DEDICATED_CHG,
91 MAX8997_CHARGER_TYPE_500MA,
92 MAX8997_CHARGER_TYPE_1A,
93 MAX8997_CHARGER_TYPE_DEAD_BATTERY = 7,
94};
95
96struct max8997_muic_reg_data { 81struct max8997_muic_reg_data {
97 u8 addr; 82 u8 addr;
98 u8 data; 83 u8 data;
@@ -107,6 +92,16 @@ struct max8997_muic_reg_data {
107struct max8997_muic_platform_data { 92struct max8997_muic_platform_data {
108 struct max8997_muic_reg_data *init_data; 93 struct max8997_muic_reg_data *init_data;
109 int num_init_data; 94 int num_init_data;
95
96 /* Check cable state after certain delay */
97 int detcable_delay_ms;
98
99 /*
100 * Default usb/uart path whether UART/USB or AUX_UART/AUX_USB
101 * h/w path of COMP2/COMN1 on CONTROL1 register.
102 */
103 int path_usb;
104 int path_uart;
110}; 105};
111 106
112enum max8997_haptic_motor_type { 107enum max8997_haptic_motor_type {