Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3892837rdb; Thu, 28 Dec 2023 03:42:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IH+nxmn7qfNyWRGlXe4/QtxjOACLfh9vcOPB2sWtqYhMXgkneCpkVYDgJHLZhaJ4mQeSxYR X-Received: by 2002:ac8:5803:0:b0:427:fe0b:126 with SMTP id g3-20020ac85803000000b00427fe0b0126mr230832qtg.35.1703763745132; Thu, 28 Dec 2023 03:42:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703763745; cv=none; d=google.com; s=arc-20160816; b=DKBbdz0UXCwGVmeWH8hL4ZLXccmNb++KS/F0JgI41q2cwUAMgy8gPQmH+3wSeig9Jy IDObOLWAVoq3O//SRaFStHNZSUSsFQYaYbCD6WxVnsjBwvIXFdScY0Mcc+SkRadDowjn v7yAkTD8jEH8LVeBofpRSu02YEuqPCg7slma8koirYcsJ5wp2mtbzEVSjO+WHA3XoZpP G4WZD6BqlUC99FsQXVInNy+9GTf2VgZgPpsll5lkYxaigLtxQNN9lffUWwe1d+rAi4Jp AGZsoAd3TnxDC9A+5Uz2xV3hoynAfETu8cVpFhrt0XZd8tvvu1pcTaihPmr3OKlwrZtL vM6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=jbh0l/OCUlD5uVSuXEGMcXjE9wl3eO27IjVISScAPlo=; fh=4JOzqA2oEXpn9TNycEGFSXJdkZkrOrBHCApwJqYS1zo=; b=uWgnsyu9SBuhmLZDtfl7t7ujpXnwMRovTlPkAKjzSzgKcBHIZwuvgbLr0arZ78fiij aZJP7AlmjgZwmtAgWs/eWvnwpShPlZxtR7iwwzHE+SJuTsHkgEhlCcuTiAulYYzZojeJ wdtNAtQwTjrmRYhRIVzgYPmUHtAMgaQ+C8JQ2ohIVksV/FGdlA3jYHD3VxpfpbZj4Pnt Q/bZ9KJ8UGvDH/W6sJy9NlWpgVuijqltS4pZYhzhffJVZvWoENldy0rnzXQD+2EzG4w2 GnX2XCSsCdyUrKedB49WjZk3CtJPSgaKRaN9AkjEETh5u6gCEUCUysp3Hs5DFlliWov3 ZqdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LZaXJ7p6; spf=pass (google.com: domain of linux-kernel+bounces-12618-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12618-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o18-20020a05622a139200b00427e8bb628csi4308219qtk.447.2023.12.28.03.42.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 03:42:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12618-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LZaXJ7p6; spf=pass (google.com: domain of linux-kernel+bounces-12618-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12618-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DED0A1C2322B for ; Thu, 28 Dec 2023 11:42:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2B0547482; Thu, 28 Dec 2023 11:42:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="LZaXJ7p6" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36A726FC5 for ; Thu, 28 Dec 2023 11:42:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f182.google.com with SMTP id 38308e7fff4ca-2cc7b9281d1so73408531fa.1 for ; Thu, 28 Dec 2023 03:42:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1703763729; x=1704368529; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=jbh0l/OCUlD5uVSuXEGMcXjE9wl3eO27IjVISScAPlo=; b=LZaXJ7p6c9EuH8ElUlfPZf/8XX8OUluDcLEJ4/mQSU1Ie578J8w2yeSnjXmLNPsFbI LnI32SjSdYjxYTY3/QxC5HJc9JpG0OAzhBTKV0oDbzyVPlEI5NTl/eWDBdzkjNJxGSbL LFOg5VvzKiWTRdT6ItQevwsBEvnLhKbwhicriB8sQoW9uy/GCVjwFZNX3qK96O7ys798 v8DzstZO+Krr4n0mt2JORu2zmh8opg6XmWhOU7dVsMbHWb2Id7OLKG1QOsuqMtfOtqF+ 8L1QJSXpAPMmyh/+5GQDF+4L+iMPlYl9wjSv04xWNzH2z1aY0VZ6aq8OvLLjKBj+nfQS jkww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703763729; x=1704368529; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=jbh0l/OCUlD5uVSuXEGMcXjE9wl3eO27IjVISScAPlo=; b=EehmrNSARQGV96ZI1VN5BZihkXHsXD/bEmhdRsGpSFfgv0i5PnQruE1nHbcfY9fxj3 /glH/1YnBlB4YxOrvA11gqPTKm8IpuMWprz1gX4orx/pN/gDbrN0133rvP9zPpzKTauK qD/YGVUTPVKy46iUIH8PwmPWkiGzsRbc5P3xS58y/SzaTLohL5wf3PjsEzFCqz5l90rp 8hip6p/a5H+rSy4eqOLHUaqZY0JLQ5jctWr+NWIjnXt64W6Co9rFXja7bK2ZHCJNGds6 D66lTCggaoCkc2rct5a4J7LKu7rD2J/4dyeud0U0NpwAjG6YfyWUR1uMIEzrZUrYC4Co jvDw== X-Gm-Message-State: AOJu0YxR7zwp3JVNzYBNYkwVQK66zC+UrZcTBcK4BW2yDGlIfXQEovr2 zftnRAx2rcPPKZphF5dVnZVlpA17Z6+cdQ== X-Received: by 2002:a2e:3c02:0:b0:2cc:69f5:de84 with SMTP id j2-20020a2e3c02000000b002cc69f5de84mr4762669lja.100.1703763729234; Thu, 28 Dec 2023 03:42:09 -0800 (PST) Received: from uffe-tuxpro14.. (h-178-174-189-39.A498.priv.bahnhof.se. [178.174.189.39]) by smtp.gmail.com with ESMTPSA id a4-20020a05651c210400b002cc32fbe2e5sm2792867ljq.51.2023.12.28.03.42.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 03:42:08 -0800 (PST) From: Ulf Hansson To: "Rafael J . Wysocki" , Greg Kroah-Hartman , Viresh Kumar , linux-pm@vger.kernel.org Cc: Ulf Hansson , Sudeep Holla , Kevin Hilman , Konrad Dybcio , Bjorn Andersson , Nikunj Kela , Prasad Sodagudi , Stephan Gerhold , Ben Horgan , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-remoteproc@vger.kernel.org, linux-media@vger.kernel.org Subject: [PATCH 0/5] PM: domains: Add helpers for multi PM domains to avoid open-coding Date: Thu, 28 Dec 2023 12:41:52 +0100 Message-Id: <20231228114157.104822-1-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Attaching/detaching of a device to multiple PM domains has started to become a common operation for many drivers, typically during ->probe() and ->remove(). In most cases, this has lead to lots of boilerplate code in the drivers. This series adds a pair of helper functions to manage the attach/detach of a device to its multiple PM domains. Moreover, a couple of drivers have been converted to use the new helpers as a proof of concept. Note 1) The changes in the drivers have only been compile tested, while the helpers have been tested along with a couple of local dummy drivers that I have hacked up to model both genpd providers and genpd consumers. Note 2) I was struggling to make up mind if we should have a separate helper to attach all available power-domains described in DT, rather than providing "NULL" to the dev_pm_domain_attach_list(). I decided not to, but please let me know if you prefer the other option. Note 3) For OPP integration, as a follow up I am striving to make the dev_pm_opp_attach_genpd() redundant. Instead I think we should move towards using dev_pm_opp_set_config()->_opp_set_required_devs(), which would allow us to use the helpers that $subject series is adding. Kind regards Ulf Hansson Ulf Hansson (5): PM: domains: Add helper functions to attach/detach multiple PM domains remoteproc: imx_dsp_rproc: Convert to dev_pm_domain_attach|detach_list() remoteproc: imx_rproc: Convert to dev_pm_domain_attach|detach_list() remoteproc: qcom_q6v5_adsp: Convert to dev_pm_domain_attach|detach_list() media: venus: Convert to dev_pm_domain_attach|detach_list() for vcodec drivers/base/power/common.c | 133 +++++++++++++++ drivers/media/platform/qcom/venus/core.c | 12 +- drivers/media/platform/qcom/venus/core.h | 7 +- .../media/platform/qcom/venus/pm_helpers.c | 48 ++---- drivers/remoteproc/imx_dsp_rproc.c | 82 +-------- drivers/remoteproc/imx_rproc.c | 73 +------- drivers/remoteproc/qcom_q6v5_adsp.c | 160 ++++++++---------- include/linux/pm_domain.h | 38 +++++ 8 files changed, 288 insertions(+), 265 deletions(-) -- 2.34.1