From patchwork Tue Oct 26 00:00:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 12583677 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5A52C433FE for ; Tue, 26 Oct 2021 00:02:02 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 97EDE604DC for ; Tue, 26 Oct 2021 00:02:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 97EDE604DC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A840C6E1E8; Tue, 26 Oct 2021 00:01:11 +0000 (UTC) Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by gabe.freedesktop.org (Postfix) with ESMTPS id DDAC76E1D2 for ; Tue, 26 Oct 2021 00:01:05 +0000 (UTC) Received: by mail-pg1-x52d.google.com with SMTP id e65so12288429pgc.5 for ; Mon, 25 Oct 2021 17:01:05 -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=3a3i/nDaB8ZUdNqJ4VU8hWXyXTL7/wWiLoMS1h5NiSM=; b=POKLqO9A5vFJYIMS8pDOGDNHrdvF+JGJ1RBptw04C+3ULsNNXEb8rzNes3OwQLycD9 mK8PUPDvEmyMLAr5KMKceB9OAR/WBuFFTb6yYUkDXh/hFm6aNHjQZt3iaLddpIFN7kSB yIgyLMqUT295OnHqv8CSdmE6qYj2QfMN/v0nM= 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=3a3i/nDaB8ZUdNqJ4VU8hWXyXTL7/wWiLoMS1h5NiSM=; b=bllI0wwMQeX6tDw/RmsyzJ0Q6us3XheI/CqHpTnwQHwXvc22yWJqrhuqvQ4DWu0ZlP Rqa0dOJMlEmr8Va7bHbIVIR49UEfuC2TrtQxVa9XkiMupqccU2FvC9C8hPT+7MHAmLi8 gvlQwJx4xfp8QS18LH59wM4dgHkRJgeamScFQX+ENuMV3YQiyDOk6FaSjN/i9Y8ZAXxs MR2iL/AL5gZ64+GMYTUwzp/Io2M7soNxuAmMKdftqqmFO4Hp3bKm6RyXkG87V3TcpLoy hPHJcqUTzGc0TtrrgikgzfjbXPdWji+TI40/n7Ox7XX346Oz7H46EjqUNoILz2yvERJG HJnw== X-Gm-Message-State: AOAM530BaGRhRQyZEP7+9huTutpqB9HjpfUGWLtNSyyTueiLmjXajW7o uFX8diQAok03tthIK/i9ooaLlg== X-Google-Smtp-Source: ABdhPJwyghGp8z+hGwt4DgRUq0G8EmSQY+HM8pjy5c/TQQoyxw212WuajFfYIV51GIC8q/N6JFDdjw== X-Received: by 2002:a05:6a00:14c6:b0:44d:4f03:78ff with SMTP id w6-20020a056a0014c600b0044d4f0378ffmr21882495pfu.13.1635206465460; Mon, 25 Oct 2021 17:01:05 -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.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:01:05 -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 22/34] drm/sti: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:32 -0700 Message-Id: <20211026000044.885195-23-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 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: , 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: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/sti/sti_drv.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index c7efb43b83ee..b277cc679154 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c @@ -182,8 +182,9 @@ static void sti_cleanup(struct drm_device *ddev) ddev->dev_private = NULL; } -static int sti_bind(struct device *dev) +static int sti_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *ddev; int ret; @@ -216,8 +217,9 @@ static int sti_bind(struct device *dev) return ret; } -static void sti_unbind(struct device *dev) +static void sti_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *ddev = dev_get_drvdata(dev); drm_dev_unregister(ddev); @@ -225,9 +227,13 @@ static void sti_unbind(struct device *dev) drm_dev_put(ddev); } -static const struct component_master_ops sti_ops = { - .bind = sti_bind, - .unbind = sti_unbind, +static struct aggregate_driver sti_aggregate_driver = { + .probe = sti_bind, + .remove = sti_unbind, + .driver = { + .name = "sti_drm", + .owner = THIS_MODULE, + }, }; static int sti_platform_probe(struct platform_device *pdev) @@ -249,12 +255,12 @@ static int sti_platform_probe(struct platform_device *pdev) child_np = of_get_next_available_child(node, child_np); } - return component_master_add_with_match(dev, &sti_ops, match); + return component_aggregate_register(dev, &sti_aggregate_driver, match); } static int sti_platform_remove(struct platform_device *pdev) { - component_master_del(&pdev->dev, &sti_ops); + component_aggregate_unregister(&pdev->dev, &sti_aggregate_driver); return 0; }