]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: rt5645: Check if codec is initialized in workqueue handler
authorNicolas Boichat <drinkcat@chromium.org>
Fri, 17 Jul 2015 02:36:57 +0000 (10:36 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 17 Jul 2015 11:12:20 +0000 (12:12 +0100)
commit179fe3f9f0e78a17db63bf50ea864c526b3acfb8
tree510494e37d61e1c0dace24259edb656c0cbb8b2b
parent0c9e0229f3c4e023815b9350b2095fd8ad5809e3
ASoC: rt5645: Check if codec is initialized in workqueue handler

This fixes kernel panic on boot, if rt5645->codec is NULL when
rt5645_jack_detect_work is first called.

rt5645_jack_detect_work needs rt5645->codec to be initialized to setup
dapm pins. Also, reporting jack events is useless, as the jacks cannot
be set before the codec is ready.

Since we manually call the interrupt handler in
rt5645_set_jack_detect, the initial jack state will be reported
correctly, and dapm pins will be setup at that time.

Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt5645.c