Skip to content

OPP: Add new configuration interface: dev_pm_opp_set_config()

Viresh Kumar dri-devel linux-arm-kernel linux-arm-msm linux-mediatek linux-pm linux-samsung-soc linux-sunxi linux-tegra lkml 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest20 patches 7 repliesIn review
  2. v230 patches 8 repliesSuperseded
  3. v131 patches 41 repliesSuperseded

Changes in v3 from the cover letter

- Merged two patchsets:
[PATCH V2 00/30] OPP: Add new configuration interface: dev_pm_opp_set_config() [PATCH V2 0/5] OPP: Replace custom set_opp() with config_regulators()

- The existing APIs aren't removed anymore, but are made to use the new core API to set various configurations (Greg KH).

- clk-names and regulator-names are NULL terminated arrays now (Greg KH).

- New interface added: dev_pm_opp_set_config_regulators().

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/20OPP: Track if clock name is configured by platformdrivers/opp/core.c drivers/opp/opp.h+9 -00 replies
2/20OPP: Make dev_pm_opp_set_regulators() accept NULL terminated listdrivers/cpufreq/cpufreq-dt.c drivers/cpufreq/ti-cpufreq.c drivers/devfreq/exynos-bus.c +5 more+31 -274 replies
2/20OPP: Make dev_pm_opp_set_regulators() accept NULL terminated listdrivers/cpufreq/cpufreq-dt.c drivers/cpufreq/ti-cpufreq.c drivers/devfreq/exynos-bus.c +6 more+40 -321 reply
3/20OPP: Add dev_pm_opp_set_config() and friendsdrivers/opp/core.c drivers/opp/opp.h include/linux/pm_opp.h+291 -10 replies
4/20cpufreq: qcom-nvmem: Migrate to dev_pm_opp_set_config()drivers/cpufreq/qcom-cpufreq-nvmem.c+28 -810 replies
5/20cpufreq: sti: Migrate to dev_pm_opp_set_config()drivers/cpufreq/sti-cpufreq.c+10 -170 replies
6/20cpufreq: ti: Migrate to dev_pm_opp_set_config()drivers/cpufreq/ti-cpufreq.c+14 -230 replies
7/20drm/lima: Migrate to dev_pm_opp_set_config()drivers/gpu/drm/lima/lima_devfreq.c+6 -50 replies
8/20soc/tegra: Add comment over devm_pm_opp_set_clkname()drivers/soc/tegra/common.c+7 -00 replies
9/20soc/tegra: Migrate to dev_pm_opp_set_config()drivers/soc/tegra/common.c+31 -210 replies
10/20OPP: Migrate set-regulators API to use set-config helpersdrivers/cpufreq/cpufreq-dt.c drivers/devfreq/exynos-bus.c drivers/opp/core.c +1 more+60 -1061 reply
11/20OPP: Migrate set-supported-hw API to use set-config helpersdrivers/cpufreq/imx-cpufreq-dt.c drivers/cpufreq/tegra20-cpufreq.c drivers/memory/tegra/tegra124-emc.c +2 more+66 -1050 replies
12/20OPP: Migrate set-clk-name API to use set-config helpersdrivers/opp/core.c include/linux/pm_opp.h+69 -1140 replies
13/20OPP: Migrate set-opp-helper API to use set-config helpersdrivers/opp/core.c drivers/opp/ti-opp-supply.c include/linux/pm_opp.h+39 -890 replies
14/20OPP: Migrate attach-genpd API to use set-config helpersdrivers/opp/core.c include/linux/pm_opp.h+49 -840 replies
15/20OPP: Migrate set-prop-name helper API to use set-config helpersdrivers/cpufreq/sun50i-cpufreq-nvmem.c drivers/opp/core.c include/linux/pm_opp.h+46 -631 reply
16/20OPP: Add support for config_regulators() helperdrivers/opp/core.c drivers/opp/opp.h include/linux/pm_opp.h+91 -10 replies
17/20OPP: Make _generic_set_opp_regulator() a config_regulators() interfacedrivers/opp/core.c+12 -390 replies
18/20OPP: Add dev_pm_opp_get_supplies()drivers/opp/core.c include/linux/pm_opp.h+32 -00 replies
19/20OPP: ti: Migrate to dev_pm_opp_set_config_regulators()drivers/opp/ti-opp-supply.c+34 -410 replies
20/20OPP: Remove custom OPP helper supportdrivers/opp/core.c drivers/opp/opp.h include/linux/pm_opp.h+2 -1880 replies

Reviews trailers per patch

4 of 21 patches have a Reviewed-by or Acked-by.

