Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp847353pxb; Mon, 25 Oct 2021 20:29:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwuRA2Qns0f+fZ8mfA9kFJ4mt2S5qA15z1lsq45o3DrfOFYbDC9YpyKhJtdqyrZ1SAtgaZ X-Received: by 2002:a62:e707:0:b0:47b:e32f:8538 with SMTP id s7-20020a62e707000000b0047be32f8538mr14641835pfh.69.1635218959393; Mon, 25 Oct 2021 20:29:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635218959; cv=none; d=google.com; s=arc-20160816; b=LNuc+1FqSgXesXCchG2S6VoYThFlxaNrwM/yI2cHA0XV/KSV6PQyso/rliynTYL0wH FLgaTLdQm8oKQeTeZc8oB+riVYVWpL6h5tC3sXdk9KyMzDwnUf3YMhGKrCp7z5vvPIoA aqxc5dI1loSeFtebuhIpLlRJ0yja6bcvdOOU+ADgzbhFBUdkL1JCKFb5+yv7w3E1EXr8 PxlIq2Eij9xWvTnDIRzKMwewyUo+UcG2EBCq04eVToBKWwLjiDQyEY9S49sAuMAyhsrs M/+U9O8Wz4filLAFgVlNyJC9K8HcXzUMai1ZUuSfe1bXwFA/R4z2me61Ur/ZPIo8T1oi Ueng== 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=InGYSc3cNsqSsbEpZp55brWuJhvXfCPzOPufF1ln430=; b=bSu9YPWR+cqLFMaGZOh+3pmtFm3HU3xGtBWpeCw4KbudFNx9kGVt59RYDjRoeE64X2 0rPTMCAclMfB999yhQ89nuMvmYtxWxty2PcLgsjPP5XT2XDNknvJijTssftaQ2m6imqw RNiNOqNyPmr5C9WmG6bjaqXFoK1f2H3DM3TDKUjI9zDBOOcFUZOaIyIlCZN9Q8J/NGvE lwavwTbYRVXM+mt4FU7ziVbSfM934TeD5fADjVACICAWbzNinBn2d6qzMdphIa3A1TBR 9i4zaOFAeOs1vnfoAckOe3itJHVgHEg+g6zB+nNzJ4gJh0QoiXm655jwuimkA06IK4Sx 4Q+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=n27nI7U1; 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 e27si26929845pgl.492.2021.10.25.20.29.04; Mon, 25 Oct 2021 20:29:19 -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=n27nI7U1; 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 S236086AbhJZAER (ORCPT + 99 others); Mon, 25 Oct 2021 20:04:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58384 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235673AbhJZADX (ORCPT ); Mon, 25 Oct 2021 20:03:23 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D913FC061243 for ; Mon, 25 Oct 2021 17:01:00 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id g184so12292620pgc.6 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=InGYSc3cNsqSsbEpZp55brWuJhvXfCPzOPufF1ln430=; b=n27nI7U1DJDvZP2a3K1XXE0Ongz64Cp5hXkiNgMSat5fEPQ3vu1a75vTaQO3+pnmyg STl3OLtEq/SmPIKsXzKjPLBmUSWixbG6f0RdS7Vj1YqGvA8qSFXroU2wrN6ON8KMmdV1 dvpfHtKuA3jb1u8Ybs8VnD+AxNg5h7KdZdi80= 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=InGYSc3cNsqSsbEpZp55brWuJhvXfCPzOPufF1ln430=; b=gVIZowDBuuN1CeCG3sCc8x6bTGlxf8O8w/3x3Ifnm6ExncRNBPyX5VGYyYcqIfv/0u 2XKGdUe5RYuv8RgPjNbXmjWwS8lFR9xUtvSp7UTW/BBRSbmVUW4JA/6yEbW1rl/GFiER vSD4wSCdI6NNjE0IJ2KcUmNyDwQcGLbOp9ig/YySjUl9rAguC77cj0tWT2TAwtNQ1ILB SPzXsu60xV6v//jrA3BlU84j2anIDh6PcVKVq0ZpZeDVN6ZY2G8JbzAWsoW7Ib+R4cpl 3Oc81qaY/4Ajfljl0Nx4A1Y6e1alwxXrOTmz+ZD/opfpT7zcyMcGZtLhfN8r12J1oFJ4 4RHw== X-Gm-Message-State: AOAM530CoL9NcO6ddFLSMKFyyJ7WA4LwLMXuLKTan0meUSsuiFAGcNwt bwnOKHOZz9Fb1vYBDyB5/ZUC/A== X-Received: by 2002:a63:3f8f:: with SMTP id m137mr3065948pga.279.1635206460430; Mon, 25 Oct 2021 17:01:00 -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.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:01:00 -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, Paul Cercueil , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v3 16/34] drm/ingenic: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:26 -0700 Message-Id: <20211026000044.885195-17-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: Move the helpers to PM in aggregate driver hooks. Acked-by: Paul Cercueil Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 25 +++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index a5df1c8d34cd..d5330fb486e8 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -1150,8 +1150,10 @@ static int ingenic_drm_bind(struct device *dev, bool has_components) return ret; } -static int ingenic_drm_bind_with_components(struct device *dev) +static int ingenic_drm_bind_with_components(struct aggregate_device *adev) { + struct device *dev = adev->parent; + return ingenic_drm_bind(dev, true); } @@ -1174,9 +1176,20 @@ static void ingenic_drm_unbind(struct device *dev) drm_atomic_helper_shutdown(&priv->drm); } -static const struct component_master_ops ingenic_master_ops = { - .bind = ingenic_drm_bind_with_components, - .unbind = ingenic_drm_unbind, +static void ingenic_aggregate_remove(struct aggregate_device *adev) +{ + struct device *dev = adev->parent; + + ingenic_drm_unbind(dev); +} + +static struct aggregate_driver ingenic_aggregate_driver = { + .probe = ingenic_drm_bind_with_components, + .remove = ingenic_aggregate_remove, + .driver = { + .name = "ingenic_drm", + .owner = THIS_MODULE, + }, }; static int ingenic_drm_probe(struct platform_device *pdev) @@ -1196,7 +1209,7 @@ static int ingenic_drm_probe(struct platform_device *pdev) drm_of_component_match_add(dev, &match, compare_of, np); of_node_put(np); - return component_master_add_with_match(dev, &ingenic_master_ops, match); + return component_aggregate_register(dev, &ingenic_aggregate_driver, match); } static int ingenic_drm_remove(struct platform_device *pdev) @@ -1206,7 +1219,7 @@ static int ingenic_drm_remove(struct platform_device *pdev) if (!IS_ENABLED(CONFIG_DRM_INGENIC_IPU)) ingenic_drm_unbind(dev); else - component_master_del(dev, &ingenic_master_ops); + component_aggregate_unregister(dev, &ingenic_aggregate_driver); return 0; } -- https://chromeos.dev