From patchwork Thu Jun 16 21:40:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pierre-Louis Bossart X-Patchwork-Id: 582253 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47947C433EF for ; Thu, 16 Jun 2022 21:45:41 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 88B051B14; Thu, 16 Jun 2022 23:44:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 88B051B14 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655415939; bh=0BQF5PsHJ1JQy5HOM9hB5lrpLFFsVHdE+XOwjDSyfvE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Ix01QketjbNFeBhlhAk1If0/srCtYEsZUtSlIrQU+J8S2QDCDv+QrAMXXly1iKJMS rynbBNpYDtW+w7NJYt7XuaVQX3on8JmLbFYdFjGfvRnxTyGPm6Yy2fWkqh7Ardqjm6 eb4FMJ2trZeFkG8vGxuGB7+6bhTQIAM4jbVBc1k4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C58B2F8058C; Thu, 16 Jun 2022 23:41:33 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9D05CF80535; Thu, 16 Jun 2022 23:41:28 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id C75D4F80535 for ; Thu, 16 Jun 2022 23:41:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C75D4F80535 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="NC7N4Kog" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655415678; x=1686951678; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=0BQF5PsHJ1JQy5HOM9hB5lrpLFFsVHdE+XOwjDSyfvE=; b=NC7N4KognYVo+/wbu47pHs1g3oFs2ChbFvnxzx4D4qPSE/kFe9hn5SyY 7/TvHVqPv+5IQMEiF+P27LhT243PJFcLGbKJ2jBsYp9tn5D3ehKb3KaLR oZjOSxA0PAtm72a/SZ/Yphd5MKEeD01aDgF4J17Wb4rSDYJbyaiPbb57a XU6uXdN5BTmFwC8cIiJiYi8EDIu6x4NntK7xHpjrsjtLrSH7EmsvxPT/0 /YsklQUa0KA1/EGOo7jOF0kLJgU/JlwXMXjqg1uVLKAoX0f5yx9zzEEeh 7CFfhphLuzoUsQuszD5CD04KAuYiNSqSJTspkamDYHATR2jWx03HZ6eO1 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="276932471" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="276932471" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 14:41:12 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="831746793" Received: from buckkenx-mobl.amr.corp.intel.com (HELO pbossart-mobl3.intel.com) ([10.212.52.70]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jun 2022 14:41:12 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 11/13] ASoC: Intel: sof_da7219_max98373: remap jack pins Date: Thu, 16 Jun 2022 16:40:53 -0500 Message-Id: <20220616214055.134943-12-pierre-louis.bossart@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220616214055.134943-1-pierre-louis.bossart@linux.intel.com> References: <20220616214055.134943-1-pierre-louis.bossart@linux.intel.com> MIME-Version: 1.0 Cc: Cezary Rojewski , tiwai@suse.de, Bard Liao , Pierre-Louis Bossart , Curtis Malainey , broonie@kernel.org, Ranjani Sridharan , =?utf-8?q?Amadeusz_S?= =?utf-8?q?=C5=82awi=C5=84ski?= , =?utf-8?q?P=C3=A9ter_Ujfalusi?= X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The card did not map jack pins to controls, which prevents PulseAudio/PipeWire from dealing with jack detection. It's likely that jack detection was only tested with the CRAS server and extensions of UCM. Suggested-by: Jaroslav Kysela Signed-off-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Reviewed-by: Péter Ujfalusi Reviewed-by: Bard Liao --- sound/soc/intel/boards/sof_da7219_max98373.c | 23 +++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/sound/soc/intel/boards/sof_da7219_max98373.c b/sound/soc/intel/boards/sof_da7219_max98373.c index a83f30b687cf3..34cf849a8344e 100644 --- a/sound/soc/intel/boards/sof_da7219_max98373.c +++ b/sound/soc/intel/boards/sof_da7219_max98373.c @@ -135,6 +135,17 @@ static const struct snd_soc_dapm_route max98360a_map[] = { {"DMic", NULL, "SoC DMIC"}, }; +static struct snd_soc_jack_pin jack_pins[] = { + { + .pin = "Headphone Jack", + .mask = SND_JACK_HEADPHONE, + }, + { + .pin = "Headset Mic", + .mask = SND_JACK_MICROPHONE, + }, +}; + static struct snd_soc_jack headset; static int da7219_codec_init(struct snd_soc_pcm_runtime *rtd) @@ -156,11 +167,13 @@ static int da7219_codec_init(struct snd_soc_pcm_runtime *rtd) * Headset buttons map to the google Reference headset. * These can be configured by userspace. */ - ret = snd_soc_card_jack_new(rtd->card, "Headset Jack", - SND_JACK_HEADSET | SND_JACK_BTN_0 | - SND_JACK_BTN_1 | SND_JACK_BTN_2 | - SND_JACK_BTN_3 | SND_JACK_LINEOUT, - &headset); + ret = snd_soc_card_jack_new_pins(rtd->card, "Headset Jack", + SND_JACK_HEADSET | SND_JACK_BTN_0 | + SND_JACK_BTN_1 | SND_JACK_BTN_2 | + SND_JACK_BTN_3 | SND_JACK_LINEOUT, + &headset, + jack_pins, + ARRAY_SIZE(jack_pins)); if (ret) { dev_err(rtd->dev, "Headset Jack creation failed: %d\n", ret); return ret;