Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2737939pxb; Mon, 31 Jan 2022 03:16:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJyOGlacsQMHhJOW7V/gGuAXg/Jj/4PUdvJqq+liWBFS0VQnMOUDhWavLiNXuOFn4n/IyE/O X-Received: by 2002:a17:907:2d06:: with SMTP id gs6mr16909094ejc.177.1643627791448; Mon, 31 Jan 2022 03:16:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643627791; cv=none; d=google.com; s=arc-20160816; b=owzkYLkzUNViKgHWFhGgoZ9pNOa2KRGitnv3xBawgknu4BOqpRKRBeaz/jDsMZE7Ms 7ORN9oI4GkXSMf8Rxeke3hGQhFCD31Xm1x9qMED0x/sgd7zpQRGjtXsmN4HKlfxrjZrn Qt+58Dzwq64BiMbqznnlBUduOW6LxmqXm4xWEW+EYjZwx558saxpCUmnrk8Efu/OTSRg yV3kcHCEAJRXaR0pLEfVvxKoPkEveBRcPsnMYT/EtlovwMa8oTqz5RQ/WQduvV7h147k 6VvIZqV69lijIU6NRZ6+O1DlOq8dvgZl/kUYggX/CmH0itcj565ld0g017QXVGTpYE5i hUpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Cf7OAoPDkDYDyJ+YdWsUoov/cWTeNL2iMplb2533y8o=; b=t2LcHmgDDJlUItVnCOjYVcQgu5XVTqB0xNFho6n6Wzf8k0YcwW+hxZFp26Bp9PShn0 CbW3gz7tw63GcKMiHKvssX9ZYpqYM0w2visFbzw+k9uEQ3Byn3Hk81LndFpL0pY24GPv 8wp4X6iP9YfX2W2Y9UcFsJE31pfWs+AoMTiH85OCP9tYvr/GWqpCqHuY9l4Ogv2Mar4Y g23Qkogs3mQeqElSvpMuwoFIVWYv/v7+qWRHg8ZQXBZyKFqv0O8A+rtTJGA5TG3NWo8N nnmLjiKeVuHYacZm12q5OW07Ldn5bbJiAHGVAXSUiEBL0LiCn04XgAy8U25AAkQKd46u 0mhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RuD7sdvo; 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 r14si7530116edw.155.2022.01.31.03.16.06; Mon, 31 Jan 2022 03:16:31 -0800 (PST) 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=k20201202 header.b=RuD7sdvo; 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 S1349991AbiA1QRc (ORCPT + 99 others); Fri, 28 Jan 2022 11:17:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349986AbiA1QRa (ORCPT ); Fri, 28 Jan 2022 11:17:30 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E40A5C061714; Fri, 28 Jan 2022 08:17:29 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8C94DB82025; Fri, 28 Jan 2022 16:17:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5E6DEC36AE2; Fri, 28 Jan 2022 16:17:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1643386647; bh=nxlbZsy8Q2SWe4ga/LjTbDUaRa0eP0r7WRbq2+PkVTY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RuD7sdvoMr8QES3FX3rcpoeDNwdSeUFh+KgUSLBbBnwUafMuhGbKt4ORG1zA2Jhc5 tRlHNjal9W7TDfURiSmz/y13RRHv62GwB5XUc0+XpkUzlYQ+0w3OIGF1DiD09fAfuu H7+0LKem2Abml7fczXH9hmZpi7XOX5HhLaD+3hRaXrHk5/jqNnsIURjaALX42JyY/1 5kwGuByVxdOWIi/TO59MBMrxbSmpJ/SYJetO3WYE6tk77vDVU3oMsWVfj8gIwywmLN jpdxHNTvz1+dRBNPqF6QooLBCDaOtnqYvxknH/4bAgebDaZq6hF+MLlxBhmgupZESO InfSyk+Huhipg== Received: by mail-ej1-f46.google.com with SMTP id s5so17660839ejx.2; Fri, 28 Jan 2022 08:17:27 -0800 (PST) X-Gm-Message-State: AOAM530/4sNfjSkBPKI1WUw7RvbYH+mbYOiVLCywOJ1MrSpZDCgQ8RPp pXhBVUhY1sMFKwlJHN3EFEtHWvlxCf/cGWIPSA== X-Received: by 2002:a17:907:a089:: with SMTP id hu9mr7611025ejc.680.1643386645417; Fri, 28 Jan 2022 08:17:25 -0800 (PST) MIME-Version: 1.0 References: <20220128120718.30545-1-yongqiang.niu@mediatek.com> <20220128120718.30545-3-yongqiang.niu@mediatek.com> In-Reply-To: <20220128120718.30545-3-yongqiang.niu@mediatek.com> From: Chun-Kuang Hu Date: Sat, 29 Jan 2022 00:17:14 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1, 2/4] soc: mediatek: add mtk mutex support for MT8186 To: Yongqiang Niu Cc: Chun-Kuang Hu , Rob Herring , Matthias Brugger , Philipp Zabel , David Airlie , Daniel Vetter , Jassi Brar , Fabien Parent , Dennis YC Hsieh , DTML , Linux ARM , "moderated list:ARM/Mediatek SoC support" , linux-kernel , DRI Development , Project_Global_Chrome_Upstream_Group@mediatek.com, Hsin-Yi Wang Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Yongqiang: Yongqiang Niu =E6=96=BC 2022=E5=B9=B41=E6=9C= =8828=E6=97=A5 =E9=80=B1=E4=BA=94 =E4=B8=8B=E5=8D=888:07=E5=AF=AB=E9=81=93= =EF=BC=9A > > Add mtk mutex support for MT8186 SoC. > > Signed-off-by: Yongqiang Niu > --- > drivers/soc/mediatek/mtk-mutex.c | 45 ++++++++++++++++++++++++++++++++ > 1 file changed, 45 insertions(+) > > diff --git a/drivers/soc/mediatek/mtk-mutex.c b/drivers/soc/mediatek/mtk-= mutex.c > index 2ca55bb5a8be..ebd95fd0f36e 100644 > --- a/drivers/soc/mediatek/mtk-mutex.c > +++ b/drivers/soc/mediatek/mtk-mutex.c > @@ -26,6 +26,23 @@ > > #define INT_MUTEX BIT(1) > > +#define MT8186_MUTEX_MOD_DISP_OVL0 0 > +#define MT8186_MUTEX_MOD_DISP_OVL0_2L 1 > +#define MT8186_MUTEX_MOD_DISP_RDMA0 2 > +#define MT8186_MUTEX_MOD_DISP_COLOR0 4 > +#define MT8186_MUTEX_MOD_DISP_CCORR0 5 > +#define MT8186_MUTEX_MOD_DISP_AAL0 7 > +#define MT8186_MUTEX_MOD_DISP_GAMMA0 8 > +#define MT8186_MUTEX_MOD_DISP_POSTMASK0 9 > +#define MT8186_MUTEX_MOD_DISP_DITHER0 10 > +#define MT8186_MUTEX_MOD_DISP_RDMA1 17 > + > +#define MT8186_MUTEX_SOF_SINGLE_MODE 0 > +#define MT8186_MUTEX_SOF_DSI0 1 > +#define MT8186_MUTEX_SOF_DPI0 2 > +#define MT8186_MUTEX_EOF_DSI0 (MT8186_MUTEX_SOF_DSI0 << 6) > +#define MT8186_MUTEX_EOF_DPI0 (MT8186_MUTEX_SOF_DPI0 << 6) > + > #define MT8167_MUTEX_MOD_DISP_PWM 1 > #define MT8167_MUTEX_MOD_DISP_OVL0 6 > #define MT8167_MUTEX_MOD_DISP_OVL1 7 > @@ -226,6 +243,19 @@ static const unsigned int mt8183_mutex_mod[DDP_COMPO= NENT_ID_MAX] =3D { > [DDP_COMPONENT_WDMA0] =3D MT8183_MUTEX_MOD_DISP_WDMA0, > }; > > +static const unsigned int mt8186_mutex_mod[DDP_COMPONENT_ID_MAX] =3D { > + [DDP_COMPONENT_AAL0] =3D MT8186_MUTEX_MOD_DISP_AAL0, > + [DDP_COMPONENT_CCORR] =3D MT8186_MUTEX_MOD_DISP_CCORR0, > + [DDP_COMPONENT_COLOR0] =3D MT8186_MUTEX_MOD_DISP_COLOR0, > + [DDP_COMPONENT_DITHER] =3D MT8186_MUTEX_MOD_DISP_DITHER0, > + [DDP_COMPONENT_GAMMA] =3D MT8186_MUTEX_MOD_DISP_GAMMA0, > + [DDP_COMPONENT_OVL0] =3D MT8186_MUTEX_MOD_DISP_OVL0, > + [DDP_COMPONENT_OVL_2L0] =3D MT8186_MUTEX_MOD_DISP_OVL0_2L, > + [DDP_COMPONENT_POSTMASK0] =3D MT8186_MUTEX_MOD_DISP_POSTMASK0, > + [DDP_COMPONENT_RDMA0] =3D MT8186_MUTEX_MOD_DISP_RDMA0, > + [DDP_COMPONENT_RDMA1] =3D MT8186_MUTEX_MOD_DISP_RDMA1, > +}; > + > static const unsigned int mt8192_mutex_mod[DDP_COMPONENT_ID_MAX] =3D { > [DDP_COMPONENT_AAL0] =3D MT8192_MUTEX_MOD_DISP_AAL0, > [DDP_COMPONENT_CCORR] =3D MT8192_MUTEX_MOD_DISP_CCORR0, > @@ -264,6 +294,12 @@ static const unsigned int mt8183_mutex_sof[MUTEX_SOF= _DSI3 + 1] =3D { > [MUTEX_SOF_DPI0] =3D MT8183_MUTEX_SOF_DPI0 | MT8183_MUTEX_EOF_DPI= 0, > }; > > +static const unsigned int mt8186_mutex_sof[MUTEX_SOF_DSI3 + 1] =3D { > + [MUTEX_SOF_SINGLE_MODE] =3D MUTEX_SOF_SINGLE_MODE, > + [MUTEX_SOF_DSI0] =3D MT8186_MUTEX_SOF_DSI0 | MT8186_MUTEX_EOF_DSI= 0, > + [MUTEX_SOF_DPI0] =3D MT8186_MUTEX_SOF_DPI0 | MT8186_MUTEX_EOF_DPI= 0, > +}; > + > static const struct mtk_mutex_data mt2701_mutex_driver_data =3D { > .mutex_mod =3D mt2701_mutex_mod, > .mutex_sof =3D mt2712_mutex_sof, > @@ -301,6 +337,13 @@ static const struct mtk_mutex_data mt8183_mutex_driv= er_data =3D { > .no_clk =3D true, > }; > > +static const struct mtk_mutex_data mt8186_mutex_driver_data =3D { > + .mutex_mod =3D mt8186_mutex_mod, > + .mutex_sof =3D mt8186_mutex_sof, > + .mutex_mod_reg =3D MT8183_MUTEX0_MOD0, > + .mutex_sof_reg =3D MT8183_MUTEX0_SOF0, > +}; > + > static const struct mtk_mutex_data mt8192_mutex_driver_data =3D { > .mutex_mod =3D mt8192_mutex_mod, > .mutex_sof =3D mt8183_mutex_sof, > @@ -540,6 +583,8 @@ static const struct of_device_id mutex_driver_dt_matc= h[] =3D { > .data =3D &mt8173_mutex_driver_data}, > { .compatible =3D "mediatek,mt8183-disp-mutex", > .data =3D &mt8183_mutex_driver_data}, > + { .compatible =3D "mediatek,mt8186-disp-mutex", Add "mediatek,mt8186-disp-mutex" to binding document. Regards, Chun-Kuang. > + .data =3D &mt8186_mutex_driver_data}, > { .compatible =3D "mediatek,mt8192-disp-mutex", > .data =3D &mt8192_mutex_driver_data}, > {}, > -- > 2.25.1 >