From patchwork Thu Dec 2 22:26:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stephen Boyd X-Patchwork-Id: 520060 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B0E7C43217 for ; Thu, 2 Dec 2021 22:27:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239809AbhLBWa7 (ORCPT ); Thu, 2 Dec 2021 17:30:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60498 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349201AbhLBWa7 (ORCPT ); Thu, 2 Dec 2021 17:30:59 -0500 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89872C06175B for ; Thu, 2 Dec 2021 14:27:36 -0800 (PST) Received: by mail-pl1-x636.google.com with SMTP id u11so751619plf.3 for ; Thu, 02 Dec 2021 14:27:36 -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:mime-version :content-transfer-encoding; bh=5WjMVJlEvHCp7tTv7npHyleFiHNkXhRhHCdBOuZtqvQ=; b=Bjy1MQ1/dmjzsHusnNupzZgwROVBZHR+JowF629y1E1WFpdgUOafwyPSlDiFFbH4DS TtmOv1mKEn8sS6GtBLCyMvee4wdRX9qPCJLPht+ksdTUTV8k07HfHtgVui1y1uKKElqY h58KNT3N4Jkutcui3TbymX6qTPQ2JnAA4eAss= 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:mime-version :content-transfer-encoding; bh=5WjMVJlEvHCp7tTv7npHyleFiHNkXhRhHCdBOuZtqvQ=; b=ydDK0BSGrvn20Rx7z6Y2BmAEfU6gDiGxVEcn7LAhcUHYiXrrQ3Hbv3Bf36LbuoqDeI XDOkUejHyhCKOJnCoOj41sXH+toUKhuosNM5hXz4wiMmWcYUBPnB+fFLihHe8ZdpikH+ ejtqEzAmHTio3c7Ktd7+WdNni6ZAQNSwdP4up1KZsLDeiz3njTTGK221+N06JmpNQxR/ AWBYDp6JgdO3YZ8eMpjcXyY8FAv7ORW4AmgtVcOnhFFFy8ZTj/o5MqB5wIYM2Fdm6a6w PsnhbAPSdhYPpiwgA+YGjtJpBwXDo/PxXNH91VaRvZtkUCSUtBF/7bS1lyoGf8Pxxtjl NraQ== X-Gm-Message-State: AOAM532peN3D6n806MSjjY4fDHF9fk7qGJ+0Qt3ixyHG0U3yB+4FFp39 CJtgtbd6Al40fwAT7F3zVVs8WQ== X-Google-Smtp-Source: ABdhPJyMSX7reHsiHW/u9oxdh7JPxePin6ydBK/uJtlLT6HG2XEj1YzWc6sEjYmPD3r5kOUwBPPOdA== X-Received: by 2002:a17:903:4053:b0:143:6d84:984c with SMTP id n19-20020a170903405300b001436d84984cmr18435905pla.37.1638484055856; Thu, 02 Dec 2021 14:27:35 -0800 (PST) Received: from smtp.gmail.com ([2620:15c:202:201:f4f2:1b7e:5aea:bf3c]) by smtp.gmail.com with ESMTPSA id q9sm836934pfj.9.2021.12.02.14.27.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Dec 2021 14:27:34 -0800 (PST) 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, Arnd Bergmann , Benjamin Gaignard , Chen Feng , Chen-Yu Tsai , Christian Gmeiner , Chun-Kuang Hu , Daniel Vetter , Emma Anholt , =?utf-8?q?Heiko_St=C3=BCbner?= , Inki Dae , James Qian Wang , Jaroslav Kysela , Joerg Roedel , John Stultz , Joonyoung Shim , Jyri Sarha , Kai Vehmanen , Kyungmin Park , Laurent Pinchart , linux-fbdev@vger.kernel.org, linux-omap@vger.kernel.org, linux-pm@vger.kernel.org, Linus Walleij , Liviu Dudau , Lucas Stach , Mark Brown , Maxime Ripard , Neil Armstrong , Paul Cercueil , Philipp Zabel , "Rafael J. Wysocki" , Rob Clark , Russell King , Russell King , Russell King , Sandy Huang , Saravana Kannan , Sebastian Reichel , Seung-Woo Kim , Takashi Iwai , Tian Tao , Tomas Winkler , Tomi Valkeinen , Will Deacon , Xinliang Liu , Xinwei Kong , Yong Wu , Vitaly Lubart , Daniele Ceraolo Spurio , Rodrigo Vivi Subject: [PATCH v4 00/34] component: Make into an aggregate bus Date: Thu, 2 Dec 2021 14:26:58 -0800 Message-Id: <20211202222732.2453851-1-swboyd@chromium.org> X-Mailer: git-send-email 2.34.0.384.gca35af8252-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org This series is from discussion we had on reordering the device lists for drm shutdown paths[1]. I've introduced an 'aggregate' bus that we put the aggregate device onto and then we probe the aggregate device once all the components are probed and call component_add(). The probe/remove hooks are where the bind/unbind calls go, and then a shutdown hook is added that can be used to shutdown the drm display pipeline at the right time. This works for me on my sc7180 board. I no longer get a warning from i2c at shutdown that we're trying to make an i2c transaction after the i2c bus has been shutdown. There's more work to do on the msm drm driver to extract component device resources like clks, regulators, etc. out of the component bind function into the driver probe but I wanted to move everything over now in other component drivers before tackling that problem. Tested-by tags would be appreciated, and Acked-by/Reviewed-by tags too. Changes since v3 (https://lore.kernel.org/r/20211026000044.885195-1-swboyd@chromium.org): - Picked up tags - Rebased to v5.16-rc2 - Updated component.c for a few new patches there - Dropped a conversion patch - Added a conversion patch Changes since v2 (https://lore.kernel.org/r/20211006193819.2654854-1-swboyd@chromium.org): - Picked up acks - Fixed build warnings/errors - Reworked patch series to rename 'master' in a different patch Changes since v1 (https://lore.kernel.org/r/20210520002519.3538432-1-swboyd@chromium.org): - Use devlink to connect components to the aggregate device - Don't set the registering device as a parent of the aggregate device - New patch for bind_component/unbind_component ops that takes the aggregate device - Convert all drivers in the tree to use the aggregate driver approach - Allow one aggregate driver to be used for multiple aggregate devices [1] https://lore.kernel.org/r/20210508074118.1621729-1-swboyd@chromium.org Stephen Boyd (34): component: Introduce struct aggregate_device component: Remove most references to 'master' component: Introduce the aggregate bus_type component: Move struct aggregate_device out to header file component: Add {bind,unbind}_component() ops that take aggregate device drm/of: Add a drm_of_aggregate_probe() API drm/msm: Migrate to aggregate driver drm/komeda: Migrate to aggregate driver drm/arm/hdlcd: Migrate to aggregate driver drm/malidp: Migrate to aggregate driver drm/armada: Migrate to aggregate driver drm/etnaviv: Migrate to aggregate driver drm/kirin: Migrate to aggregate driver drm/exynos: Migrate to aggregate driver drm/imx: Migrate to aggregate driver drm/ingenic: Migrate to aggregate driver drm/mcde: Migrate to aggregate driver drm/mediatek: Migrate to aggregate driver drm/meson: Migrate to aggregate driver drm/omap: Migrate to aggregate driver drm/rockchip: Migrate to aggregate driver drm/sti: Migrate to aggregate driver drm/sun4i: Migrate to aggregate driver drm/tilcdc: Migrate to aggregate driver drm/vc4: Migrate to aggregate driver iommu/mtk: Migrate to aggregate driver mei: Migrate to aggregate driver power: supply: ab8500: Migrate to aggregate driver fbdev: omap2: Migrate to aggregate driver sound: hdac: Migrate to aggregate driver ASoC: codecs: wcd938x: Migrate to aggregate driver mei: pxp: Migrate to aggregate driver component: Get rid of drm_of_component_probe() component: Remove component_master_ops and friends drivers/base/component.c | 544 ++++++++++-------- .../gpu/drm/arm/display/komeda/komeda_drv.c | 20 +- drivers/gpu/drm/arm/hdlcd_drv.c | 21 +- drivers/gpu/drm/arm/malidp_drv.c | 21 +- drivers/gpu/drm/armada/armada_drv.c | 23 +- drivers/gpu/drm/drm_drv.c | 2 +- drivers/gpu/drm/drm_of.c | 18 +- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 20 +- drivers/gpu/drm/exynos/exynos_drm_drv.c | 21 +- .../gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 20 +- drivers/gpu/drm/imx/imx-drm-core.c | 20 +- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 25 +- drivers/gpu/drm/mcde/mcde_drv.c | 23 +- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 20 +- drivers/gpu/drm/meson/meson_drv.c | 21 +- drivers/gpu/drm/msm/msm_drv.c | 46 +- drivers/gpu/drm/omapdrm/dss/dss.c | 20 +- drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 20 +- drivers/gpu/drm/sti/sti_drv.c | 20 +- drivers/gpu/drm/sun4i/sun4i_drv.c | 26 +- drivers/gpu/drm/tilcdc/tilcdc_drv.c | 28 +- drivers/gpu/drm/vc4/vc4_drv.c | 20 +- drivers/iommu/mtk_iommu.c | 14 +- drivers/iommu/mtk_iommu.h | 6 +- drivers/iommu/mtk_iommu_v1.c | 14 +- drivers/misc/mei/hdcp/mei_hdcp.c | 22 +- drivers/misc/mei/pxp/mei_pxp.c | 22 +- drivers/power/supply/ab8500_charger.c | 22 +- drivers/video/fbdev/omap2/omapfb/dss/dss.c | 20 +- include/drm/drm_of.h | 10 +- include/linux/component.h | 92 ++- sound/hda/hdac_component.c | 21 +- sound/soc/codecs/wcd938x.c | 20 +- 33 files changed, 772 insertions(+), 490 deletions(-) Cc: Arnd Bergmann Cc: Benjamin Gaignard Cc: Chen Feng Cc: Chen-Yu Tsai Cc: Christian Gmeiner Cc: Chun-Kuang Hu Cc: Daniel Vetter Cc: Emma Anholt Cc: Greg Kroah-Hartman Cc: "Heiko Stübner" Cc: Inki Dae Cc: James Qian Wang (Arm Technology China) Cc: Jaroslav Kysela Cc: Joerg Roedel Cc: John Stultz Cc: Joonyoung Shim Cc: Jyri Sarha Cc: Kai Vehmanen Cc: Kyungmin Park Cc: Laurent Pinchart Cc: Cc: Cc: Cc: Linus Walleij Cc: Liviu Dudau Cc: Lucas Stach Cc: Mark Brown Cc: Maxime Ripard Cc: Neil Armstrong Cc: Paul Cercueil Cc: Philipp Zabel Cc: "Rafael J. Wysocki" Cc: Rob Clark Cc: Russell King Cc: Russell King Cc: Russell King Cc: Sandy Huang Cc: Saravana Kannan Cc: Sebastian Reichel Cc: Seung-Woo Kim Cc: Takashi Iwai Cc: Tian Tao Cc: Tomas Winkler Cc: Tomi Valkeinen Cc: Will Deacon Cc: Xinliang Liu Cc: Xinwei Kong Cc: Yong Wu Cc: Vitaly Lubart Cc: Daniele Ceraolo Spurio Cc: Rodrigo Vivi Cc: Kai Vehmanen base-commit: 136057256686de39cc3a07c2e39ef6bc43003ff6 Tested-by: Linus Walleij Tested-by: Linus Walleij