From patchwork Mon Jan 11 04:46:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 360432 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp2568848jai; Sun, 10 Jan 2021 20:47:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJwy+yXwqH3Ebq5/BgkiGdrU5EjIULuxqKxW740x4z0xS3unzBgWK4dFvLVmggpovlTl1HG5 X-Received: by 2002:a62:d142:0:b029:19e:62a0:ca16 with SMTP id t2-20020a62d1420000b029019e62a0ca16mr14627740pfl.46.1610340421327; Sun, 10 Jan 2021 20:47:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610340421; cv=none; d=google.com; s=arc-20160816; b=ok+PiN3qedySbVtQ41iLY+v4mOBmvRWuEGlHX2789RpXfPOmWcxB3J9jBf5NQUAHRH wL1N5txvQAIUMtFUPK6UuwIzcLTE/xj6YZsIVfZIC4NFxc/+VNrJRjTGjsV5KKfKeA4l RB08aY8+USHt2QPOo2JRU0LQhyUKi/ArVC41nOqoXM0ChpPX6rEam9OkeNXLZCOOc24I Fka7TnAs27Pr7+lFtb/ihHPuThwzU5Tz3ky9rzplCW0fPeHgIp6+0KXp/qMlQIfoV0OA fnyFKq27jg7niaYE/vY+3wfZNWUQfPw2joMToG3G+5eBk3CF2sbZEtNUKJHIE7W2XnIr 0/VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:dkim-signature:delivered-to; bh=cjumvhqhoC6ruR3FhhZA+mDG1YwqUKARBeFhGd8Jats=; b=0vA0p2I8t8HMwX2RTEIbImEXqMYCoJJ/JFKHjA+RsItVdmxGsVQSvjjsYs7fiDSXnr hCPY9syo3W7KiouDuL9icQh6tvs8QUbc4kDTRUrHDzkwRAklj0cVhr/a2yccJAVLNKRL T7JY/h2f34us7X/fRynjEgcUYHtlWHGMhnOhabTIIvF2mRmQKUWsBgR9RHHs/qEChFZ/ 63rC93jm3+dVHmCSqyGR7IIpYrF4SAh47IKnErhw/1bvcppKGwXwxCB7fPHESI3gsRgd TpAD4NfnVTg04A6d2fLW59GxEUQzJ+9SqnaMDdDRkJlMmTq7O0UXknLzHurD21Q+Ikp0 LqgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=dw5F35aw; 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 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 c17si17378885plo.393.2021.01.10.20.47.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jan 2021 20:47:01 -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=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=dw5F35aw; 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 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ACAA989B69; Mon, 11 Jan 2021 04:46:56 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6666189B69 for ; Mon, 11 Jan 2021 04:46:56 +0000 (UTC) Received: by mail-pj1-x1030.google.com with SMTP id n3so7669411pjm.1 for ; Sun, 10 Jan 2021 20:46:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MTf0t/g0yj3eP5J//Lhcit/5I+gGR9P17fx+loKYd/M=; b=dw5F35awsAORBgdcbHHhKYguLZM0wNpcAaLrWiMxPHQ4tVm1cEZ3v74VLibe/czHdO pwQ99HhRgX0FOyRYJqxbtB/L1y1De2JhaK4naHS4s5akLQbPjXTSfN1i0DUgeb5Kqx7H FzQcDvVn71rvwYON67M6KQ/mqbMTWBdV7dOXg+Wxllpp9qpOs7sln5VPaFRhvyPZlQtD M++05rDMjs2LTTBELMhAsq6J7QkN3V8myu3QrIDmNvd9d5wTfuLCPPoElPo/izspnJk/ jcY5XjteZxRrgdhmGmnTmQPqsPlEsXcSqoED50FZPgqVdlBcI7d/DQE1zXgl8+rA2HOO yNvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=MTf0t/g0yj3eP5J//Lhcit/5I+gGR9P17fx+loKYd/M=; b=IcG/7VDzb5jtoYkXkKNub2i0Nzl2K6pGGTXafkLyTMsjhGS57zYGvC8wKVVOt+iQAb gEX2ng4Y5VknMO/mx+0jqnzejSWToo0LwTZabpeun3fQ/nGirvcueh4HIvVn9I6wnWkk AwKfMMtivpnU/KDY9nj+8SSVbWH8gCQVgYll+tbFg/Abe0A5AThnweUisWVa4b/XO7G5 k7JeWwNRHibsP0EoGGXqajMV1bSEvf5a6MNH6n1Ten6tlmqgrl37FgerkPuxRvWlqWv9 NrHNx6Ao2EF7kYxJEH+BxQ17IMJm4xkiJw8Az9T0WwKQSWYk4uI49DtREC7hOlIMxR0q uhRQ== X-Gm-Message-State: AOAM532o/K03f/+1XePuvOvVxaJGB+133hgdmPZHMQ8ggBkCAcOi1BEP uXfvNlgYr66l3jdSNV96qbU= X-Received: by 2002:a17:90a:2e84:: with SMTP id r4mr15948077pjd.147.1610340415961; Sun, 10 Jan 2021 20:46:55 -0800 (PST) Received: from localhost.localdomain ([45.124.203.14]) by smtp.gmail.com with ESMTPSA id z6sm17442303pfj.22.2021.01.10.20.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Jan 2021 20:46:54 -0800 (PST) From: Joel Stanley To: David Airlie , Daniel Vetter , Andrew Jeffery Subject: [PATCH 1/2] drm/aspeed: Look up syscon by phandle Date: Mon, 11 Jan 2021 15:16:37 +1030 Message-Id: <20210111044638.290909-2-joel@jms.id.au> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210111044638.290909-1-joel@jms.id.au> References: <20210111044638.290909-1-joel@jms.id.au> 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: linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-aspeed@lists.ozlabs.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This scales better to multiple families of SoC. The lookup by compatible can be removed in a future change. Signed-off-by: Joel Stanley --- drivers/gpu/drm/aspeed/aspeed_gfx_drv.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) -- 2.29.2 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel diff --git a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c index 457ec04950f7..8ada7e944147 100644 --- a/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c +++ b/drivers/gpu/drm/aspeed/aspeed_gfx_drv.c @@ -103,6 +103,7 @@ static int aspeed_gfx_load(struct drm_device *drm) { struct platform_device *pdev = to_platform_device(drm->dev); struct aspeed_gfx *priv = to_aspeed_gfx(drm); + struct device_node *np = pdev->dev.of_node; struct resource *res; int ret; @@ -111,10 +112,13 @@ static int aspeed_gfx_load(struct drm_device *drm) if (IS_ERR(priv->base)) return PTR_ERR(priv->base); - priv->scu = syscon_regmap_lookup_by_compatible("aspeed,ast2500-scu"); + priv->scu = syscon_regmap_lookup_by_phandle(np, "syscon"); if (IS_ERR(priv->scu)) { - dev_err(&pdev->dev, "failed to find SCU regmap\n"); - return PTR_ERR(priv->scu); + priv->scu = syscon_regmap_lookup_by_compatible("aspeed,aspeed-scu"); + if (IS_ERR(priv->scu)) { + dev_err(&pdev->dev, "failed to find SCU regmap\n"); + return PTR_ERR(priv->scu); + } } ret = of_reserved_mem_device_init(drm->dev);