Received: by 10.223.185.116 with SMTP id b49csp1745075wrg; Thu, 15 Feb 2018 00:28:53 -0800 (PST) X-Google-Smtp-Source: AH8x225o0kWFAhyFLy9TX/Gh/wDeuHRb5x51mPZ2KZRYZvExMMzz20D4HCLKGcTY1CGHMfWgOP/K X-Received: by 10.98.227.8 with SMTP id g8mr1905309pfh.200.1518683333821; Thu, 15 Feb 2018 00:28:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518683333; cv=none; d=google.com; s=arc-20160816; b=GnpFI8PKaJmBi+LUG1/LhFanycdQjLjr6CvFZYGeTqi9GPzaUcoajtyDbeMQKS//mQ D+rj4VpbYua0gqnbNTVG5Lm5PJ8jMFvLLa4h8hkyPFp/daQvFyyxkCUfLK/oyX4rcqcQ 3N2CV0VZh3BYkBmGoOXOQQOT9TA9wANKhhE5hf3Hw1yDhSZTvv//INKRY7qyIDzdTLlH /bq6BMK7t6EbyrTS4VV9pOHioqIS7zdBgWluFgRcPbv95DtFzzhmw6qndJ6egXB9k85k ROLB5/1XoGCnds2KNEYqWndPLQtiaBMamJtgQtr4EhUQa6jSF2lZJClqu2+exK0ZZJ1T fQhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=4kGEo7Rww8h2CEfxjS5zztuK1Od69zt2JkYUEcTfgho=; b=qyaqNWVL60xUWzGZ4cv48DUrebY/ic1NzaYYc8yytQ0eo4tRraWAHQucNYYvCecFPF DrszZ0vX2Ha94HORV8JEVGR1/AjyRgnYs0jxXQ1/EDYsJUzg+GIxMY9A1uIS9H3uidWZ 3DnBzE5feMxPNgoyD2hLHLhffhhrw3ez9p8a7XQsAD5RjC1mHAg8yaz4lpGDdy0HSaIf wynApE2zQvhRkty4t/IQ3p3aZcbIIsrksuXciY0kG6HN0tONyUKdqfv5osxiauopZLPH dPVd6Gs8/8R2OaKHnQHWlJZGO6jYQoMW7T15k70bQsnpjVA0zdWWrleBNZxowG3+czSQ Ry/w== ARC-Authentication-Results: i=1; mx.google.com; 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 3-v6si1394068pls.721.2018.02.15.00.28.39; Thu, 15 Feb 2018 00:28:53 -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; 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 S1755090AbeBOI1e (ORCPT + 99 others); Thu, 15 Feb 2018 03:27:34 -0500 Received: from mga18.intel.com ([134.134.136.126]:46703 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755017AbeBOI1d (ORCPT ); Thu, 15 Feb 2018 03:27:33 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Feb 2018 00:27:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,516,1511856000"; d="scan'208";a="30935294" Received: from intel-h97m-d3h.iind.intel.com ([10.66.247.169]) by fmsmga001.fm.intel.com with ESMTP; 15 Feb 2018 00:27:29 -0800 From: abhijeet.kumar@intel.com To: 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 Cc: abhijeet.kumar@intel.com Subject: [PATCH] ASoC: hdac_hdmi : Ensuring proper setting of output widget power state Date: Thu, 15 Feb 2018 14:05:38 +0530 Message-Id: <1518683739-4448-1-git-send-email-abhijeet.kumar@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516728657-21522-3-git-send-email-abhijeet.kumar@intel.com> References: <1516728657-21522-3-git-send-email-abhijeet.kumar@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Abhijeet Kumar 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 --- 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 dba6f4c5074a..0483afc40db6 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; + } + } + } } -- 1.9.1