Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3997882imu; Tue, 18 Dec 2018 07:32:05 -0800 (PST) X-Google-Smtp-Source: AFSGD/XMWZmTGCsk/NyoxiwcWWZF7gjd2KrersaXwVJJAjAgt6xfy6z1MfWHfFQ+0bQ/ysRrOAaI X-Received: by 2002:a17:902:5a5:: with SMTP id f34mr16994184plf.161.1545147125622; Tue, 18 Dec 2018 07:32:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545147125; cv=none; d=google.com; s=arc-20160816; b=PIBcocVfJHW48ogROGlH2MfeOabyLzZREmzHhjXB8lqRhZP1i+0UMEVnYzBeLhmVvd hatNmPyL1V6NBMSZddYPWmZRsNK7U5LKDibXW8tsgS+GnekvMJirI4fCvBavPuCz//OO VeVzhbvg2m0QcgC6/mV5oBLF1wI3BHAz29YzXJ0leSBBK1CW/t+DAAG0x5QjLF9UW3AB kG+96UGss9ypEy4aLkmn1pvLqpykbChceRNY24fZAPdeceIA3zwq98V8eQ1RBJrz43YY egUMBHWHk4VPsMJCq1iL5avUaPktpUw7c9Z8gyLb8vgDp9ylZ023xDT7vHE9n5SBweJM rcPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature; bh=RvNXk5145uv/kzsKFqqWbxqBNcWAPQ28q7zBEtuUJDE=; b=EgEElBypmDgZfP/Zg6QTni0iN/c9uPZvOoP4wb5msZtL2MW8m3o8/QSFb8jIMDVXkU f2EVrbrkkPTWdCqGEbXK/fjIJDe0CKxeEK29CoLq1i/WHYx0+dS3w17x7ywU39su9tDN 9R8gNpL5gWC20G2GV5FN5QgczLCSDU+dmILGIgzcz0Rv6tNV3+8Bb96w47tfhM2LzZuM aZXI5Pkq3rNracuAiT1T+UzEC00oeR2mV+gKcWAjRHhYW/sJnODZ3rMzZNLDH1Juq5sI 5PpjoBfDOiw7jrzUb40pKXaRkzR/MjjkO/xiw6OmyeAif45dWujRBii6RjBGw3pBJfbq RNBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=gsUcMenk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g7si13298288plt.212.2018.12.18.07.31.49; Tue, 18 Dec 2018 07:32:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=gsUcMenk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726965AbeLRPar (ORCPT + 99 others); Tue, 18 Dec 2018 10:30:47 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:47078 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726840AbeLRPar (ORCPT ); Tue, 18 Dec 2018 10:30:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=RvNXk5145uv/kzsKFqqWbxqBNcWAPQ28q7zBEtuUJDE=; b=gsUcMenkxSVy qfaHsq5f6zZt4fChJVlLOjMR+6uGa57egfebqHob6UaH/BU7gv96jpeBlD6I5qdqRzSBFmWIyW2xf gLwgIcWtmVg7y5h+ANTLEi8d1W5ztUFLUOaEeX/ky4eg92vX3oze4MIT7Y9nBzdjmDq+isUWFEEfr 1jsjc=; Received: from cpc102320-sgyl38-2-0-cust46.18-2.cable.virginm.net ([82.37.168.47] helo=debutante.sirena.org.uk) by heliosphere.sirena.org.uk with esmtpa (Exim 4.89) (envelope-from ) id 1gZHKK-0007Gt-Vx; Tue, 18 Dec 2018 15:30:33 +0000 Received: by debutante.sirena.org.uk (Postfix, from userid 1000) id AA3191125500; Tue, 18 Dec 2018 15:30:32 +0000 (GMT) From: Mark Brown To: Rohit kumar Cc: Mark Brown , plai@codeaurora.org, bgoswami@codeaurora.org, asishb@codeaurora.org, lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, rohkumar@qti.qualcomm.com, srinivas.kandagatla@linaro.org, alsa-devel@alsa-project.org Subject: Applied "ASoC: sdm845: set jack only for a specific backend" to the asoc tree In-Reply-To: <1544781703-9585-1-git-send-email-rohitkr@codeaurora.org> X-Patchwork-Hint: ignore Message-Id: <20181218153032.AA3191125500@debutante.sirena.org.uk> Date: Tue, 18 Dec 2018 15:30:32 +0000 (GMT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: sdm845: set jack only for a specific backend has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From d62805014ee8632e117fd061c18ff15ba90b9f61 Mon Sep 17 00:00:00 2001 From: Rohit kumar Date: Fri, 14 Dec 2018 15:31:43 +0530 Subject: [PATCH] ASoC: sdm845: set jack only for a specific backend Headset codec is connected over PRIMARY_MI2S interface. Call set_jack for codec associated with Primary Mi2s interface. Also, set_jack to NULL when jack is freed. Signed-off-by: Rohit kumar Signed-off-by: Mark Brown --- sound/soc/qcom/sdm845.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/sound/soc/qcom/sdm845.c b/sound/soc/qcom/sdm845.c index 1db8ef668223..6f66a58e23ca 100644 --- a/sound/soc/qcom/sdm845.c +++ b/sound/soc/qcom/sdm845.c @@ -158,17 +158,24 @@ static int sdm845_snd_hw_params(struct snd_pcm_substream *substream, return ret; } +static void sdm845_jack_free(struct snd_jack *jack) +{ + struct snd_soc_component *component = jack->private_data; + + snd_soc_component_set_jack(component, NULL, NULL); +} + static int sdm845_dai_init(struct snd_soc_pcm_runtime *rtd) { struct snd_soc_component *component; - struct snd_soc_dai_link *dai_link = rtd->dai_link; struct snd_soc_card *card = rtd->card; + struct snd_soc_dai *codec_dai = rtd->codec_dai; + struct snd_soc_dai *cpu_dai = rtd->cpu_dai; struct sdm845_snd_data *pdata = snd_soc_card_get_drvdata(card); - int i, rval; + struct snd_jack *jack; + int rval; if (!pdata->jack_setup) { - struct snd_jack *jack; - rval = snd_soc_card_jack_new(card, "Headset Jack", SND_JACK_HEADSET | SND_JACK_HEADPHONE | @@ -190,16 +197,22 @@ static int sdm845_dai_init(struct snd_soc_pcm_runtime *rtd) pdata->jack_setup = true; } - for (i = 0 ; i < dai_link->num_codecs; i++) { - struct snd_soc_dai *dai = rtd->codec_dais[i]; + switch (cpu_dai->id) { + case PRIMARY_MI2S_RX: + jack = pdata->jack.jack; + component = codec_dai->component; - component = dai->component; - rval = snd_soc_component_set_jack( - component, &pdata->jack, NULL); + jack->private_data = component; + jack->private_free = sdm845_jack_free; + rval = snd_soc_component_set_jack(component, + &pdata->jack, NULL); if (rval != 0 && rval != -ENOTSUPP) { dev_warn(card->dev, "Failed to set jack: %d\n", rval); return rval; } + break; + default: + break; } return 0; -- 2.19.0.rc2