From patchwork Thu Dec 2 22:27:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 12653641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 91089C433EF for ; Thu, 2 Dec 2021 22:28:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4C5386FC6B; Thu, 2 Dec 2021 22:27:55 +0000 (UTC) Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C3986FC39 for ; Thu, 2 Dec 2021 22:27:46 +0000 (UTC) Received: by mail-pl1-x62c.google.com with SMTP id y8so761896plg.1 for ; Thu, 02 Dec 2021 14:27:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NsjwfsQuiDMEQ+TXne3j17pwDv7xto97Rnhld6OcLgM=; b=edVjBt2zUt8d3ir9bHAny/D3iecuGEgCqLqHfB5LmxlqM/yeay/mFqvVssTz8pJmS1 jIweoBkWZO8bpd1W6q5ofzuSBydx3x8o279iLi58XYs+aUU3Ru8bhRqzS309BXG95AOM pii45rKsVjczgp4/CPME0N90C+u8Xq5jwOJ0E= 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=NsjwfsQuiDMEQ+TXne3j17pwDv7xto97Rnhld6OcLgM=; b=GFf2nJKAcSZldF3kPdMwAdxYE2aTrCPQKtn8/xpKnz4XP35iE0PlC8HIQbcet+dZjn glovFVSTRQknaPG8WKghekotLpvBkq+ZC8yDeCYqLvlK4tbRxZYXtWcJ4yNoHUZuuMDc T64hMEKgkE8w/gyKypEFkLTuj3XiexfG1YNaK/7kPm0pAb2me+yeSGZDQJHbltWrgC8H foZVMSGtadmcvZ9uBBCcga3sFdTC2QsvUtuGQZeHkjNdp7L6TqFxcA04h4B3RAvyiJVj Kv3ar7xY/eBylMwtCkM7WGL3twO/kaLmcsBiJ5EkMD5QIXHvBVKINJEY0s5fWJTu6Hrs WSQA== X-Gm-Message-State: AOAM533lptcRSSBiaiGOEZzrSRDWLzPDDEOY5JhSrA72t9leouHrUH1K lHfb/P95sgzBqunUtlqIeqZ3TQ== X-Google-Smtp-Source: ABdhPJwr+y/130Jtap14aGacCeh6jp3d9XXNKHQZYwirxPlGzgQbGLR2z4IOOYuR0xMawVt16u+bLg== X-Received: by 2002:a17:902:7890:b0:143:c4f7:59e6 with SMTP id q16-20020a170902789000b00143c4f759e6mr18430277pll.87.1638484066222; Thu, 02 Dec 2021 14:27:46 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:201:f4f2:1b7e:5aea:bf3c]) by smtp.gmail.com with ESMTPSA id q9sm836934pfj.9.2021.12.02.14.27.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 14:27:45 -0800 (PST) From: Stephen Boyd To: Greg Kroah-Hartman Subject: [PATCH v4 12/34] drm/etnaviv: Migrate to aggregate driver Date: Thu, 2 Dec 2021 14:27:10 -0800 Message-Id: <20211202222732.2453851-13-swboyd@chromium.org> X-Mailer: git-send-email 2.34.0.384.gca35af8252-goog In-Reply-To: <20211202222732.2453851-1-swboyd@chromium.org> References: <20211202222732.2453851-1-swboyd@chromium.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: Saravana Kannan , "Rafael J. Wysocki" , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Daniel Vetter , Russell King , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use an aggregate driver instead of component ops so that we can get proper driver probe ordering of the aggregate device with respect to all the component devices that make up the aggregate device. Cc: Lucas Stach Cc: Russell King Cc: Christian Gmeiner Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index 7dcc6392792d..95d1e518ff13 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -494,8 +494,9 @@ static const struct drm_driver etnaviv_drm_driver = { /* * Platform driver: */ -static int etnaviv_bind(struct device *dev) +static int etnaviv_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct etnaviv_drm_private *priv; struct drm_device *drm; int ret; @@ -552,8 +553,9 @@ static int etnaviv_bind(struct device *dev) return ret; } -static void etnaviv_unbind(struct device *dev) +static void etnaviv_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *drm = dev_get_drvdata(dev); struct etnaviv_drm_private *priv = drm->dev_private; @@ -569,9 +571,13 @@ static void etnaviv_unbind(struct device *dev) drm_dev_put(drm); } -static const struct component_master_ops etnaviv_master_ops = { - .bind = etnaviv_bind, - .unbind = etnaviv_unbind, +static struct aggregate_driver etnaviv_aggregate_driver = { + .probe = etnaviv_bind, + .remove = etnaviv_unbind, + .driver = { + .name = "etnaviv_drm", + .owner = THIS_MODULE, + }, }; static int compare_of(struct device *dev, void *data) @@ -609,12 +615,12 @@ static int etnaviv_pdev_probe(struct platform_device *pdev) component_match_add(dev, &match, compare_str, names[i]); } - return component_master_add_with_match(dev, &etnaviv_master_ops, match); + return component_aggregate_register(dev, &etnaviv_aggregate_driver, match); } static int etnaviv_pdev_remove(struct platform_device *pdev) { - component_master_del(&pdev->dev, &etnaviv_master_ops); + component_aggregate_unregister(&pdev->dev, &etnaviv_aggregate_driver); return 0; }