Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp8128ybe; Sun, 1 Sep 2019 19:10:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0l22x5aUL2fxC57kx4nDdZ/h4clZANxb0pp/ugxyNFtXAkOmlr0b2d9UcUOGPbqeBxjU6 X-Received: by 2002:a65:43c2:: with SMTP id n2mr23384640pgp.110.1567390212319; Sun, 01 Sep 2019 19:10:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567390212; cv=none; d=google.com; s=arc-20160816; b=gH74JumDhHR0ysKriEhhcnXxrfRw2CzYa/o1WOWQQ/ZASl4Ej8TtPH6iYDwnqwt4Zs vJiAg1xvVDddXyy+/DBpLZ9Ad4a4PqbE142HsS26Eoi9ZuypwPvci+30I/qp3/hrFFY7 M6aK5NuY5IuFkd5TSXoZnA/lllSCWoqNTXoWGU85ax35766Gi4l12iLOEZfsdR2cdq8G s6I1WohdP/a6zE+o5jl78FoGCp8oyqa7Gyo3d4l03fWKh/K8W60lksSaI12SaxaNDpHF cYLbzjFyu9cDVJP+P0sfBvHehxrrwRd69MwXzeFeaFHBO5aUJD+WL1rUtmMxiAo7W5AT 0jsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=SteZi7Jc1Qj/ZWEovebsg0xMt+f3c5vmQftu053JsS8=; b=BJLoN4XYRzKYlMNXXCGmTKLQnjvjdku5D/z9LZvgG/F0uw8Lup+BGpxD/PiA42xXEO heBPZa1a5kkh8C2DNnh8XGO7mXSURr6geAXiQkBJzPsteyavAwSWPybTtu6fh4E2/+A7 5I9BULP4Vwy2uCYadob9T4t/tMCYbN7Jjb68sotBGu9vvRkCn7+vh1S4e4szrzYN87uJ ST2iY91gil18qj4xh9LQeGlNU1j/XIeEjkVUBhPXmfMCJ9wM/FbPCw/aYJMq6dtH9ACi jt/CfBbRbu0zvBQqma1l4s/xgbom00CTcF6KfDW5fs7vD/YhnyVXJ9qnfmWgLaFvJNic Qnlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lPR+RAf4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r17si10263182pgr.277.2019.09.01.19.09.56; Sun, 01 Sep 2019 19:10:12 -0700 (PDT) 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=pass header.i=@chromium.org header.s=google header.b=lPR+RAf4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729253AbfIBCHY (ORCPT + 99 others); Sun, 1 Sep 2019 22:07:24 -0400 Received: from mail-vs1-f66.google.com ([209.85.217.66]:39269 "EHLO mail-vs1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727517AbfIBCHY (ORCPT ); Sun, 1 Sep 2019 22:07:24 -0400 Received: by mail-vs1-f66.google.com with SMTP id y62so8269853vsb.6 for ; Sun, 01 Sep 2019 19:07:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SteZi7Jc1Qj/ZWEovebsg0xMt+f3c5vmQftu053JsS8=; b=lPR+RAf4lLbHFKrG7BKbpxKO2o5PIV6QPEk5yeLJsGuOupELQ4EX6PQ2n7tlyefFjX 5TueBZwuZlQptLjVpdiWoRTQzixxBywwaHL2Q/9NxpVlWZua4yL5HvNYQaptM2F6I5gj urBmtznxWX5SXt9UN7RdKLsmNWsgswpCy+GTA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SteZi7Jc1Qj/ZWEovebsg0xMt+f3c5vmQftu053JsS8=; b=dM0bXVecqcFVXAA2e4Xf21ibUknJPAhwAxImEs/iVfSkfTOlIuDKgio14N3ppz/iJ0 ggPSHFiLaamzZFUqnnP8X1/NmBzqHQ9cG9aNhYSqVm3lA+09B6HOmEpTi91Zlvk+JltW tg2fTIUTYkVDUqVVgeWWBgQBW8ZVNSox8RcAL9THCCnsJR0eeG9TF42eRr+ypek7Xiuj DqWxIJX66oAe41DYc7KpktyoU2YkLFSJxveizpzGrIzGRbqEvO2J+Mcw2lqUy9SFQhsB 5VucTpObdDOP0pYqmr0bdFHjMd2JGJnS6Ggj1/C6FyI+c4qLl+f4Bz4nkj9v/6qDXyfF /EFg== X-Gm-Message-State: APjAAAWcB1yldT5Sp/A7+yMNmL1zvUhU1jvA7qN1pAoa0xHMBOztEsiv r9Pw/EKkEKKlnOu/J8pkDRXipVoDzpem2RA5fXSX3g== X-Received: by 2002:a67:de08:: with SMTP id q8mr4571764vsk.119.1567390042918; Sun, 01 Sep 2019 19:07:22 -0700 (PDT) MIME-Version: 1.0 References: <20190829042957.150929-1-cychiang@chromium.org> In-Reply-To: From: Cheng-yi Chiang Date: Mon, 2 Sep 2019 10:06:55 +0800 Message-ID: Subject: Re: [PATCH] drm: dw-hdmi-i2s: enable audio clock in audio_startup To: Jonas Karlman Cc: "linux-kernel@vger.kernel.org" , "alsa-devel@alsa-project.org" , "tzungbi@chromium.org" , "zhengxing@rock-chips.com" , "kuninori.morimoto.gx@renesas.com" , "a.hajda@samsung.com" , "airlied@linux.ie" , "jeffy.chen@rock-chips.com" , "dianders@chromium.org" , "dri-devel@lists.freedesktop.org" , "cain.cai@rock-chips.com" , "linux-rockchip@lists.infradead.org" , "eddie.cai@rock-chips.com" , "Laurent.pinchart@ideasonboard.com" , "daniel@ffwll.ch" , "enric.balletbo@collabora.com" , "dgreid@chromium.org" , "sam@ravnborg.org" , "linux-arm-kernel@lists.infradead.org" , Neil Armstrong , Jernej Skrabec Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 1, 2019 at 6:04 PM Jonas Karlman wrote: > > On 2019-08-29 06:29, Cheng-Yi Chiang wrote: > > In the designware databook, the sequence of enabling audio clock and > > setting format is not clearly specified. > > Currently, audio clock is enabled in the end of hw_param ops after > > setting format. > > > > On some monitors, there is a possibility that audio does not come out. > > Fix this by enabling audio clock in audio_startup ops > > before hw_param ops setting format. > > > > Signed-off-by: Cheng-Yi Chiang > > --- > > drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c | 9 +++++++++ > > 1 file changed, 9 insertions(+) > > > > diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c > > index 5cbb71a866d5..08b4adbb1ddc 100644 > > --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c > > +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c > > @@ -69,6 +69,14 @@ static int dw_hdmi_i2s_hw_params(struct device *dev, void *data, > > hdmi_write(audio, conf0, HDMI_AUD_CONF0); > > hdmi_write(audio, conf1, HDMI_AUD_CONF1); > > > > + return 0; > > +} > > + > > +static int dw_hdmi_i2s_audio_startup(struct device *dev, void *data) > > +{ > > + struct dw_hdmi_i2s_audio_data *audio = data; > > + struct dw_hdmi *hdmi = audio->hdmi; > > + > > dw_hdmi_audio_enable(hdmi); > > > > return 0; > > @@ -105,6 +113,7 @@ static int dw_hdmi_i2s_get_dai_id(struct snd_soc_component *component, > > } > > > > static struct hdmi_codec_ops dw_hdmi_i2s_ops = { > > + .audio_startup = dw_hdmi_i2s_audio_startup, > > A small white space nit, there should be a tab and not space to align the equal sign above. ACK. Will fix in v2. > > Also this patch do not cleanly apply to drm-misc-next or linux-next after > fc1ca6e01d0a "drm/bridge: dw-hdmi-i2s: add .get_eld support" was merged. ACK. Will rebase in v2. > > > > > This patch does fix an issue I have observed on my Rockchip devices where audio would not always > came out after switching between audio streams having different rate and channels parameters. > I used to carry [1] to fix that issue, but this seems like a more sane fix. > > [1] https://github.com/Kwiboo/linux-rockchip/commit/4862e4044532b8b480fa3a0faddc197586623808 > > With above fixed, > > Reviewed-by: Jonas Karlman Thanks a lot! > > > Regards, > Jonas > > > .hw_params = dw_hdmi_i2s_hw_params, > > .audio_shutdown = dw_hdmi_i2s_audio_shutdown, > > .get_dai_id = dw_hdmi_i2s_get_dai_id, >