From patchwork Thu Jun 16 21:40:46 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: 582258 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 5D9B2C433EF for ; Thu, 16 Jun 2022 21:43:00 +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 9ED681AFE; Thu, 16 Jun 2022 23:42:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9ED681AFE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1655415778; bh=Lxad8cjV5si1PUpk9CGLhewL8HdnrvqcxHT5MqGfg48=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Afky5qMzrf2SqUBFTp3jhMRzhRwnk6B54HlKmjQp1n+AKKTgf/cvDjL4qnOuaqn7y YXCHQIHMjx9gOOMKrBaLB/jK44Ce1b5E3vDZBS64HKuOnrZjj35XOEWEMajdap4icA CQly13ZDOVFFBVgBEUv35hIP+p8U8BAZpDUUMYy0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 97EECF80423; Thu, 16 Jun 2022 23:41:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BD58BF8053D; Thu, 16 Jun 2022 23:41:18 +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 D0164F80310 for ; Thu, 16 Jun 2022 23:41:09 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D0164F80310 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="HUztf5Ks" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655415671; x=1686951671; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Lxad8cjV5si1PUpk9CGLhewL8HdnrvqcxHT5MqGfg48=; b=HUztf5KsE6l7uKs4SM0Zy0aowdAUQTg18g0wGjVbqh2DUsv0xyyVRKz6 1q5/90nUOQjB7nJg1MX51dxx8KGfx07HfBF872VqG7eYDxPTR/XHkq34d GP2fdlaAieTc7WtcOAbRAXLpM1J+/pQlzmDWQZCz+6H0aQUW+B6GN3AW7 QqCnvYxjaSmWt8W3E0y/Q5CabhlmMxsZDVCIUDh5XJaniRXfzreRa5A2Z XNYaLywIsLndciobwMswq6LQnxohvFyubm59FTpUUEwerfCUQTU3q0KK5 zeH3zB/OoL40+5FvfWBJrAiCgJLIQBXl3ppz1qQDmS8Y9KtwNTn9I61i/ A==; X-IronPort-AV: E=McAfee;i="6400,9594,10380"; a="276932427" X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="276932427" 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:07 -0700 X-IronPort-AV: E=Sophos;i="5.92,306,1650956400"; d="scan'208";a="831746749" 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:05 -0700 From: Pierre-Louis Bossart To: alsa-devel@alsa-project.org Subject: [PATCH 04/13] ASoC: Intel: kbl_da7219_max98357a: remap jack pins Date: Thu, 16 Jun 2022 16:40:46 -0500 Message-Id: <20220616214055.134943-5-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/kbl_da7219_max98357a.c | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/sound/soc/intel/boards/kbl_da7219_max98357a.c b/sound/soc/intel/boards/kbl_da7219_max98357a.c index ceabed85e9daa..329457e3e3a22 100644 --- a/sound/soc/intel/boards/kbl_da7219_max98357a.c +++ b/sound/soc/intel/boards/kbl_da7219_max98357a.c @@ -99,6 +99,17 @@ static const struct snd_soc_dapm_widget kabylake_widgets[] = { SND_SOC_DAPM_POST_PMD), }; +static struct snd_soc_jack_pin jack_pins[] = { + { + .pin = "Headphone Jack", + .mask = SND_JACK_HEADPHONE, + }, + { + .pin = "Headset Mic", + .mask = SND_JACK_MICROPHONE, + }, +}; + static const struct snd_soc_dapm_route kabylake_map[] = { { "Headphone Jack", NULL, "HPL" }, { "Headphone Jack", NULL, "HPR" }, @@ -179,10 +190,12 @@ static int kabylake_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(kabylake_audio_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, - &ctx->kabylake_headset); + ret = snd_soc_card_jack_new_pins(kabylake_audio_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, + &ctx->kabylake_headset, + jack_pins, + ARRAY_SIZE(jack_pins)); if (ret) { dev_err(rtd->dev, "Headset Jack creation failed: %d\n", ret); return ret;