mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
ASoC: rt5682: Disable jack detection interrupt during suspend
commit8b271370e9upstream. The rt5682 driver switches its regmap to cache-only when the device suspends and back to regular mode on resume. When the jack detect interrupt fires rt5682_irq() schedules the jack detect work. This can result in invalid reads from the regmap in cache-only mode if the work runs before the device has resumed: [ 56.245502] rt5682 9-001a: ASoC: error at soc_component_read_no_lock on rt5682.9-001a for register: [0x000000f0] -16 Disable the jack detection interrupt during suspend and re-enable it on resume. The driver already schedules the jack detection work on resume, so any state change during suspend is still handled. This is essentially the same as commitf7d00a9be1("SoC: rt5682s: Disable jack detection interrupt during suspend") for the rt5682s. Cc: stable@kernel.org Signed-off-by: Matthias Kaehlcke <mka@chromium.org Reviewed-by: Douglas Anderson <dianders@chromium.org Reviewed-by: Stephen Boyd <swboyd@chromium.org Link: https://lore.kernel.org/r/20230516164629.1.Ibf79e94b3442eecc0054d2b478779cc512d967fc@changeid Signed-off-by: Mark Brown <broonie@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
72c28207c1
commit
da1e8adab3
@@ -267,7 +267,9 @@ static int rt5682_i2c_probe(struct i2c_client *i2c)
|
|||||||
ret = devm_request_threaded_irq(&i2c->dev, i2c->irq, NULL,
|
ret = devm_request_threaded_irq(&i2c->dev, i2c->irq, NULL,
|
||||||
rt5682_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING
|
rt5682_irq, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING
|
||||||
| IRQF_ONESHOT, "rt5682", rt5682);
|
| IRQF_ONESHOT, "rt5682", rt5682);
|
||||||
if (ret)
|
if (!ret)
|
||||||
|
rt5682->irq = i2c->irq;
|
||||||
|
else
|
||||||
dev_err(&i2c->dev, "Failed to reguest IRQ: %d\n", ret);
|
dev_err(&i2c->dev, "Failed to reguest IRQ: %d\n", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2957,6 +2957,9 @@ static int rt5682_suspend(struct snd_soc_component *component)
|
|||||||
if (rt5682->is_sdw)
|
if (rt5682->is_sdw)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (rt5682->irq)
|
||||||
|
disable_irq(rt5682->irq);
|
||||||
|
|
||||||
cancel_delayed_work_sync(&rt5682->jack_detect_work);
|
cancel_delayed_work_sync(&rt5682->jack_detect_work);
|
||||||
cancel_delayed_work_sync(&rt5682->jd_check_work);
|
cancel_delayed_work_sync(&rt5682->jd_check_work);
|
||||||
if (rt5682->hs_jack && (rt5682->jack_type & SND_JACK_HEADSET) == SND_JACK_HEADSET) {
|
if (rt5682->hs_jack && (rt5682->jack_type & SND_JACK_HEADSET) == SND_JACK_HEADSET) {
|
||||||
@@ -3025,6 +3028,9 @@ static int rt5682_resume(struct snd_soc_component *component)
|
|||||||
mod_delayed_work(system_power_efficient_wq,
|
mod_delayed_work(system_power_efficient_wq,
|
||||||
&rt5682->jack_detect_work, msecs_to_jiffies(0));
|
&rt5682->jack_detect_work, msecs_to_jiffies(0));
|
||||||
|
|
||||||
|
if (rt5682->irq)
|
||||||
|
enable_irq(rt5682->irq);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -1462,6 +1462,7 @@ struct rt5682_priv {
|
|||||||
int pll_out[RT5682_PLLS];
|
int pll_out[RT5682_PLLS];
|
||||||
|
|
||||||
int jack_type;
|
int jack_type;
|
||||||
|
int irq;
|
||||||
int irq_work_delay_time;
|
int irq_work_delay_time;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user