From mboxrd@z Thu Jan 1 00:00:00 1970 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 62F6AC433FE for ; Thu, 2 Dec 2021 22:28:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EBE576FC3F; Thu, 2 Dec 2021 22:27:50 +0000 (UTC) Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1C3146FC2F for ; Thu, 2 Dec 2021 22:27:45 +0000 (UTC) Received: by mail-pj1-x1033.google.com with SMTP id w33-20020a17090a6ba400b001a722a06212so3952908pjj.0 for ; Thu, 02 Dec 2021 14:27:45 -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=tyFhWuo5Hgtey/EJ0ER9SojRROyEQ1lmEqqEKYabFj8=; b=odwqzjRkBmxA1qXzAb8CtaV8Ax17PvJAsF8AWA5KlGHBc9xiJ20mEnFtBc9/S0n2DS m5c2HgazJs1iEEriuNiaJGQstV3se73Rp9LsgIm8iHfGJY8nQorkhMitamkq8qynQfK6 EUNGQbhmWVuUpWpQ7GeD3K90KEgEaF78pPYEg= 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=tyFhWuo5Hgtey/EJ0ER9SojRROyEQ1lmEqqEKYabFj8=; b=09StypuM7rE7r8sgpnkVR8XX6BlEXfggv7cVP7TKVEFjHA1yK9+S00RzFWWcW7sDsD HiNaEgzBaNoSQOciNfsPOYLsv8rfb0IUIIKMZYzpwDH1Py92uyCae2sYVq0e12TPfz0/ XftIKz3tVhT3vi1/IVH7AG7vSEInTTe/852uK4oZjbf11myJHwdyPs08gdQdUHYf46wy NmSPzLidlDZWc2+iLqtFWpQC/KJOPRirxJh4tzhvXNR/nYrUVr/4zziEo/uVOqXSuZFz TXIoAvTzGQnDoIFwhD67hVNrXmKFdfbwO3stictVgjBGOzKylBfK2PJVJkcpW05YsHEa boaA== X-Gm-Message-State: AOAM533tWQcHE0d7fM3+VYOeT2P0g1aaENq2JOoY2Q9BiI980NvWApwA h5F07CIC6P9iTo85M0tQIVQkVg== X-Google-Smtp-Source: ABdhPJzTjzlJn/+0dlB7m+bDOcOE8sPA8L78n/0o1kEtXiZ8GrYP+EFvD6RSgzQOktKB+UYrIdbj7A== X-Received: by 2002:a17:902:6acb:b0:142:76c3:d35f with SMTP id i11-20020a1709026acb00b0014276c3d35fmr18280297plt.89.1638484064692; Thu, 02 Dec 2021 14:27:44 -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.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 14:27:44 -0800 (PST) From: Stephen Boyd To: Greg Kroah-Hartman Subject: [PATCH v4 10/34] drm/malidp: Migrate to aggregate driver Date: Thu, 2 Dec 2021 14:27:08 -0800 Message-Id: <20211202222732.2453851-11-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 Content-Transfer-Encoding: 8bit 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 , "Rafael J. Wysocki" , linux-arm-msm@vger.kernel.org, Liviu Dudau , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Laurent Pinchart , 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. TODO: This can be updated to move the drm helper logic into the aggregate driver shutdown op. Cc: Laurent Pinchart Cc: Liviu Dudau Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/arm/malidp_drv.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c index 78d15b04b105..e6ee4d1e3bb8 100644 --- a/drivers/gpu/drm/arm/malidp_drv.c +++ b/drivers/gpu/drm/arm/malidp_drv.c @@ -702,8 +702,9 @@ static int malidp_runtime_pm_resume(struct device *dev) return 0; } -static int malidp_bind(struct device *dev) +static int malidp_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct resource *res; struct drm_device *drm; struct malidp_drm *malidp; @@ -894,8 +895,9 @@ static int malidp_bind(struct device *dev) return ret; } -static void malidp_unbind(struct device *dev) +static void malidp_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *drm = dev_get_drvdata(dev); struct malidp_drm *malidp = drm->dev_private; struct malidp_hw_device *hwdev = malidp->dev; @@ -921,9 +923,13 @@ static void malidp_unbind(struct device *dev) of_reserved_mem_device_release(dev); } -static const struct component_master_ops malidp_master_ops = { - .bind = malidp_bind, - .unbind = malidp_unbind, +static struct aggregate_driver malidp_aggregate_driver = { + .probe = malidp_bind, + .remove = malidp_unbind, + .driver = { + .name = "malidp_drm", + .owner = THIS_MODULE, + }, }; static int malidp_compare_dev(struct device *dev, void *data) @@ -949,13 +955,12 @@ static int malidp_platform_probe(struct platform_device *pdev) drm_of_component_match_add(&pdev->dev, &match, malidp_compare_dev, port); of_node_put(port); - return component_master_add_with_match(&pdev->dev, &malidp_master_ops, - match); + return component_aggregate_register(&pdev->dev, &malidp_aggregate_driver, match); } static int malidp_platform_remove(struct platform_device *pdev) { - component_master_del(&pdev->dev, &malidp_master_ops); + component_aggregate_unregister(&pdev->dev, &malidp_aggregate_driver); return 0; } -- https://chromeos.dev