extcon: madera: Default to normal tuning on jack removal
authorStuart Henderson <stuarth@opensource.wolfsonmicro.com>
Fri, 19 May 2017 13:41:37 +0000 (14:41 +0100)
committer강신형 <s47.kang@samsung.com>
Tue, 19 Jun 2018 07:08:41 +0000 (16:08 +0900)
Change-Id: I8437c23eb177063e65327ccb73f91544c2025f31
Signed-off-by: Stuart Henderson <stuarth@opensource.wolfsonmicro.com>
drivers/extcon/extcon-madera.c

index 0d338891618c04b2d208603fb4207d8ae6724ea9..0ffb8ef53e406e92963f4a37a45f3e1d1c644cfc 100644 (file)
@@ -1389,6 +1389,20 @@ static int madera_tune_headphone(struct madera_extcon *info, int reading)
                return 0;
        }
 
+       if (reading == MADERA_HP_Z_OPEN) {
+               if (info->hp_tuning_level == 1)
+                       return 0;
+
+               dev_dbg(info->dev, "No jack: Setting tuning level 1\n");
+
+               info->hp_tuning_level = 1;
+
+               ret = regmap_multi_reg_write(madera->regmap,
+                                            tuning[1].patch,
+                                            tuning[1].patch_len);
+               return ret;
+       }
+
        /*
         * Check for tuning, we don't need to compare against the last
         * tuning entry because we always select that if reading is not