PatchDmitry OsipenkoSamuel HollandSteven PriceChanwoo Choi
1/20
2/20R-b R-b
2/20R-b R-b
3/20T-b
4/20
5/20
6/20
7/20
8/20T-b
9/20T-b
10/20R-b
11/20
12/20
13/20
14/20
15/20A-b
16/20T-b
17/20T-b
18/20T-b
19/20
20/20T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH V3 00/20] OPP: Add new configuration interface: dev_pm_opp_set_config()

Hello,

We have too many configuration specific APIs currently, six of them already, like dev_pm_opp_set_regulators(). This makes it complex/messy for both the OPP core and its users to manage. There is also code redundancy in these APIs, in the way they add/manage the OPP table specific stuff.

This patch series is an attempt to simplify these interfaces by adding a new interface, dev_pm_opp_set_config(), which is now used by all the existing ones. This series also migrates few users to the new API, where multiple configurations were required and rest are updated for API interface changes.

This is pushed here:

git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git opp/linux-next

This was earlier tested by various folks, I have tested it again on hikey board, it will get further tested on linux-next in the coming days. Build test is already done by Linaro's bot for enough platform though.

The entire patchset shall get merged via the OPP tree in 5.20-rc1, please do not merge individual patches.

V2->V3:
- Merged two patchsets:
[PATCH V2 00/30] OPP: Add new configuration interface: dev_pm_opp_set_config() [PATCH V2 0/5] OPP: Replace custom set_opp() with config_regulators()

- The existing APIs aren't removed anymore, but are made to use the new core API to set various configurations (Greg KH).

- clk-names and regulator-names are NULL terminated arrays now (Greg KH).

- New interface added: dev_pm_opp_set_config_regulators().

V1->V2:
- dev_pm_opp_set_config() doesn't return the OPP table anymore, but a token allocated with xa_alloc(). The same needs to be passed to clear-config API.
- Updated all users according to that as well.
- The clk_names interface is updated to allow multiple clocks.
- Converted few // comments to /* */.
- Added tags by few people.
- Dropped the last patch to rearrange stuff, not required anymore.

Thanks.

--
Viresh

Viresh Kumar (20):
OPP: Track if clock name is configured by platform
OPP: Make dev_pm_opp_set_regulators() accept NULL terminated list
OPP: Add dev_pm_opp_set_config() and friends
cpufreq: qcom-nvmem: Migrate to dev_pm_opp_set_config()
cpufreq: sti: Migrate to dev_pm_opp_set_config()
cpufreq: ti: Migrate to dev_pm_opp_set_config()
drm/lima: Migrate to dev_pm_opp_set_config()
soc/tegra: Add comment over devm_pm_opp_set_clkname() soc/tegra: Migrate to dev_pm_opp_set_config()
OPP: Migrate set-regulators API to use set-config helpers
OPP: Migrate set-supported-hw API to use set-config helpers
OPP: Migrate set-clk-name API to use set-config helpers
OPP: Migrate set-opp-helper API to use set-config helpers
OPP: Migrate attach-genpd API to use set-config helpers
OPP: Migrate set-prop-name helper API to use set-config helpers
OPP: Add support for config_regulators() helper
OPP: Make _generic_set_opp_regulator() a config_regulators() interface
OPP: Add dev_pm_opp_get_supplies()
OPP: ti: Migrate to dev_pm_opp_set_config_regulators()
OPP: Remove custom OPP helper support

 drivers/cpufreq/cpufreq-dt.c                |  19 +-
 drivers/cpufreq/imx-cpufreq-dt.c            |  12 +-
 drivers/cpufreq/qcom-cpufreq-nvmem.c        | 109 +--
 drivers/cpufreq/sti-cpufreq.c               |  27 +-
 drivers/cpufreq/sun50i-cpufreq-nvmem.c      |  31 +-
 drivers/cpufreq/tegra20-cpufreq.c           |  12 +-
 drivers/cpufreq/ti-cpufreq.c                |  42 +-
 drivers/devfreq/exynos-bus.c                |  21 +-
 drivers/gpu/drm/lima/lima_devfreq.c         |  12 +-
 drivers/gpu/drm/panfrost/panfrost_devfreq.c |   4 +-
 drivers/memory/tegra/tegra124-emc.c         |  11 +-
 drivers/opp/core.c                          | 821 +++++++++-----------
 drivers/opp/opp.h                           |  32 +-
 drivers/opp/ti-opp-supply.c                 |  77 +-
 drivers/soc/tegra/common.c                  |  49 +-
 drivers/soc/tegra/pmc.c                     |   4 +-
 include/linux/pm_opp.h                      | 295 ++++---
 17 files changed, 750 insertions(+), 828 deletions(-)
Signature · 1 line
2.31.1.272.g89b43f80a514