Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1932722ybl; Tue, 3 Dec 2019 15:13:57 -0800 (PST) X-Google-Smtp-Source: APXvYqxoU75irxPmD53XBH589wyaob8G9X3nLidVvt1u0ewKbx1bOSriz02gSKy/ErTLQkfQEox9 X-Received: by 2002:a05:6830:22e2:: with SMTP id t2mr304884otc.129.1575414836978; Tue, 03 Dec 2019 15:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575414836; cv=none; d=google.com; s=arc-20160816; b=CHuSghmH4CA5NECyoEBK1zd+aJaH4ykCXc8jQZ3XTZOASAz+HAVx87dotemmPkBUXF +Mw/kWRjp0UFPH8MoqSU1DcVZ1gY7uIQfUMmWVjhYBLjfKTHOFLm8faBa4Vg63QZlP4x s0ZODeygoViq5lqJ/C+NvVtUeWigjgd/RNWE4B08Konq2sT6092U+Cmgx4ZAvCcTIrda I8JBwavwEf3xvZRy8A8daZNc+gw5VVXvYLXh4sBxlGgKKYt6tujiV0nGjoMNti0eMPHR ilguOGt+KB64byDbBk1e5pRsFHyDdieQnWdTHiDH/AhX4YLIM9//Tnom9uI6b7IyzXMc eE1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=L5lFWSc3f5ooreOAUYZcwtU262x16JucoLTLdqiyHoY=; b=S8ThdcHg/qpAOwiMh1WcBmehZuT68sEaU32LshvhRvJZ5Qty3ix4l5rSAPWZT67DKg 2LeuenLVT/xkmg4BuTrDaPE0LVeGskOUHMtIhLaaHt5te2M1a2iVz0ys0uR4snka9/Ll dL7k675oM6Fz1Mqklskf6k/Vmmm/bXaEG51IfXOvtagGUzsgs169w3fQTtmUPk3npJLg NLso+ZEpOE9VIDgtBUgNYyGFKXXpjYBp0f6JzKHhSNKjygE2AS2Vmsb/smdaVO0SUXcF mnNfZVlAmnILGqPZnV5yiHUGKZRfFMiIBZHRc/7/BLW3MhTxcCAOAWr5PNGyCi2HNyOR XEJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=l3UcRbsA; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 22si2078734oij.168.2019.12.03.15.13.33; Tue, 03 Dec 2019 15:13:56 -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=pass header.i=@kernel.org header.s=default header.b=l3UcRbsA; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728747AbfLCXMN (ORCPT + 99 others); Tue, 3 Dec 2019 18:12:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:52428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728049AbfLCWkQ (ORCPT ); Tue, 3 Dec 2019 17:40:16 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 78FB22073C; Tue, 3 Dec 2019 22:40:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575412815; bh=6aZUMqtER/CrO+tBsO/WYKls1zOlhwfAyEZ/V2jk7+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l3UcRbsA35SjTOQXtyhxAEDFvddfuJEklDQqdpLzlrD5sAsKl6Q9N3TjipytVeaKE cbXpIM8TdO605KSsjLQCL8lePI7xxy76VKWoGKDUSNHCzamfw3dAtIyTRWU3n15TVC rShIJjaHNIurUlv+VK5Ck9cCNvXmynZyILiJGNUs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Cheng-Yi Chiang , Mark Brown , Sasha Levin Subject: [PATCH 5.3 027/135] ASoC: rockchip: rockchip_max98090: Enable SHDN to fix headset detection Date: Tue, 3 Dec 2019 23:34:27 +0100 Message-Id: <20191203213011.147408629@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191203213005.828543156@linuxfoundation.org> References: <20191203213005.828543156@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Cheng-Yi Chiang [ Upstream commit 07c1b73e2a027ea9a52677beeb6a943a3e357139 ] max98090 spec states that chip needs to be in turned-on state to supply mic bias. Enable SHDN dapm widget along with MICBIAS widget to actually turn on mic bias for proper headset button detection. This is similar to cht_ti_jack_event in sound/soc/intel/boards/cht_bsw_max98090_ti.c. Note that due to ts3a227e reports the jack event right away before the notifier is registered, if headset is plugged on boot, headset button will not get detected until headset is unplugged and plugged. This is still an issue to be fixed. Signed-off-by: Cheng-Yi Chiang Link: https://lore.kernel.org/r/20191028095229.99438-1-cychiang@chromium.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- sound/soc/rockchip/rockchip_max98090.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sound/soc/rockchip/rockchip_max98090.c b/sound/soc/rockchip/rockchip_max98090.c index 782e534d4c0dd..f2add1fe2e79d 100644 --- a/sound/soc/rockchip/rockchip_max98090.c +++ b/sound/soc/rockchip/rockchip_max98090.c @@ -67,10 +67,13 @@ static int rk_jack_event(struct notifier_block *nb, unsigned long event, struct snd_soc_jack *jack = (struct snd_soc_jack *)data; struct snd_soc_dapm_context *dapm = &jack->card->dapm; - if (event & SND_JACK_MICROPHONE) + if (event & SND_JACK_MICROPHONE) { snd_soc_dapm_force_enable_pin(dapm, "MICBIAS"); - else + snd_soc_dapm_force_enable_pin(dapm, "SHDN"); + } else { snd_soc_dapm_disable_pin(dapm, "MICBIAS"); + snd_soc_dapm_disable_pin(dapm, "SHDN"); + } snd_soc_dapm_sync(dapm); -- 2.20.1