ASoC: codecs: rt298: Fix jack detection
authorAmadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Thu, 7 Jul 2022 12:56:58 +0000 (14:56 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 11 Jul 2022 13:59:07 +0000 (14:59 +0100)
commitc0c5a242bba878b4d34f7c9612fd6cd6c404d414
treeb45fea2c4b407ea9226a5efb6de7bceea1e6dc36
parent9b6803ec1fe0f10942b9297d2d60ec46f2999323
ASoC: codecs: rt298: Fix jack detection

On our RVP platforms using rt298 with combojack we've seen issues with
controls being in incorrect state after suspend/resume cycle. This is
caused by codec driver not setting pins to correct state and causing
codec suspend method to not be called. Which on resume caused codec
registers to be in undefined state. Fix this by setting pins correctly
in jack detect function.

Above problem is caused by the fact that when jack == NULL code doesn't
reach rt298_jack_detect() function which sets pins. Alternatively
problem could be fixed by just moving rt298_jack_detect, but as rt298
codec is similar to rt286, align the code by setting pins explicitly.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://lore.kernel.org/r/20220707125701.3518263-3-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt298.c