]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ASoC: rt298: enable IRQ for jack detection
authorBard Liao <bardliao@realtek.com>
Wed, 24 Feb 2016 07:51:26 +0000 (15:51 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 24 Feb 2016 08:24:34 +0000 (17:24 +0900)
There are some registers needed for enabling rt298 IRQ missed on
current driver.

Signed-off-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt298.c
sound/soc/codecs/rt298.h

index 30c6de62ae6c980584a1a5bdd9d637dcfc3d0338..e67ef5f8d4f3d4784b98ba71aadd9a6cbc4dfc78 100644 (file)
@@ -1225,6 +1225,12 @@ static int rt298_i2c_probe(struct i2c_client *i2c,
        regmap_update_bits(rt298->regmap,
                                RT298_WIND_FILTER_CTRL, 0x0082, 0x0082);
        regmap_update_bits(rt298->regmap, RT298_IRQ_CTRL, 0x2, 0x2);
+
+       regmap_write(rt298->regmap, RT298_UNSOLICITED_INLINE_CMD, 0x81);
+       regmap_write(rt298->regmap, RT298_UNSOLICITED_HP_OUT, 0x82);
+       regmap_write(rt298->regmap, RT298_UNSOLICITED_MIC1, 0x84);
+       regmap_update_bits(rt298->regmap, RT298_IRQ_FLAG_CTRL, 0x2, 0x2);
+
        rt298->is_hp_in = -1;
 
        if (rt298->i2c->irq) {
index 31da16265f2b14f5c14f63a4d61f8c24562a2051..d66f8847b67632354d8750f5fee8f7153aa3768a 100644 (file)
@@ -34,6 +34,7 @@
 #define RT298_HP_OUT                                   0x21
 #define RT298_MIXER_IN1                                        0x22
 #define RT298_MIXER_IN2                                        0x23
+#define RT298_INLINE_CMD                               0x55
 
 #define RT298_SET_PIN_SFT                              6
 #define RT298_SET_PIN_ENABLE                           0x40
        VERB_CMD(AC_VERB_SET_COEF_INDEX, RT298_VENDOR_REGISTERS, 0)
 #define RT298_PROC_COEF\
        VERB_CMD(AC_VERB_SET_PROC_COEF, RT298_VENDOR_REGISTERS, 0)
+#define RT298_UNSOLICITED_INLINE_CMD\
+       VERB_CMD(AC_VERB_SET_UNSOLICITED_ENABLE, RT298_INLINE_CMD, 0)
+#define RT298_UNSOLICITED_HP_OUT\
+       VERB_CMD(AC_VERB_SET_UNSOLICITED_ENABLE, RT298_HP_OUT, 0)
+#define RT298_UNSOLICITED_MIC1\
+       VERB_CMD(AC_VERB_SET_UNSOLICITED_ENABLE, RT298_MIC1, 0)
 
 /* Index registers */
 #define RT298_A_BIAS_CTRL1     0x01
 #define RT298_DEPOP_CTRL2      0x67
 #define RT298_DEPOP_CTRL3      0x68
 #define RT298_DEPOP_CTRL4      0x69
+#define RT298_IRQ_FLAG_CTRL    0x7c
 
 /* SPDIF (0x06) */
 #define RT298_SPDIF_SEL_SFT    0