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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCEC2C433EF for ; Thu, 6 Jan 2022 21:46:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244817AbiAFVqo (ORCPT ); Thu, 6 Jan 2022 16:46:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244509AbiAFVqR (ORCPT ); Thu, 6 Jan 2022 16:46:17 -0500 Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CF0DC061201 for ; Thu, 6 Jan 2022 13:46:17 -0800 (PST) Received: by mail-pf1-x435.google.com with SMTP id u20so3559315pfi.12 for ; Thu, 06 Jan 2022 13:46:17 -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=FPtGNMfzlxXubKgayi75A1lRD5p2YHP9GYCHjNIhA04=; b=F/n1S4F8s3kPZEe2GW35Eidb0SesLDzR2YqgAQAZIHrdsevP1q9bknfHQTxF6SqGJm Nfl9MQ9rGKoXrK+IFOpOOh3SAwv6F1KaWuQD7pffTOrkiJO/cXpEdVGWkZZkJ3dX53Xr AdWLpJwFpppBOInDDUOP4omGqDFxmR1REDYFY= 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=FPtGNMfzlxXubKgayi75A1lRD5p2YHP9GYCHjNIhA04=; b=X9JxeHMKcT3K5BTiOAS2qQhKrrgLrobloq99epe/W4zR45EeOgo2kRbrADYWvEjJnp tm/7+4RA2s8+hr457g0teaNXOo0N5U5eS/QS2LygZ0A3hnr6XowHxOz7lSpLksbr8IS6 vtLMKSq9PtmZtTT/KHwAuaIzhUCP0jOA3G3Y/rhBwKaTesocmBzgjLETAGipfZaAI4H1 2tEAQHBVwCEtnp9QFolOyJ+fCl+1+2VwsOITK2WivqpxjUSv5m7YPW4QdS6E9H0qDrtq nWWpu5SzuVO+msqBQnhrLsP54XU2xVbZVamEMrrqmSFVqt1r64mKN1Kjlilp0XUMu7ac im7Q== X-Gm-Message-State: AOAM533RdbXJ7zOoyrnF0JqenDqBu30P0SBdaLaPBsWgxMcqJjKEidMi /2+6mEziHEdFYD3pSh+N6JavVw== X-Google-Smtp-Source: ABdhPJzDyXbJ5oiJeJM1+1uFcXWrB43YEPXT+ZHV9hULBBomq9G68oQkCiEkLjlw9Juc82HcneKgAw== X-Received: by 2002:a62:1642:0:b0:4bb:b3b6:c037 with SMTP id 63-20020a621642000000b004bbb3b6c037mr56659975pfw.50.1641505576581; Thu, 06 Jan 2022 13:46:16 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:201:1ebe:a8fd:f9b0:7e85]) by smtp.gmail.com with ESMTPSA id 10sm3539960pfm.56.2022.01.06.13.46.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 13:46:16 -0800 (PST) From: Stephen Boyd To: Greg Kroah-Hartman , Douglas Anderson Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Inki Dae , Joonyoung Shim , Seung-Woo Kim , Kyungmin Park , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v5 13/32] drm/exynos: Migrate to aggregate driver Date: Thu, 6 Jan 2022 13:45:36 -0800 Message-Id: <20220106214556.2461363-14-swboyd@chromium.org> X-Mailer: git-send-email 2.34.1.448.ga2b2bfdf31-goog In-Reply-To: <20220106214556.2461363-1-swboyd@chromium.org> References: <20220106214556.2461363-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: Inki Dae Cc: Joonyoung Shim Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index d8f1cf4d6b69..dcb52ec2bd35 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -253,8 +253,9 @@ static struct component_match *exynos_drm_match_add(struct device *dev) return match ?: ERR_PTR(-ENODEV); } -static int exynos_drm_bind(struct device *dev) +static int exynos_drm_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct exynos_drm_private *private; struct drm_encoder *encoder; struct drm_device *drm; @@ -330,8 +331,9 @@ static int exynos_drm_bind(struct device *dev) return ret; } -static void exynos_drm_unbind(struct device *dev) +static void exynos_drm_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *drm = dev_get_drvdata(dev); drm_dev_unregister(drm); @@ -350,9 +352,13 @@ static void exynos_drm_unbind(struct device *dev) drm_dev_put(drm); } -static const struct component_master_ops exynos_drm_ops = { - .bind = exynos_drm_bind, - .unbind = exynos_drm_unbind, +static struct aggregate_driver exynos_drm_aggregate_driver = { + .probe = exynos_drm_bind, + .remove = exynos_drm_unbind, + .driver = { + .name = "exynos_drm", + .owner = THIS_MODULE, + }, }; static int exynos_drm_platform_probe(struct platform_device *pdev) @@ -365,13 +371,12 @@ static int exynos_drm_platform_probe(struct platform_device *pdev) if (IS_ERR(match)) return PTR_ERR(match); - return component_master_add_with_match(&pdev->dev, &exynos_drm_ops, - match); + return component_aggregate_register(&pdev->dev, &exynos_drm_aggregate_driver, match); } static int exynos_drm_platform_remove(struct platform_device *pdev) { - component_master_del(&pdev->dev, &exynos_drm_ops); + component_aggregate_unregister(&pdev->dev, &exynos_drm_aggregate_driver); return 0; } -- https://chromeos.dev