From patchwork Tue Aug 22 12:49:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 110656 Delivered-To: patch@linaro.org Received: by 10.182.109.195 with SMTP id hu3csp5226211obb; Tue, 22 Aug 2017 05:51:02 -0700 (PDT) X-Received: by 10.28.1.194 with SMTP id 185mr337770wmb.49.1503406262040; Tue, 22 Aug 2017 05:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503406262; cv=none; d=google.com; s=arc-20160816; b=AHL1ZX9KvBw+LJ/wI+AotqBw9JcFZQncH9cynuZekIbX9uF2aqawve7ouo22Em5dW2 Z+o2iSDUCIYD6MLE33PX3lBvlmGBvOO/ohbD/Zdom7rPn8ybqkG7yYi/Aqd3rTkT5ikW FFt1bCChym3FxT4Z8MnIwkbsZYKZEZjnjPMdVOH/Q15aOzSie3C9I0mQd8l6m9ITGhq+ sQ5MBKoeLMCtL8BTcHzsZl5oaV2nCxH/TBWqATGH6ZC8HCWMg3sU+v5QV5g7czsA2yl8 ytEXKdoeUu4OGJA2d8KvMWs/lm0Zpn2oGgqwsjd/A6ctxCmoeRLkXxXXZoZlY9riK7eo aA/g== 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=olIsh3sLF0LClMXy2AX1/czHno33ySJAPPtsS93IFXs=; b=f83gfWYfF/r6n7r796cwcKMf0xKIssZlIzfPYl0HYP5FfRRYsdjivFXftCjHa5es+D Wok70/IdyIkMK2o2q4ca1+rGnFfN8/Cabr7qUceiJBd9rvqj3ItDzm+s2iKwOw2poIZr mjTQupftyNYL19iJf/93+qunfL/tzX+03BScF/frWTtvFs84U9kUYMQEr0Y1fLQH2wwO XD4vbCMRQC3WCl4HFA4a3eN+ByHADIZVxSf/vOvVQLfHOAzCTKCllcGhWIg0e27y3o2d VSnc+5hsMtvBoi3ZYSL9Yhcj2bWOgarn16M39Q71oOP6ad93WSOi+BZqGR4WobVc0qSW Er2Q== 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=dZ5isrsI; 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 Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id f45si4029749wrf.74.2017.08.22.05.51.01; Tue, 22 Aug 2017 05:51:02 -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=dZ5isrsI; 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 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id B3109267639; Tue, 22 Aug 2017 14:50:55 +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 8AB63267640; Tue, 22 Aug 2017 14:50:54 +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.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, RP_MATCHES_RCVD, SPF_PASS, URIBL_BLOCKED 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 7826726762C for ; Tue, 22 Aug 2017 14:49:39 +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=hKnenIA249hwDPTfawWUvDd2776ne7YKs0MIhzQVpVk=; b=dZ5isrsIHwnU HwCU15gSWhm1IT/cLHbY+NGleT+OqNxRL9lbctxoj+7MZ+Zyae2hJ9+1DN+gF0bU8VEk6SLmpN90C kb5SpGL03JS+zn+UZ1XMeeQ+4Mv5j9+vfx7oX5CmhTnWBrNmyLO1v54c/3hntiKcBMr0/iWC0GT65 1k1Do=; Received: from [2001:470:1f1d:6b5:7e7a:91ff:fede:4a45] (helo=finisterre) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1dk8ci-0002go-J0; Tue, 22 Aug 2017 12:49:36 +0000 Received: from broonie by finisterre with local (Exim 4.89) (envelope-from ) id 1dk8ci-0000RP-2j; Tue, 22 Aug 2017 13:49:36 +0100 From: Mark Brown To: Takashi Iwai In-Reply-To: Message-Id: Date: Tue, 22 Aug 2017 13:49:36 +0100 Cc: Bard Liao , alsa-devel@alsa-project.org, Mark Brown , Pierre-Louis Bossart , Andy Shevchenko Subject: [alsa-devel] Applied "ASoC: rt5670: Fix GPIO headset detection regression" 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: rt5670: Fix GPIO headset detection regression has been applied to the asoc tree at git://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 804e73adf5cf4b3aea3b6ce058f4dc0191143821 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 22 Aug 2017 07:44:52 +0200 Subject: [PATCH] ASoC: rt5670: Fix GPIO headset detection regression RT5670 codec driver and its machine driver for Intel CHT assume the implicit GPIO mapping on the index 0 while BIOS on most devices don't provide it. The recent commit f10e4bf6632b ("gpio: acpi: Even more tighten up ACPI GPIO lookups") restricts such cases and it resulted in a regression where the headset jack setup fails like: rt5670 i2c-10EC5672:00: ASoC: Cannot get gpio at index 0: -2 rt5670 i2c-10EC5672:00: Adding jack GPIO failed For fixing this, we need to provide the GPIO mapping explicitly in the machine driver. Also this patch corrects the string to be passed to gpiolib to match with the pre-given mapping, too. Fixes: f10e4bf6632b ("gpio: acpi: Even more tighten up ACPI GPIO lookups") Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=115531 Reported-by: Pierre-Louis Bossart Tested-by: Pierre-Louis Bossart Signed-off-by: Takashi Iwai Reviewed-by: Andy Shevchenko Signed-off-by: Mark Brown --- sound/soc/codecs/rt5670.c | 2 +- sound/soc/intel/boards/cht_bsw_rt5672.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) -- 2.13.2 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel diff --git a/sound/soc/codecs/rt5670.c b/sound/soc/codecs/rt5670.c index 0ec7985ed306..054b613cb0d0 100644 --- a/sound/soc/codecs/rt5670.c +++ b/sound/soc/codecs/rt5670.c @@ -567,7 +567,7 @@ int rt5670_set_jack_detect(struct snd_soc_codec *codec, rt5670->jack = jack; rt5670->hp_gpio.gpiod_dev = codec->dev; - rt5670->hp_gpio.name = "headphone detect"; + rt5670->hp_gpio.name = "headset"; rt5670->hp_gpio.report = SND_JACK_HEADSET | SND_JACK_BTN_0 | SND_JACK_BTN_1 | SND_JACK_BTN_2; rt5670->hp_gpio.debounce_time = 150; diff --git a/sound/soc/intel/boards/cht_bsw_rt5672.c b/sound/soc/intel/boards/cht_bsw_rt5672.c index bc2a52de06a3..f597d5582223 100644 --- a/sound/soc/intel/boards/cht_bsw_rt5672.c +++ b/sound/soc/intel/boards/cht_bsw_rt5672.c @@ -184,6 +184,13 @@ static int cht_aif1_hw_params(struct snd_pcm_substream *substream, return 0; } +static const struct acpi_gpio_params headset_gpios = { 0, 0, false }; + +static const struct acpi_gpio_mapping cht_rt5672_gpios[] = { + { "headset-gpios", &headset_gpios, 1 }, + {}, +}; + static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) { int ret; @@ -191,6 +198,9 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime) struct snd_soc_codec *codec = codec_dai->codec; struct cht_mc_private *ctx = snd_soc_card_get_drvdata(runtime->card); + if (devm_acpi_dev_add_driver_gpios(codec->dev, cht_rt5672_gpios)) + dev_warn(runtime->dev, "Unable to add GPIO mapping table\n"); + /* TDM 4 slots 24 bit, set Rx & Tx bitmask to 4 active slots */ ret = snd_soc_dai_set_tdm_slot(codec_dai, 0xF, 0xF, 4, 24); if (ret < 0) {