Commit f3bd4dde authored by David Ward's avatar David Ward Committed by Mark Brown

ASoC: rt298: Configure combo jack for headphones

During jack detection, the combo jack is configured for a CTIA headset, and
then for an OMTP headset, while sensing the mic connection. If a mic is not
found in either case, the combo jack should be re-configured for headphones
only. This is consistent with the HDA driver behavior.
Signed-off-by: default avatarDavid Ward <david.ward@gatech.edu>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210418134658.4333-4-david.ward@gatech.eduSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent b15c3ea7
...@@ -267,11 +267,16 @@ static int rt298_jack_detect(struct rt298_priv *rt298, bool *hp, bool *mic) ...@@ -267,11 +267,16 @@ static int rt298_jack_detect(struct rt298_priv *rt298, bool *hp, bool *mic)
msleep(300); msleep(300);
regmap_read(rt298->regmap, regmap_read(rt298->regmap,
RT298_CBJ_CTRL2, &val); RT298_CBJ_CTRL2, &val);
if (0x0070 == (val & 0x0070)) if (0x0070 == (val & 0x0070)) {
*mic = true; *mic = true;
else } else {
*mic = false; *mic = false;
regmap_update_bits(rt298->regmap,
RT298_CBJ_CTRL1,
0xfcc0, 0xc400);
}
} }
regmap_update_bits(rt298->regmap, regmap_update_bits(rt298->regmap,
RT298_DC_GAIN, 0x200, 0x0); RT298_DC_GAIN, 0x200, 0x0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment