summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/rt5651.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2018-02-25 11:46:43 +0100
committerMark Brown <broonie@kernel.org>2018-03-01 17:32:23 +0000
commitf06da4fdb5fc2b78d52f62c32aec65b7819178b0 (patch)
tree638e0db40dd194988fca9ec4413ff8b0b1602e09 /sound/soc/codecs/rt5651.h
parent54e3a3a152a6f466f3a94b28be10f08b86905bc0 (diff)
ASoC: rt5651: Move all jack-detect initialization to rt5651_set_jack_detect
Move all jack-detect initialization to rt5651_set_jack_detect. The main reason to do this is so that platform code can setup jack-detect properties after the device has been probed, which unfortunately is necessary on some platforms. This has 2 additional advantages: 1) Grouping all jack-detect init together makes it easier to follow what is happening and results in a small reduction in the number of loc. 2) Before we would register the irq handler before rt5651->hp_jack was assigned, leading to a potential NULL deref if the jack_detect work runs before the machine driver has called set_jack. Tested-by: Carlo Caione <carlo@endlessm.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rt5651.h')
-rw-r--r--sound/soc/codecs/rt5651.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/soc/codecs/rt5651.h b/sound/soc/codecs/rt5651.h
index 148e139e6a26..8f128d057ff0 100644
--- a/sound/soc/codecs/rt5651.h
+++ b/sound/soc/codecs/rt5651.h
@@ -2065,6 +2065,7 @@ struct rt5651_priv {
struct delayed_work jack_detect_work;
enum rt5651_jd_src jd_src;
+ int irq;
int sysclk;
int sysclk_src;
int lrck[RT5651_AIFS];