From patchwork Tue Feb 9 12:37:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 12077933 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.3 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 1B9AAC433DB for ; Tue, 9 Feb 2021 12:39:31 +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 B108B64E50 for ; Tue, 9 Feb 2021 12:39:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B108B64E50 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=6TpMBAUyaNN0mlSpRM+gI2dNth40aUueuFlY6haCbnY=; b=m78dnofCb0PkHGVjZ29RCk4vo X+SQQIXVMIAkTEmpQysFdX7M170bu34roV7QU3PTO/l8MJ3VpLEi7RxWMBMkqPmyW7voSjhsGMB21 HSVOIQijh8VQOxZjVp51JAal1uLaOjiYE316jdJhFllhu3+Eh+6weHuAndtL9Cqo1tVQk9frjddhJ Vy/IvbECdt8e7T0S4wrMt0XBd/EHrfvr0GwBpVL5bFKEyc2YDtKguZ0H/BphURn6ZLW6AhMuQUclw tK0psyYKxaTkh1EWhjXfiBbs9HPUbKz7ir6LJkhzyFu81R4kj2A25XIxk2K357q/0IsdtUNWVA08A 1+ictq09g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SHI-0001N6-T7; Tue, 09 Feb 2021 12:38:00 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9SH9-0001IW-Kc for linux-arm-kernel@lists.infradead.org; Tue, 09 Feb 2021 12:37:52 +0000 Received: by mail-pf1-x42c.google.com with SMTP id t29so11807408pfg.11 for ; Tue, 09 Feb 2021 04:37:51 -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=HEWcLvUvYkWYLO51rzp4RR+x1aKBWP/abPyEZI4rYFM=; b=UA7qw6pCaOdf/yqq69etxef0untkhUFXSI+O9aCuyR/lOYzzPCRtWaHB6KbMDFaObh maH0YiX2IcjeEONLLi2m+Sk+3PTzs33BzrB2mJ0HcLcjRk2r9l8yFR3/KfrkL6EkdZzb i8Cave62QyllrlcUMYo1mEwijF+bfDhpgxDWkcnziTD6OcT6DxjwzJyWMEFdZWboC3uY cbIO+ZB5NSD6J70UHw1gRakG/afPMQiZ5Hd6tPMcqAv+xikSyDJDq/u4w5z8EMpDP8T2 Lg8Z3VO2gx3ssY95EEyC5FYR7D6991/PEqnpomJXo/ZUGeBHxea1UuMcYEtJj3Cc0wko 9Lgw== 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=HEWcLvUvYkWYLO51rzp4RR+x1aKBWP/abPyEZI4rYFM=; b=MmhZTMopS97qJtz56J/375+xtFI4PbGiyb/vyrZpYhPlIslciRDxY85Ijpfu6OZOpl /2c6Y2RlgJcyb8s08yc8hbqEUrk2kQpEhDMGpRR4TstUBQuhzrQw7+mZtWe+LNxf7tun cf7e/VSDedhB2UQNfFJFuGGNdlvw6pK2teSoUB69Tx/XirkhPzSqkD836mogR5YSpliP VTi3OHCIf/xAIBiJzCFGS1fKcycjZpiNwNVNqfhkeS9+1TEw0Uv7t+1oBJdZxm01PfKL 3oZyoFH+b0DmK+6Pcv/I0U7v45mtiUoBTJENHfroI8KRK+rK/VHjP/IC7EtfNYRM8tNT WXpg== X-Gm-Message-State: AOAM531rpyw+8o+Myj9TUQC+ihy0rgYZUghpZy90h0M2B3+8caFmtYVx vQvKa9aGMKKLZ0lXl/133gE= X-Google-Smtp-Source: ABdhPJyzzNoV3ORY6H1uJ0CJ3FGX0Y0Hbb6/83hFpXTlUvZfQQ4ZzNnS2ckv5IYMwgAECs49OLy6zg== X-Received: by 2002:a63:c70c:: with SMTP id n12mr22157570pgg.347.1612874269194; Tue, 09 Feb 2021 04:37:49 -0800 (PST) Received: from voyager.lan ([45.124.203.14]) by smtp.gmail.com with ESMTPSA id i7sm22584395pfc.50.2021.02.09.04.37.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Feb 2021 04:37:48 -0800 (PST) From: Joel Stanley To: David Airlie , Daniel Vetter , Andrew Jeffery , Jeremy Kerr Subject: [PATCH v3 1/2] drm/aspeed: Look up syscon by phandle Date: Tue, 9 Feb 2021 23:07:33 +1030 Message-Id: <20210209123734.130483-2-joel@jms.id.au> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210209123734.130483-1-joel@jms.id.au> References: <20210209123734.130483-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-20210209_073751_719780_37EAA5C3 X-CRM114-Status: GOOD ( 14.26 ) 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. The fallback path is for the ast2500 platform only. Other platforms will be added with the new style, so they won't need fallback paths. Signed-off-by: Joel Stanley Reviewed-by: Andrew Jeffery --- v2: Fix fallback path to still find ast2500-scu. Thanks jk for the review --- 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..54a6bda03c0e 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,ast2500-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);