diff options
author | 2023-12-04 15:42:00 -0600 | |
---|---|---|
committer | 2023-12-04 21:46:12 +0000 | |
commit | 70a6b66d6e8e70966274cab2fc9ee75fd60e36bf (patch) | |
tree | 98e8a9519e47f6c6cc9041fa7d66c600d458969a /sound/soc/intel | |
parent | ASoC: Intel: sof_sdw_rt_sdca_jack_common: ctx->headset_codec_dev = NULL (diff) | |
download | linux-70a6b66d6e8e70966274cab2fc9ee75fd60e36bf.tar.gz linux-70a6b66d6e8e70966274cab2fc9ee75fd60e36bf.tar.bz2 linux-70a6b66d6e8e70966274cab2fc9ee75fd60e36bf.zip |
ASoC: Intel: sof_sdw_rt_sdca_jack_common: check ctx->headset_codec_dev instead of playback
'if (!playback)' will not work if the dai is only on capture dai link
or is on more than one playback dai links. Check 'if
(ctx->headset_codec_dev)' instead.
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20231204214200.203100-6-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel')
-rw-r--r-- | sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c index 1e5725f0ae33..d9c283829fc7 100644 --- a/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c +++ b/sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c @@ -192,10 +192,10 @@ int sof_sdw_rt_sdca_jack_init(struct snd_soc_card *card, int ret; /* - * headset should be initialized once. - * Do it with dai link for playback. + * Jack detection should be only initialized once for headsets since + * the playback/capture is sharing the same jack */ - if (!playback) + if (ctx->headset_codec_dev) return 0; sdw_dev = bus_find_device_by_name(&sdw_bus_type, NULL, dai_links->codecs[0].name); |