Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4714422pxa; Mon, 10 Aug 2020 16:37:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVNLknJ2NnwVhCwnaIYqo1N4P0V1T+khE5hRCTfw4Yi2fkHxiLvy9O4v7fOEIRUCkremDy X-Received: by 2002:a17:906:e289:: with SMTP id gg9mr25097829ejb.448.1597102631653; Mon, 10 Aug 2020 16:37:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597102631; cv=none; d=google.com; s=arc-20160816; b=ZtPn7FigMBsbDtMdngLG5HGyAHpslxF+FI86RWJJYv4NaPxEGViRAA0By5OOn7MlGS 0V8i2TxmUoQ2XWY112b1bo2xX50YLTHImPYVd99zzEBL2h7uaNwhoUwbeUuBfNeyomP6 ey60+yJZttXHw+OJw9LEi1Ai8UhqmOi3Vob/2Dw9yjYoxbEby64C1kVy9pqJKewZl9lz xsho7CnGaAbJ+JKTB7d2TpwFbkqu3wCKM8+MfUJI4ATRgXr4e0CjuTVsy+Zz8WMOBptT B81OZcFHs9DJfDBK8uACRPot4UY/44yYzbuuyG08pyYx7fNeOHXlzVXO+LB6VO5lnN5R 3ucQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=zfWCNhDugKVapx57h6VxfTwE9DV/AZUPRQ9JKSNFQ8A=; b=bBiq9nBgA1yQJanyBBBP5WKXbiqqiR4hWQLVzZjU5CW/gMx90T3JKucwZN/9mxNpQ8 kxr6RIT9/FeYX+SNOHzEy+g2+Hepvo9wxuty6PK5zaw2oKSktSQSkpHHl58uCkC1A2PU IzMDrRsNQkFe3uKmB3QV/Y8LYyIcPb4xX9JJr3zLrw1gjWGpgs2wt5fbEpYjbKI2yM/J l6C9pJKWdEj7Ihi1f1SGtfhDx8PrH6SLGdoV4Z7VR09cK8WlSWylRCwWnUngTnxjRZDJ Qr2CEvNxNWfD0LBtkOQcOMkhuCKD3LncpJUo7evPSsZeEXnyp5JaCIWsaH2HbpBMSoA0 WlLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vBW9u2ml; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id zg2si11708525ejb.183.2020.08.10.16.36.38; Mon, 10 Aug 2020 16:37:11 -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=@kernel.org header.s=default header.b=vBW9u2ml; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726998AbgHJXfZ (ORCPT + 99 others); Mon, 10 Aug 2020 19:35:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:57472 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726859AbgHJXfZ (ORCPT ); Mon, 10 Aug 2020 19:35:25 -0400 Received: from mail-ej1-f43.google.com (mail-ej1-f43.google.com [209.85.218.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8014E2075D; Mon, 10 Aug 2020 23:35:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597102524; bh=mUFFmkou94l0+oI7TalaQjtTqBSFTvrCHtwnmz6LL0A=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=vBW9u2mlbk5HoC5arbS7XOKaq/n3mNVP07JZtF9T6scT1DVVIeBJqU1VYp5xuk/Yn 4FBVO3aOU5SVhzZLb1x+ovVr9CuYnZuaAJAbppWuHOUphiM+H4QnI3UuYWb5JrcMPm L/7l50z+giBwjQtpb4bayVeukl18kzJK9afq3cWY= Received: by mail-ej1-f43.google.com with SMTP id a26so11151962ejc.2; Mon, 10 Aug 2020 16:35:24 -0700 (PDT) X-Gm-Message-State: AOAM533ooCUsnP8767vqt83ho+APFWpB77Ot4DJTW9IrKp6BFUSzPqw2 L22nHiKVfxPmP8Cz1IQuYA1J32PbQfiCb+oDlQ== X-Received: by 2002:a17:906:2356:: with SMTP id m22mr23377263eja.124.1597102523075; Mon, 10 Aug 2020 16:35:23 -0700 (PDT) MIME-Version: 1.0 References: <1596855231-5782-1-git-send-email-yongqiang.niu@mediatek.com> <1596855231-5782-4-git-send-email-yongqiang.niu@mediatek.com> In-Reply-To: <1596855231-5782-4-git-send-email-yongqiang.niu@mediatek.com> From: Chun-Kuang Hu Date: Tue, 11 Aug 2020 07:35:10 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RESEND v7, PATCH 3/7] mtk-mmsys: add mmsys private data To: Yongqiang Niu Cc: CK Hu , Philipp Zabel , Rob Herring , Matthias Brugger , Mark Rutland , devicetree@vger.kernel.org, David Airlie , linux-kernel , DRI Development , "moderated list:ARM/Mediatek SoC support" , Daniel Vetter , Linux ARM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Yongqiang: Yongqiang Niu =E6=96=BC 2020=E5=B9=B48=E6=9C= =888=E6=97=A5 =E9=80=B1=E5=85=AD =E4=B8=8A=E5=8D=8810:56=E5=AF=AB=E9=81=93= =EF=BC=9A > > the reason why split out display connection function: > 1. there will more and more Mediatek Soc upstream, and the display path > connection function mtk_mmsys_ddp_mout_en, mtk_mmsys_ddp_sel_in and > mtk_mmsys_ddp_sout_sel will complicated more and more > 2. many of the connection are only used in some SoC, and useless for > other SoC and not readable, > 3. if we add a new SoC connection, we need check is this affect other > Soc > > the reason why not apply the previous series method: > this version is more readable and clear > if go on use v6, except mt2701/mt8173/mt2712, we need add two more > private data array for mt6779 and mt6797, and the connect function > will add more if/else usecase > > move current display connection function into mt2701-mmsys.c > keep mt2701/mt8173/mt2712/mt6779/mt6797 with original version > connection function > the corresponded SoC upstream member will coding these and test it > on the SoC if it is need. > For this patch, I prefer [1]'s implementation. In [1], for each SoC, the only difference is an array for routing register setting. In this patch, the difference are three function which is more complicated than [1]. If you like, you could pick [1] to upstream. [1] https://chromium-review.googlesource.com/c/chromiumos/third_party/kerne= l/+/2345186 Regards, Chun-Kuang. > Signed-off-by: Yongqiang Niu > --- > drivers/soc/mediatek/Makefile | 1 + > drivers/soc/mediatek/mmsys/Makefile | 2 + > drivers/soc/mediatek/mmsys/mt2701-mmsys.c | 250 ++++++++++++++++++++++++= +++ > drivers/soc/mediatek/mtk-mmsys.c | 271 +++++-------------------= ------ > include/linux/soc/mediatek/mtk-mmsys.h | 15 ++ > 5 files changed, 314 insertions(+), 225 deletions(-) > create mode 100644 drivers/soc/mediatek/mmsys/Makefile > create mode 100644 drivers/soc/mediatek/mmsys/mt2701-mmsys.c >