Received: by 10.223.185.116 with SMTP id b49csp2635843wrg; Thu, 15 Feb 2018 15:07:19 -0800 (PST) X-Google-Smtp-Source: AH8x227+OlWaxhv59Fa9WxdP2WI5VjIveHHe0QMIgKo2A+WzqPtfybF5TiAUNer2ZN3u5TgrcjD/ X-Received: by 2002:a17:902:4601:: with SMTP id o1-v6mr3954700pld.210.1518736039522; Thu, 15 Feb 2018 15:07:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518736039; cv=none; d=google.com; s=arc-20160816; b=VUuvCpOHsoN7VKehQhIbv7skux9ebFCl7+HKLBF9C8q/C6bVca9I4PKpAVz3lOeuyw 9NBANPvad3mXE3VxkJGBCT0qnP+Ggijdf1bHJwhbDN51axnh5wIMheQ6vDzjXj2exRFD Qg4XBuyhxjBTxKPbsiEmC5Jwe69TkAhXRy5kXG/VYGAL2I7FMBZyB8n8kjoMAYQs8xpb r7oms9gl2MdWNnjQ/4sO7KF+n6X8dKi90RSOqxfJyCIS996hY0XytR/sKIg5Zot5ZcbJ Ws1t6bXtMtldU36mgTeTh/6pa462R32D6KwARBmriNaEJrR9YdVMGMGrBtZj8FVtg2Us MM+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=V70GznpOHPEKp1hU9+NMdlSiZcN/geJFFY0i4T0iBKw=; b=X+OR7LepxVTDZLp1N+UtaoJYPaXLk6mm971G6Y8PQGb8or3Eyu4ktz5ESz7Injt1cu PpMFo7cdMRfxMTJuPztxgsSfoU+gn2eRc9BIX86pYjIKE4wFpcMVC+/vc7iQf5so8PBn 0E2xhS6y1pxGPpUd1ISRyWdHqpNDJx4qb1Ckfuqb7g4daL7p5THvS7gTPnwmixvjxpxp IZioGg0RW6geajpbItse9/BdxvKdLFts3AybOLsllL9WecNobwuSAWXBpjkg3ikYgzK1 ++bvPWdUEd1bAOlSJr2NJvAMePcXh5wES0UUZxVucpppFAmhgs1qBjJAYxAr5opdg44W k9Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=iQPUikAt; 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 t74si222137pgc.649.2018.02.15.15.06.41; Thu, 15 Feb 2018 15:07:19 -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=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=iQPUikAt; 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 S1165171AbeBOPev (ORCPT + 99 others); Thu, 15 Feb 2018 10:34:51 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:36428 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1165142AbeBOPen (ORCPT ); Thu, 15 Feb 2018 10:34:43 -0500 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=V70GznpOHPEKp1hU9+NMdlSiZcN/geJFFY0i4T0iBKw=; b=iQPUikAtLINH P73ujjR8jZfLKrUQpZr4k8F4U7UFWtnCCslbe+2lxne2n0NU7DCqZ9yVZXiIOUY8pkQzfIV3A1K52 Upv2ZLp2wyJxeEHcIH6hxi4OS60f4FXP9fCYXUlNfmISQ1BgbVqHy4c8qZTBlg8g3TfST3EtpNhQs g4dyY=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1emLYH-0002C8-9X; Thu, 15 Feb 2018 15:34:25 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1emLYG-0007Ln-Qd; Thu, 15 Feb 2018 15:34:24 +0000 From: Mark Brown To: Abhijeet Kumar Cc: Mark Brown , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Vinod Koul , Jeeja KP , Guneshwor Singh , "Subhransu S. Prusty" , "Ughreja, Rakesh A" , Puneeth Prabhu , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, abhijeet.kumar@intel.com, alsa-devel@alsa-project.org Subject: Applied "ASoC: hdac_hdmi : Ensuring proper setting of output widget power state" to the asoc tree In-Reply-To: <1518683739-4448-1-git-send-email-abhijeet.kumar@intel.com> Message-Id: Date: Thu, 15 Feb 2018 15:34:24 +0000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: hdac_hdmi : Ensuring proper setting of output widget power state has been applied to the asoc tree at https://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 753597fbb7031ff147d4f2862426699e4ad8efca Mon Sep 17 00:00:00 2001 From: Abhijeet Kumar Date: Thu, 15 Feb 2018 14:05:38 +0530 Subject: [PATCH] ASoC: hdac_hdmi : Ensuring proper setting of output widget power state In usecases like hot plug-unplug DP panel or modeset during a playback, sometimes we observe no audio after codec resets. During no audio condition, we have noticed that the power state of the pin or the connector is D3. Optimizing the way we set the power mitigates the issue. With this changes the verb is sent to set the power state and waits until actual state reaches target state. Thus ensuring power state is set. Signed-off-by: Abhijeet Kumar Signed-off-by: Mark Brown --- sound/soc/codecs/hdac_hdmi.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index 0758927d1e06..60bea9d69fc0 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -718,10 +718,22 @@ static struct hdac_hdmi_pcm *hdac_hdmi_get_pcm(struct hdac_ext_device *edev, static void hdac_hdmi_set_power_state(struct hdac_ext_device *edev, hda_nid_t nid, unsigned int pwr_state) { + int count; + unsigned int state; + if (get_wcaps(&edev->hdev, nid) & AC_WCAP_POWER) { - if (!snd_hdac_check_power_state(&edev->hdev, nid, pwr_state)) - snd_hdac_codec_write(&edev->hdev, nid, 0, - AC_VERB_SET_POWER_STATE, pwr_state); + if (!snd_hdac_check_power_state(&edev->hdac, nid, pwr_state)) { + for (count = 0; count < 10; count++) { + snd_hdac_codec_read(&edev->hdac, nid, 0, + AC_VERB_SET_POWER_STATE, + pwr_state); + state = snd_hdac_sync_power_state(&edev->hdac, + nid, pwr_state); + if (!(state & AC_PWRST_ERROR)) + break; + } + } + } } -- 2.16.1