linux/drivers/extcon
Hans de Goede c309a3e879 extcon: arizona: Fix some issues when HPDET IRQ fires after the jack has been unplugged
When the jack is partially inserted and then removed again it may be
removed while the hpdet code is running. In this case the following
may happen:

1. The "JACKDET rise" or ""JACKDET fall" IRQ triggers
2. arizona_jackdet runs and takes info->lock
3. The "HPDET" IRQ triggers
4. arizona_hpdet_irq runs, blocks on info->lock
5. arizona_jackdet calls arizona_stop_mic() and clears info->hpdet_done
6. arizona_jackdet releases info->lock
7. arizona_hpdet_irq now can continue running and:
7.1 Calls arizona_start_mic() (if a mic was detected)
7.2 sets info->hpdet_done

Step 7 is undesirable / a bug:
7.1 causes the device to stay in a high power-state (with MICVDD enabled)
7.2 causes hpdet to not run on the next jack insertion, which in turn
    causes the EXTCON_JACK_HEADPHONE state to never get set

This fixes both issues by skipping these 2 steps when arizona_hpdet_irq
runs after the jack has been unplugged.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Tested-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2021-03-18 11:46:15 +00:00
..
devres.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 282 2019-06-05 17:36:37 +02:00
extcon-adc-jack.c extcon: adc-jack: Fix an error handling path in 'adc_jack_probe()' 2020-05-29 17:36:01 +09:00
extcon-arizona.c extcon: arizona: Fix some issues when HPDET IRQ fires after the jack has been unplugged 2021-03-18 11:46:15 +00:00
extcon-axp288.c extcon: axp288: Use module_platform_driver to simplify the code 2020-09-30 00:40:06 +09:00
extcon-fsa9480.c extcon: fsa9480: Support TI TSU6111 variant 2020-12-11 17:01:09 +09:00
extcon-gpio.c extcon: gpio: Request reasonable interrupts 2019-07-24 19:20:19 +09:00
extcon-intel-cht-wc.c extcon-intel-cht-wc: Don't reset USB data connection at probe 2019-10-01 06:46:30 +09:00
extcon-intel-int3496.c extcon: int3496: Convert to use SPDX identifier 2018-08-28 11:21:15 +09:00
extcon-intel-mrfld.c extcon: mrfld: Introduce extcon driver for Basin Cove PMIC 2019-04-05 10:21:41 +09:00
extcon-intel.h extcon: intel: Split out some definitions to a common header 2019-04-05 10:21:41 +09:00
extcon-max3355.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 233 2019-06-19 17:09:06 +02:00
extcon-max8997.c extcon: max8997: Return error code of extcon_dev_allocate() 2020-09-24 19:20:49 +09:00
extcon-max14577.c extcon: max14577: Return error code of extcon_dev_allocate() 2020-09-24 19:20:49 +09:00
extcon-max77693.c extcon: max77693: Fix modalias string 2020-12-11 17:18:10 +09:00
extcon-max77843.c extcon: max77843: Return error code of extcon_dev_allocate() 2020-09-24 19:20:49 +09:00
extcon-palmas.c extcon: palmas: Simplify with dev_err_probe() 2020-09-24 19:20:49 +09:00
extcon-ptn5150.c extcon: ptn5150: Do not print error during probe if nothing is attached 2020-09-30 00:38:54 +09:00
extcon-qcom-spmi-misc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
extcon-rt8973a.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
extcon-rt8973a.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
extcon-sm5502.c extcon: sm5502: Remove unneeded semicolon 2019-12-16 10:23:19 +09:00
extcon-sm5502.h extcon: sm5502: Reset registers during initialization 2019-10-11 10:43:26 +09:00
extcon-usb-gpio.c extcon: Replace HTTP links with HTTPS ones 2020-09-24 19:20:48 +09:00
extcon-usbc-cros-ec.c mfd / platform: cros_ec: Reorganize platform and mfd includes 2019-09-02 11:33:42 +01:00
extcon-usbc-tusb320.c extcon: Add driver for TI TUSB320 2020-12-11 17:01:09 +09:00
extcon.c extcon: remove redundant assignment to variable idx 2020-05-29 17:36:01 +09:00
extcon.h USB/PHY patches for 4.15-rc1 2017-11-13 21:14:07 -08:00
Kconfig extcon: Add driver for TI TUSB320 2020-12-11 17:01:09 +09:00
Makefile extcon: Add driver for TI TUSB320 2020-12-11 17:01:09 +09:00