From patchwork Tue Jul 3 15:34:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 140988 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1309777ljj; Tue, 3 Jul 2018 08:35:56 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcecHRc1HdmHqs4h81n97KxEYVDi8eHBazrrNe/3e0M0eY/rHGQ5spgmxJSf3An8x4PRi02 X-Received: by 2002:a1c:8b0d:: with SMTP id n13-v6mr9022653wmd.46.1530632156333; Tue, 03 Jul 2018 08:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530632156; cv=none; d=google.com; s=arc-20160816; b=G0rx8uYr+OR5QZB7M7TYfFlV2TEtC5KC1BVYtARY7dUMCpBWO5WeqX9QKLVWaUPHW6 GkWeeCn0ceZqyXvwHZM4o6myi9M2m7BsiYH9jaVWYtLIT5DPQy9+Ihw/t2auyr3XcDVr uYg9suOVX5bZbRbSRA5KR7RvrK6lZ+7y0qDSg2ccJG06AYVh7JyWpfWNnPkAV51VLGOI D0yz3A5wFsYUSwceM/Bs2bpm1sldxwifmCo0E6ZUo6uuPz2E/ISlAmSbPP7fHiIiYQUp AOxFse1ytV9m3cN3xHWkMZPQOnNSnf6dY1nuid6aZYYz//50Ss4SrS/TCsc4Cp5sJyNP w63g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=Gml79iiNHNASGbrqhagT4nf/Y826xKZFYfxxiCdNCY8=; b=ukRLLuPNG9yqEYB0bJA3LJHd0nUASavv6wCi7uYpVVsZadWDpUwELcsKtg3VaerANl YGpolN/jtliYwmVg01aGQo0LZSBfPRnTkkMCL6PhQauq2pRMqy3tiuDOBHR3/kAQlYF3 cLLrkOKdpbgfc4LAzIRmQzX1ZGnPL3kxAHrmB/E07GQMIyHcp6hJ0NgtzbpyHRb1TkOP zyw1yKOEa4LqfZ7ZjHCDG8YWj+oevRzq3exLWkX2lx4m6IXVgd56OwxdkIhN8ZLt8Gyi CN9g34aqs9QHBEg3hlGS7I5ZEE6KKWNhkYHuMpf3MTuODWzkggSoDbK8byWIS3CSQo+/ tx5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Vkk7b8IJ; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id h14-v6si1039448wrq.378.2018.07.03.08.35.56; Tue, 03 Jul 2018 08:35:56 -0700 (PDT) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Vkk7b8IJ; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 7E32A26772D; Tue, 3 Jul 2018 17:34:58 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 4E0DC2677C6; Tue, 3 Jul 2018 17:34:56 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id DE83D26776A for ; Tue, 3 Jul 2018 17:34:53 +0200 (CEST) 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=tfaG0S/QRibCZCSi+jCrIiSLNCCywDdPolo8fGXTpqE=; b=Vkk7b8IJr14v Ng5IAx7k6xI0PDgXUu3IpLbvoSy4bo0vC8qSvjgvsWQOrEOhxesAY3qtYyhz2mT7uBM6z+QquGZ2L lKoYqr831ExsPmlrxBuhUMd+1xABak2rRAMKQ6u4/XhoKa01N2w3mUVj2HnOrlVZ6bLvI7G2Ot9bp xcJO0=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1faNK2-0006Bu-Mj; Tue, 03 Jul 2018 15:34:30 +0000 Received: from broonie by debutante with local (Exim 4.91) (envelope-from ) id 1faNK2-0003tN-8x; Tue, 03 Jul 2018 16:34:30 +0100 From: Mark Brown To: Bard Liao In-Reply-To: <1530594445-30007-1-git-send-email-bardliao@realtek.com> Message-Id: Date: Tue, 03 Jul 2018 16:34:30 +0100 Cc: oder_chiou@realtek.com, jack.yu@realtek.com, alsa-devel@alsa-project.org, lars@metafoo.de, lgirdwood@gmail.com, broonie@kernel.org, shumingf@realtek.com, naveen.m@intel.com, flove@realtek.com Subject: [alsa-devel] Applied "ASoC: rt5682: add button detection mode control" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org The patch ASoC: rt5682: add button detection mode control 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 2daf3d9962c5a11fb79fe17bae03125df5d60236 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Tue, 3 Jul 2018 13:07:25 +0800 Subject: [PATCH] ASoC: rt5682: add button detection mode control We are currently using power saving mode for button detection. However, it will impact the headset recording performance. This patch will switch button detection to normal mode in capture and switch to power saving mode in the end of capture. Signed-off-by: Bard Liao Signed-off-by: Mark Brown --- sound/soc/codecs/rt5682.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.18.0.rc2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c index baad177908ab..640d400ca013 100644 --- a/sound/soc/codecs/rt5682.c +++ b/sound/soc/codecs/rt5682.c @@ -857,6 +857,8 @@ static int rt5682_button_detect(struct snd_soc_component *component) btn_type = val & 0xfff0; snd_soc_component_write(component, RT5682_4BTN_IL_CMD_1, val); pr_debug("%s btn_type=%x\n", __func__, btn_type); + snd_soc_component_update_bits(component, + RT5682_SAR_IL_CMD_2, 0x10, 0x10); return btn_type; } @@ -1645,6 +1647,8 @@ static const struct snd_soc_dapm_widget rt5682_dapm_widgets[] = { SND_SOC_DAPM_MIXER("Stereo1 ADC MIXR", RT5682_STO1_ADC_DIG_VOL, RT5682_R_MUTE_SFT, 1, rt5682_sto1_adc_r_mix, ARRAY_SIZE(rt5682_sto1_adc_r_mix)), + SND_SOC_DAPM_SUPPLY("BTN Detection Mode", RT5682_SAR_IL_CMD_1, + 14, 1, NULL, 0), /* ADC PGA */ SND_SOC_DAPM_PGA("Stereo1 ADC MIX", SND_SOC_NOPM, 0, 0, NULL, 0), @@ -1807,6 +1811,8 @@ static const struct snd_soc_dapm_route rt5682_dapm_routes[] = { {"Stereo1 ADC MIXR", "ADC2 Switch", "Stereo1 ADC R2 Mux"}, {"Stereo1 ADC MIXR", NULL, "ADC Stereo1 Filter"}, + {"ADC Stereo1 Filter", NULL, "BTN Detection Mode"}, + {"Stereo1 ADC MIX", NULL, "Stereo1 ADC MIXL"}, {"Stereo1 ADC MIX", NULL, "Stereo1 ADC MIXR"},