Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp440127rwb; Thu, 1 Dec 2022 04:17:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf4ZJqQ4MtK8jJSxOCga51CmyYXhFrv0MxiHtZm4CTHrDFHZGxZ1HlevJaVCCua9l7tF9zVD X-Received: by 2002:a17:90a:4e41:b0:218:a971:d847 with SMTP id t1-20020a17090a4e4100b00218a971d847mr55120082pjl.91.1669897068671; Thu, 01 Dec 2022 04:17:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669897068; cv=none; d=google.com; s=arc-20160816; b=BTimNlpC/JrtdXtxLWiFZ/WrDFgKNgvUNrd1ByZbIZ4YXZftWQkmi6RaJpJ5IGq7BV hDu0OPk1hy4GvVyjzX7tskMGgeSB4f8kGXehYqMbYWUL1L2SB7EuHdHboIcsWMpML1Vw mYjJ2Qyoclh+7UB5nH2ZVecyRq8ve6nmZPRV4jF5D8NtW537rd50hohdCr/4IB6D/SUl NvxQIvdcx2bI7H8RhDHc5p6/Ja/IwIjKf+RgQN6I8WifYereuO7gvSUzXYWmHrUYVYtu 5KU9frzJ6XBaUTG7jeMo5Iv3rrgCOn2pJ2SSwW0kjkQdPdoWz2D3MS23eWAL/Js6FzNb oXqg== 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=qE/q8OTGX/vukPXHLJF5f0ZobL7IbidYs5xkC1/4Glo=; b=YF+B+lmHvF0A3CGjwUcjpH/l+AuYH6EJbSGScjz7O1STnXlB1jahoYZq7S5qu2l56n bxFSESfJhnkr9yx3qiGJFxJovD2u/uM/CdlmSisxot28VgV+q0Goks2R8DHY2qrL+b6w wpBWXTvjqlFb7J31rzB1XWad+8C1/PspcjazLMWdPsUdAaRngj0IxdeUlxvT9NWlrLmY iZmLrS+yVpRkvU+i9Z7YpQZ8ViYAUTLeQh3cfS3gGim0HBmtKuaJbALYnPBFnJZroI35 7gwt+9A0JS2SMKvMW2g/TaM122cBZsyGjSsNm3j8E/f0aK1vOfWNhHlFdlbE9JwwjiP9 Cvbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="EzvNjsK/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id om2-20020a17090b3a8200b00213625eee7fsi8181405pjb.106.2022.12.01.04.17.36; Thu, 01 Dec 2022 04:17:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="EzvNjsK/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231144AbiLALpY (ORCPT + 82 others); Thu, 1 Dec 2022 06:45:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231191AbiLALpJ (ORCPT ); Thu, 1 Dec 2022 06:45:09 -0500 Received: from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com [IPv6:2607:f8b0:4864:20::e35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 750ACA0579 for ; Thu, 1 Dec 2022 03:45:07 -0800 (PST) Received: by mail-vs1-xe35.google.com with SMTP id 128so1262439vsz.12 for ; Thu, 01 Dec 2022 03:45:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qE/q8OTGX/vukPXHLJF5f0ZobL7IbidYs5xkC1/4Glo=; b=EzvNjsK/64biWBOqAzlM7ZmFo/qswGF8E2psYeSj0xdD6287yOJeqmtxtWiDCeeRne HLae+HG1stNZu59moUdMxeVYOQDp9sfWFNA6V3VypSXCAVupelhw74Ch1etHO5XDWI0m ybBlh0c2Z/irb2/MSL4MDBPlinBeHrffEoJ60= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qE/q8OTGX/vukPXHLJF5f0ZobL7IbidYs5xkC1/4Glo=; b=6CNjBzd2uXBXxzpykE19RF8z1v8T/5elGcgpUsIU1wUur1/zz5FCqobSKJmV1jJTtn jnM30P7oSMzF/dW6yqxbB4nRbtk3YpsaBfPC80C+lmdVmbitGSGDMQn4Rk+byQIN8Psx UVg/s1eI84McSd4KX58p05uJxehgro0uq0RscvW9DHhG2S0n5nBC4jdZKmu3tWCpO4me ZbKoMgW0B9+Lit4yyXul0KY4rLajmED5JERh5U2KVMAfi50rouzpFzsG8kC6qcWg+RaP HuBdICNBfVLyu+KoQnLh71wrCRfSLRN/wlQWpcmMf40dw4lkz3wYjxAs3WURFUF/om49 KO1Q== X-Gm-Message-State: ANoB5ple/l8VoSVu4XoBv6n1BuQA/t+TQ5+o9fL67TGGsreTxqpX5FDZ /hjG3qcDe0uyiVVWMJ3d80cQ6AhlcKgEBr/GDGHBYw== X-Received: by 2002:a67:c98e:0:b0:3ad:3d65:22b with SMTP id y14-20020a67c98e000000b003ad3d65022bmr28646035vsk.65.1669895106580; Thu, 01 Dec 2022 03:45:06 -0800 (PST) MIME-Version: 1.0 References: <20221107072243.15748-1-nancy.lin@mediatek.com> <20221107072243.15748-6-nancy.lin@mediatek.com> In-Reply-To: <20221107072243.15748-6-nancy.lin@mediatek.com> From: Chen-Yu Tsai Date: Thu, 1 Dec 2022 19:44:55 +0800 Message-ID: Subject: Re: [PATCH v28 05/11] soc: mediatek: refine code to use mtk_mmsys_update_bits API To: "Nancy.Lin" Cc: Rob Herring , Matthias Brugger , Chun-Kuang Hu , Philipp Zabel , wim@linux-watchdog.org, AngeloGioacchino Del Regno , linux@roeck-us.net, nfraprado@collabora.com, devicetree@vger.kernel.org, Project_Global_Chrome_Upstream_Group@mediatek.com, Yongqiang Niu , David Airlie , "jason-jh . lin" , singo.chang@mediatek.com, llvm@lists.linux.dev, Nick Desaulniers , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Nathan Chancellor , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 7, 2022 at 3:23 PM Nancy.Lin wrote: > > Simplify code for update mmsys reg. > > Signed-off-by: Nancy.Lin > Reviewed-by: AngeloGioacchino Del Regno > Reviewed-by: CK Hu > Tested-by: AngeloGioacchino Del Regno > Tested-by: Bo-Chen Chen > Reviewed-by: N=C3=ADcolas F. R. A. Prado > --- > drivers/soc/mediatek/mtk-mmsys.c | 45 ++++++++++++-------------------- > 1 file changed, 16 insertions(+), 29 deletions(-) > > diff --git a/drivers/soc/mediatek/mtk-mmsys.c b/drivers/soc/mediatek/mtk-= mmsys.c > index 9a327eb5d9d7..73c8bd27e6ae 100644 > --- a/drivers/soc/mediatek/mtk-mmsys.c > +++ b/drivers/soc/mediatek/mtk-mmsys.c [...] > @@ -124,27 +129,14 @@ void mtk_mmsys_ddp_disconnect(struct device *dev, > { > struct mtk_mmsys *mmsys =3D dev_get_drvdata(dev); > const struct mtk_mmsys_routes *routes =3D mmsys->data->routes; > - u32 reg; > int i; > > for (i =3D 0; i < mmsys->data->num_routes; i++) > - if (cur =3D=3D routes[i].from_comp && next =3D=3D routes[= i].to_comp) { > - reg =3D readl_relaxed(mmsys->regs + routes[i].add= r); > - reg &=3D ~routes[i].mask; > - writel_relaxed(reg, mmsys->regs + routes[i].addr)= ; > - } > + if (cur =3D=3D routes[i].from_comp && next =3D=3D routes[= i].to_comp) > + mtk_mmsys_update_bits(mmsys, routes[i].addr, rout= es[i].mask, 0); > } > EXPORT_SYMBOL_GPL(mtk_mmsys_ddp_disconnect); > > -static void mtk_mmsys_update_bits(struct mtk_mmsys *mmsys, u32 offset, u= 32 mask, u32 val) > -{ > - u32 tmp; > - > - tmp =3D readl_relaxed(mmsys->regs + offset); > - tmp =3D (tmp & ~mask) | val; > - writel_relaxed(tmp, mmsys->regs + offset); > -} > - > void mtk_mmsys_ddp_dpi_fmt_config(struct device *dev, u32 val) > { > if (val) This hunk now doesn't apply due to soc: mediatek: Add all settings to mtk_mmsys_ddp_dpi_fmt_config func touching mtk_mmsys_ddp_dpi_fmt_config() as well. It's trivial to resolve though. ChenYu