Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp845147pxb; Mon, 25 Oct 2021 20:25:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzURxvUlxDXWWXfMaJGkLHx8NJv13mDC7Ijfl7kRqfI+dunaIDbZb5ERZTPVZVMxcwzGaxF X-Received: by 2002:a17:902:da83:b0:13f:704:d731 with SMTP id j3-20020a170902da8300b0013f0704d731mr19641920plx.77.1635218758707; Mon, 25 Oct 2021 20:25:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635218758; cv=none; d=google.com; s=arc-20160816; b=OBmkg1ibJMA7o8b0vI2pqNS6Nmd/HWoOwVZsl7oX+i69ujV6Y/zSf3k0QcIt/I7+F5 ikld9bqi4Mi1pRqRS4SgUJP5QUOuoHpGP8+PigoHjQBPBVX4wR/rEDNX+OOch66VVZBh 5nXIxjXnAhawcOHU6GkAN+ojJCTZ5olWo4fcsoTI9PzJRaYOZpAMYE1ICzeAWMd/rALk P8Jby6uJ4CszXcNjkO1qr6AJak+MifhJxiaMdJQANVP9IHe/tG/DJogOAsbtNftt/EPk XsJjYAxKDC5hZNnEXxlkGJDESKEe+cDNQrP4bRxSQswKYyn43GklCjNvrDksDBggfWe2 3nAA== 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=3+KKYOBNeMz4YDnDUwMm+dvq1TCGf0KiZpH7bEg1t3k=; b=UucuMef1J5Mre+LxHqXoZz9WWxAXgof96Vvcttiebu0r4nKeBFQo6C7xG93HqzoonH W/0vpiC0j2yb2Tx9vXzjP0AGQbDIYumdb/s0gfE+XlKmJ+s3gC+FlUyTUKYyK9AK/f/n 1oSTUCErZECaOIqa2I3VCsvVTEfnCAbw9UfMuWUGjJIlNr6eRt61YeZF8XgTiArAVPdf EsTz7Mz/jB5/B9n9AQiDtIpVGlPnywzhzIF00i4X9+sSMP3l7ilPaw3MqSHM3Uf2abln jr8ZJhok5+/08mGxIFYp5qQA8G+eYsPEJ6BCDmSXd8p4rUsQu/RdXQS8uTRS48Vou83k SS9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GplvTc2D; 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 e27si26929845pgl.492.2021.10.25.20.25.45; Mon, 25 Oct 2021 20:25:58 -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=GplvTc2D; 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 S236019AbhJZAEJ (ORCPT + 99 others); Mon, 25 Oct 2021 20:04:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235676AbhJZADY (ORCPT ); Mon, 25 Oct 2021 20:03:24 -0400 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9DEDC061745 for ; Mon, 25 Oct 2021 17:01:01 -0700 (PDT) Received: by mail-pf1-x42d.google.com with SMTP id x66so12447549pfx.13 for ; Mon, 25 Oct 2021 17:01:01 -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=3+KKYOBNeMz4YDnDUwMm+dvq1TCGf0KiZpH7bEg1t3k=; b=GplvTc2D5rIgNOQA1eP1yoxTjAIYe0PZG6YRddKv1MnJQ9yrh+qHpqmdw/je0TUp2z cfTefK2FJ3hVpHRTz//HY1/C6OCaprIiFbpmSl0BZV9OufOdt3V0LXj4u5uQYmdjeRPF GttCNt93E+3QSbkAYpBRbYimEiRA34fjFU3+U= 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=3+KKYOBNeMz4YDnDUwMm+dvq1TCGf0KiZpH7bEg1t3k=; b=gnePReIh+x8zHpmawO9WN2vTliE0GGv0ZnR3DkgweHOiYghvo+Xyxpe983Zpdew6JH CN/neWfa3gdGWoLd5k6i6CxasLTM0Yip0LUYXIw41202nutGLwxHP396O5QnN9G+aPPT 5DamKlVi3cEzqfm7BJqNXsYf0J3lR1EWnRW0+meP8lkQtFyIDOhvz3UuixvjB82fcK9S CyQkuguiWC54y8pxqc7Yqjl7FCPe8Nj/mcNe5Z+GWymegOv+tfvs1FozDhBs/mu70Zw4 4MRXmoXPhc8TkHRipUCn21fNTJJ+1QfUPOKXwVITYeVf1vE/XGzfQnjcOQMqWdR2lI/5 b+gA== X-Gm-Message-State: AOAM5316Ku2/Q5MKjdBDHvdIr3Aozd3aiMN8BHURVO/LHCIMdVrozMhm fjboCcl9JUjQpWuSYrPGaLLdRw== X-Received: by 2002:a62:bd03:0:b0:47b:e033:d52b with SMTP id a3-20020a62bd03000000b0047be033d52bmr16404456pff.20.1635206461214; Mon, 25 Oct 2021 17:01:01 -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.01.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:01:00 -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, Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v3 17/34] drm/mcde: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:27 -0700 Message-Id: <20211026000044.885195-18-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: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/mcde/mcde_drv.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/mcde/mcde_drv.c b/drivers/gpu/drm/mcde/mcde_drv.c index e60566a5739c..84fcfe77540e 100644 --- a/drivers/gpu/drm/mcde/mcde_drv.c +++ b/drivers/gpu/drm/mcde/mcde_drv.c @@ -215,8 +215,9 @@ static const struct drm_driver mcde_drm_driver = { DRM_GEM_CMA_DRIVER_OPS, }; -static int mcde_drm_bind(struct device *dev) +static int mcde_drm_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *drm = dev_get_drvdata(dev); int ret; @@ -247,8 +248,9 @@ static int mcde_drm_bind(struct device *dev) return ret; } -static void mcde_drm_unbind(struct device *dev) +static void mcde_drm_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *drm = dev_get_drvdata(dev); drm_dev_unregister(drm); @@ -256,9 +258,13 @@ static void mcde_drm_unbind(struct device *dev) component_unbind_all(drm->dev, drm); } -static const struct component_master_ops mcde_drm_comp_ops = { - .bind = mcde_drm_bind, - .unbind = mcde_drm_unbind, +static struct aggregate_driver mcde_drm_comp_driver = { + .probe = mcde_drm_bind, + .remove = mcde_drm_unbind, + .driver = { + .name = "mcde_drm", + .owner = THIS_MODULE, + }, }; static struct platform_driver *const mcde_component_drivers[] = { @@ -421,7 +427,7 @@ static int mcde_probe(struct platform_device *pdev) * Perform an invasive reset of the MCDE and all blocks by * cutting the power to the subsystem, then bring it back up * later when we enable the display as a result of - * component_master_add_with_match(). + * component_aggregate_register(). */ ret = regulator_disable(mcde->epod); if (ret) { @@ -431,8 +437,7 @@ static int mcde_probe(struct platform_device *pdev) /* Wait 50 ms so we are sure we cut the power */ usleep_range(50000, 70000); - ret = component_master_add_with_match(&pdev->dev, &mcde_drm_comp_ops, - match); + ret = component_aggregate_register(&pdev->dev, &mcde_drm_comp_driver, match); if (ret) { dev_err(dev, "failed to add component master\n"); /* @@ -461,7 +466,7 @@ static int mcde_remove(struct platform_device *pdev) struct drm_device *drm = platform_get_drvdata(pdev); struct mcde *mcde = to_mcde(drm); - component_master_del(&pdev->dev, &mcde_drm_comp_ops); + component_aggregate_unregister(&pdev->dev, &mcde_drm_comp_driver); clk_disable_unprepare(mcde->mcde_clk); regulator_disable(mcde->vana); regulator_disable(mcde->epod); -- https://chromeos.dev