Skip to content

Commit d3efd26

Browse files
tititiou36broonie
authored andcommitted
ASoC: wcd9335: Disable irq on slave ports in the remove function
The probe calls 'wcd9335_setup_irqs()' to enable interrupts on all slave ports. This must be undone in the remove function. Add a 'wcd9335_teardown_irqs()' function that undoes 'wcd9335_setup_irqs()' function, and call it from the remove function. Fixes: 20aedaf ("ASoC: wcd9335: add support to wcd9335 codec") Signed-off-by: Christophe JAILLET <[email protected]> Message-Id: <8f761244d79bd4c098af8a482be9121d3a486d1b.1629091028.git.christophe.jaillet@wanadoo.fr> Signed-off-by: Mark Brown <[email protected]>
1 parent fc6fc81 commit d3efd26

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

sound/soc/codecs/wcd9335.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4076,6 +4076,16 @@ static int wcd9335_setup_irqs(struct wcd9335_codec *wcd)
40764076
return ret;
40774077
}
40784078

4079+
static void wcd9335_teardown_irqs(struct wcd9335_codec *wcd)
4080+
{
4081+
int i;
4082+
4083+
/* disable interrupts on all slave ports */
4084+
for (i = 0; i < WCD9335_SLIM_NUM_PORT_REG; i++)
4085+
regmap_write(wcd->if_regmap, WCD9335_SLIM_PGD_PORT_INT_EN0 + i,
4086+
0x00);
4087+
}
4088+
40794089
static void wcd9335_cdc_sido_ccl_enable(struct wcd9335_codec *wcd,
40804090
bool ccl_flag)
40814091
{
@@ -4878,6 +4888,7 @@ static void wcd9335_codec_remove(struct snd_soc_component *comp)
48784888
struct wcd9335_codec *wcd = dev_get_drvdata(comp->dev);
48794889

48804890
wcd_clsh_ctrl_free(wcd->clsh_ctrl);
4891+
wcd9335_teardown_irqs(wcd);
48814892
}
48824893

48834894
static int wcd9335_codec_set_sysclk(struct snd_soc_component *comp,

0 commit comments

Comments
 (0)