Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp852227pxb; Mon, 25 Oct 2021 20:37:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwwGVShz5MPa0kr4nlUQxAlkB5eKwXrvWdTzVmUzqsCjRsKUSK/Yf6T2YL4sN+sNzjPdj4 X-Received: by 2002:a50:d78c:: with SMTP id w12mr31998235edi.147.1635219441752; Mon, 25 Oct 2021 20:37:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635219441; cv=none; d=google.com; s=arc-20160816; b=ON0a6/kLW7Jl0rSDrLpcANy2XNvfBwQum0GOW45dksn8Z+GTBbYkF8qGwWnoo0AJ5x 0c3t/IN6EpQNfd2UPBX/dXyavqjre/aJM3UdB/wc/CqKyxHtEWHvWC+tILEGZXwuJe6y hJv5SIcpLHYug9unf2N++tc/FgE4n7ZBHE6Fjx375g8t6ineWWe54LPZ/JuOC+PJQ4tS KHyq0+l1KfsO/u53cfXPcAOEOkLzP2iNhTdQU8k0TzQ9N+jPsl/ST/pwDFd68QI5khm+ Pz2xeJLvUIb9DhTWsS7oRDsUAC3OE4sw8suClHGhhNczg3w3NfMp0wQktZQcltb242Q9 i5Zg== 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=pu3Ettw2+f3cI24EEPlu+iHiL6Bl5h06ZQoWL3Cz2Tw=; b=ZErPAEdnkx0+jGb66BG3d5Dr42c9lWN5Q24DLd9l+XweHKvCNaLZvqR8hN1yhu06Zn vjA+QdzXVA1cW2MNgdkJZNcGk8DtZf1NPRl617WDZwzeSb703dzaRuM4Mo6UyS0ca8Ze zngMch5jxl0cAI3BMdP3j8NUQNVbbiVEpxldhyUTbQXzTdS4SqeQNMWckG4jlY7I1uqj pVNWimO7wdu4Vt1/s4dSBEZFKgUQtg9A4vtWyQLHAznnE+51PB6vWWr0hpSsxDMTiDgv SSJw5FFVSgH9KCy1+bsNGnYmmI8ib7eYFzIDsnk6n7FOZxDs4PPHGdsZ1saHG+oIAGRc rt2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=FyVFBxqf; 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 gg1si7536088ejc.409.2021.10.25.20.36.58; Mon, 25 Oct 2021 20:37:21 -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=FyVFBxqf; 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 S236272AbhJZAFI (ORCPT + 99 others); Mon, 25 Oct 2021 20:05:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235712AbhJZAD2 (ORCPT ); Mon, 25 Oct 2021 20:03:28 -0400 Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D6D7C061745 for ; Mon, 25 Oct 2021 17:01:05 -0700 (PDT) Received: by mail-pj1-x102e.google.com with SMTP id oa12-20020a17090b1bcc00b0019f715462a8so221713pjb.3 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=pu3Ettw2+f3cI24EEPlu+iHiL6Bl5h06ZQoWL3Cz2Tw=; b=FyVFBxqfsIYw8YOp7sC2d6zkxP42HZ4IH945uwnHC8IJXRMGAOMflzcAsSWqsBv3LS rx7di7IicyojDoCy/pfarCS70keFfp5aLLJ7RAYiJFwVcBLnyfVyMQztieULiZDGYH9J XYY2V8lXbLnP7x9/7EQfmfg0ZmwwKzOjuvCN8= 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=pu3Ettw2+f3cI24EEPlu+iHiL6Bl5h06ZQoWL3Cz2Tw=; b=v5qmZOF90IxQ0aspXl6e80HRqWXXAJw82TL4ZqUW5P1Kl+UylnXv1WxhwHuNA9JUiV LXT2x+gP2NPIoqupe4Nk2cCAKiHJQ69diOl+OM5jiqvmCW7IKwRmOoV8J5w9XcKb6KGa w6RUvaWbahUugrzYPMB3jrf/XrhfL1uNYigQrTRCsYGZbYDqp8Q0VrWNMyMIembS1i1U Q/JIppPap1sdO4xX8yoLpgvqHumRmGrwy4DPkU9BMGHUC4IL9/6IOnBAcBpCVEF7SY4c /qrQHrJnqPCYMEEZgMtmhri5DboTxGietx71GpPxnveZSwZD34vtpQaq6T/revWeZeq9 COpg== X-Gm-Message-State: AOAM530XEDpmLxkoGqGSjG8Tk2c6R4PUbq776QF4ElqXup8sYGeuzPrj rksqc7OFtOvEctrEzCnzDSv5Zw== X-Received: by 2002:a17:903:1111:b0:13f:d1d7:fb67 with SMTP id n17-20020a170903111100b0013fd1d7fb67mr18762269plh.85.1635206464672; Mon, 25 Oct 2021 17:01:04 -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.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:01:04 -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, Sandy Huang , =?UTF-8?q?Heiko=20St=C3=BCbner?= , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v3 21/34] drm/rockchip: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:31 -0700 Message-Id: <20211026000044.885195-22-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-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 bfba9793d238..cc63222c3ad0 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c @@ -109,8 +109,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 = adev->parent; struct drm_device *drm_dev; struct rockchip_drm_private *private; int ret; @@ -186,8 +187,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 = adev->parent; struct drm_device *drm_dev = dev_get_drvdata(dev); drm_dev_unregister(drm_dev); @@ -342,9 +344,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) @@ -415,7 +421,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; @@ -426,7 +432,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