Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp928683pxb; Mon, 25 Oct 2021 22:43:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOTvUMWBqpx6eYaD4TvwRpKzYDb3x36ekC9c1ZAG4BUkFZJ5vJimGUW7BJTGnZ7OmUvTBx X-Received: by 2002:a17:90a:644d:: with SMTP id y13mr26306044pjm.10.1635227030451; Mon, 25 Oct 2021 22:43:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635227030; cv=none; d=google.com; s=arc-20160816; b=y+dy0vdi2ItHjMWNQDpYNN0KWx6HtKXJ5jpY73lhFJAW5pE6FT13csv1CJXBJDsCsw Qh5CNrZKi8PNTh8SMkzN/HBrk7wSuc5s88LGzxqZx1En987mPlIFnFckW69F/7VvnpLy OlLXC8L3dvoUbnVuKeulgPrs0wI4qXIhJFmDFFxXrkgCL53JbfbyPsszt4710jHFAI02 NtDDJNJF+DfWEMCDNEziLfIRp6tfoU/FVf67/SvmPd9Xcq7ub9z81lcbzUgHczbYUYIR I9AyWpKV2LQnPpX5Oq3SApz7MaSF6SOA1FDz2hzCLYVbCi4EuytrvgVesnQ7PfrY+xhC p6cw== 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=5Xg9zrUyKFMa3ddbem3zPmmRQ2IkXwWBatRdclbFjwA=; b=govyJVgtgkQ0+STCo419xQnXqk94Syj8d7szhfgqFE1sfDFHGkfJAxcWv6afoA7uvH hfNh03XSJwBFfkmgbuZSA3Vi9qwDUcfumK5c8f0LTwHBL5pixq/i++b9ywV1pFozzUbN tcU7t7UUk8VMwvt977MvukR+6/ixy+zUZ9qhxpQk/LHdr9dXVGcasW7W1sBC/qdcJv6h Xg16tVkCnsN4Wr/envmtkpY1GZXIlA9G0k2qiy/KygjpgySJVkp8csIQTaN0wgcjDCKl 4QbgQ6MIRYvnxgz8kRwrivBAOYbvkoM9tnDnO7HcgZ6LRLTFniWro02HUTn0HgANBVXv RSRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=X+qIwuMI; 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 j7si5977203pfc.67.2021.10.25.22.43.37; Mon, 25 Oct 2021 22:43:50 -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=X+qIwuMI; 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 S236118AbhJZAEX (ORCPT + 99 others); Mon, 25 Oct 2021 20:04:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235697AbhJZAD1 (ORCPT ); Mon, 25 Oct 2021 20:03:27 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 835CBC061224 for ; Mon, 25 Oct 2021 17:01:03 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id f5so12251982pgc.12 for ; Mon, 25 Oct 2021 17:01:03 -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=5Xg9zrUyKFMa3ddbem3zPmmRQ2IkXwWBatRdclbFjwA=; b=X+qIwuMITz6qKYQulA551uMYxR8jlZgi8Db5cvWB3HBwUrd3DvVFN2hlELtd3puyiy Ww1WqQqWkyJNVSY8STnESySzdjIyVTwTccUSZMhpSSkbO117dO+9sqLyJaNkB+NtjZsn QMPPk6RaLEZ10FxQZ2hMHJxkO7EZWoksXQ/5E= 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=5Xg9zrUyKFMa3ddbem3zPmmRQ2IkXwWBatRdclbFjwA=; b=jqnz5wgnH/zRPtvF7cnQ7UMoUCrIk1nQSz8xwiG4eY0uQXMyud075zrtFKsVbgO4UD HYhPz1v2yQEng9GR3/+Mh0f2Z6CMlSC/WUQNyFWslsom57pN99WiFNAIUiDFLNlS1bJC kh8S5OJb1r9F8dvOglyPo+bvWKhery/FcaJc+e9D1cMojISvCacYOCC77HOASwI8U9C/ av8D8Q3SHdKrLTgaUXbYB7yVlSgTWxMVBgTAv1FvHVPfu3l7opZ//rPObBRK6kz3lvu9 q3itSSEx5T6ZyvHjMownXQ81xPFMkfntQ68xxYnUXoWiwFH2wMqXyJ/rBuJLw9Ech5H0 d0FQ== X-Gm-Message-State: AOAM533QPh/69E9KVFnBdgPU8Zj6QDAY6p01CGqtqlUqbCKja4AKOiMN m9wAZiP0EKqWAtmlAEt/vVUpNw== X-Received: by 2002:a63:35cd:: with SMTP id c196mr13974325pga.284.1635206462978; Mon, 25 Oct 2021 17:01:02 -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.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Oct 2021 17:01:02 -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, Neil Armstrong , Daniel Vetter , "Rafael J. Wysocki" , Rob Clark , Russell King , Saravana Kannan Subject: [PATCH v3 19/34] drm/meson: Migrate to aggregate driver Date: Mon, 25 Oct 2021 17:00:29 -0700 Message-Id: <20211026000044.885195-20-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: Neil Armstrong Cc: Daniel Vetter Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Saravana Kannan Signed-off-by: Stephen Boyd --- drivers/gpu/drm/meson/meson_drv.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/meson/meson_drv.c b/drivers/gpu/drm/meson/meson_drv.c index bc0d60df04ae..109fb9d057e3 100644 --- a/drivers/gpu/drm/meson/meson_drv.c +++ b/drivers/gpu/drm/meson/meson_drv.c @@ -357,13 +357,16 @@ static int meson_drv_bind_master(struct device *dev, bool has_components) return ret; } -static int meson_drv_bind(struct device *dev) +static int meson_drv_bind(struct aggregate_device *adev) { + struct device *dev = adev->parent; + return meson_drv_bind_master(dev, true); } -static void meson_drv_unbind(struct device *dev) +static void meson_drv_unbind(struct aggregate_device *adev) { + struct device *dev = adev->parent; struct meson_drm *priv = dev_get_drvdata(dev); struct drm_device *drm = priv->drm; @@ -387,9 +390,13 @@ static void meson_drv_unbind(struct device *dev) } } -static const struct component_master_ops meson_drv_master_ops = { - .bind = meson_drv_bind, - .unbind = meson_drv_unbind, +static struct aggregate_driver meson_aggregate_drv = { + .probe = meson_drv_bind, + .remove = meson_drv_unbind, + .driver = { + .name = "meson_drm", + .owner = THIS_MODULE, + }, }; static int __maybe_unused meson_drv_pm_suspend(struct device *dev) @@ -503,9 +510,7 @@ static int meson_drv_probe(struct platform_device *pdev) if (count) { dev_info(&pdev->dev, "Queued %d outputs on vpu\n", count); - return component_master_add_with_match(&pdev->dev, - &meson_drv_master_ops, - match); + return component_aggregate_register(&pdev->dev, &meson_aggregate_drv, match); } /* If no output endpoints were available, simply bail out */ -- https://chromeos.dev