Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3188383pxf; Mon, 5 Apr 2021 05:44:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxp289UxZSTE6gdxbVRgQbEX2rpgHBJPyoyiEz43zNCWXTJ2qBcZU+yZI7G6MB2aH7Dcd3A X-Received: by 2002:a17:906:2419:: with SMTP id z25mr15349221eja.273.1617626699628; Mon, 05 Apr 2021 05:44:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617626699; cv=none; d=google.com; s=arc-20160816; b=e8WlWI3N58XX+lrwNYEW/F5iBHG+/blTMiaD4QRqADXCcFr653rs+zgwj/1tcqPjwA xbe8DuE93ZqDthWU0sG/sVfByNSW8HcTzTcwn07O6IWFQ6AnMfOCfXN7gBBmnPqKKO1V EB02s22dR8ODkRhfTBL0b9FiUlKKYpb1JigUYnMosYHI7eVjfbpTPehhevLW6+L1JMnh IDj9GvEZaViyQFmYgAIFQwmKwo93nxgIIuwEU6I/kvbAPUPzyIc6cM9uT1efB5f0WGp+ pvZ6jUC0zIkOYUeNjM3hxzcyD/JwzwHIv/qhB1K08WWG1z5cDUPpPqbFklqIyF8Eg2Vn YD0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Knh+X5vLoB7RD5HchXisd6qtQPs9AYItZ+DfYUl/5Vw=; b=kiC7FCZ0HzVKajMScsigKdC5EyQHSUbU13Xh68tO0BN/QrX7q+QIIcTM5NMlY8WCpx LLrn1qamsxf6zkQgpiIK0VR4lIQADkhb7MwSc/d6Om572gAO8NFYVwQF3HOs0wOluaAG SnOlvQWY79TWPZ/V7KHK1VGmGrc8gEfv4hsj9pA6AsbEW0KHIG3gksPLX+EqOL9xe9oa eJ1LMat727R5QKc6LNQiI2cdS1UJgiSkoeeWH+Q53Z1ZoIvttsraH7++Ksb0ErDaYGqr Qu8m1JaJgX36tja4XDZ6cawwsA7ju4Qon1x+h0aeqNXkT+oRMKTu/Bvn+3Y+QE7Z2Fi8 yfsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hqbtsUWJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z16si13095991edc.65.2021.04.05.05.44.36; Mon, 05 Apr 2021 05:44:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hqbtsUWJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237119AbhDEJA4 (ORCPT + 99 others); Mon, 5 Apr 2021 05:00:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:41772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237141AbhDEJAQ (ORCPT ); Mon, 5 Apr 2021 05:00:16 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E27EA6139C; Mon, 5 Apr 2021 09:00:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617613209; bh=KkX+a3EJBm9puBdGl63ZwLCFqc7hZbvS6WUcps0hT/Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hqbtsUWJIH9nOEpH0TtlHMzSFNz0gABVdOcRDtlmfXKk35wWiiXpeUO7IwXGClVev uvvo3VKSRWdofwdvZUabq52G5Re5ojkDy6cb6jojlOaN6anYkcyXpKzvCZn0rrTGz9 VOGLWBEmj3c+1U02cXRt0OnlqArD/AHqaCTzZ2Ho= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hui Wang , Takashi Iwai Subject: [PATCH 4.14 26/52] ALSA: hda/realtek: call alc_update_headset_mode() in hp_automute_hook Date: Mon, 5 Apr 2021 10:53:52 +0200 Message-Id: <20210405085022.845393774@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210405085021.996963957@linuxfoundation.org> References: <20210405085021.996963957@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hui Wang commit e54f30befa7990b897189b44a56c1138c6bfdbb5 upstream. We found the alc_update_headset_mode() is not called on some machines when unplugging the headset, as a result, the mode of the ALC_HEADSET_MODE_UNPLUGGED can't be set, then the current_headset_type is not cleared, if users plug a differnt type of headset next time, the determine_headset_type() will not be called and the audio jack is set to the headset type of previous time. On the Dell machines which connect the dmic to the PCH, if we open the gnome-sound-setting and unplug the headset, this issue will happen. Those machines disable the auto-mute by ucm and has no internal mic in the input source, so the update_headset_mode() will not be called by cap_sync_hook or automute_hook when unplugging, and because the gnome-sound-setting is opened, the codec will not enter the runtime_suspend state, so the update_headset_mode() will not be called by alc_resume when unplugging. In this case the hp_automute_hook is called when unplugging, so add update_headset_mode() calling to this function. Cc: Signed-off-by: Hui Wang Link: https://lore.kernel.org/r/20210320091542.6748-2-hui.wang@canonical.com Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -4811,6 +4811,7 @@ static void alc_update_headset_jack_cb(s struct alc_spec *spec = codec->spec; spec->current_headset_type = ALC_HEADSET_TYPE_UNKNOWN; snd_hda_gen_hp_automute(codec, jack); + alc_update_headset_mode(codec); } static void alc_probe_headset_mode(struct hda_codec *codec)