Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3090488pxf; Mon, 5 Apr 2021 03:01:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+LVhu8tWFvaYIQIW3L4IWNpQ5jHT0Ts/hmVXWXVQwnibZfCUwgxe+gojQasvLsefksmMw X-Received: by 2002:a92:dc85:: with SMTP id c5mr19436471iln.79.1617616884685; Mon, 05 Apr 2021 03:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617616884; cv=none; d=google.com; s=arc-20160816; b=F8DzOxOfXg8LGLrlBaL8cKh9+S+n6Ja9pKY35XyDwF/p4XUIMgma1V6/3oB/2eCBxY 7NgsssOyZ5U2/L676mRwHcOJtZLCo6WQjaVGbHjEZ0IHD4jmZBno8Afwmv7ugvEmd6J6 3XGPknj/WNgLyXasTgZ+D0acNvp8+CM+30Ctar/T7dVPAhrPpFOoOYBCf4abFU1FBgZN +gy6yfAIiZAfRbnjdd9Z/hMHJa6XF6gdv5WrEYKyDIhR1GlTIaXM6l1Thd2bFZzjc9jd fUc2FiSqT9MlLiTfgZANKgY9eXrP5NlQNWrtVdCNLsgyCumtMEl/EObHS3tqj4/Xr6gI wf2w== 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=Hl76m20J2CAZjsQZ5MsfDsx0OEdfNvQ4BfUVAMDuExk=; b=WlYiGexFgBIcuHDkrs6zyRc/TRMihPFgW9euaw0E6qd4mrj7Sbskxh83034tztCO6d ik9waqdrnu6FELl5d+9b8JwhExPj7c1kgcWUNp3RLcC6gurzioGmL5IgYuG2uKWdWEhM /9nQ9KRCUhJURwP0UBUrDeTGXWI3dR2Uv9FIWtL2l5dMuirR2OBXlGtyAKLCyqmUt30l n/gnmdHuh6LHj0eoDrxJbeIexpF1Jox2YQI3VcB6KPrhP2urjHIYV7bjgt2nv4SN8sPI Mmq15Goc1SvjPSUGv3qFNiXtF9eZiAulRv11f1SfRYFRqAYW+aGvzpnxVhA2zdNlVSCa DMAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tdeLorDA; 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 r19si14680668ilj.18.2021.04.05.03.01.11; Mon, 05 Apr 2021 03:01:24 -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=tdeLorDA; 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 S232670AbhDEIzl (ORCPT + 99 others); Mon, 5 Apr 2021 04:55:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:33676 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230305AbhDEIzk (ORCPT ); Mon, 5 Apr 2021 04:55:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1231961245; Mon, 5 Apr 2021 08:55:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617612934; bh=FFqXti1lAOLMRaerjWNaFbz7YDI1i+/1fmlLdtLu/l8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tdeLorDAqroSwH8lXC/NGhbvh6yXp5QqbEXD3lxcBYorE5tq+CaCNFGH0tz5gJC6J 939FOoYlvcu48uZtpMM0CCT7+LBKtBaFeHzjqMtMUj6DVU6Oaj9vwAOd2k1650cCJS n7uVjkAylwSGDVGsJDXY6cwqlPbK74DpdSeNfeTQ= 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.4 16/28] ALSA: hda/realtek: call alc_update_headset_mode() in hp_automute_hook Date: Mon, 5 Apr 2021 10:53:50 +0200 Message-Id: <20210405085017.529021457@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210405085017.012074144@linuxfoundation.org> References: <20210405085017.012074144@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 @@ -4294,6 +4294,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)