Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp846341pxb; Mon, 25 Oct 2021 20:27:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5WT5qEAsjZqXbYGD7AGo7Kv6CAjjawrLoDk0ntlS9zkzDDztsD9KSLQhDoB82LqpcF8VC X-Received: by 2002:a17:906:d14e:: with SMTP id br14mr27473989ejb.505.1635218851789; Mon, 25 Oct 2021 20:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635218851; cv=none; d=google.com; s=arc-20160816; b=wF8xDJvLUX6mIUo1bpG6wJeCBKKr+CvFA5ihZ43dJRB/xNulNeShuvjkquwqHcDbmY weOCE0zz3swxOjw1igM3kCoh1+JQV1k71dc6B/v7GvaZr9c2iC57wejgFtit3tR7Dv6I MK52rJY9n3nW63teZlbs0moivTwRRMMoc9ndLpeqt0c9P9hqvmrRaunoa2xtU+UWgb6A ts9DeBs5SYkItGD3G4LUO2DsKeB4xI9K3seKhUD2IsvlfIa9yueOCK5K7spjQXgxyI/3 O1QU/a+2yyhegcOUIp4mlbcGAliRcHRAyCqSJ89LfNk0/lSD5DZwCURkvqPf0+i8zxh3 z37A== 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=xbBIA2S7VMXOXCQu3Vr82oQpSXn2i51a0ZJRtaPISIs=; b=BwH+JZQFSR1AF14BAU51bwILTsse4wJBk+jt0Bg3TCk0h3GxswBPzZx6X9MTCXYU51 /KBS4/atQu6EHpSk6wsOJ4oBBQN6q68vjl6f+DyNvWraTzkhLIsSa3NO0jarOQbwg0wJ Xf/DfNcdFCYWQB/VCYVEAOQyzwT5pMm1FlQjTyrOdLHt/kLkuhIcexk8dCYlu8megGH3 LjDSZN6uyDhzCL0xkhba1zg3mxLNIVQEjTAbAXObo69X4IDwjvNhBo7UdOZ67XTpf52b W1A56hC8VhiktoDB5s2gQhbLhwJVUJCDqwqQLz7dRcbX0SzZTMPZKDpk8NQdxlmhkqB3 aZlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=IFB7bXnz; 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 d4si13326991edo.606.2021.10.25.20.27.08; Mon, 25 Oct 2021 20:27:31 -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=IFB7bXnz; 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 S236047AbhJZAEM (ORCPT + 99 others); Mon, 25 Oct 2021 20:04:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58374 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235666AbhJZADX (ORCPT ); Mon, 25 Oct 2021 20:03:23 -0400 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08682C061228 for ; Mon, 25 Oct 2021 17:01:00 -0700 (PDT) Received: by mail-pg1-x52b.google.com with SMTP id t7so12281390pgl.9 for ; Mon, 25 Oct 2021 17:01:00 -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=xbBIA2S7VMXOXCQu3Vr82oQpSXn2i51a0ZJRtaPISIs=; b=IFB7bXnzVvlVX81TcMP9+qq+2LS6XC8kvLUolA0a9EiVRRhI9h5HOH8CYlQMBkyZtF w1M1dJ4099haRG17Kbgw/c/Hsi08G5NXG224TvF1tLfU6uN4bQCMLs9fL2cgkX0PsshI WqofS2DtMsrWBcKMWVeAUZkp00CFd7c/5aFXk= 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=xbBIA2S7VMXOXCQu3Vr82oQpSXn2i51a0ZJRtaPISIs=; b=cI0ayhSmx1Es9FO2LcIg7CZBF8JFYX4fzaMQY/kTF9r8+47ZRhi34wGlITrWwumdCX yovcQM1RFrthXzkpV+taoMsdj0t00rxwPo+CJx/Rd45p+1OzlpT+eEEpL6lofVhv/qQt KVetkmflXlJVDLfBGIQ20TzjNsiw654snxNO8AuiWNVPGxVmtFbV2wS+jsxg52iP44Vq 1TYDseQxZxl42jrOLpaKcPBlGYgl6bS4h5geLbf25Nu275Tqhw2pHrhVlT+fX8XqH9d+ JTKhTDhS6Svru408QtY17EvYTVIOiREypt5UF//XrrbUepSRntbS1+GgBsAc/nPCaec+ kifg== X-Gm-Message-State: AOAM531X0Zw24V7QALLVe5LeooFU82+voCmevnI+mf8foHNf46rVFSMO Zutg4vOoE1DTThVWnAQnnE5ASA== X-Received: by 2002:a63:230c:: with SMTP id j12mr16437201pgj.1.1635206459577; Mon, 25 Oct 2021 17:00:59 -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.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:00:59 -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, Philipp Zabel , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v3 15/34] drm/imx: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:25 -0700 Message-Id: <20211026000044.885195-16-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. Cc: Philipp Zabel Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/imx/imx-drm-core.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index 9558e9e1b431..dbf5cca5201d 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -198,8 +198,9 @@ static int compare_of(struct device *dev, void *data) return dev->of_node == np; } -static int imx_drm_bind(struct device *dev) +static int imx_drm_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *drm; int ret; @@ -266,8 +267,9 @@ static int imx_drm_bind(struct device *dev) return ret; } -static void imx_drm_unbind(struct device *dev) +static void imx_drm_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct drm_device *drm = dev_get_drvdata(dev); drm_dev_unregister(drm); @@ -281,14 +283,18 @@ static void imx_drm_unbind(struct device *dev) dev_set_drvdata(dev, NULL); } -static const struct component_master_ops imx_drm_ops = { - .bind = imx_drm_bind, - .unbind = imx_drm_unbind, +static struct aggregate_driver imx_drm_aggregate_driver = { + .probe = imx_drm_bind, + .remove = imx_drm_unbind, + .driver = { + .name = "imx_drm", + .owner = THIS_MODULE, + }, }; static int imx_drm_platform_probe(struct platform_device *pdev) { - int ret = drm_of_component_probe(&pdev->dev, compare_of, &imx_drm_ops); + int ret = drm_of_aggregate_probe(&pdev->dev, compare_of, &imx_drm_aggregate_driver); if (!ret) ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32)); @@ -298,7 +304,7 @@ static int imx_drm_platform_probe(struct platform_device *pdev) static int imx_drm_platform_remove(struct platform_device *pdev) { - component_master_del(&pdev->dev, &imx_drm_ops); + component_aggregate_unregister(&pdev->dev, &imx_drm_aggregate_driver); return 0; } -- https://chromeos.dev