From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E15DC433EF for ; Tue, 5 Apr 2022 05:57:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230005AbiDEF7L (ORCPT ); Tue, 5 Apr 2022 01:59:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57110 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbiDEF7J (ORCPT ); Tue, 5 Apr 2022 01:59:09 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD8A069728; Mon, 4 Apr 2022 22:57:11 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 775201F37E; Tue, 5 Apr 2022 05:57:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1649138230; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aq+dfe7t7uVb6nhFWo1ZuXqHwk+7toIxAoNOkXg7JeM=; b=nGu2CIBBBIVdM9h/HXw2+mXUxdT4zvs8uLiwvCpeQBtTvNRk2bVzoQAmjmigT/DJennzvY Rkwvvee04yfAS/2VtE1Q+SHqesryFM/fMwPy+86C2CFdfLW5a5dxFveIjUzSztWMDTtO3F SPURh6iJms3RPNL2iAL42BkUHY5GQ+0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1649138230; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=aq+dfe7t7uVb6nhFWo1ZuXqHwk+7toIxAoNOkXg7JeM=; b=FMvCcsebYvOYoGOtv2oF54oHadK6D06fDLoZbg23UtWhc7dUnAM6LkeJQO2vKWVGeKIBCT 8K03Ttjniez8yyDw== Received: from alsa1.suse.de (alsa1.suse.de [10.160.4.42]) by relay2.suse.de (Postfix) with ESMTP id 9B3DAA3B82; Tue, 5 Apr 2022 05:57:09 +0000 (UTC) Date: Tue, 05 Apr 2022 07:57:09 +0200 Message-ID: From: Takashi Iwai To: Mohan Kumar Cc: , , , , , , , Subject: Re: [PATCH] ALSA: hda/tegra: Fix hda Jack detection In-Reply-To: <20220405032607.8489-1-mkumard@nvidia.com> References: <20220405032607.8489-1-mkumard@nvidia.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 05 Apr 2022 05:26:07 +0200, Mohan Kumar wrote: > > Tegra HDA Jack detection logic doesn't work when the HDACODEC > in runtime suspended state as unsol event won't be triggered > during D3 state. As pulseaudio server in userspace rely on the > jack mixer control status to show the audio devices in gui and > any display sink device hotplug event during D3 state will never > updates the jack status which will result in no audio device option > available in userspace settings. > > The possible option available to resolve this issue for multiple > tegra platforms is to use Jack polling method for every 5 seconds. > Also to make Jack detection work seamlessly the Jack worker thread > needs to run continuously after HDA sound card registered > irrespective of whether HDMI sink device connected or not, but the > Jack state update call happens only when Codec is not powered on. > > Signed-off-by: Mohan Kumar Hmm, any reason not to use the standard jackpoll stuff that is already implemented in HD-audio controller side? That is, doesn't the following oneliner work instead? thanks, Takashi -- 8< -- --- a/sound/pci/hda/hda_tegra.c +++ b/sound/pci/hda/hda_tegra.c @@ -421,6 +421,7 @@ static int hda_tegra_create(struct snd_card *card, chip->driver_type = driver_caps & 0xff; chip->dev_index = 0; INIT_LIST_HEAD(&chip->pcm_list); + chip->jackpoll_interval = msecs_to_jiffies(5000); chip->codec_probe_mask = -1;