Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2901921pxv; Mon, 12 Jul 2021 04:52:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/hsWtzpHKPbxdJrR19mOEjetl45FXSk4acqdv95PmzW7SGoG4t1eo9ebMavZ68lNVB5Gv X-Received: by 2002:a17:906:edc9:: with SMTP id sb9mr36039016ejb.99.1626090719743; Mon, 12 Jul 2021 04:51:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626090719; cv=none; d=google.com; s=arc-20160816; b=ddiZsIFyPYUuDaQ4dZtBOWc/CtQxIrhTbIsP0LIbSPvV1wMnu0GVsFje0X5oRzHe5x B9Y07soreD9KYDlXuu+hom/DyEAOyNu6gHQbx30QApKC5cnqpaMScZe3P6SktwCvm4rt NgXheR33W/VHOTMsTI89NRvW99DjWkuBZggPFtVoI15j8CwiIJAdT173+oAeF6LTLYxF FG+e8XX3UW8zC66WyNVGpZuvVr8LBfK8O9iLwezPC0IQRZRPlUjRh1VlcUsatoHPedXl cyZRjEMG9MxmYSlJHvomH9DERyIi/ZqvNHUm0hjXaxrpafIaGVCjpPYQ9sADPHKbxZrW m9cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=ZOdc96YFcvm1cT3+FQXaEW2uWnVS0so06S70r05OXpY=; b=1H2sfDALoZWlmqHWij//SaDt+YfPdFTEHybRJ3/3e0gGEUlZ6XIAxVPKc7m+F4TjFD yZTzmvTSb9VQEyV9gqEkFLvrCtrlCLrFxkeS0pavBg+pYB6q1/NgdWXTz2DjR7TOzN2k czymZi5mj5A3oZgeD6BVVRWw3uua83NY4QTqkr56HB741Lxkza0trQ9Z1/HDSr0K2PKh ramJHnbzV1fRzI6B4BQflDrBP0bEFJBw6egQoxkBN35FpMwn1kF85JxmRlOZlMYps+20 Lz+1S6BP93EDXLuj9tpmRQnS6D+GsM0dMEJIRarJfmGnwqvpGvVD5tJcVV6yx7XuLvbr Y8Vg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p8si20811717edj.399.2021.07.12.04.51.36; Mon, 12 Jul 2021 04:51:59 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231986AbhGLLxD (ORCPT + 99 others); Mon, 12 Jul 2021 07:53:03 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:52668 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230457AbhGLLxD (ORCPT ); Mon, 12 Jul 2021 07:53:03 -0400 Received: from [IPv6:2a02:810a:880:f54:e464:19d5:3655:dde7] (unknown [IPv6:2a02:810a:880:f54:e464:19d5:3655:dde7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id B6CA01F42190; Mon, 12 Jul 2021 12:50:13 +0100 (BST) Subject: Re: [PATCH] soc: mediatek: mmsys: fix HDMI output on mt7623/bananapi-r2 To: Frank Wunderlich , linux-mediatek@lists.infradead.org Cc: Frank Wunderlich , Matthias Brugger , CK Hu , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Enric Balletbo Serra , David Airlie , dri-devel@lists.freedesktop.org, Daniel Vetter References: <20210710132431.265985-1-linux@fw-web.de> From: Dafna Hirschfeld Message-ID: <456f0611-1fc7-75ac-ff45-9afd94190283@collabora.com> Date: Mon, 12 Jul 2021 13:50:08 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210710132431.265985-1-linux@fw-web.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi On 10.07.21 15:24, Frank Wunderlich wrote: > From: Frank Wunderlich > > HDMI output was broken on mt7623/BPI-R2 in 5.13 because function for > special output selection (mtk_mmsys_ddp_sout_sel) was dropped. > This function wrote 3 registers at one time and so it is not compatible > with the array-approach. > > I re-added the old function and call this after the default routing table > was applied. This default routing table can still be used as the only > connection handled by mmsys on BPI-R2 is OVL0->RDMA0 and this is already > present in the default routing table > > Fixes: 440147639ac7 ("soc: mediatek: mmsys: Use an array for setting the routing registers") > Signed-off-by: Frank Wunderlich > --- > drivers/soc/mediatek/mtk-mmsys.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-mmsys.c > index 080660ef11bf..f91b7fdd417a 100644 > --- a/drivers/soc/mediatek/mtk-mmsys.c > +++ b/drivers/soc/mediatek/mtk-mmsys.c > @@ -57,6 +57,25 @@ struct mtk_mmsys { > const struct mtk_mmsys_driver_data *data; > }; > > +static void mtk_mmsys_ddp_sout_sel(struct device *dev, > + enum mtk_ddp_comp_id cur, > + enum mtk_ddp_comp_id next) > +{ > + struct mtk_mmsys *mmsys = dev_get_drvdata(dev); > + > + if (cur == DDP_COMPONENT_BLS && next == DDP_COMPONENT_DSI0) { > + writel_relaxed(BLS_TO_DSI_RDMA1_TO_DPI1, > + mmsys->regs + DISP_REG_CONFIG_OUT_SEL); > + } else if (cur == DDP_COMPONENT_BLS && next == DDP_COMPONENT_DPI0) { > + writel_relaxed(BLS_TO_DPI_RDMA1_TO_DSI, > + mmsys->regs + DISP_REG_CONFIG_OUT_SEL); > + writel_relaxed(DSI_SEL_IN_RDMA, > + mmsys->regs + DISP_REG_CONFIG_DSI_SEL); > + writel_relaxed(DPI_SEL_IN_BLS, > + mmsys->regs + DISP_REG_CONFIG_DPI_SEL); you can still use the array approach for this like that: { DDP_COMPONENT_BLS, DDP_COMPONENT_DSI0, DISP_REG_CONFIG_OUT_SEL, BLS_TO_DSI_RDMA1_TO_DPI1 }, { { DDP_COMPONENT_BLS, DDP_COMPONENT_DPI0, DISP_REG_CONFIG_OUT_SEL, BLS_TO_DPI_RDMA1_TO_DSI }, { { DDP_COMPONENT_BLS, DDP_COMPONENT_DPI0, DISP_REG_CONFIG_DSI_SEL, DSI_SEL_IN_RDMA }, { { DDP_COMPONENT_BLS, DDP_COMPONENT_DPI0, DISP_REG_CONFIG_DPI_SEL, DPI_SEL_IN_BLS }, { Thanks, Dafna > + } > +} > + > void mtk_mmsys_ddp_connect(struct device *dev, > enum mtk_ddp_comp_id cur, > enum mtk_ddp_comp_id next) > @@ -71,6 +90,8 @@ void mtk_mmsys_ddp_connect(struct device *dev, > reg = readl_relaxed(mmsys->regs + routes[i].addr) | routes[i].val; > writel_relaxed(reg, mmsys->regs + routes[i].addr); > } > + > + mtk_mmsys_ddp_sout_sel(dev, cur, next); > } > EXPORT_SYMBOL_GPL(mtk_mmsys_ddp_connect); > >