aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/extcon
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-21 12:42:58 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-21 12:42:58 -0400
commit1fc149933fd49a5b0e7738dc0853dbfbac4ae0e1 (patch)
treedfe99751c21aaf39e49765379d0b9b32114c757d /drivers/extcon
parent41d5e08ea86af3359239d5a6f7021cdc61beaa49 (diff)
parentea5505fabd3b59608750bfd3721d0f8bc5c8b0bb (diff)
Merge tag 'char-misc-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH: "Here's the big char/misc driver patchset for 4.1-rc1. Lots of different driver subsystem updates here, nothing major, full details are in the shortlog. All of this has been in linux-next for a while" * tag 'char-misc-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (133 commits) mei: trace: remove unused TRACE_SYSTEM_STRING DTS: ARM: OMAP3-N900: Add lis3lv02d support Documentation: DT: lis302: update wakeup binding lis3lv02d: DT: add wakeup unit 2 and wakeup threshold lis3lv02d: DT: use s32 to support negative values Drivers: hv: hv_balloon: correctly handle num_pages>INT_MAX case Drivers: hv: hv_balloon: correctly handle val.freeram<num_pages case mei: replace check for connection instead of transitioning mei: use mei_cl_is_connected consistently mei: fix mei_poll operation hv_vmbus: Add gradually increased delay for retries in vmbus_post_msg() Drivers: hv: hv_balloon: survive ballooning request with num_pages=0 Drivers: hv: hv_balloon: eliminate jumps in piecewiese linear floor function Drivers: hv: hv_balloon: do not online pages in offline blocks hv: remove the per-channel workqueue hv: don't schedule new works in vmbus_onoffer()/vmbus_onoffer_rescind() hv: run non-blocking message handlers in the dispatch tasklet coresight: moving to new "hwtracing" directory coresight-tmc: Adding a status interface to sysfs coresight: remove the unnecessary configuration coresight-default-sink ...
Diffstat (limited to 'drivers/extcon')
-rw-r--r--drivers/extcon/Kconfig17
-rw-r--r--drivers/extcon/Makefile4
-rw-r--r--drivers/extcon/extcon-arizona.c49
-rw-r--r--drivers/extcon/extcon-max14577.c5
-rw-r--r--drivers/extcon/extcon-max77693.c37
-rw-r--r--drivers/extcon/extcon-max77843.c881
-rw-r--r--drivers/extcon/extcon-max8997.c5
-rw-r--r--drivers/extcon/extcon-rt8973a.c6
-rw-r--r--drivers/extcon/extcon-sm5502.c6
-rw-r--r--drivers/extcon/extcon-usb-gpio.c237
-rw-r--r--drivers/extcon/extcon.c (renamed from drivers/extcon/extcon-class.c)36
11 files changed, 1227 insertions, 56 deletions
diff --git a/drivers/extcon/Kconfig b/drivers/extcon/Kconfig
index 6a1f7de6fa54..fdc0bf0543ce 100644
--- a/drivers/extcon/Kconfig
+++ b/drivers/extcon/Kconfig
@@ -55,6 +55,16 @@ config EXTCON_MAX77693
55 Maxim MAX77693 PMIC. The MAX77693 MUIC is a USB port accessory 55 Maxim MAX77693 PMIC. The MAX77693 MUIC is a USB port accessory
56 detector and switch. 56 detector and switch.
57 57
58config EXTCON_MAX77843
59 tristate "MAX77843 EXTCON Support"
60 depends on MFD_MAX77843
61 select IRQ_DOMAIN
62 select REGMAP_I2C
63 help
64 If you say yes here you get support for the MUIC device of
65 Maxim MAX77843. The MAX77843 MUIC is a USB port accessory
66 detector add switch.
67
58config EXTCON_MAX8997 68config EXTCON_MAX8997
59 tristate "MAX8997 EXTCON Support" 69 tristate "MAX8997 EXTCON Support"
60 depends on MFD_MAX8997 && IRQ_DOMAIN 70 depends on MFD_MAX8997 && IRQ_DOMAIN
@@ -93,4 +103,11 @@ config EXTCON_SM5502
93 Silicon Mitus SM5502. The SM5502 is a USB port accessory 103 Silicon Mitus SM5502. The SM5502 is a USB port accessory
94 detector and switch. 104 detector and switch.
95 105
106config EXTCON_USB_GPIO
107 tristate "USB GPIO extcon support"
108 depends on GPIOLIB
109 help
110 Say Y here to enable GPIO based USB cable detection extcon support.
111 Used typically if GPIO is used for USB ID pin detection.
112
96endif # MULTISTATE_SWITCH 113endif # MULTISTATE_SWITCH
diff --git a/drivers/extcon/Makefile b/drivers/extcon/Makefile
index 0370b42e5a27..9204114791a3 100644
--- a/drivers/extcon/Makefile
+++ b/drivers/extcon/Makefile
@@ -2,13 +2,15 @@
2# Makefile for external connector class (extcon) devices 2# Makefile for external connector class (extcon) devices
3# 3#
4 4
5obj-$(CONFIG_EXTCON) += extcon-class.o 5obj-$(CONFIG_EXTCON) += extcon.o
6obj-$(CONFIG_EXTCON_ADC_JACK) += extcon-adc-jack.o 6obj-$(CONFIG_EXTCON_ADC_JACK) += extcon-adc-jack.o
7obj-$(CONFIG_EXTCON_ARIZONA) += extcon-arizona.o 7obj-$(CONFIG_EXTCON_ARIZONA) += extcon-arizona.o
8obj-$(CONFIG_EXTCON_GPIO) += extcon-gpio.o 8obj-$(CONFIG_EXTCON_GPIO) += extcon-gpio.o
9obj-$(CONFIG_EXTCON_MAX14577) += extcon-max14577.o 9obj-$(CONFIG_EXTCON_MAX14577) += extcon-max14577.o
10obj-$(CONFIG_EXTCON_MAX77693) += extcon-max77693.o 10obj-$(CONFIG_EXTCON_MAX77693) += extcon-max77693.o
11obj-$(CONFIG_EXTCON_MAX77843) += extcon-max77843.o
11obj-$(CONFIG_EXTCON_MAX8997) += extcon-max8997.o 12obj-$(CONFIG_EXTCON_MAX8997) += extcon-max8997.o
12obj-$(CONFIG_EXTCON_PALMAS) += extcon-palmas.o 13obj-$(CONFIG_EXTCON_PALMAS) += extcon-palmas.o
13obj-$(CONFIG_EXTCON_RT8973A) += extcon-rt8973a.o 14obj-$(CONFIG_EXTCON_RT8973A) += extcon-rt8973a.o
14obj-$(CONFIG_EXTCON_SM5502) += extcon-sm5502.o 15obj-$(CONFIG_EXTCON_SM5502) += extcon-sm5502.o
16obj-$(CONFIG_EXTCON_USB_GPIO) += extcon-usb-gpio.o
diff --git a/drivers/extcon/extcon-arizona.c b/drivers/extcon/extcon-arizona.c
index 6b5e795f3fe2..a0ed35b336e4 100644
--- a/drivers/extcon/extcon-arizona.c
+++ b/drivers/extcon/extcon-arizona.c
@@ -136,18 +136,35 @@ static const char *arizona_cable[] = {
136 136
137static void arizona_start_hpdet_acc_id(struct arizona_extcon_info *info); 137static void arizona_start_hpdet_acc_id(struct arizona_extcon_info *info);
138 138
139static void arizona_extcon_do_magic(struct arizona_extcon_info *info, 139static void arizona_extcon_hp_clamp(struct arizona_extcon_info *info,
140 unsigned int magic) 140 bool clamp)
141{ 141{
142 struct arizona *arizona = info->arizona; 142 struct arizona *arizona = info->arizona;
143 unsigned int mask = 0, val = 0;
143 int ret; 144 int ret;
144 145
146 switch (arizona->type) {
147 case WM5110:
148 mask = ARIZONA_HP1L_SHRTO | ARIZONA_HP1L_FLWR |
149 ARIZONA_HP1L_SHRTI;
150 if (clamp)
151 val = ARIZONA_HP1L_SHRTO;
152 else
153 val = ARIZONA_HP1L_FLWR | ARIZONA_HP1L_SHRTI;
154 break;
155 default:
156 mask = ARIZONA_RMV_SHRT_HP1L;
157 if (clamp)
158 val = ARIZONA_RMV_SHRT_HP1L;
159 break;
160 };
161
145 mutex_lock(&arizona->dapm->card->dapm_mutex); 162 mutex_lock(&arizona->dapm->card->dapm_mutex);
146 163
147 arizona->hpdet_magic = magic; 164 arizona->hpdet_clamp = clamp;
148 165
149 /* Keep the HP output stages disabled while doing the magic */ 166 /* Keep the HP output stages disabled while doing the clamp */
150 if (magic) { 167 if (clamp) {
151 ret = regmap_update_bits(arizona->regmap, 168 ret = regmap_update_bits(arizona->regmap,
152 ARIZONA_OUTPUT_ENABLES_1, 169 ARIZONA_OUTPUT_ENABLES_1,
153 ARIZONA_OUT1L_ENA | 170 ARIZONA_OUT1L_ENA |
@@ -158,20 +175,20 @@ static void arizona_extcon_do_magic(struct arizona_extcon_info *info,
158 ret); 175 ret);
159 } 176 }
160 177
161 ret = regmap_update_bits(arizona->regmap, 0x225, 0x4000, 178 ret = regmap_update_bits(arizona->regmap, ARIZONA_HP_CTRL_1L,
162 magic); 179 mask, val);
163 if (ret != 0) 180 if (ret != 0)
164 dev_warn(arizona->dev, "Failed to do magic: %d\n", 181 dev_warn(arizona->dev, "Failed to do clamp: %d\n",
165 ret); 182 ret);
166 183
167 ret = regmap_update_bits(arizona->regmap, 0x226, 0x4000, 184 ret = regmap_update_bits(arizona->regmap, ARIZONA_HP_CTRL_1R,
168 magic); 185 mask, val);
169 if (ret != 0) 186 if (ret != 0)
170 dev_warn(arizona->dev, "Failed to do magic: %d\n", 187 dev_warn(arizona->dev, "Failed to do clamp: %d\n",
171 ret); 188 ret);
172 189
173 /* Restore the desired state while not doing the magic */ 190 /* Restore the desired state while not doing the clamp */
174 if (!magic) { 191 if (!clamp) {
175 ret = regmap_update_bits(arizona->regmap, 192 ret = regmap_update_bits(arizona->regmap,
176 ARIZONA_OUTPUT_ENABLES_1, 193 ARIZONA_OUTPUT_ENABLES_1,
177 ARIZONA_OUT1L_ENA | 194 ARIZONA_OUT1L_ENA |
@@ -603,7 +620,7 @@ done:
603 ARIZONA_HP_IMPEDANCE_RANGE_MASK | ARIZONA_HP_POLL, 620 ARIZONA_HP_IMPEDANCE_RANGE_MASK | ARIZONA_HP_POLL,
604 0); 621 0);
605 622
606 arizona_extcon_do_magic(info, 0); 623 arizona_extcon_hp_clamp(info, false);
607 624
608 if (id_gpio) 625 if (id_gpio)
609 gpio_set_value_cansleep(id_gpio, 0); 626 gpio_set_value_cansleep(id_gpio, 0);
@@ -648,7 +665,7 @@ static void arizona_identify_headphone(struct arizona_extcon_info *info)
648 if (info->mic) 665 if (info->mic)
649 arizona_stop_mic(info); 666 arizona_stop_mic(info);
650 667
651 arizona_extcon_do_magic(info, 0x4000); 668 arizona_extcon_hp_clamp(info, true);
652 669
653 ret = regmap_update_bits(arizona->regmap, 670 ret = regmap_update_bits(arizona->regmap,
654 ARIZONA_ACCESSORY_DETECT_MODE_1, 671 ARIZONA_ACCESSORY_DETECT_MODE_1,
@@ -699,7 +716,7 @@ static void arizona_start_hpdet_acc_id(struct arizona_extcon_info *info)
699 716