From patchwork Thu Dec 2 22:27:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 12653633 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 8B432C43217 for ; Thu, 2 Dec 2021 22:28:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6DAAB6FC6C; Thu, 2 Dec 2021 22:27:55 +0000 (UTC) Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7EB956FC51 for ; Thu, 2 Dec 2021 22:27:53 +0000 (UTC) Received: by mail-pf1-x435.google.com with SMTP id n26so967732pff.3 for ; Thu, 02 Dec 2021 14:27:53 -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=6IAciPlNRPfkJgo3LSljGMR1t9yoWVxJAu5cqfoLKs8=; b=ZrzSCh/rFXkmx5Dr8yB+yeAaW9c6VEvfWvglxVBg2FFKJ7efhLwtmeT6vKYdWUr8Yw QqxZbXE04o4P2qvypJIKuDvCMKiknt4LJ6XNiz71Fa8gTKRC1cIH4is5SvtDk3Ngr68s MNI0HNgCtQ3pqos7n1/yzeN1LmON/a29L9lRY= 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=6IAciPlNRPfkJgo3LSljGMR1t9yoWVxJAu5cqfoLKs8=; b=BXQZ6C882xOK7U4iV3UPFF/X/RXT4x7UKCQnMdnAwGIvmJwLQifvejh7sKZ2JjjkRl 4byrJQ+GLfWAan4UWYm2u2mKTubSOyZP+s5686flL2XazOiEE3PhUr4CdW19QDPpWaNX rklRrZRq9EkJ134OSHekcefbHTTI2pYjDxjWTkySbxRYEc2CG5WIAaDPB02bMHfhqJcH oGY31+DTKJ2Ou26EbnU+ClwCzY/ebqRSyCM3mOC7Mgwblff4jVQeV2pQnzxubXEXagPY /lwrr4wICyWm2gbRNyVG7uKkzhCN9g3LiWnjMBgt1pfLzHrDS/MjYazFcea98zMr168Q v2ww== X-Gm-Message-State: AOAM532eqtHamSAD3aGKrNj7A4UZlP6N5Qvxz1DchnAiLMSCfalKFELA HftClYjvS2+xua5zh3yjva30Hw== X-Google-Smtp-Source: ABdhPJy13mZ48jfTvFMjifi+H+M3BRVPQTEod/OK8/r5QfcrwMxFPAuEeOqfLBI/CQ3w3gfEW2A7GQ== X-Received: by 2002:a63:8848:: with SMTP id l69mr1617155pgd.41.1638484073050; Thu, 02 Dec 2021 14:27:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 14:27:52 -0800 (PST) From: Stephen Boyd To: Greg Kroah-Hartman Subject: [PATCH v4 20/34] drm/omap: Migrate to aggregate driver Date: Thu, 2 Dec 2021 14:27:18 -0800 Message-Id: <20211202222732.2453851-21-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 , Tomi Valkeinen , "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: Tomi Valkeinen Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/omapdrm/dss/dss.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c index d6a5862b4dbf..9328d97f19ab 100644 --- a/drivers/gpu/drm/omapdrm/dss/dss.c +++ b/drivers/gpu/drm/omapdrm/dss/dss.c @@ -1304,8 +1304,9 @@ static const struct soc_device_attribute dss_soc_devices[] = { { /* sentinel */ } }; -static int dss_bind(struct device *dev) +static int dss_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct dss_device *dss = dev_get_drvdata(dev); struct platform_device *drm_pdev; struct dss_pdata pdata; @@ -1330,8 +1331,9 @@ static int dss_bind(struct device *dev) return 0; } -static void dss_unbind(struct device *dev) +static void dss_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct dss_device *dss = dev_get_drvdata(dev); platform_device_unregister(dss->drm_pdev); @@ -1339,9 +1341,13 @@ static void dss_unbind(struct device *dev) component_unbind_all(dev, NULL); } -static const struct component_master_ops dss_component_ops = { - .bind = dss_bind, - .unbind = dss_unbind, +static struct aggregate_driver dss_aggregate_driver = { + .probe = dss_bind, + .remove = dss_unbind, + .driver = { + .name = "dss_drm", + .owner = THIS_MODULE, + }, }; static int dss_component_compare(struct device *dev, void *data) @@ -1504,7 +1510,7 @@ static int dss_probe(struct platform_device *pdev) cmatch.match = &match; device_for_each_child(&pdev->dev, &cmatch, dss_add_child_component); - r = component_master_add_with_match(&pdev->dev, &dss_component_ops, match); + r = component_aggregate_register(&pdev->dev, &dss_aggregate_driver, match); if (r) goto err_of_depopulate; @@ -1543,7 +1549,7 @@ static int dss_remove(struct platform_device *pdev) of_platform_depopulate(&pdev->dev); - component_master_del(&pdev->dev, &dss_component_ops); + component_aggregate_unregister(&pdev->dev, &dss_aggregate_driver); dss_debugfs_remove_file(dss->debugfs.clk); dss_debugfs_remove_file(dss->debugfs.dss);