Skip to content

Commit

Permalink
ASoC: Intel: sof_sdw_rt_sdca_jack_common: check ctx->headset_codec_dev
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
  • Loading branch information
bardliao authored and plbossart committed Nov 30, 2023
1 parent 63a92d6 commit 266ee31
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sound/soc/intel/boards/sof_sdw_rt_sdca_jack_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 266ee31

Please sign in to comment.