ASoC: rt5645: add inv_jd1_1 flag
authorBard Liao <bardliao@realtek.com>
Wed, 28 Jun 2017 12:49:38 +0000 (14:49 +0200)
committerMark Brown <broonie@kernel.org>
Wed, 28 Jun 2017 17:33:31 +0000 (18:33 +0100)
The flag will invert jd1_1 status. Which will be used if the jack
connector is normal closed.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/rt5645.h
sound/soc/codecs/rt5645.c

index c427f10a39aeb1fe12b0c12f70b3908e74d8b8ec..d0c33a9972b917c2f1b4e91aebfc35d9540102f8 100644 (file)
@@ -23,6 +23,8 @@ struct rt5645_platform_data {
        unsigned int jd_mode;
        /* Use level triggered irq */
        bool level_trigger_irq;
+       /* Invert JD1_1 status polarity */
+       bool inv_jd1_1;
 };
 
 #endif
index e0c09bbd3f12218a0e5a3f4a90279bf54dd1533c..162044d82632c5945f57ff836a498b9123837db9 100644 (file)
@@ -3833,6 +3833,10 @@ static int rt5645_i2c_probe(struct i2c_client *i2c,
                default:
                        break;
                }
+               if (rt5645->pdata.inv_jd1_1) {
+                       regmap_update_bits(rt5645->regmap, RT5645_IRQ_CTRL2,
+                               RT5645_JD_1_1_MASK, RT5645_JD_1_1_INV);
+               }
        }
 
        regmap_update_bits(rt5645->regmap, RT5645_ADDA_CLK1,