Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp846405pxb; Mon, 25 Oct 2021 20:27:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8WOw1i8AFRKpi0Yd6S+xUWMhZtzQKRGlE6MH2GehPEG+9pdB2i3OJ+3Bb30by6IR4qc99 X-Received: by 2002:a05:6402:17c4:: with SMTP id s4mr31708791edy.253.1635218857234; Mon, 25 Oct 2021 20:27:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635218857; cv=none; d=google.com; s=arc-20160816; b=gBs41f7hadLD7jFW6q80jaRrJmDxo+KiTNPQuYY/tNImkRuQjH/uFsO960/2z15jwX 4uasbyhOZWnPPCgsp2EAprOOZEe5P4ZvqaXgLjHRos9L0TB7ErENddhF9AVEY0C0mDF+ psoxEolAVSTdcBCct7uJfFJIj4J71NQhm4sljJWiJjE4m5+T0TMirN2oP5cpzFXJ23Pv Jv3R1OzVgpvlWw0PR9GSaBlmgOPayybLdtvnxqRdOEPP//Vw1KMXwZSG1IaSUmSI5L7w xEu5ALQTLf7SftnB9G7JLv4wKCAJxggHKoN7VKz+RmV1mTo1aF1j//T+pWiroFJ6XM31 DqcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FPtGNMfzlxXubKgayi75A1lRD5p2YHP9GYCHjNIhA04=; b=Me1R0XYTEoiYt4MLSGsiPhIvSzgf7IMQoF2OAEdRpLG+e/z/pUvjbGZ7fAUY1Dq9kO FI7vT0fi9B580TL5z1j5EDjMfjSIvipl13mNCpMDw0nEIBAGXhiJabTLjMu8Ln0Rdf2x 8WTK/t/Aflf4DQ3cQhag3rEaFtx2KK99nD4JeNEoySOUQY3yGnrkzL1c4NBqXFY0aMVZ EW+e4FSJImpP0DxJsSnvvOeUMT5D3/82Jk2npxtff7EMs+zOStruJcedDeefFaCRxQxu +w1BFm09zgMctk3lwpXe0aVAwe6C9/zxZ2GrN/CcWOSlhGXJJ3RZFm46EP7Rcxb6lVNM 81AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZQosD7V6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b15si7965876edz.346.2021.10.25.20.27.14; Mon, 25 Oct 2021 20:27:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ZQosD7V6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235695AbhJZAEO (ORCPT + 99 others); Mon, 25 Oct 2021 20:04:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235668AbhJZADX (ORCPT ); Mon, 25 Oct 2021 20:03:23 -0400 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EEDEC061226 for ; Mon, 25 Oct 2021 17:00:59 -0700 (PDT) Received: by mail-pf1-x429.google.com with SMTP id 187so12449803pfc.10 for ; Mon, 25 Oct 2021 17:00:59 -0700 (PDT) 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=ZQosD7V6yQmvlhhH7d9LVxQjs391cq+ZugAInt195ZJB1c31iI7cpfD6FPl7x6BVal jAp6KnYpubjBSvUeerLBNjMSLqvvohfmu+7stNepicCuaGyF3rTtuU1cTvqrzPBwOAZx ZfubfBnwp95j7sOejWDuWRNYZPT3gf3dhS3bI= 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=spYYR9i6rnLgJiBonGyhxXWN7lhXea0qSIZJUEz/mU37g6kVVcJMLBzOuV0kxkjxKr pA+fWE0job1Dc0wkBctdm1MdGzZJEfovmmaZ3gACLqhPcPns49+LlPAO+TDz+Y+bgmXd oCDo6qC6DtarGFA6duurv32Re9EtrP/XMaBLxVmdf01IvJZ8PU/MF//cTTiMeJDzjY1f bJyXtSq7PYpL/J9FGkmsG0HCeYmOsYcTaVusmkRKh+QwnrgYpRM9HxRegl7yoHXGQIhq q8gD3NjWboHwsQZR76Bxlq7KUnqq/gudz0B9wTWSZ0ItKLh8+nTbVQugaSkcSO0dMCJS I/lA== X-Gm-Message-State: AOAM531cP2bnImkcCSuO6ZB1e37UH8PuqaFcvuI2ipeQeLKv7aNYF2Q0 gXBW/G76UaNqIlHZX/1ZDRLIwA== X-Received: by 2002:aa7:9ad8:0:b0:44d:24d0:3ddf with SMTP id x24-20020aa79ad8000000b0044d24d03ddfmr22014955pfp.29.1635206458706; Mon, 25 Oct 2021 17:00:58 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:201:f5e3:5eb1:d5ee:6893]) by smtp.gmail.com with ESMTPSA id b7sm9900747pfm.28.2021.10.25.17.00.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:00:58 -0700 (PDT) From: Stephen Boyd To: Greg Kroah-Hartman 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 v3 14/34] drm/exynos: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:24 -0700 Message-Id: <20211026000044.885195-15-swboyd@chromium.org> X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog In-Reply-To: <20211026000044.885195-1-swboyd@chromium.org> References: <20211026000044.885195-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