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: 12009717 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDBF7C433E0 for ; Mon, 11 Jan 2021 04:49:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8FC2A20782 for ; Mon, 11 Jan 2021 04:49:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8FC2A20782 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=jms.id.au Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=a7ExBEWXLvhvoQDcOfVEoexoHII0V7MUGeXtP5cLs6c=; b=ByEnExZF4J0e1SJS123jDGhjk qVF/jXcZyY8lEmTAUe2ELHN1vMQZtaboWWwQhsOn+6tdskqSwmfXQZ/mHU9j7kEzA4MCQ47Bb+G5a iJ3ZSaRhdVsFqaHFOnMNHcYXsFG3DOQmt5LwFyf0k13Rv2Lqu9duoNNtRTDnXZvjkzkyf9Z3L3s9b PobnOd3QSCW0u9h+N60KQpe5H5aEgg64z1gJOaj3tBfahvF4L4nssaP2mdYmhRUsfKlBm9hqtaXUF /ZglFyx5JNElFsGnVii1V2BNz6wbKPVBJS4tETIyi1GkFY2/iUlZrevseHHu6rXm+dbkxGsnRccRh VMyHsixGA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyp6f-0005u1-3I; Mon, 11 Jan 2021 04:47:05 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kyp6Y-0005re-8I for linux-arm-kernel@lists.infradead.org; Mon, 11 Jan 2021 04:46:59 +0000 Received: by mail-pl1-x635.google.com with SMTP id y8so8855904plp.8 for ; Sun, 10 Jan 2021 20:46:57 -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=LV2ONqH0UtvFpZnC4QCLnVPcw6r3JOVGTWOncviP/JuHjmAv7BD4p8nNLpMdUsbLpr J8QyOc4K8SB3mmAp2wJThpV2t1du0EbtH8NBbf1L0r23bR5nCvxFmsq0f4QbbAtOz0Rx 8Fs/9Am41RhuEft4lhq7n5PPC0NZ3DJ4/ume8GzKHTT/iFxQZ2NIOecumWAnE8lRETvX B4keCFb+Wf4g8vg30KwRrniTGNWNthPX+sQiEK/L9kkD2qW+E+oYBp3u8BMWV9KrafGJ n3naANcHzrNj0ABnYj/LrwmFxyEA53ZGnJUhNo98okTF2X+FCouJEjvtmLsbKOTGoM+G Fxdw== X-Gm-Message-State: AOAM533YNeF4NEeLxtVztQqUSzmbAhQjU6hNx4yUN23/GN2r6Z6Xc9z2 QGI5VKZ7aRLYgxLcXLHD0iR+5aKOl/1jiA== X-Google-Smtp-Source: ABdhPJxBCkl3x3enJELsSBqm0G69v1s8CkiXkSccBZx3mbk8e2hUMZjKOIW2OVFq2LoTLGhJe3UxIQ== 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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210110_234658_387169_1E90FC0E X-CRM114-Status: GOOD ( 13.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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(-) 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);