From: Mark Brown Date: Mon, 20 Jul 2015 17:14:12 +0000 (+0100) Subject: Merge branch 'fix/rt5645' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie... X-Git-Tag: next-20150824~60^2~19^2~1 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=2c23b0c10f64335031781cf78fd57aae072e9372;p=uclinux-h8%2Flinux.git Merge branch 'fix/rt5645' of git://git./linux/kernel/git/broonie/sound into asoc-rt5645 --- 2c23b0c10f64335031781cf78fd57aae072e9372 diff --cc sound/soc/codecs/rt5645.c index 5f5d8adf6f42,e9cc3aae5366..19392b13bd5b --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@@ -2925,8 -2913,39 +2925,11 @@@ static void rt5645_jack_detect_work(str { struct rt5645_priv *rt5645 = container_of(work, struct rt5645_priv, jack_detect_work.work); - - rt5645_irq_detection(rt5645); -} - -static irqreturn_t rt5645_irq(int irq, void *data) -{ - struct rt5645_priv *rt5645 = data; - - queue_delayed_work(system_power_efficient_wq, - &rt5645->jack_detect_work, msecs_to_jiffies(250)); - - return IRQ_HANDLED; -} - -static int rt5645_button_detect(struct snd_soc_codec *codec) -{ - int btn_type, val; - - val = snd_soc_read(codec, RT5650_4BTN_IL_CMD1); - pr_debug("val=0x%x\n", val); - btn_type = val & 0xfff0; - snd_soc_write(codec, RT5650_4BTN_IL_CMD1, val); - - return btn_type; -} - -static int rt5645_irq_detection(struct rt5645_priv *rt5645) -{ int val, btn_type, gpio_state = 0, report = 0; + if (!rt5645->codec) + return -EINVAL; + switch (rt5645->pdata.jd_mode) { case 0: /* Not using rt5645 JD */ if (rt5645->gpiod_hp_det) {