Commit f89c0a87 authored by Mark Brown's avatar Mark Brown

Merge tag 'ib-mfd-extcon-v5.13' of...

Merge tag 'ib-mfd-extcon-v5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into asoc-5.13

Immutable branch between MFD and Extcon due for the v5.13 merge window
parents dfb81e3b a908a716
...@@ -19378,7 +19378,6 @@ F: Documentation/devicetree/bindings/sound/wlf,arizona.yaml ...@@ -19378,7 +19378,6 @@ F: Documentation/devicetree/bindings/sound/wlf,arizona.yaml
F: Documentation/hwmon/wm83??.rst F: Documentation/hwmon/wm83??.rst
F: arch/arm/mach-s3c/mach-crag6410* F: arch/arm/mach-s3c/mach-crag6410*
F: drivers/clk/clk-wm83*.c F: drivers/clk/clk-wm83*.c
F: drivers/extcon/extcon-arizona.c
F: drivers/gpio/gpio-*wm*.c F: drivers/gpio/gpio-*wm*.c
F: drivers/gpio/gpio-arizona.c F: drivers/gpio/gpio-arizona.c
F: drivers/hwmon/wm83??-hwmon.c F: drivers/hwmon/wm83??-hwmon.c
...@@ -19402,7 +19401,7 @@ F: include/linux/mfd/wm8400* ...@@ -19402,7 +19401,7 @@ F: include/linux/mfd/wm8400*
F: include/linux/regulator/arizona* F: include/linux/regulator/arizona*
F: include/linux/wm97xx.h F: include/linux/wm97xx.h
F: include/sound/wm????.h F: include/sound/wm????.h
F: sound/soc/codecs/arizona.? F: sound/soc/codecs/arizona*
F: sound/soc/codecs/cs47l24* F: sound/soc/codecs/cs47l24*
F: sound/soc/codecs/wm* F: sound/soc/codecs/wm*
......
...@@ -21,14 +21,6 @@ config EXTCON_ADC_JACK ...@@ -21,14 +21,6 @@ config EXTCON_ADC_JACK
help help
Say Y here to enable extcon device driver based on ADC values. Say Y here to enable extcon device driver based on ADC values.
config EXTCON_ARIZONA
tristate "Wolfson Arizona EXTCON support"
depends on MFD_ARIZONA && INPUT && SND_SOC
help
Say Y here to enable support for external accessory detection
with Wolfson Arizona devices. These are audio CODECs with
advanced audio accessory detection support.
config EXTCON_AXP288 config EXTCON_AXP288
tristate "X-Power AXP288 EXTCON support" tristate "X-Power AXP288 EXTCON support"
depends on MFD_AXP20X && USB_SUPPORT && X86 && ACPI depends on MFD_AXP20X && USB_SUPPORT && X86 && ACPI
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
obj-$(CONFIG_EXTCON) += extcon-core.o obj-$(CONFIG_EXTCON) += extcon-core.o
extcon-core-objs += extcon.o devres.o extcon-core-objs += extcon.o devres.o
obj-$(CONFIG_EXTCON_ADC_JACK) += extcon-adc-jack.o obj-$(CONFIG_EXTCON_ADC_JACK) += extcon-adc-jack.o
obj-$(CONFIG_EXTCON_ARIZONA) += extcon-arizona.o
obj-$(CONFIG_EXTCON_AXP288) += extcon-axp288.o obj-$(CONFIG_EXTCON_AXP288) += extcon-axp288.o
obj-$(CONFIG_EXTCON_FSA9480) += extcon-fsa9480.o obj-$(CONFIG_EXTCON_FSA9480) += extcon-fsa9480.o
obj-$(CONFIG_EXTCON_GPIO) += extcon-gpio.o obj-$(CONFIG_EXTCON_GPIO) += extcon-gpio.o
......
...@@ -881,11 +881,6 @@ static const char * const wm5102_supplies[] = { ...@@ -881,11 +881,6 @@ static const char * const wm5102_supplies[] = {
static const struct mfd_cell wm5102_devs[] = { static const struct mfd_cell wm5102_devs[] = {
{ .name = "arizona-micsupp" }, { .name = "arizona-micsupp" },
{ .name = "arizona-gpio" }, { .name = "arizona-gpio" },
{
.name = "arizona-extcon",
.parent_supplies = wm5102_supplies,
.num_parent_supplies = 1, /* We only need MICVDD */
},
{ .name = "arizona-haptics" }, { .name = "arizona-haptics" },
{ .name = "arizona-pwm" }, { .name = "arizona-pwm" },
{ {
...@@ -898,11 +893,6 @@ static const struct mfd_cell wm5102_devs[] = { ...@@ -898,11 +893,6 @@ static const struct mfd_cell wm5102_devs[] = {
static const struct mfd_cell wm5110_devs[] = { static const struct mfd_cell wm5110_devs[] = {
{ .name = "arizona-micsupp" }, { .name = "arizona-micsupp" },
{ .name = "arizona-gpio" }, { .name = "arizona-gpio" },
{
.name = "arizona-extcon",
.parent_supplies = wm5102_supplies,
.num_parent_supplies = 1, /* We only need MICVDD */
},
{ .name = "arizona-haptics" }, { .name = "arizona-haptics" },
{ .name = "arizona-pwm" }, { .name = "arizona-pwm" },
{ {
...@@ -939,11 +929,6 @@ static const char * const wm8997_supplies[] = { ...@@ -939,11 +929,6 @@ static const char * const wm8997_supplies[] = {
static const struct mfd_cell wm8997_devs[] = { static const struct mfd_cell wm8997_devs[] = {
{ .name = "arizona-micsupp" }, { .name = "arizona-micsupp" },
{ .name = "arizona-gpio" }, { .name = "arizona-gpio" },
{
.name = "arizona-extcon",
.parent_supplies = wm8997_supplies,
.num_parent_supplies = 1, /* We only need MICVDD */
},
{ .name = "arizona-haptics" }, { .name = "arizona-haptics" },
{ .name = "arizona-pwm" }, { .name = "arizona-pwm" },
{ {
...@@ -956,11 +941,6 @@ static const struct mfd_cell wm8997_devs[] = { ...@@ -956,11 +941,6 @@ static const struct mfd_cell wm8997_devs[] = {
static const struct mfd_cell wm8998_devs[] = { static const struct mfd_cell wm8998_devs[] = {
{ .name = "arizona-micsupp" }, { .name = "arizona-micsupp" },
{ .name = "arizona-gpio" }, { .name = "arizona-gpio" },
{
.name = "arizona-extcon",
.parent_supplies = wm5102_supplies,
.num_parent_supplies = 1, /* We only need MICVDD */
},
{ .name = "arizona-haptics" }, { .name = "arizona-haptics" },
{ .name = "arizona-pwm" }, { .name = "arizona-pwm" },
{ {
......
...@@ -290,7 +290,7 @@ static void arizona_start_mic(struct arizona_extcon_info *info) ...@@ -290,7 +290,7 @@ static void arizona_start_mic(struct arizona_extcon_info *info)
unsigned int mode; unsigned int mode;
/* Microphone detection can't use idle mode */ /* Microphone detection can't use idle mode */
pm_runtime_get(info->dev); pm_runtime_get_sync(info->dev);
if (info->detecting) { if (info->detecting) {
ret = regulator_allow_bypass(info->micvdd, false); ret = regulator_allow_bypass(info->micvdd, false);
...@@ -601,7 +601,7 @@ static irqreturn_t arizona_hpdet_irq(int irq, void *data) ...@@ -601,7 +601,7 @@ static irqreturn_t arizona_hpdet_irq(int irq, void *data)
struct arizona *arizona = info->arizona; struct arizona *arizona = info->arizona;
int id_gpio = arizona->pdata.hpdet_id_gpio; int id_gpio = arizona->pdata.hpdet_id_gpio;
unsigned int report = EXTCON_JACK_HEADPHONE; unsigned int report = EXTCON_JACK_HEADPHONE;
int ret, reading; int ret, reading, state;
bool mic = false; bool mic = false;
mutex_lock(&info->lock); mutex_lock(&info->lock);
...@@ -614,12 +614,11 @@ static irqreturn_t arizona_hpdet_irq(int irq, void *data) ...@@ -614,12 +614,11 @@ static irqreturn_t arizona_hpdet_irq(int irq, void *data)
} }
/* If the cable was removed while measuring ignore the result */ /* If the cable was removed while measuring ignore the result */
ret = extcon_get_state(info->edev, EXTCON_MECHANICAL); state = extcon_get_state(info->edev, EXTCON_MECHANICAL);
if (ret < 0) { if (state < 0) {
dev_err(arizona->dev, "Failed to check cable state: %d\n", dev_err(arizona->dev, "Failed to check cable state: %d\n", state);
ret);
goto out; goto out;
} else if (!ret) { } else if (!state) {
dev_dbg(arizona->dev, "Ignoring HPDET for removed cable\n"); dev_dbg(arizona->dev, "Ignoring HPDET for removed cable\n");
goto done; goto done;
} }
...@@ -667,7 +666,7 @@ static irqreturn_t arizona_hpdet_irq(int irq, void *data) ...@@ -667,7 +666,7 @@ static irqreturn_t arizona_hpdet_irq(int irq, void *data)
gpio_set_value_cansleep(id_gpio, 0); gpio_set_value_cansleep(id_gpio, 0);
/* If we have a mic then reenable MICDET */ /* If we have a mic then reenable MICDET */
if (mic || info->mic) if (state && (mic || info->mic))
arizona_start_mic(info); arizona_start_mic(info);
if (info->hpdet_active) { if (info->hpdet_active) {
...@@ -675,7 +674,9 @@ static irqreturn_t arizona_hpdet_irq(int irq, void *data) ...@@ -675,7 +674,9 @@ static irqreturn_t arizona_hpdet_irq(int irq, void *data)
info->hpdet_active = false; info->hpdet_active = false;
} }
info->hpdet_done = true; /* Do not set hp_det done when the cable has been unplugged */
if (state)
info->hpdet_done = true;
out: out:
mutex_unlock(&info->lock); mutex_unlock(&info->lock);
...@@ -694,7 +695,7 @@ static void arizona_identify_headphone(struct arizona_extcon_info *info) ...@@ -694,7 +695,7 @@ static void arizona_identify_headphone(struct arizona_extcon_info *info)
dev_dbg(arizona->dev, "Starting HPDET\n"); dev_dbg(arizona->dev, "Starting HPDET\n");
/* Make sure we keep the device enabled during the measurement */ /* Make sure we keep the device enabled during the measurement */
pm_runtime_get(info->dev); pm_runtime_get_sync(info->dev);
info->hpdet_active = true; info->hpdet_active = true;
...@@ -1509,7 +1510,7 @@ static int arizona_extcon_probe(struct platform_device *pdev) ...@@ -1509,7 +1510,7 @@ static int arizona_extcon_probe(struct platform_device *pdev)
*/ */
info->micd_pol_gpio = gpiod_get_optional(arizona->dev, info->micd_pol_gpio = gpiod_get_optional(arizona->dev,
"wlf,micd-pol", "wlf,micd-pol",
GPIOD_OUT_LOW); mode);
if (IS_ERR(info->micd_pol_gpio)) { if (IS_ERR(info->micd_pol_gpio)) {
ret = PTR_ERR(info->micd_pol_gpio); ret = PTR_ERR(info->micd_pol_gpio);
dev_err(arizona->dev, dev_err(arizona->dev,
...@@ -1759,25 +1760,6 @@ static int arizona_extcon_remove(struct platform_device *pdev) ...@@ -1759,25 +1760,6 @@ static int arizona_extcon_remove(struct platform_device *pdev)
bool change; bool change;
int ret; int ret;
ret = regmap_update_bits_check(arizona->regmap, ARIZONA_MIC_DETECT_1,
ARIZONA_MICD_ENA, 0,
&change);
if (ret < 0) {
dev_err(&pdev->dev, "Failed to disable micd on remove: %d\n",
ret);
} else if (change) {
regulator_disable(info->micvdd);
pm_runtime_put(info->dev);
}
gpiod_put(info->micd_pol_gpio);
pm_runtime_disable(&pdev->dev);
regmap_update_bits(arizona->regmap,
ARIZONA_MICD_CLAMP_CONTROL,
ARIZONA_MICD_CLAMP_MODE_MASK, 0);
if (info->micd_clamp) { if (info->micd_clamp) {
jack_irq_rise = ARIZONA_IRQ_MICD_CLAMP_RISE; jack_irq_rise = ARIZONA_IRQ_MICD_CLAMP_RISE;
jack_irq_fall = ARIZONA_IRQ_MICD_CLAMP_FALL; jack_irq_fall = ARIZONA_IRQ_MICD_CLAMP_FALL;
...@@ -1793,10 +1775,31 @@ static int arizona_extcon_remove(struct platform_device *pdev) ...@@ -1793,10 +1775,31 @@ static int arizona_extcon_remove(struct platform_device *pdev)
arizona_free_irq(arizona, jack_irq_rise, info); arizona_free_irq(arizona, jack_irq_rise, info);
arizona_free_irq(arizona, jack_irq_fall, info); arizona_free_irq(arizona, jack_irq_fall, info);
cancel_delayed_work_sync(&info->hpdet_work); cancel_delayed_work_sync(&info->hpdet_work);
cancel_delayed_work_sync(&info->micd_detect_work);
cancel_delayed_work_sync(&info->micd_timeout_work);
ret = regmap_update_bits_check(arizona->regmap, ARIZONA_MIC_DETECT_1,
ARIZONA_MICD_ENA, 0,
&change);
if (ret < 0) {
dev_err(&pdev->dev, "Failed to disable micd on remove: %d\n",
ret);
} else if (change) {
regulator_disable(info->micvdd);
pm_runtime_put(info->dev);
}
regmap_update_bits(arizona->regmap,
ARIZONA_MICD_CLAMP_CONTROL,
ARIZONA_MICD_CLAMP_MODE_MASK, 0);
regmap_update_bits(arizona->regmap, ARIZONA_JACK_DETECT_ANALOGUE, regmap_update_bits(arizona->regmap, ARIZONA_JACK_DETECT_ANALOGUE,
ARIZONA_JD1_ENA, 0); ARIZONA_JD1_ENA, 0);
arizona_clk32k_disable(arizona); arizona_clk32k_disable(arizona);
gpiod_put(info->micd_pol_gpio);
pm_runtime_disable(&pdev->dev);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment