Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1700296pxb; Thu, 16 Sep 2021 13:20:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5Fa4upThpAs3vB5qprTRaLGWemnSdC2UK/WjGFa0+NFpuB3iJH4XUD+bhtWJMCkFlmnpd X-Received: by 2002:a17:906:368e:: with SMTP id a14mr8140828ejc.60.1631823618966; Thu, 16 Sep 2021 13:20:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631823618; cv=none; d=google.com; s=arc-20160816; b=fg+4pW8Gi9T0ePXqiCIGllhCPokymz0CblnZxjihnkQEl73AUP66Dfs7HFpOh7/Kij D9Qjs3mjdytxnwvCvseWPTCc7a/6JtCd4uGHcVlLWkBs6d4ZxzFuek+Lwz77Ad/4DMMF kLKru4iPx2e52ca9z7ocHms632MBn7v0G9k/zR0r3NPaRcPhCJwOm6+m5EJn7PHDVCtI suSOudB0EVIqDzD7CQzePAuO8nzACDvoSrsuyFWByGX/TB+XoEaWstP83Yo9rJ7d+ZGb 4bTtBYg8Dg3K2sttFJfdPoBadnNz387taZzVQW27EtpgjyjY0ubqo0Sgrzxn1E1wGjBN BGVA== 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=3S6OeqHjj+HGmts1fpFzITInJ5rRDpLLosNLcV9sGho=; b=G9t9PvgsGUs/Ki02eJpQOcf8lL+CFkZXTJIeBsPUMGVzBAD0wrkaYwDCCHdLTBmiwi Xg+HZeibr9aupoPOhLyzYn3H8QENUgPU9hku3sJ1OPrx/oz/Om3NPWV+SqGXeWFNGizn F4OubsWT+LZ9uOZFJZ9AelbwrkrQ5q+r057/nHu3pF/tZ5b7cXGD+DShCZGWZ5vbs7ed qAVbRHu/0O+/9vE7lDXElPmhBLkyYarjtHhVLDH9NLVmUeYZQEZxd5t+l0VmcGLcvsj4 qJtPlaRC4jp+o/+uorVj5TsHSLhFolMes+pDAm/2s088XJ0InDYIcU3AmXwvBrT+oEBe z8fQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MKjuXSZG; 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 hq33si4518494ejc.437.2021.09.16.13.19.55; Thu, 16 Sep 2021 13:20:18 -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=MKjuXSZG; 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 S241572AbhIPQVo (ORCPT + 99 others); Thu, 16 Sep 2021 12:21:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:48608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237082AbhIPQM7 (ORCPT ); Thu, 16 Sep 2021 12:12:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7442161368; Thu, 16 Sep 2021 16:09:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631808576; bh=l6otXLWJKbzqWhRfS+K84WrcdbPANIzdtDGgV0fqRvo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MKjuXSZGXu40w65tjWpVu494O3eF6F+/p3ahzy2JZr240XJIUhRwyAoQVV2tTX6vd jF8KgaZ0g355jyjGmuRrfcQO7pU5IFV8q3FRyXv3nbaomVE7BYccsY/aDlCrlnh+s2 3qRo2FNXgsHYUs3iSe6Px+e6SKXbaHhW33R5ki5Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dom Cobley , Maxime Ripard , Nicolas Saenz Julienne , Sasha Levin Subject: [PATCH 5.10 110/306] drm/vc4: hdmi: Set HD_CTL_WHOLSMP and HD_CTL_CHALIGN_SET Date: Thu, 16 Sep 2021 17:57:35 +0200 Message-Id: <20210916155757.826598346@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155753.903069397@linuxfoundation.org> References: <20210916155753.903069397@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: Dom Cobley [ Upstream commit 1698ecb218eb82587dbfc71a2e26ded66e5ecf59 ] Symptom is random switching of speakers when using multichannel. Repeatedly running speakertest -c8 occasionally starts with channels jumbled. This is fixed with HD_CTL_WHOLSMP. The other bit looks beneficial and apears harmless in testing so I'd suggest adding it too. Documentation says: HD_CTL_WHILSMP_SET Wait for whole sample. When this bit is set MAI transmit will start only when there is at least one whole sample available in the fifo. Documentation says: HD_CTL_CHALIGN_SET Channel Align When Overflow. This bit is used to realign the audio channels in case of an overflow. If this bit is set, after the detection of an overflow, equal amount of dummy words to the missing words will be written to fifo, filling up the broken sample and maintaining alignment. Signed-off-by: Dom Cobley Signed-off-by: Maxime Ripard Reviewed-by: Nicolas Saenz Julienne Link: https://patchwork.freedesktop.org/patch/msgid/20210525132354.297468-7-maxime@cerno.tech Signed-off-by: Sasha Levin --- drivers/gpu/drm/vc4/vc4_hdmi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index c58b8840090a..ee293f061f0a 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1074,7 +1074,9 @@ static int vc4_hdmi_audio_trigger(struct snd_pcm_substream *substream, int cmd, HDMI_WRITE(HDMI_MAI_CTL, VC4_SET_FIELD(vc4_hdmi->audio.channels, VC4_HD_MAI_CTL_CHNUM) | - VC4_HD_MAI_CTL_ENABLE); + VC4_HD_MAI_CTL_WHOLSMP | + VC4_HD_MAI_CTL_CHALIGN | + VC4_HD_MAI_CTL_ENABLE); break; case SNDRV_PCM_TRIGGER_STOP: HDMI_WRITE(HDMI_MAI_CTL, -- 2.30.2