Skip to content

Commit ab5201e

Browse files
David Raubroonie
authored andcommitted
ASoC: da7219: Improve system suspend and resume handling
When DA7219 is suspended, prevent the AAD IRQ handler is unexpectedly executed and cause the I2C driver "Transfer while suspended" failure. Signed-off-by: David Rau <David.Rau.opensource@dm.renesas.com> Link: https://lore.kernel.org/r/20231101022507.6226-1-David.Rau.opensource@dm.renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent ed2232d commit ab5201e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

sound/soc/codecs/da7219-aad.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,10 +927,15 @@ void da7219_aad_suspend(struct snd_soc_component *component)
927927
struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(component);
928928
u8 micbias_ctrl;
929929

930+
disable_irq(da7219_aad->irq);
931+
930932
if (da7219_aad->jack) {
931933
/* Disable jack detection during suspend */
932934
snd_soc_component_update_bits(component, DA7219_ACCDET_CONFIG_1,
933935
DA7219_ACCDET_EN_MASK, 0);
936+
cancel_delayed_work_sync(&da7219_aad->jack_det_work);
937+
/* Disable ground switch */
938+
snd_soc_component_update_bits(component, 0xFB, 0x01, 0x00);
934939

935940
/*
936941
* If we have a 4-pole jack inserted, then micbias will be
@@ -947,8 +952,6 @@ void da7219_aad_suspend(struct snd_soc_component *component)
947952
}
948953
}
949954
}
950-
951-
synchronize_irq(da7219_aad->irq);
952955
}
953956

954957
void da7219_aad_resume(struct snd_soc_component *component)
@@ -971,6 +974,8 @@ void da7219_aad_resume(struct snd_soc_component *component)
971974
DA7219_ACCDET_EN_MASK,
972975
DA7219_ACCDET_EN_MASK);
973976
}
977+
978+
enable_irq(da7219_aad->irq);
974979
}
975980

976981

0 commit comments

Comments
 (0)