Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp758947pxb; Fri, 28 Jan 2022 09:20:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJyAmPucA0Q1RbnjnDRCDA2XGOZWZCO7r9nB74+ZBkEA3jHhG46Zj2f75GA5YAX8BkACx6tL X-Received: by 2002:a17:903:41c6:: with SMTP id u6mr4091219ple.6.1643390422168; Fri, 28 Jan 2022 09:20:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643390422; cv=none; d=google.com; s=arc-20160816; b=d0f926H24ZN6qbvWajAOH2pKc8pc38u1A+DjkjMZITGzmbLA0xeaQSZVAkbKD3ybce eHxPduAeTdJkp7rEIfiNyjpfg/mk1vYIsW71Rm9OyjUjepRMSoWLDiHHO3C7AJwQNskE 6fP6H/05/IODI3z1gRd9+plzO5NL86XWDXNnklPVr0l4eC+nianOqE3K4vOmenh5JdBY E9k35YmyosnNuSFPytYHWCrAv8H7qJbKOIXJJghb95HGSQ7iFjUKTQ5ZGxNioeu29Qbk 5IBnnZLLWPTqupgHvYN5CNp5gjwxdkbg8DYZpn62FlEKe+IQx2DAgiI4oL1KWxQRUOmw h1XQ== 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=IW/8Y9aTwhLOwEb2xP1btnAgZlqJiVoA25E4MQ0ztlM=; b=wMxDqxQv7Mg+E4KVU2D1PxsswLhdegF+4JDVmYg6gO8pMbLWy+iGfSSESlFuV1VV+c UKfayPCSOu4wqBqlUwueDxnwqzslNrLx/Sw+qtqnp+kStgTGlbIQeF138pfUrfiU0t8x o7GwtZqrCqcQxGRvWq6IeVVNwWYUeNNIy/I/ZnopM2ZN0asT+lGinGq4Vm8AgqLA5iGH MnQOU938Ch+gD7BSXJyZgdA8yHCrO2nGsPmTSZaQ+SRCixxBMKwWzgE4jSlKBkorbO8m CtNiHA+EDQwaPyrlprlQgUYXDDQu4TG4g/MN1ffmzUKLL11AtHPJDDscSzlJOJzgVFSs z0LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Orc/8SO3"; 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 n17si6950038plf.69.2022.01.28.09.20.10; Fri, 28 Jan 2022 09:20:22 -0800 (PST) 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="Orc/8SO3"; 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 S1343942AbiA0UD5 (ORCPT + 99 others); Thu, 27 Jan 2022 15:03:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343765AbiA0UCY (ORCPT ); Thu, 27 Jan 2022 15:02:24 -0500 Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1B965C061762 for ; Thu, 27 Jan 2022 12:02:21 -0800 (PST) Received: by mail-pj1-x102d.google.com with SMTP id h12so4142692pjq.3 for ; Thu, 27 Jan 2022 12:02:21 -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=IW/8Y9aTwhLOwEb2xP1btnAgZlqJiVoA25E4MQ0ztlM=; b=Orc/8SO3R+dEVDvMgPCjrMtDqLFJ0Q6HS0V1upmPpUW4kXr9C4iejmRDOGbRV9iW4j k9loF01QGaULZ1/ixZXpaAmhKNCK4M8hIxc3gWmGet47QcH0vvkYz42DwlJvJdht3Dnv tqIWTsf24/eGXmaKQV4HRtIrBwUEtqhRo9dI4= 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=IW/8Y9aTwhLOwEb2xP1btnAgZlqJiVoA25E4MQ0ztlM=; b=vY3epaw7reVpjFV/se+niUuNdhVCaAIP1nBRurUgTN3MOV9XvxsjxMvYDceS0UHueI H5P0jvJn1tSvxUcSTV2w6lEVSAyPbyTd2z9SxQLXb6Vm7GEmjF9CKlhFBEPGbrHzdV9t RbncPf8iTKqyMoz3RIPAkv8X3lsLQ0tIiFlZvSJXccilrZJ4PdxRjZMxNz23xU+Fm4tZ /LHuoW4kaaalMCnERAOEKvrT/qgkmBTQHN1Os/JDNNcIl73v4M5NbIGaR9L+ReEy9UzY ZrGCFZa3VnP9jxWF7pongsUBDVLpmhKGmXajf/0XxaSzPJ+i+pkjuVATEoH4tZ5mJhIE 7VTQ== X-Gm-Message-State: AOAM532u5qjA7o+0bf7mnRAHJ+c6eoNFqhQJFV1015q1M9Ur7lkOoG9E hxnYrvqPlXvWGmOqV8MbTKn1og== X-Received: by 2002:a17:902:da90:: with SMTP id j16mr4907623plx.101.1643313740669; Thu, 27 Jan 2022 12:02:20 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:201:9246:1838:3243:3071]) by smtp.gmail.com with ESMTPSA id k21sm6561190pff.33.2022.01.27.12.02.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jan 2022 12:02:20 -0800 (PST) From: Stephen Boyd To: Greg Kroah-Hartman , Douglas Anderson Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Sandy Huang , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v6 20/35] drm/rockchip: Migrate to aggregate driver Date: Thu, 27 Jan 2022 12:01:26 -0800 Message-Id: <20220127200141.1295328-21-swboyd@chromium.org> X-Mailer: git-send-email 2.35.0.rc0.227.g00780c9af4-goog In-Reply-To: <20220127200141.1295328-1-swboyd@chromium.org> References: <20220127200141.1295328-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: Sandy Huang Cc: "Heiko Stübner" Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c index bec207de4544..6a6ed293d7a0 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -108,8 +108,9 @@ static void rockchip_iommu_cleanup(struct drm_device *drm_dev) iommu_domain_free(private->domain); } -static int rockchip_drm_bind(struct device *dev) +static int rockchip_drm_bind(struct aggregate_device *adev) { + struct device *dev = aggregate_device_parent(adev); struct drm_device *drm_dev; struct rockchip_drm_private *private; int ret; @@ -179,8 +180,9 @@ static int rockchip_drm_bind(struct device *dev) return ret; } -static void rockchip_drm_unbind(struct device *dev) +static void rockchip_drm_unbind(struct aggregate_device *adev) { + struct device *dev = aggregate_device_parent(adev); struct drm_device *drm_dev = dev_get_drvdata(dev); drm_dev_unregister(drm_dev); @@ -331,9 +333,13 @@ static struct component_match *rockchip_drm_match_add(struct device *dev) return match ?: ERR_PTR(-ENODEV); } -static const struct component_master_ops rockchip_drm_ops = { - .bind = rockchip_drm_bind, - .unbind = rockchip_drm_unbind, +static struct aggregate_driver rockchip_aggregate_driver = { + .probe = rockchip_drm_bind, + .remove = rockchip_drm_unbind, + .driver = { + .name = "rockchip_drm", + .owner = THIS_MODULE, + }, }; static int rockchip_drm_platform_of_probe(struct device *dev) @@ -404,7 +410,7 @@ static int rockchip_drm_platform_probe(struct platform_device *pdev) if (IS_ERR(match)) return PTR_ERR(match); - ret = component_master_add_with_match(dev, &rockchip_drm_ops, match); + ret = component_aggregate_register(dev, &rockchip_aggregate_driver, match); if (ret < 0) { rockchip_drm_match_remove(dev); return ret; @@ -415,7 +421,7 @@ static int rockchip_drm_platform_probe(struct platform_device *pdev) static int rockchip_drm_platform_remove(struct platform_device *pdev) { - component_master_del(&pdev->dev, &rockchip_drm_ops); + component_aggregate_unregister(&pdev->dev, &rockchip_aggregate_driver); rockchip_drm_match_remove(&pdev->dev); -- https://chromeos.dev