Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp844107pxb; Mon, 25 Oct 2021 20:24:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQr5/cCs3W9HrAfGmbz0CLWrHElFnJKcSDW76jdt6N/wssRgd+SNBk7kCgFpWiK2ToAP1z X-Received: by 2002:a17:906:ca4a:: with SMTP id jx10mr26209430ejb.542.1635218660110; Mon, 25 Oct 2021 20:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635218660; cv=none; d=google.com; s=arc-20160816; b=KG4y+tr4F+FNe2gx/vOpb92xOD04247mHjm7NOuntc+jveljdH3vXysAKo6H1Cd4bu O1lfGEJYNIpx9kWlAiyHglMoXI1bDEibfANM7il7Sjqe91KHISsphE207Tdg0i+aGbIK z3K2oXZt7FVzPHLZIGcCO0/TjeYbgkDFXOvImORbp+iN5loWc5amzwc/WhsZSbs1CK2W mBRiszJ8nMxrng3O8v7zkSrhEI5HE12Uz4F/W0w4gMzOSThWKgfrj4AgSZep3tPS0hEy +ZIBy1BJtqivWKhZDsEqLcvvCWf2P3SBhD53rRDqTzwmBgkc/fHSKNOyzewiq/ezmxnp hiYA== 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=tyFhWuo5Hgtey/EJ0ER9SojRROyEQ1lmEqqEKYabFj8=; b=gij8hXz8jK12Tbuss7C6tQArEKVuxU9/VcCqb+EIMnPu0sH1EQVDS/vQcMwYGaSZPQ 8SuX9DGnIhm9DMDNVzlM5wm2zL89poTIufCD2+ffF6J74oY5UVIc7bGtqqxrKloYwXy1 LkRDCx/ogHo30G4oJj/gM7WbjAUqY3CxStGQLFy6YOnlUADjHqY6C+Rh9gOIOwRFI9DI NqXbzR0q1kr8MdRmNgA2+mefXtZIqSwRnzSEAifntuxsldAO52ETBdCRKEUN1w5Y+1bB KHZ0P4Scv6g8OVt8rh+6C9Fh7W49FsfZEfuxwHVAjSpImPxNo44NCNY6dRj8vent8gPp jfHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SptjloWo; 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 l9si2343121edb.119.2021.10.25.20.23.56; Mon, 25 Oct 2021 20:24:20 -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=SptjloWo; 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 S235837AbhJZADt (ORCPT + 99 others); Mon, 25 Oct 2021 20:03:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235587AbhJZADS (ORCPT ); Mon, 25 Oct 2021 20:03:18 -0400 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6193C061224 for ; Mon, 25 Oct 2021 17:00:55 -0700 (PDT) Received: by mail-pg1-x52c.google.com with SMTP id 75so12301736pga.3 for ; Mon, 25 Oct 2021 17:00:55 -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=tyFhWuo5Hgtey/EJ0ER9SojRROyEQ1lmEqqEKYabFj8=; b=SptjloWoUYaVdCtGZsYI9iL8VgxY1BnDa9M8zKaVGY7F7tWuIK4FESeSHoMsaxoOwK YLpNMipadYfxyCpQQRN1P+nCWjdcRRDYe0cnn6hPSh/hY0usdtT2bEKy95de/dnsn+T+ nbJm/KaGU6iTTpq92dFA9PRP9b9pxw7fYhZrI= 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=HKIgACpmzjpYdZlSbN+YIrxCY7PBWBtnQNZlnPTl3ZmdaRPbzDPwR27OQOthHqO+g3 K7yihoRGXL5X6J/yYuYqkAa3WuoVS/x0+wXGkTjAL87e6PvX3KBb+byqS/1ZFxMryR1r GJ3tbXGi+DwFH6nZt5IurOR9yloplbAYAUtb1pvj2IWC2VILX0VA+zrFEAz4HRi2btEw QVTX+l/NJ6io7eWfFJv8078Tq2GSB7TskpYghrBmSQg2B0GQdIOrMu7DISUxN3e9eSIO z2x9GLVd/wqPJp/+07ixl5rROZkAPQPh7pZ/Z9pkCtoEKK6rut01ZefMiS51BkESiEiN hKFA== X-Gm-Message-State: AOAM531tUMQLLaf0PUO4UenHCLTyTVCpflA091j8LJsvt2JBYvvbgxjV L6AFp3KsvgcuGXdLdKuvVx+f+Q== X-Received: by 2002:a65:448a:: with SMTP id l10mr16169625pgq.313.1635206455327; Mon, 25 Oct 2021 17:00:55 -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.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:00:54 -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, Laurent Pinchart , Liviu Dudau , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v3 10/34] drm/malidp: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:20 -0700 Message-Id: <20211026000044.885195-11-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. 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