From patchwork Wed Jan 5 23:27:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 530180 Delivered-To: patch@linaro.org Received: by 2002:ad5:544f:0:0:0:0:0 with SMTP id a15csp708614imp; Wed, 5 Jan 2022 15:27:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYtw40swjRFS2CRtu0zbxIOKSwZSEafNNv943rEfrFVAVWHM2rFvatDL0fp5HSMgPDJCDE X-Received: by 2002:a63:894a:: with SMTP id v71mr49153391pgd.29.1641425234787; Wed, 05 Jan 2022 15:27:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1641425234; cv=none; d=google.com; s=arc-20160816; b=mycFSZYKJa8QbUCU9LiNna0ASzJOvXatj5TBeMwQpW0bOtxMr5rArg+j7irSU+S9qE m6/UrhKnW4TF5mNCr5YfY7Rnmv1bSt8lti7wIqvWUyZACEbGhUUNLX5pXEGAsuUGIQQh qto6YwRFqco2jtpK8dyVq2+n2zVGqr0XgVAVmAa8oxOjiudxOyBpFKGAmm83qaCGyDTg JCEySH95WZEyHr6jHNyUeQlBpR7V0KvhHz5GXgHwne3WCJfa9xtmuUYuJi3itZk0iq/C 5jV13HXOsGi4XYovezH3m2lxIFgUxX/djIYncZ6n4Inb/OdYKpyeENFrZHJ7IoCIcvqi bkZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=58QAv1zSqapbnHsZYOklL7IQDyaDq+jkAqsKjvZ/E/Y=; b=R/QOzQ1eND+1WI3aFN5T+o2F7orp9zk/ge0O/Bg+FJzJYjhQDmWf2l49f4v2gPRIgA TbVUhz3K8Vr1qGLaY/dqzURbk50rzY0QYp+Gy5K2GELod4G87C+fCn9C+TIY0htmgrZ0 zCoFnDqvPluSPaFz4dih4hOtTFSdoibV9Ig7WuTALylGHFpLzo50VQJ96MZSh0txSG7o 6CiNcLjLU1l7SlZHxNXTrqFB7jwU5YZbDavss441eYhuMJFTmDcm0bW7D1uGJx2e8eUo h5/caVOjVrSG3ok98NU2q5WH+P1VYPo0UfmM/6LMGTHo64aoegSUwEvC2uk7p+P4SE47 y4Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Kjo4mVSx; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id g12si295212plt.121.2022.01.05.15.27.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 15:27:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Kjo4mVSx; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 43DB210E442; Wed, 5 Jan 2022 23:27:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com [IPv6:2a00:1450:4864:20::22c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0A3B610E43B for ; Wed, 5 Jan 2022 23:27:05 +0000 (UTC) Received: by mail-lj1-x22c.google.com with SMTP id q8so1275461ljp.9 for ; Wed, 05 Jan 2022 15:27:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=58QAv1zSqapbnHsZYOklL7IQDyaDq+jkAqsKjvZ/E/Y=; b=Kjo4mVSxgdH4TDW8ccNVmTg4lD4jQFmHJ5XOzqcVYOLjEKC6Zeflsn9RzSmdr90VEn 8lM/BK9c3lWY5TXLjoMjZf1kKCw7bVUFnUGFk02Q/jQ7glLeBjO0fdf9rl0ydOfdCKh0 FkEZja32ca5ytgYGMOOJKMu8Cn0FPrTT5asw+7//viYk/mWoBJNxooRn9WyzId59uVNZ JMQJJb5Ktw9s07kp45mknpnTh5e9cXkfPZE6w3KGsxs1u2leE97FqznK3oJWpn85duzg vhhWQ4U7jLFuHC0HeU0lS+bKEg6opDmwxHC3yGZW5WlAzDbhdC2APq/OE5Zf3lopuRDy t0+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=58QAv1zSqapbnHsZYOklL7IQDyaDq+jkAqsKjvZ/E/Y=; b=af0tOl2dPoYRMJQGxckVnWp9yShxWpqp0WOkzlCgmyVUZ9ENRGUaqRwiKlZzMVq0cg bC8uFTjE1tESL/P9vXtRGGsYid2dP98t1t97gPxSrOw9DW4jldsuUQN0uP4Sg5rFVe4R Bvoxe5yM1JvXNxt0+6JRCbBR8VSrz7Ir2+u4Lj+3Zni1qcXgJFUjzz5ZPFaE/48w7E1S 16g5qFau5apqhsRA0hDprinTWwJKuqCUGoUpV88igCi5KjKFQvk41FX2l7AlLjaKouRQ HCRl1pUGBOnxNmOWup2o6QsjdkG5OryHWfhgpgJFajQP+A7NIz4LU+U6eFLXPkYXq4F8 KqPg== X-Gm-Message-State: AOAM530A4q+q+l2eUwh8PehpxIsWbuIPb22rXQMAh4zEqh6hn5Esp+bU f5CjwMOFLj9LJKpouteGLTL6qA== X-Received: by 2002:a2e:9e81:: with SMTP id f1mr45680361ljk.469.1641425223435; Wed, 05 Jan 2022 15:27:03 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id b29sm28730lfv.187.2022.01.05.15.27.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jan 2022 15:27:02 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH v2 3/3] drm/msm: move msm_readl/_writel to msm_drv.h Date: Thu, 6 Jan 2022 02:27:00 +0300 Message-Id: <20220105232700.444170-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220105232700.444170-1-dmitry.baryshkov@linaro.org> References: <20220105232700.444170-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Stephen Boyd , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" With the reglog removal, msm_readl/_writel became single line wrappers around readl/writel. Move those two wrappers and msm_rmw to msm_drv.h to remove need for extra function calls when doing register writes. Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd --- drivers/gpu/drm/msm/msm_drv.c | 20 -------------------- drivers/gpu/drm/msm/msm_drv.h | 14 +++++++++++--- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index 73757b7dc935..fd62a4da14a1 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c @@ -164,26 +164,6 @@ void __iomem *msm_ioremap_size(struct platform_device *pdev, const char *name, return _msm_ioremap(pdev, name, false, psize); } -void msm_writel(u32 data, void __iomem *addr) -{ - writel(data, addr); -} - -u32 msm_readl(const void __iomem *addr) -{ - u32 val = readl(addr); - - return val; -} - -void msm_rmw(void __iomem *addr, u32 mask, u32 or) -{ - u32 val = msm_readl(addr); - - val &= ~mask; - msm_writel(val | or, addr); -} - static enum hrtimer_restart msm_hrtimer_worktimer(struct hrtimer *t) { struct msm_hrtimer_work *work = container_of(t, diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index 56d1242efcc1..3ab19775a5c3 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -484,9 +484,17 @@ void __iomem *msm_ioremap(struct platform_device *pdev, const char *name); void __iomem *msm_ioremap_size(struct platform_device *pdev, const char *name, phys_addr_t *size); void __iomem *msm_ioremap_quiet(struct platform_device *pdev, const char *name); -void msm_writel(u32 data, void __iomem *addr); -u32 msm_readl(const void __iomem *addr); -void msm_rmw(void __iomem *addr, u32 mask, u32 or); + +#define msm_writel(data, addr) writel((data), (addr)) +#define msm_readl(addr) readl((addr)) + +static inline void msm_rmw(void __iomem *addr, u32 mask, u32 or) +{ + u32 val = msm_readl(addr); + + val &= ~mask; + msm_writel(val | or, addr); +} /** * struct msm_hrtimer_work - a helper to combine an hrtimer with kthread_work