Repository navigation
Rt5682 module unload fix - #1147
Conversation
| } | ||
|
|
||
| return 0; | ||
| } |
There was a problem hiding this comment.
@juimonen a couple of comments: 1. a typo in the commit message "...which disables ..." instead of disabled. 2. Do you think cancelling the jack_detect_work in rt5682 codec driver's remove will be a better option?
linux/sound/soc/codecs/rt5682.c
Line 2339 in adbdb59
There was a problem hiding this comment.
@ranjani ok, I'll fix the commit message. Adding the remove to sof_rt5682.c was suggested by @bardliao so I'm not totally sure of the possible reason... I guess the removal starts from bottom up and this is the way to do it in earlier stage? however I can try to add it solely to codec and see what happens...
There was a problem hiding this comment.
@juimonen I "guess" the reason is we reset the codec on rt5682_remove(), which reset the codec IRQ pin to the initial gpio function and trigger the interrupt. And we doesn't disable irq before that.
bardliao
left a comment
There was a problem hiding this comment.
Looks good to me, but we need to set rt5682->hs_jack = NULL when jack detection is disabled.
| @@ -995,6 +995,14 @@ static int rt5682_set_jack_detect(struct snd_soc_component *component, | |||
| { | |||
| struct rt5682_priv *rt5682 = snd_soc_component_get_drvdata(component); | |||
|
|
|||
There was a problem hiding this comment.
We need to set rt5682->hs_jack = hs_jack; even hs_jack = NULL to prevent rt5682->hs_jack from being garbage after codec driver is removed. So I suggest to move rt5682->hs_jack = hs_jack; from line 1043 to here.
Implement NULL handler in set_jack function to disable irq's. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
When removing sof module the rt5682 jack handler will oops if jack detection is not disabled. So add remove function, which disables the jack detection. Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
|
SOFCI TEST |
|
testing results shows that this PR fix #1106 |
@bardliao this fixes the module unloading oops...