Skip to content

Commit

Permalink
ASoC: rt5645: polling jd status in all conditions
Browse files Browse the repository at this point in the history
We only polling jd status when rt5645->pdata.jd_invert is true.
However, it should be done at all time since there will be no
interrupt for jd if we press a headset button and remove the
headset at the same time.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
  • Loading branch information
Bard Liao authored and Mark Brown committed May 5, 2016
1 parent 178ff7c commit 381437d
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions sound/soc/codecs/rt5645.c
Original file line number Diff line number Diff line change
Expand Up @@ -3286,10 +3286,8 @@ static void rt5645_jack_detect_work(struct work_struct *work)
if (btn_type == 0)/* button release */
report = rt5645->jack_type;
else {
if (rt5645->pdata.jd_invert) {
mod_timer(&rt5645->btn_check_timer,
msecs_to_jiffies(100));
}
mod_timer(&rt5645->btn_check_timer,
msecs_to_jiffies(100));
}

break;
Expand Down Expand Up @@ -3816,9 +3814,9 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
if (rt5645->pdata.jd_invert) {
regmap_update_bits(rt5645->regmap, RT5645_IRQ_CTRL2,
RT5645_JD_1_1_MASK, RT5645_JD_1_1_INV);
setup_timer(&rt5645->btn_check_timer,
rt5645_btn_check_callback, (unsigned long)rt5645);
}
setup_timer(&rt5645->btn_check_timer,
rt5645_btn_check_callback, (unsigned long)rt5645);

INIT_DELAYED_WORK(&rt5645->jack_detect_work, rt5645_jack_detect_work);
INIT_DELAYED_WORK(&rt5645->rcclock_work, rt5645_rcclock_work);
Expand Down

0 comments on commit 381437d

Please sign in to comment.