Skip to contentSkip to conversation

Per-user clock constraints

PATCH Superseded Tomeu Vizoso 3 participants 15 messages Sep 3, 2014 – Sep 9, 2014

Subsystems (49)

v9 of 13 Superseded Latest is v13 →

lore
Share & tools
lore
#0 lore raw

v9 cover Per-user clock constraints

Hi,

I'm sending this v9 in order to fix a few build errors found by Intel's 0day build farm. Notable changes are:

* Changes to mxs-saif.c have been folded into 2/6, in order for bisectability to be preserved.

* All floor constraints are applied first, then all ceiling constraints. This is to keep the behavior deterministic and to prevent any situation in which floor constraints could trump over ceiling constraints.

* A WARN has been added to flag inconsistent ranges of constraints.

* Redundant includes of linux/clk.h have been removed.

These series depend on Mike's patches at [0] and is rebased on top of today's clk-next.

Follows the original cover letter blurb:

I'm retaking Rabin's patches [1] for splitting the clk API in two: one API for clk consumers and another for providers. The consumer API uses a clk structure that just keeps track of the consumer and has a reference to the actual clk_core struct, which is used internally.

I have kept a patch from Rabin that aims to aid in debugging nested enable/disable calls, though my personal aim is to allow more than one consumer to influence the final, effective frequency rate. For now this is limited to setting floor and ceiling constraints, with the short-term aim of allowing devfreq and thermal drivers to set floor and ceiling frequencies on the memory clock, respectively.

For those functions in the consumer clk API that were called from providers, I have added variants to clk-provider.h that are the same only that accept a clk_core instead. These functions are prefixed with clk_provider_.

Patch 1/7 just adds a bunch of defines with the goal of having all the renames in their own commit while preserving git-bisectability, with patch 3/7 containing the rename itself as generated by the Coccinelle script in [2]. Patch 2/7 is needed because sound/soc/mxs/mxs-saif.c calls both the consumer and the provider API. The actual implementation of the API split comes in patch 4/7. I will be happy to organize the refactoring differently if anybody has a better idea.

Patch 5/7 warns when there's an unbalanced usage of the enable and disable APIs, and patch 6/7 adds the API for setting floor and ceiling frequencies, per consumer. Patch 7/7 will warn when prepare/unprepare are used unbalanced, printing the code location of the last call to unprepare.

[0] http://thread.gmane.org/gmane.linux.kernel/1778132
[1] http://thread.gmane.org/gmane.linux.kernel/1402006
[2] http://cgit.collabora.com/git/user/tomeu/linux.git/log/?h=clk-refactoring-9

Thanks,

Tomeu

Tomeu Vizoso (6):
clk: Add temporary mapping to the existing API
clk: Move all drivers to use internal API
clk: use struct clk only for external API
clk: per-user clock accounting for debug
clk: Add floor and ceiling constraints to clock rates
clk: Warn of unbalanced clk_prepare() calls

 arch/arm/mach-dove/common.c                   |  10 +-
 arch/arm/mach-imx/clk-busy.c                  |   9 +-
 arch/arm/mach-imx/clk-fixup-div.c             |   4 +-
 arch/arm/mach-imx/clk-fixup-mux.c             |   4 +-
 arch/arm/mach-imx/clk-gate2.c                 |   4 +-
 arch/arm/mach-imx/clk-imx1.c                  |   3 +-
 arch/arm/mach-imx/clk-imx21.c                 |   3 +-
 arch/arm/mach-imx/clk-imx25.c                 |   9 +-
 arch/arm/mach-imx/clk-imx27.c                 |   5 +-
 arch/arm/mach-imx/clk-imx31.c                 |  11 +-
 arch/arm/mach-imx/clk-imx35.c                 |  23 +-
 arch/arm/mach-imx/clk-imx51-imx53.c           |  78 +--
 arch/arm/mach-imx/clk-imx6q.c                 |  54 +-
 arch/arm/mach-imx/clk-imx6sl.c                |  14 +-
 arch/arm/mach-imx/clk-imx6sx.c                |  98 ++--
 arch/arm/mach-imx/clk-pfd.c                   |   5 +-
 arch/arm/mach-imx/clk-pllv1.c                 |   5 +-
 arch/arm/mach-imx/clk-pllv2.c                 |   5 +-
 arch/arm/mach-imx/clk-pllv3.c                 |   5 +-
 arch/arm/mach-imx/clk-vf610.c                 |  43 +-
 arch/arm/mach-imx/clk.c                       |  11 +-
 arch/arm/mach-imx/clk.h                       |  42 +-
 arch/arm/mach-msm/clock-pcom.c                |   2 +-
 arch/arm/mach-msm/clock.c                     |   2 +-
 arch/arm/mach-mv78xx0/common.c                |   2 +-
 arch/arm/mach-omap2/board-cm-t35.c            |   2 +-
 arch/arm/mach-omap2/cclock3xxx_data.c         | 371 +++++++------
 arch/arm/mach-omap2/clkt2xxx_dpll.c           |   5 +-
 arch/arm/mach-omap2/clkt2xxx_dpllcore.c       |   5 +-
 arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c  |  11 +-
 arch/arm/mach-omap2/clkt34xx_dpll3m2.c        |   3 +-
 arch/arm/mach-omap2/clkt_clksel.c             |  46 +-
 arch/arm/mach-omap2/clkt_dpll.c               |   8 +-
 arch/arm/mach-omap2/clock.c                   |  52 +-
 arch/arm/mach-omap2/clock.h                   |  18 +-
 arch/arm/mach-omap2/clock3xxx.c               |  23 +-
 arch/arm/mach-omap2/clock3xxx.h               |   4 +-
 arch/arm/mach-omap2/clock_common_data.c       |   2 +-
 arch/arm/mach-omap2/clockdomain.c             |   9 +-
 arch/arm/mach-omap2/clockdomain.h             |   4 +-
 arch/arm/mach-omap2/display.c                 |   6 +-
 arch/arm/mach-omap2/dpll3xxx.c                |  29 +-
 arch/arm/mach-omap2/dpll44xx.c                |   5 +-
 arch/arm/mach-omap2/mcbsp.c                   |   5 +-
 arch/arm/mach-omap2/omap_device.c             |  10 +-
 arch/arm/mach-omap2/omap_hwmod.c              |  42 +-
 arch/arm/mach-omap2/omap_hwmod.h              |  12 +-
 arch/arm/mach-omap2/pm24xx.c                  |  12 +-
 arch/arm/mach-orion5x/common.c                |   2 +-
 arch/arm/mach-shmobile/clock.c                |  10 +-
 arch/arm/mach-vexpress/spc.c                  |   4 +-
 arch/arm/plat-orion/common.c                  |  22 +-
 arch/arm/plat-orion/include/plat/common.h     |  12 +-
 arch/powerpc/platforms/512x/clock-commonclk.c |  48 +-
 drivers/clk/at91/clk-main.c                   |  24 +-
 drivers/clk/at91/clk-master.c                 |   6 +-
 drivers/clk/at91/clk-peripheral.c             |  12 +-
 drivers/clk/at91/clk-pll.c                    |   6 +-
 drivers/clk/at91/clk-plldiv.c                 |   6 +-
 drivers/clk/at91/clk-programmable.c           |  10 +-
 drivers/clk/at91/clk-slow.c                   |  24 +-
 drivers/clk/at91/clk-smd.c                    |   6 +-
 drivers/clk/at91/clk-system.c                 |   6 +-
 drivers/clk/at91/clk-usb.c                    |  20 +-
 drivers/clk/at91/clk-utmi.c                   |   6 +-
 drivers/clk/bcm/clk-kona-setup.c              |   6 +-
 drivers/clk/bcm/clk-kona.c                    |  12 +-
 drivers/clk/bcm/clk-kona.h                    |   2 +-
 drivers/clk/berlin/berlin2-avpll.c            |   4 +-
 drivers/clk/berlin/berlin2-avpll.h            |   4 +-
 drivers/clk/berlin/berlin2-div.c              |   2 +-
 drivers/clk/berlin/berlin2-div.h              |   2 +-
 drivers/clk/berlin/berlin2-pll.c              |   2 +-
 drivers/clk/berlin/berlin2-pll.h              |   2 +-
 drivers/clk/berlin/bg2.c                      |  14 +-
 drivers/clk/berlin/bg2q.c                     |  10 +-
 drivers/clk/clk-axi-clkgen.c                  |   3 +-
 drivers/clk/clk-axm5516.c                     |   4 +-
 drivers/clk/clk-bcm2835.c                     |   2 +-
 drivers/clk/clk-composite.c                   |  11 +-
 drivers/clk/clk-conf.c                        |  18 +-
 drivers/clk/clk-devres.c                      |  31 ++
 drivers/clk/clk-divider.c                     |   8 +-
 drivers/clk/clk-efm32gg.c                     |   3 +-
 drivers/clk/clk-fixed-factor.c                |   6 +-
 drivers/clk/clk-fixed-rate.c                  |   8 +-
 drivers/clk/clk-fractional-divider.c          |   4 +-
 drivers/clk/clk-gate.c                        |   4 +-
 drivers/clk/clk-highbank.c                    |   8 +-
 drivers/clk/clk-ls1x.c                        |  16 +-
 drivers/clk/clk-max77686.c                    |  10 +-
 drivers/clk/clk-moxart.c                      |   8 +-
 drivers/clk/clk-mux.c                         |   7 +-
 drivers/clk/clk-nomadik.c                     |  15 +-
 drivers/clk/clk-nspire.c                      |   4 +-
 drivers/clk/clk-palmas.c                      |   7 +-
 drivers/clk/clk-ppc-corenet.c                 |   8 +-
 drivers/clk/clk-s2mps11.c                     |   6 +-
 drivers/clk/clk-si5351.c                      |  17 +-
 drivers/clk/clk-si570.c                       |   4 +-
 drivers/clk/clk-twl6040.c                     |   3 +-
 drivers/clk/clk-u300.c                        |  13 +-
 drivers/clk/clk-vt8500.c                      |   4 +-
 drivers/clk/clk-wm831x.c                      |   7 +-
 drivers/clk/clk-xgene.c                       |  12 +-
 drivers/clk/clk.c                             | 724 +++++++++++++++++---------
 drivers/clk/clk.h                             |  12 +-
 drivers/clk/clkdev.c                          | 130 ++++-
 drivers/clk/hisilicon/clk-hi3620.c            |   9 +-
 drivers/clk/hisilicon/clk-hip04.c             |   1 -
 drivers/clk/hisilicon/clk.c                   |  17 +-
 drivers/clk/hisilicon/clk.h                   |   2 +-
 drivers/clk/hisilicon/clkgate-separated.c     |   5 +-
 drivers/clk/keystone/gate.c                   |   7 +-
 drivers/clk/keystone/pll.c                    |  11 +-
 drivers/clk/mmp/clk-apbc.c                    |   5 +-
 drivers/clk/mmp/clk-apmu.c                    |   5 +-
 drivers/clk/mmp/clk-frac.c                    |   4 +-
 drivers/clk/mmp/clk-mmp2.c                    |  14 +-
 drivers/clk/mmp/clk-pxa168.c                  |  12 +-
 drivers/clk/mmp/clk-pxa910.c                  |  12 +-
 drivers/clk/mmp/clk.h                         |   8 +-
 drivers/clk/mvebu/clk-corediv.c               |   4 +-
 drivers/clk/mvebu/clk-cpu.c                   |   8 +-
 drivers/clk/mvebu/common.c                    |  15 +-
 drivers/clk/mvebu/kirkwood.c                  |   6 +-
 drivers/clk/mxs/clk-div.c                     |   5 +-
 drivers/clk/mxs/clk-frac.c                    |   5 +-
 drivers/clk/mxs/clk-imx23.c                   |   5 +-
 drivers/clk/mxs/clk-imx28.c                   |   5 +-
 drivers/clk/mxs/clk-pll.c                     |   5 +-
 drivers/clk/mxs/clk-ref.c                     |   5 +-
 drivers/clk/mxs/clk.h                         |  17 +-
 drivers/clk/qcom/clk-rcg.c                    |   8 +-
 drivers/clk/qcom/clk-rcg2.c                   |  14 +-
 drivers/clk/qcom/clk-regmap.c                 |   2 +-
 drivers/clk/qcom/clk-regmap.h                 |   2 +-
 drivers/clk/qcom/common.c                     |   6 +-
 drivers/clk/qcom/gcc-apq8084.c                |   2 +-
 drivers/clk/qcom/gcc-ipq806x.c                |   2 +-
 drivers/clk/qcom/gcc-msm8660.c                |   2 +-
 drivers/clk/qcom/gcc-msm8960.c                |   2 +-
 drivers/clk/qcom/gcc-msm8974.c                |   2 +-
 drivers/clk/qcom/mmcc-msm8960.c               |   6 +-
 drivers/clk/rockchip/clk-pll.c                |   9 +-
 drivers/clk/rockchip/clk-rk3188.c             |   2 +-
 drivers/clk/rockchip/clk-rk3288.c             |   2 +-
 drivers/clk/rockchip/clk-rockchip.c           |   2 +-
 drivers/clk/rockchip/clk.c                    |  23 +-
 drivers/clk/rockchip/clk.h                    |   5 +-
 drivers/clk/samsung/clk-exynos-audss.c        |  16 +-
 drivers/clk/samsung/clk-exynos-clkout.c       |   9 +-
 drivers/clk/samsung/clk-exynos3250.c          |   1 -
 drivers/clk/samsung/clk-exynos4.c             |   7 +-
 drivers/clk/samsung/clk-exynos5250.c          |   1 -
 drivers/clk/samsung/clk-exynos5260.c          |   1 -
 drivers/clk/samsung/clk-exynos5410.c          |   1 -
 drivers/clk/samsung/clk-exynos5420.c          |   1 -
 drivers/clk/samsung/clk-exynos5440.c          |   1 -
 drivers/clk/samsung/clk-pll.c                 |   6 +-
 drivers/clk/samsung/clk-pll.h                 |   2 +-
 drivers/clk/samsung/clk-s3c2410-dclk.c        |  30 +-
 drivers/clk/samsung/clk-s3c2410.c             |   1 -
 drivers/clk/samsung/clk-s3c2412.c             |   1 -
 drivers/clk/samsung/clk-s3c2443.c             |   1 -
 drivers/clk/samsung/clk-s3c64xx.c             |   1 -
 drivers/clk/samsung/clk-s5pv210-audss.c       |  16 +-
 drivers/clk/samsung/clk.c                     |  22 +-
 drivers/clk/samsung/clk.h                     |   3 +-
 drivers/clk/shmobile/clk-div6.c               |   2 +-
 drivers/clk/shmobile/clk-emev2.c              |   4 +-
 drivers/clk/shmobile/clk-mstp.c               |   6 +-
 drivers/clk/shmobile/clk-r8a7740.c            |   6 +-
 drivers/clk/shmobile/clk-r8a7779.c            |   6 +-
 drivers/clk/shmobile/clk-rcar-gen2.c          |  10 +-
 drivers/clk/shmobile/clk-rz.c                 |   6 +-
 drivers/clk/sirf/clk-atlas6.c                 |   3 +-
 drivers/clk/sirf/clk-common.c                 |  30 +-
 drivers/clk/sirf/clk-prima2.c                 |   3 +-
 drivers/clk/socfpga/clk-gate.c                |   3 +-
 drivers/clk/socfpga/clk-periph.c              |   3 +-
 drivers/clk/socfpga/clk-pll.c                 |   5 +-
 drivers/clk/spear/clk-aux-synth.c             |   8 +-
 drivers/clk/spear/clk-frac-synth.c            |   4 +-
 drivers/clk/spear/clk-gpt-synth.c             |   4 +-
 drivers/clk/spear/clk-vco-pll.c               |   8 +-
 drivers/clk/spear/clk.h                       |  14 +-
 drivers/clk/spear/spear1310_clock.c           |   3 +-
 drivers/clk/spear/spear1340_clock.c           |   3 +-
 drivers/clk/spear/spear3xx_clock.c            |  17 +-
 drivers/clk/spear/spear6xx_clock.c            |   3 +-
 drivers/clk/st/clk-flexgen.c                  |  12 +-
 drivers/clk/st/clkgen-fsyn.c                  |  22 +-
 drivers/clk/st/clkgen-mux.c                   |  32 +-
 drivers/clk/st/clkgen-pll.c                   |  34 +-
 drivers/clk/sunxi/clk-a10-hosc.c              |   2 +-
 drivers/clk/sunxi/clk-a20-gmac.c              |   2 +-
 drivers/clk/sunxi/clk-factors.c               |   4 +-
 drivers/clk/sunxi/clk-sun6i-apb0-gates.c      |   2 +-
 drivers/clk/sunxi/clk-sun6i-apb0.c            |   2 +-
 drivers/clk/sunxi/clk-sun6i-ar100.c           |   6 +-
 drivers/clk/sunxi/clk-sun8i-apb0.c            |   2 +-
 drivers/clk/sunxi/clk-sunxi.c                 |  18 +-
 drivers/clk/tegra/clk-audio-sync.c            |   4 +-
 drivers/clk/tegra/clk-divider.c               |   5 +-
 drivers/clk/tegra/clk-periph-gate.c           |   5 +-
 drivers/clk/tegra/clk-periph.c                |   9 +-
 drivers/clk/tegra/clk-pll-out.c               |   5 +-
 drivers/clk/tegra/clk-pll.c                   |  41 +-
 drivers/clk/tegra/clk-super.c                 |   5 +-
 drivers/clk/tegra/clk-tegra-audio.c           |   5 +-
 drivers/clk/tegra/clk-tegra-fixed.c           |   9 +-
 drivers/clk/tegra/clk-tegra-periph.c          |  13 +-
 drivers/clk/tegra/clk-tegra-pmc.c             |   5 +-
 drivers/clk/tegra/clk-tegra-super-gen4.c      |   9 +-
 drivers/clk/tegra/clk-tegra114.c              |  11 +-
 drivers/clk/tegra/clk-tegra124.c              |   7 +-
 drivers/clk/tegra/clk-tegra20.c               |  13 +-
 drivers/clk/tegra/clk-tegra30.c               |   9 +-
 drivers/clk/tegra/clk.c                       |  25 +-
 drivers/clk/tegra/clk.h                       |  38 +-
 drivers/clk/ti/apll.c                         |   8 +-
 drivers/clk/ti/clk-2xxx.c                     |   8 +-
 drivers/clk/ti/clk-33xx.c                     |  18 +-
 drivers/clk/ti/clk-3xxx.c                     |   8 +-
 drivers/clk/ti/clk-43xx.c                     |   8 +-
 drivers/clk/ti/clk-44xx.c                     |  16 +-
 drivers/clk/ti/clk-54xx.c                     |  25 +-
 drivers/clk/ti/clk-7xx.c                      |  28 +-
 drivers/clk/ti/clk-dra7-atl.c                 |   6 +-
 drivers/clk/ti/clk.c                          |   2 +-
 drivers/clk/ti/clockdomain.c                  |   4 +-
 drivers/clk/ti/composite.c                    |   2 +-
 drivers/clk/ti/divider.c                      |   6 +-
 drivers/clk/ti/dpll.c                         |   8 +-
 drivers/clk/ti/fixed-factor.c                 |   2 +-
 drivers/clk/ti/gate.c                         |   2 +-
 drivers/clk/ti/interface.c                    |   2 +-
 drivers/clk/ti/mux.c                          |   6 +-
 drivers/clk/ux500/abx500-clk.c                |   3 +-
 drivers/clk/ux500/clk-prcc.c                  |   8 +-
 drivers/clk/ux500/clk-prcmu.c                 |  16 +-
 drivers/clk/ux500/clk-sysctrl.c               |  10 +-
 drivers/clk/ux500/clk.h                       |  23 +-
 drivers/clk/ux500/u8500_clk.c                 |   3 +-
 drivers/clk/ux500/u8500_of_clk.c              |  13 +-
 drivers/clk/ux500/u8540_clk.c                 |   3 +-
 drivers/clk/ux500/u9540_clk.c                 |   1 -
 drivers/clk/versatile/clk-icst.c              |   5 +-
 drivers/clk/versatile/clk-icst.h              |   2 +-
 drivers/clk/versatile/clk-impd1.c             |  19 +-
 drivers/clk/versatile/clk-realview.c          |   3 +-
 drivers/clk/versatile/clk-sp810.c             |  30 +-
 drivers/clk/versatile/clk-versatile.c         |   3 +-
 drivers/clk/versatile/clk-vexpress-osc.c      |   2 +-
 drivers/clk/versatile/clk-vexpress.c          |   6 +-
 drivers/clk/x86/clk-lpt.c                     |   3 +-
 drivers/clk/zynq/clkc.c                       |  22 +-
 drivers/clk/zynq/pll.c                        |   4 +-
 drivers/gpu/drm/msm/hdmi/hdmi_phy_8960.c      |   3 +-
 drivers/media/platform/exynos4-is/media-dev.c |  18 +-
 drivers/media/platform/exynos4-is/media-dev.h |   7 +-
 drivers/media/platform/omap3isp/isp.h         |   2 +-
 drivers/rtc/rtc-hym8563.c                     |   4 +-
 drivers/staging/imx-drm/imx-tve.c             |  27 +-
 include/asm-generic/clkdev.h                  |   6 +-
 include/linux/clk-private.h                   |  51 +-
 include/linux/clk-provider.h                  | 137 +++--
 include/linux/clk.h                           |  50 +-
 include/linux/clk/ti.h                        |  10 +-
 include/linux/clk/zynq.h                      |   3 +-
 include/linux/clkdev.h                        |  24 +-
 include/linux/platform_data/si5351.h          |   4 +-
 sound/soc/mxs/mxs-saif.c                      |   4 +-
 274 files changed, 2276 insertions(+), 1859 deletions(-)
Signature · 1 line
1.9.3
#1 lore raw

PATCH v9 1/6 clk: Add temporary mapping to the existing API

To preserve git-bisectability, add aliases from the future provider API to the existing public API.

Also includes clk-provider.h and clk-dev.h in a few places so the right functions are defined.

---
v9: * Add mapping for clk_get_name

v7: * Add mappings for clk_notifier_[un]register
* Add more clk-provider.h includes to clk implementations

v4: * Add more clk-provider.h includes to clk implementations
* Add mapping for clk_provider_round_rate

---
 arch/arm/mach-omap2/display.c                 |  1 +
 arch/arm/mach-omap2/omap_device.c             |  1 +
 arch/arm/mach-shmobile/clock.c                |  1 +
 arch/arm/plat-orion/common.c                  |  1 +
 drivers/clk/berlin/bg2.c                      |  1 +
 drivers/clk/berlin/bg2q.c                     |  1 +
 drivers/clk/clk-conf.c                        |  1 +
 drivers/clk/clkdev.c                          |  1 +
 drivers/media/platform/exynos4-is/media-dev.c |  1 +
 include/linux/clk-provider.h                  | 27 +++++++++++++++++++++++++++
 include/linux/clk/zynq.h                      |  1 +
 11 files changed, 37 insertions(+)
arch/arm/mach-omap2/display.c +1 -0
index bf852d7..0f9e479 100644
@@ -21,6 +21,7 @@
 #include <linux/platform_device.h>
 #include <linux/io.h>
 #include <linux/clk.h>
+#include <linux/clk-provider.h>
 #include <linux/err.h>
 #include <linux/delay.h>
 #include <linux/of.h>
arch/arm/mach-omap2/omap_device.c +1 -0
index d22c30d..f138a62 100644
@@ -32,6 +32,7 @@
 #include <linux/io.h>
 #include <linux/clk.h>
 #include <linux/clkdev.h>
+#include <linux/clk-provider.h>
 #include <linux/pm_runtime.h>
 #include <linux/of.h>
 #include <linux/notifier.h>
arch/arm/mach-shmobile/clock.c +1 -0
index 806f940..ed415dc 100644
@@ -24,6 +24,7 @@
 
 #ifdef CONFIG_COMMON_CLK
 #include <linux/clk.h>
+#include <linux/clk-provider.h>
 #include <linux/clkdev.h>
 #include "clock.h"
 
arch/arm/plat-orion/common.c +1 -0
index 3ec6e8e..961b593 100644
@@ -15,6 +15,7 @@
 #include <linux/serial_8250.h>
 #include <linux/ata_platform.h>
 #include <linux/clk.h>
+#include <linux/clk-provider.h>
 #include <linux/clkdev.h>
 #include <linux/mv643xx_eth.h>
 #include <linux/mv643xx_i2c.h>
drivers/clk/berlin/bg2.c +1 -0
index 515fb13..4c81e09 100644
@@ -19,6 +19,7 @@
 
 #include <linux/clk.h>
 #include <linux/clk-provider.h>
+#include <linux/clkdev.h>
 #include <linux/kernel.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
drivers/clk/berlin/bg2q.c +1 -0
index 21784e4..748da9b 100644
@@ -19,6 +19,7 @@
 
 #include <linux/clk.h>
 #include <linux/clk-provider.h>
+#include <linux/clkdev.h>
 #include <linux/kernel.h>
 #include <linux/of.h>
 #include <linux/of_address.h>
drivers/clk/clk-conf.c +1 -0
index aad4796..d36a7b3 100644
@@ -8,6 +8,7 @@
  */
 
 #include <linux/clk.h>
+#include <linux/clkdev.h>
 #include <linux/clk-provider.h>
 #include <linux/clk/clk-conf.h>
 #include <linux/device.h>
drivers/clk/clkdev.c +1 -0
index da4bda8..c751d0c 100644
@@ -18,6 +18,7 @@
 #include <linux/string.h>
 #include <linux/mutex.h>
 #include <linux/clk.h>
+#include <linux/clk-provider.h>
 #include <linux/clkdev.h>
 #include <linux/of.h>
 
drivers/media/platform/exynos4-is/media-dev.c +1 -0
index 344718d..2620c48 100644
@@ -13,6 +13,7 @@
 #include <linux/bug.h>
 #include <linux/clk.h>
 #include <linux/clk-provider.h>
+#include <linux/clkdev.h>
 #include <linux/device.h>
 #include <linux/errno.h>
 #include <linux/i2c.h>
include/linux/clk-provider.h +27 -0
index 411dd7e..99b906f 100644
@@ -16,6 +16,33 @@
 
 #ifdef CONFIG_COMMON_CLK
 
+/* Temporarily map the to-be-added API to the old API, just so stuff compiles */
+#define clk_core			clk
+
+#define __clk_create_clk
+
+#define clk_provider_get			clk_get
+#define clk_provider_get_sys			clk_get_sys
+#define devm_clk_provider_get			devm_clk_get
+#define of_clk_provider_get			of_clk_get
+#define of_clk_provider_get_by_name		of_clk_get_by_name
+
+#define clk_provider_set_rate			clk_set_rate
+#define clk_provider_get_rate			clk_get_rate
+#define clk_provider_round_rate			clk_round_rate
+#define clk_provider_set_parent			clk_set_parent
+#define clk_provider_get_parent			clk_get_parent
+#define clk_provider_prepare			clk_prepare
+#define clk_provider_unprepare			clk_unprepare
+#define clk_provider_enable			clk_enable
+#define clk_provider_disable			clk_disable
+#define clk_provider_prepare_enable		clk_prepare_enable
+#define clk_provider_disable_unprepare		clk_unprepare
+#define clk_provider_notifier_register		clk_notifier_register
+#define clk_provider_notifier_unregister	clk_notifier_unregister
+
+#define clk_get_name				__clk_get_name
+
 /*
  * flags used across common struct clk.  these flags should only affect the
  * top-level framework.  custom flags for dealing with hardware specifics
include/linux/clk/zynq.h +1 -0
index 7a5633b..a990a59 100644
@@ -21,6 +21,7 @@
 #define __LINUX_CLK_ZYNQ_H_
 
 #include <linux/spinlock.h>
+#include <linux/clk-provider.h>
 
 void zynq_clock_init(void);
 
Signature · 1 line
1.9.3
#2 lore raw

PATCH v9 2/6 clk: Move all drivers to use internal API

In preparation to change the public API to return a per-user clk structure, remove any usage of this public API from the clock implementations.

The reason for having this in a separate commit from the one that introduces the implementation of the new functions is to separate the changes generated with Coccinelle from the rest, and keep the patches' size reasonable.

---

v9: * Fold in changes to mxs-saif.c, so to not break bisectability
* Re-generate the patch on top of the latest changes
* Remove linux/clk.h includes from clk implementations

---
 arch/arm/mach-dove/common.c                   |  10 +-
 arch/arm/mach-imx/clk-busy.c                  |   9 +-
 arch/arm/mach-imx/clk-fixup-div.c             |   4 +-
 arch/arm/mach-imx/clk-fixup-mux.c             |   4 +-
 arch/arm/mach-imx/clk-gate2.c                 |   4 +-
 arch/arm/mach-imx/clk-imx1.c                  |   3 +-
 arch/arm/mach-imx/clk-imx21.c                 |   3 +-
 arch/arm/mach-imx/clk-imx25.c                 |   9 +-
 arch/arm/mach-imx/clk-imx27.c                 |   5 +-
 arch/arm/mach-imx/clk-imx31.c                 |  11 +-
 arch/arm/mach-imx/clk-imx35.c                 |  23 +-
 arch/arm/mach-imx/clk-imx51-imx53.c           |  78 +++---
 arch/arm/mach-imx/clk-imx6q.c                 |  54 ++--
 arch/arm/mach-imx/clk-imx6sl.c                |  14 +-
 arch/arm/mach-imx/clk-imx6sx.c                |  98 ++++---
 arch/arm/mach-imx/clk-pfd.c                   |   5 +-
 arch/arm/mach-imx/clk-pllv1.c                 |   5 +-
 arch/arm/mach-imx/clk-pllv2.c                 |   5 +-
 arch/arm/mach-imx/clk-pllv3.c                 |   5 +-
 arch/arm/mach-imx/clk-vf610.c                 |  43 +--
 arch/arm/mach-imx/clk.c                       |  11 +-
 arch/arm/mach-imx/clk.h                       |  42 +--
 arch/arm/mach-msm/clock-pcom.c                |   2 +-
 arch/arm/mach-mv78xx0/common.c                |   2 +-
 arch/arm/mach-omap2/board-cm-t35.c            |   2 +-
 arch/arm/mach-omap2/cclock3xxx_data.c         | 371 +++++++++++++-------------
 arch/arm/mach-omap2/clkt2xxx_dpll.c           |   5 +-
 arch/arm/mach-omap2/clkt2xxx_dpllcore.c       |   5 +-
 arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c  |  11 +-
 arch/arm/mach-omap2/clkt34xx_dpll3m2.c        |   3 +-
 arch/arm/mach-omap2/clkt_clksel.c             |  46 ++--
 arch/arm/mach-omap2/clkt_dpll.c               |   8 +-
 arch/arm/mach-omap2/clock.c                   |  52 ++--
 arch/arm/mach-omap2/clock.h                   |  18 +-
 arch/arm/mach-omap2/clock3xxx.c               |  23 +-
 arch/arm/mach-omap2/clock3xxx.h               |   4 +-
 arch/arm/mach-omap2/clock_common_data.c       |   2 +-
 arch/arm/mach-omap2/clockdomain.c             |   9 +-
 arch/arm/mach-omap2/clockdomain.h             |   4 +-
 arch/arm/mach-omap2/display.c                 |   5 +-
 arch/arm/mach-omap2/dpll3xxx.c                |  29 +-
 arch/arm/mach-omap2/dpll44xx.c                |   5 +-
 arch/arm/mach-omap2/mcbsp.c                   |   5 +-
 arch/arm/mach-omap2/omap_device.c             |   9 +-
 arch/arm/mach-omap2/omap_hwmod.c              |  42 +--
 arch/arm/mach-omap2/omap_hwmod.h              |  12 +-
 arch/arm/mach-omap2/pm24xx.c                  |  12 +-
 arch/arm/mach-orion5x/common.c                |   2 +-
 arch/arm/mach-shmobile/clock.c                |   9 +-
 arch/arm/mach-vexpress/spc.c                  |   4 +-
 arch/arm/plat-orion/common.c                  |  21 +-
 arch/arm/plat-orion/include/plat/common.h     |  12 +-
 arch/powerpc/platforms/512x/clock-commonclk.c |  48 ++--
 drivers/clk/at91/clk-main.c                   |  24 +-
 drivers/clk/at91/clk-master.c                 |   6 +-
 drivers/clk/at91/clk-peripheral.c             |  12 +-
 drivers/clk/at91/clk-pll.c                    |   6 +-
 drivers/clk/at91/clk-plldiv.c                 |   6 +-
 drivers/clk/at91/clk-programmable.c           |  10 +-
 drivers/clk/at91/clk-slow.c                   |  24 +-
 drivers/clk/at91/clk-smd.c                    |   6 +-
 drivers/clk/at91/clk-system.c                 |   6 +-
 drivers/clk/at91/clk-usb.c                    |  20 +-
 drivers/clk/at91/clk-utmi.c                   |   6 +-
 drivers/clk/bcm/clk-kona-setup.c              |   6 +-
 drivers/clk/bcm/clk-kona.c                    |  12 +-
 drivers/clk/bcm/clk-kona.h                    |   2 +-
 drivers/clk/berlin/berlin2-avpll.c            |   4 +-
 drivers/clk/berlin/berlin2-avpll.h            |   4 +-
 drivers/clk/berlin/berlin2-div.c              |   2 +-
 drivers/clk/berlin/berlin2-div.h              |   2 +-
 drivers/clk/berlin/berlin2-pll.c              |   2 +-
 drivers/clk/berlin/berlin2-pll.h              |   2 +-
 drivers/clk/berlin/bg2.c                      |  13 +-
 drivers/clk/berlin/bg2q.c                     |   9 +-
 drivers/clk/clk-axi-clkgen.c                  |   3 +-
 drivers/clk/clk-axm5516.c                     |   4 +-
 drivers/clk/clk-bcm2835.c                     |   2 +-
 drivers/clk/clk-composite.c                   |  11 +-
 drivers/clk/clk-conf.c                        |  17 +-
 drivers/clk/clk-divider.c                     |   8 +-
 drivers/clk/clk-efm32gg.c                     |   3 +-
 drivers/clk/clk-fixed-factor.c                |   6 +-
 drivers/clk/clk-fixed-rate.c                  |   8 +-
 drivers/clk/clk-fractional-divider.c          |   4 +-
 drivers/clk/clk-gate.c                        |   4 +-
 drivers/clk/clk-highbank.c                    |   8 +-
 drivers/clk/clk-ls1x.c                        |  16 +-
 drivers/clk/clk-max77686.c                    |  10 +-
 drivers/clk/clk-moxart.c                      |   8 +-
 drivers/clk/clk-mux.c                         |   7 +-
 drivers/clk/clk-nomadik.c                     |  15 +-
 drivers/clk/clk-nspire.c                      |   4 +-
 drivers/clk/clk-palmas.c                      |   7 +-
 drivers/clk/clk-ppc-corenet.c                 |   8 +-
 drivers/clk/clk-s2mps11.c                     |   6 +-
 drivers/clk/clk-si5351.c                      |  17 +-
 drivers/clk/clk-si570.c                       |   4 +-
 drivers/clk/clk-twl6040.c                     |   3 +-
 drivers/clk/clk-u300.c                        |  13 +-
 drivers/clk/clk-vt8500.c                      |   4 +-
 drivers/clk/clk-wm831x.c                      |   7 +-
 drivers/clk/clk-xgene.c                       |  12 +-
 drivers/clk/clk.h                             |   4 +-
 drivers/clk/hisilicon/clk-hi3620.c            |   9 +-
 drivers/clk/hisilicon/clk-hip04.c             |   1 -
 drivers/clk/hisilicon/clk.c                   |  17 +-
 drivers/clk/hisilicon/clk.h                   |   2 +-
 drivers/clk/hisilicon/clkgate-separated.c     |   5 +-
 drivers/clk/keystone/gate.c                   |   7 +-
 drivers/clk/keystone/pll.c                    |  11 +-
 drivers/clk/mmp/clk-apbc.c                    |   5 +-
 drivers/clk/mmp/clk-apmu.c                    |   5 +-
 drivers/clk/mmp/clk-frac.c                    |   4 +-
 drivers/clk/mmp/clk-mmp2.c                    |  14 +-
 drivers/clk/mmp/clk-pxa168.c                  |  12 +-
 drivers/clk/mmp/clk-pxa910.c                  |  12 +-
 drivers/clk/mmp/clk.h                         |   8 +-
 drivers/clk/mvebu/clk-corediv.c               |   4 +-
 drivers/clk/mvebu/clk-cpu.c                   |   8 +-
 drivers/clk/mvebu/common.c                    |  15 +-
 drivers/clk/mvebu/kirkwood.c                  |   6 +-
 drivers/clk/mxs/clk-div.c                     |   5 +-
 drivers/clk/mxs/clk-frac.c                    |   5 +-
 drivers/clk/mxs/clk-imx23.c                   |   5 +-
 drivers/clk/mxs/clk-imx28.c                   |   5 +-
 drivers/clk/mxs/clk-pll.c                     |   5 +-
 drivers/clk/mxs/clk-ref.c                     |   5 +-
 drivers/clk/mxs/clk.h                         |  17 +-
 drivers/clk/qcom/clk-rcg.c                    |   8 +-
 drivers/clk/qcom/clk-rcg2.c                   |  14 +-
 drivers/clk/qcom/clk-regmap.c                 |   2 +-
 drivers/clk/qcom/clk-regmap.h                 |   2 +-
 drivers/clk/qcom/common.c                     |   6 +-
 drivers/clk/qcom/gcc-apq8084.c                |   2 +-
 drivers/clk/qcom/gcc-ipq806x.c                |   2 +-
 drivers/clk/qcom/gcc-msm8660.c                |   2 +-
 drivers/clk/qcom/gcc-msm8960.c                |   2 +-
 drivers/clk/qcom/gcc-msm8974.c                |   2 +-
 drivers/clk/qcom/mmcc-msm8960.c               |   6 +-
 drivers/clk/rockchip/clk-pll.c                |   9 +-
 drivers/clk/rockchip/clk-rk3188.c             |   2 +-
 drivers/clk/rockchip/clk-rk3288.c             |   2 +-
 drivers/clk/rockchip/clk-rockchip.c           |   2 +-
 drivers/clk/rockchip/clk.c                    |  23 +-
 drivers/clk/rockchip/clk.h                    |   5 +-
 drivers/clk/samsung/clk-exynos-audss.c        |  16 +-
 drivers/clk/samsung/clk-exynos-clkout.c       |   9 +-
 drivers/clk/samsung/clk-exynos3250.c          |   1 -
 drivers/clk/samsung/clk-exynos4.c             |   7 +-
 drivers/clk/samsung/clk-exynos5250.c          |   1 -
 drivers/clk/samsung/clk-exynos5260.c          |   1 -
 drivers/clk/samsung/clk-exynos5410.c          |   1 -
 drivers/clk/samsung/clk-exynos5420.c          |   1 -
 drivers/clk/samsung/clk-exynos5440.c          |   1 -
 drivers/clk/samsung/clk-pll.c                 |   6 +-
 drivers/clk/samsung/clk-pll.h                 |   2 +-
 drivers/clk/samsung/clk-s3c2410-dclk.c        |  30 +--
 drivers/clk/samsung/clk-s3c2410.c             |   1 -
 drivers/clk/samsung/clk-s3c2412.c             |   1 -
 drivers/clk/samsung/clk-s3c2443.c             |   1 -
 drivers/clk/samsung/clk-s3c64xx.c             |   1 -
 drivers/clk/samsung/clk-s5pv210-audss.c       |  16 +-
 drivers/clk/samsung/clk.c                     |  22 +-
 drivers/clk/samsung/clk.h                     |   3 +-
 drivers/clk/shmobile/clk-div6.c               |   2 +-
 drivers/clk/shmobile/clk-emev2.c              |   4 +-
 drivers/clk/shmobile/clk-mstp.c               |   6 +-
 drivers/clk/shmobile/clk-r8a7740.c            |   6 +-
 drivers/clk/shmobile/clk-r8a7779.c            |   6 +-
 drivers/clk/shmobile/clk-rcar-gen2.c          |  10 +-
 drivers/clk/shmobile/clk-rz.c                 |   6 +-
 drivers/clk/sirf/clk-atlas6.c                 |   3 +-
 drivers/clk/sirf/clk-common.c                 |  30 +--
 drivers/clk/sirf/clk-prima2.c                 |   3 +-
 drivers/clk/socfpga/clk-gate.c                |   3 +-
 drivers/clk/socfpga/clk-periph.c              |   3 +-
 drivers/clk/socfpga/clk-pll.c                 |   5 +-
 drivers/clk/spear/clk-aux-synth.c             |   8 +-
 drivers/clk/spear/clk-frac-synth.c            |   4 +-
 drivers/clk/spear/clk-gpt-synth.c             |   4 +-
 drivers/clk/spear/clk-vco-pll.c               |   8 +-
 drivers/clk/spear/clk.h                       |  14 +-
 drivers/clk/spear/spear1310_clock.c           |   3 +-
 drivers/clk/spear/spear1340_clock.c           |   3 +-
 drivers/clk/spear/spear3xx_clock.c            |  17 +-
 drivers/clk/spear/spear6xx_clock.c            |   3 +-
 drivers/clk/st/clk-flexgen.c                  |  12 +-
 drivers/clk/st/clkgen-fsyn.c                  |  22 +-
 drivers/clk/st/clkgen-mux.c                   |  32 +--
 drivers/clk/st/clkgen-pll.c                   |  34 +--
 drivers/clk/sunxi/clk-a10-hosc.c              |   2 +-
 drivers/clk/sunxi/clk-a20-gmac.c              |   2 +-
 drivers/clk/sunxi/clk-factors.c               |   4 +-
 drivers/clk/sunxi/clk-sun6i-apb0-gates.c      |   2 +-
 drivers/clk/sunxi/clk-sun6i-apb0.c            |   2 +-
 drivers/clk/sunxi/clk-sun6i-ar100.c           |   6 +-
 drivers/clk/sunxi/clk-sun8i-apb0.c            |   2 +-
 drivers/clk/sunxi/clk-sunxi.c                 |  18 +-
 drivers/clk/tegra/clk-audio-sync.c            |   4 +-
 drivers/clk/tegra/clk-divider.c               |   5 +-
 drivers/clk/tegra/clk-periph-gate.c           |   5 +-
 drivers/clk/tegra/clk-periph.c                |   9 +-
 drivers/clk/tegra/clk-pll-out.c               |   5 +-
 drivers/clk/tegra/clk-pll.c                   |  41 ++-
 drivers/clk/tegra/clk-super.c                 |   5 +-
 drivers/clk/tegra/clk-tegra-audio.c           |   5 +-
 drivers/clk/tegra/clk-tegra-fixed.c           |   9 +-
 drivers/clk/tegra/clk-tegra-periph.c          |  13 +-
 drivers/clk/tegra/clk-tegra-pmc.c             |   5 +-
 drivers/clk/tegra/clk-tegra-super-gen4.c      |   9 +-
 drivers/clk/tegra/clk-tegra114.c              |  11 +-
 drivers/clk/tegra/clk-tegra124.c              |   7 +-
 drivers/clk/tegra/clk-tegra20.c               |  13 +-
 drivers/clk/tegra/clk-tegra30.c               |   9 +-
 drivers/clk/tegra/clk.c                       |  25 +-
 drivers/clk/tegra/clk.h                       |  38 +--
 drivers/clk/ti/apll.c                         |   8 +-
 drivers/clk/ti/clk-2xxx.c                     |   8 +-
 drivers/clk/ti/clk-33xx.c                     |  18 +-
 drivers/clk/ti/clk-3xxx.c                     |   8 +-
 drivers/clk/ti/clk-43xx.c                     |   8 +-
 drivers/clk/ti/clk-44xx.c                     |  16 +-
 drivers/clk/ti/clk-54xx.c                     |  25 +-
 drivers/clk/ti/clk-7xx.c                      |  28 +-
 drivers/clk/ti/clk-dra7-atl.c                 |   6 +-
 drivers/clk/ti/clk.c                          |   2 +-
 drivers/clk/ti/clockdomain.c                  |   4 +-
 drivers/clk/ti/composite.c                    |   2 +-
 drivers/clk/ti/divider.c                      |   6 +-
 drivers/clk/ti/dpll.c                         |   8 +-
 drivers/clk/ti/fixed-factor.c                 |   2 +-
 drivers/clk/ti/gate.c                         |   2 +-
 drivers/clk/ti/interface.c                    |   2 +-
 drivers/clk/ti/mux.c                          |   6 +-
 drivers/clk/ux500/abx500-clk.c                |   3 +-
 drivers/clk/ux500/clk-prcc.c                  |   8 +-
 drivers/clk/ux500/clk-prcmu.c                 |  16 +-
 drivers/clk/ux500/clk-sysctrl.c               |  10 +-
 drivers/clk/ux500/clk.h                       |  23 +-
 drivers/clk/ux500/u8500_clk.c                 |   3 +-
 drivers/clk/ux500/u8500_of_clk.c              |  13 +-
 drivers/clk/ux500/u8540_clk.c                 |   3 +-
 drivers/clk/ux500/u9540_clk.c                 |   1 -
 drivers/clk/versatile/clk-icst.c              |   5 +-
 drivers/clk/versatile/clk-icst.h              |   2 +-
 drivers/clk/versatile/clk-impd1.c             |  19 +-
 drivers/clk/versatile/clk-realview.c          |   3 +-
 drivers/clk/versatile/clk-sp810.c             |  30 ++-
 drivers/clk/versatile/clk-versatile.c         |   3 +-
 drivers/clk/versatile/clk-vexpress-osc.c      |   2 +-
 drivers/clk/versatile/clk-vexpress.c          |   6 +-
 drivers/clk/x86/clk-lpt.c                     |   3 +-
 drivers/clk/zynq/clkc.c                       |  22 +-
 drivers/clk/zynq/pll.c                        |   4 +-
 drivers/gpu/drm/msm/hdmi/hdmi_phy_8960.c      |   3 +-
 drivers/media/platform/exynos4-is/media-dev.c |  17 +-
 drivers/media/platform/exynos4-is/media-dev.h |   7 +-
 drivers/media/platform/omap3isp/isp.h         |   2 +-
 drivers/rtc/rtc-hym8563.c                     |   4 +-
 drivers/staging/imx-drm/imx-tve.c             |  27 +-
 include/asm-generic/clkdev.h                  |   6 +-
 include/linux/clk/ti.h                        |  10 +-
 include/linux/clk/zynq.h                      |   2 +-
 include/linux/platform_data/si5351.h          |   4 +-
 sound/soc/mxs/mxs-saif.c                      |   4 +-
 266 files changed, 1453 insertions(+), 1516 deletions(-)
arch/arm/mach-dove/common.c +5 -5
index 0d1a892..4d95685 100644
@@ -71,9 +71,9 @@ void __init dove_map_io(void)
 static int dove_tclk;
 
 static DEFINE_SPINLOCK(gating_lock);
-static struct clk *tclk;
+static struct clk_core *tclk;
 
-static struct clk __init *dove_register_gate(const char *name,
+static struct clk_core __init *dove_register_gate(const char *name,
 					     const char *parent, u8 bit_idx)
 {
 	return clk_register_gate(NULL, name, parent, 0,
@@ -83,9 +83,9 @@ static struct clk __init *dove_register_gate(const char *name,
 
 static void __init dove_clk_init(void)
 {
-	struct clk *usb0, *usb1, *sata, *pex0, *pex1, *sdio0, *sdio1;
-	struct clk *nand, *camera, *i2s0, *i2s1, *crypto, *ac97, *pdma;
-	struct clk *xor0, *xor1, *ge, *gephy;
+	struct clk_core *usb0, *usb1, *sata, *pex0, *pex1, *sdio0, *sdio1;
+	struct clk_core *nand, *camera, *i2s0, *i2s1, *crypto, *ac97, *pdma;
+	struct clk_core *xor0, *xor1, *ge, *gephy;
 
 	tclk = clk_register_fixed_rate(NULL, "tclk", NULL, CLK_IS_ROOT,
 				       dove_tclk);
arch/arm/mach-imx/clk-busy.c +4 -5
index 4bb1bc4..bb3edc5 100644
@@ -10,7 +10,6 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-#include <linux/clk.h>
 #include <linux/clk-provider.h>
 #include <linux/io.h>
 #include <linux/slab.h>
@@ -78,12 +77,12 @@ static struct clk_ops clk_busy_divider_ops = {
 	.set_rate = clk_busy_divider_set_rate,
 };
 
-struct clk *imx_clk_busy_divider(const char *name, const char *parent_name,
+struct clk_core *imx_clk_busy_divider(const char *name, const char *parent_name,
 				 void __iomem *reg, u8 shift, u8 width,
 				 void __iomem *busy_reg, u8 busy_shift)
 {
 	struct clk_busy_divider *busy;
-	struct clk *clk;
+	struct clk_core *clk;
 	struct clk_init_data init;
 
 	busy = kzalloc(sizeof(*busy), GFP_KERNEL);
@@ -152,12 +151,12 @@ static struct clk_ops clk_busy_mux_ops = {
 	.set_parent = clk_busy_mux_set_parent,
 };
 
-struct clk *imx_clk_busy_mux(const char *name, void __iomem *reg, u8 shift,
+struct clk_core *imx_clk_busy_mux(const char *name, void __iomem *reg, u8 shift,
 			     u8 width, void __iomem *busy_reg, u8 busy_shift,
 			     const char **parent_names, int num_parents)
 {
 	struct clk_busy_mux *busy;
-	struct clk *clk;
+	struct clk_core *clk;
 	struct clk_init_data init;
 
 	busy = kzalloc(sizeof(*busy), GFP_KERNEL);
arch/arm/mach-imx/clk-fixup-div.c +2 -2
index 21db020..8a62bfd 100644
@@ -92,12 +92,12 @@ static const struct clk_ops clk_fixup_div_ops = {
 	.set_rate = clk_fixup_div_set_rate,
 };
 
-struct clk *imx_clk_fixup_divider(const char *name, const char *parent,
+struct clk_core *imx_clk_fixup_divider(const char *name, const char *parent,
 				  void __iomem *reg, u8 shift, u8 width,
 				  void (*fixup)(u32 *val))
 {
 	struct clk_fixup_div *fixup_div;
-	struct clk *clk;
+	struct clk_core *clk;
 	struct clk_init_data init;
 
 	if (!fixup)
arch/arm/mach-imx/clk-fixup-mux.c +2 -2
index 0d40b35..e29dc62 100644
@@ -71,12 +71,12 @@ static const struct clk_ops clk_fixup_mux_ops = {
 	.set_parent = clk_fixup_mux_set_parent,
 };
 
-struct clk *imx_clk_fixup_mux(const char *name, void __iomem *reg,
+struct clk_core *imx_clk_fixup_mux(const char *name, void __iomem *reg,
 			      u8 shift, u8 width, const char **parents,
 			      int num_parents, void (*fixup)(u32 *val))
 {
 	struct clk_fixup_mux *fixup_mux;
-	struct clk *clk;
+	struct clk_core *clk;
 	struct clk_init_data init;
 
 	if (!fixup)
arch/arm/mach-imx/clk-gate2.c +2 -2
index 84acdfd..d78f409 100644
@@ -108,14 +108,14 @@ static struct clk_ops clk_gate2_ops = {
 	.is_enabled = clk_gate2_is_enabled,
 };
 
-struct clk *clk_register_gate2(struct device *dev, const char *name,
+struct clk_core *clk_register_gate2(struct device *dev, const char *name,
 		const char *parent_name, unsigned long flags,
 		void __iomem *reg, u8 bit_idx,
 		u8 clk_gate2_flags, spinlock_t *lock,
 		unsigned int *share_count)
 {
 	struct clk_gate2 *gate;
-	struct clk *clk;
+	struct clk_core *clk;
 	struct clk_init_data init;
 
 	gate = kzalloc(sizeof(struct clk_gate2), GFP_KERNEL);
arch/arm/mach-imx/clk-imx1.c +1 -2
index 37c307a..8459bd7 100644
@@ -15,7 +15,6 @@
  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-#include <linux/clk.h>
 #include <linux/clkdev.h>
 #include <linux/clk-provider.h>
 #include <linux/err.h>
@@ -32,7 +31,7 @@ static const char *prem_sel_clks[] = { "clk32_premult", "clk16m", };
 static const char *clko_sel_clks[] = { "per1", "hclk", "clk48m", "clk16m",
 				       "prem", "fclk", };
 
-static struct clk *clk[IMX1_CLK_MAX];
+static struct clk_core *clk[IMX1_CLK_MAX];
 static struct clk_onecell_data clk_data;
 
 static void __iomem *ccm __initdata;
arch/arm/mach-imx/clk-imx21.c +1 -2
index 4b4c753..56d799c 100644
@@ -9,7 +9,6 @@
  * of the License, or (at your option) any later version.
  */
 
-#include <linux/clk.h>
 #include <linux/clk-provider.h>
 #include <linux/clkdev.h>
 #include <linux/of.h>
@@ -36,7 +35,7 @@ static const char *mpll_sel_clks[] = { "fpm_gate", "mpll_osc_sel", };
 static const char *spll_sel_clks[] = { "fpm_gate", "mpll_osc_sel", };
 static const char *ssi_sel_clks[] = { "spll_gate", "mpll_gate", };
 
-static struct clk *clk[IMX21_CLK_MAX];
+static struct clk_core *clk[IMX21_CLK_MAX];
 static struct clk_onecell_data clk_data;
 
 static void __init _mx21_clocks_init(unsigned long lref, unsigned long href)
arch/arm/mach-imx/clk-imx25.c +4 -5
index 59c0c85..06d2c72 100644
@@ -19,7 +19,6 @@
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/list.h>
-#include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/clkdev.h>
 #include <linux/err.h>
@@ -87,7 +86,7 @@ enum mx25_clks {
 	wdt_ipg, cko_div, cko_sel, cko, clk_max
 };
 
-static struct clk *clk[clk_max];
+static struct clk_core *clk[clk_max];
 
 static int __init __mx25_clocks_init(unsigned long osc_rate,
 				     void __iomem *ccm_base)
@@ -225,16 +224,16 @@ static int __init __mx25_clocks_init(unsigned long osc_rate,
 
 	imx_check_clocks(clk, ARRAY_SIZE(clk));
 
-	clk_prepare_enable(clk[emi_ahb]);
+	clk_provider_prepare_enable(clk[emi_ahb]);
 
 	/* Clock source for gpt must be derived from AHB */
-	clk_set_parent(clk[per5_sel], clk[ahb]);
+	clk_provider_set_parent(clk[per5_sel], clk[ahb]);
 
 	/*
 	 * Let's initially set up CLKO parent as ipg, since this configuration
 	 * is used on some imx25 board designs to clock the audio codec.
 	 */
-	clk_set_parent(clk[cko_sel], clk[ipg]);
+	clk_provider_set_parent(clk[cko_sel], clk[ipg]);
 
 	return 0;
 }
arch/arm/mach-imx/clk-imx27.c +2 -3
index ab6349e..7b0f01c 100644
@@ -1,4 +1,3 @@
-#include <linux/clk.h>
 #include <linux/clk-provider.h>
 #include <linux/clkdev.h>
 #include <linux/err.h>
@@ -39,7 +38,7 @@ static const char *clko_sel_clks[] = {
 
 static const char *ssi_sel_clks[] = { "spll_gate", "mpll", };
 
-static struct clk *clk[IMX27_CLK_MAX];
+static struct clk_core *clk[IMX27_CLK_MAX];
 static struct clk_onecell_data clk_data;
 
 static void __init _mx27_clocks_init(unsigned long fref)
@@ -156,7 +155,7 @@ static void __init _mx27_clocks_init(unsigned long fref)
 
 	clk_register_clkdev(clk[IMX27_CLK_CPU_DIV], NULL, "cpu0");
 
-	clk_prepare_enable(clk[IMX27_CLK_EMI_AHB_GATE]);
+	clk_provider_prepare_enable(clk[IMX27_CLK_EMI_AHB_GATE]);
 
 	imx_print_silicon_rev("i.MX27", mx27_revision());
 }
arch/arm/mach-imx/clk-imx31.c +5 -6
index 286ef42..c95fc5c 100644
@@ -16,7 +16,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/clk.h>
 #include <linux/clkdev.h>
 #include <linux/io.h>
 #include <linux/err.h>
@@ -45,7 +44,7 @@ enum mx31_clks {
 	gacc_gate, emi_gate, rtic_gate, firi_gate, clk_max
 };
 
-static struct clk *clk[clk_max];
+static struct clk_core *clk[clk_max];
 static struct clk_onecell_data clk_data;
 
 int __init mx31_clocks_init(unsigned long fref)
@@ -176,11 +175,11 @@ int __init mx31_clocks_init(unsigned long fref)
 	clk_register_clkdev(clk[sdma_gate], NULL, "imx31-sdma");
 	clk_register_clkdev(clk[iim_gate], "iim", NULL);
 
-	clk_set_parent(clk[csi], clk[upll]);
-	clk_prepare_enable(clk[emi_gate]);
-	clk_prepare_enable(clk[iim_gate]);
+	clk_provider_set_parent(clk[csi], clk[upll]);
+	clk_provider_prepare_enable(clk[emi_gate]);
+	clk_provider_prepare_enable(clk[iim_gate]);
 	mx31_revision();
-	clk_disable_unprepare(clk[iim_gate]);
+	clk_provider_disable_unprepare(clk[iim_gate]);
 
 	mxc_timer_init(MX31_IO_ADDRESS(MX31_GPT1_BASE_ADDR), MX31_INT_GPT);
 
arch/arm/mach-imx/clk-imx35.c +11 -12
index a0d2b57..846b2cc 100644
@@ -8,7 +8,6 @@
  */
 #include <linux/mm.h>
 #include <linux/delay.h>
-#include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/clkdev.h>
 #include <linux/of.h>
@@ -67,7 +66,7 @@ enum mx35_clks {
 	gpu2d_gate, clk_max
 };
 
-static struct clk *clk[clk_max];
+static struct clk_core *clk[clk_max];
 
 int __init mx35_clocks_init(void)
 {
@@ -99,7 +98,7 @@ int __init mx35_clocks_init(void)
 	else
 		clk[arm] = imx_clk_fixed_factor("arm", "mpll", 1, aad->arm);
 
-	if (clk_get_rate(clk[arm]) > 400000000)
+	if (clk_provider_get_rate(clk[arm]) > 400000000)
 		hsp_div = hsp_div_532;
 	else
 		hsp_div = hsp_div_400;
@@ -257,14 +256,14 @@ int __init mx35_clocks_init(void)
 	clk_register_clkdev(clk[csi_gate], NULL, "mx3-camera.0");
 	clk_register_clkdev(clk[admux_gate], "audmux", NULL);
 
-	clk_prepare_enable(clk[spba_gate]);
-	clk_prepare_enable(clk[gpio1_gate]);
-	clk_prepare_enable(clk[gpio2_gate]);
-	clk_prepare_enable(clk[gpio3_gate]);
-	clk_prepare_enable(clk[iim_gate]);
-	clk_prepare_enable(clk[emi_gate]);
-	clk_prepare_enable(clk[max_gate]);
-	clk_prepare_enable(clk[iomuxc_gate]);
+	clk_provider_prepare_enable(clk[spba_gate]);
+	clk_provider_prepare_enable(clk[gpio1_gate]);
+	clk_provider_prepare_enable(clk[gpio2_gate]);
+	clk_provider_prepare_enable(clk[gpio3_gate]);
+	clk_provider_prepare_enable(clk[iim_gate]);
+	clk_provider_prepare_enable(clk[emi_gate]);
+	clk_provider_prepare_enable(clk[max_gate]);
+	clk_provider_prepare_enable(clk[iomuxc_gate]);
 
 	/*
 	 * SCC is needed to boot via mmc after a watchdog reset. The clock code
@@ -272,7 +271,7 @@ int __init mx35_clocks_init(void)
 	 * handled here and not needed for mmc) and IIM (which is enabled
 	 * unconditionally above).
 	 */
-	clk_prepare_enable(clk[scc_gate]);
+	clk_provider_prepare_enable(clk[scc_gate]);
 
 	imx_print_silicon_rev("i.MX35", mx35_revision());
 
arch/arm/mach-imx/clk-imx51-imx53.c +40 -38

127 lines not on this page · raw message

arch/arm/mach-imx/clk-imx6q.c +34 -20

98 lines not on this page · raw message

arch/arm/mach-imx/clk-imx6sl.c +7 -7
index fef46fa..9f1224d 100644
@@ -7,7 +7,6 @@
  *
  */
 
-#include <linux/clk.h>
 #include <linux/clkdev.h>
 #include <linux/err.h>
 #include <linux/of.h>
@@ -79,7 +78,7 @@ static struct clk_div_table video_div_table[] = {
 	{ }
 };
 
-static struct clk *clks[IMX6SL_CLK_END];
+static struct clk_core *clks[IMX6SL_CLK_END];
 static struct clk_onecell_data clk_data;
 static void __iomem *ccm_base;
 static void __iomem *anatop_base;
@@ -355,7 +354,7 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
 	of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data);
 
 	/* Ensure the AHB clk is at 132MHz. */
-	ret = clk_set_rate(clks[IMX6SL_CLK_AHB], 132000000);
+	ret = clk_provider_set_rate(clks[IMX6SL_CLK_AHB], 132000000);
 	if (ret)
 		pr_warn("%s: failed to set AHB clock rate %d!\n",
 			__func__, ret);
@@ -365,15 +364,16 @@ static void __init imx6sl_clocks_init(struct device_node *ccm_node)
 	 * usecount and enabling/disabling of parent PLLs.
 	 */
 	for (i = 0; i < ARRAY_SIZE(clks_init_on); i++)
-		clk_prepare_enable(clks[clks_init_on[i]]);
+		clk_provider_prepare_enable(clks[clks_init_on[i]]);
 
 	if (IS_ENABLED(CONFIG_USB_MXS_PHY)) {
-		clk_prepare_enable(clks[IMX6SL_CLK_USBPHY1_GATE]);
-		clk_prepare_enable(clks[IMX6SL_CLK_USBPHY2_GATE]);
+		clk_provider_prepare_enable(clks[IMX6SL_CLK_USBPHY1_GATE]);
+		clk_provider_prepare_enable(clks[IMX6SL_CLK_USBPHY2_GATE]);
 	}
 
 	/* Audio-related clocks configuration */
-	clk_set_parent(clks[IMX6SL_CLK_SPDIF0_SEL], clks[IMX6SL_CLK_PLL3_PFD3]);
+	clk_provider_set_parent(clks[IMX6SL_CLK_SPDIF0_SEL],
+				clks[IMX6SL_CLK_PLL3_PFD3]);
 
 	/* Set initial power mode */
 	imx6q_set_lpm(WAIT_CLOCKED);
arch/arm/mach-imx/clk-imx6sx.c +57 -41

148 lines not on this page · raw message

arch/arm/mach-imx/clk-pfd.c +2 -3
index 0b0f6f6..7f172a2 100644
@@ -10,7 +10,6 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-#include <linux/clk.h>
 #include <linux/clk-provider.h>
 #include <linux/io.h>
 #include <linux/slab.h>
@@ -128,11 +127,11 @@ static const struct clk_ops clk_pfd_ops = {
 	.is_enabled     = clk_pfd_is_enabled,
 };
 
-struct clk *imx_clk_pfd(const char *name, const char *parent_name,
+struct clk_core *imx_clk_pfd(const char *name, const char *parent_name,
 			void __iomem *reg, u8 idx)
 {
 	struct clk_pfd *pfd;
-	struct clk *clk;
+	struct clk_core *clk;
 	struct clk_init_data init;
 
 	pfd = kzalloc(sizeof(*pfd), GFP_KERNEL);
arch/arm/mach-imx/clk-pllv1.c +2 -3
index d21d14c..7ef2cab 100644
@@ -1,4 +1,3 @@
-#include <linux/clk.h>
 #include <linux/clk-provider.h>
 #include <linux/io.h>
 #include <linux/slab.h>
@@ -97,11 +96,11 @@ static struct clk_ops clk_pllv1_ops = {
 	.recalc_rate = clk_pllv1_recalc_rate,
 };
 
-struct clk *imx_clk_pllv1(const char *name, const char *parent,
+struct clk_core *imx_clk_pllv1(const char *name, const char *parent,
 		void __iomem *base)
 {
 	struct clk_pllv1 *pll;
-	struct clk *clk;
+	struct clk_core *clk;
 	struct clk_init_data init;
 
 	pll = kmalloc(sizeof(*pll), GFP_KERNEL);
arch/arm/mach-imx/clk-pllv2.c +2 -3
index 20889d5..3dca7df 100644
@@ -1,5 +1,4 @@
 #include <linux/kernel.h>
-#include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/errno.h>
 #include <linux/delay.h>
@@ -237,11 +236,11 @@ static struct clk_ops clk_pllv2_ops = {
 	.set_rate = clk_pllv2_set_rate,
 };
 
-struct clk *imx_clk_pllv2(const char *name, const char *parent,
+struct clk_core *imx_clk_pllv2(const char *name, const char *parent,
 		void __iomem *base)
 {
 	struct clk_pllv2 *pll;
-	struct clk *clk;
+	struct clk_core *clk;
 	struct clk_init_data init;
 
 	pll = kzalloc(sizeof(*pll), GFP_KERNEL);
arch/arm/mach-imx/clk-pllv3.c +2 -3
index 6136405..a07603d 100644
@@ -10,7 +10,6 @@
  * http://www.gnu.org/copyleft/gpl.html
  */
 
-#include <linux/clk.h>
 #include <linux/clk-provider.h>
 #include <linux/delay.h>
 #include <linux/io.h>
@@ -320,13 +319,13 @@ static const struct clk_ops clk_pllv3_enet_ops = {
 	.recalc_rate	= clk_pllv3_enet_recalc_rate,
 };
 
-struct clk *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
+struct clk_core *imx_clk_pllv3(enum imx_pllv3_type type, const char *name,
 			  const char *parent_name, void __iomem *base,
 			  u32 div_mask)
 {
 	struct clk_pllv3 *pll;
 	const struct clk_ops *ops;
-	struct clk *clk;
+	struct clk_core *clk;
 	struct clk_init_data init;
 
 	pll = kzalloc(sizeof(*pll), GFP_KERNEL);
arch/arm/mach-imx/clk-vf610.c +27 -16

61 lines not on this page · raw message

arch/arm/mach-imx/clk.c +5 -6
index df12b53..fc54203 100644
@@ -1,4 +1,3 @@
-#include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/of.h>
 #include <linux/slab.h>
@@ -7,7 +6,7 @@
 
 DEFINE_SPINLOCK(imx_ccm_lock);
 
-void __init imx_check_clocks(struct clk *clks[], unsigned int count)
+void __init imx_check_clocks(struct clk_core *clks[], unsigned int count)
 {
 	unsigned i;
 
@@ -17,10 +16,10 @@ void __init imx_check_clocks(struct clk *clks[], unsigned int count)
 			       i, PTR_ERR(clks[i]));
 }
 
-static struct clk * __init imx_obtain_fixed_clock_from_dt(const char *name)
+static struct clk_core * __init imx_obtain_fixed_clock_from_dt(const char *name)
 {
 	struct of_phandle_args phandle;
-	struct clk *clk = ERR_PTR(-ENODEV);
+	struct clk_core *clk = ERR_PTR(-ENODEV);
 	char *path;
 
 	path = kasprintf(GFP_KERNEL, "/clocks/%s", name);
@@ -37,10 +36,10 @@ static struct clk * __init imx_obtain_fixed_clock_from_dt(const char *name)
 	return clk;
 }
 
-struct clk * __init imx_obtain_fixed_clock(
+struct clk_core * __init imx_obtain_fixed_clock(
 			const char *name, unsigned long rate)
 {
-	struct clk *clk;
+	struct clk_core *clk;
 
 	clk = imx_obtain_fixed_clock_from_dt(name);
 	if (IS_ERR(clk))
arch/arm/mach-imx/clk.h +21 -21

134 lines not on this page · raw message

arch/arm/mach-msm/clock-pcom.c +1 -1
index 9a80449..14352c4 100644
@@ -132,7 +132,7 @@ static int msm_clock_pcom_probe(struct platform_device *pdev)
 
 	for (i = 0; i < pdata->num_lookups; i++) {
 		const struct clk_pcom_desc *desc = &pdata->lookup[i];
-		struct clk *c;
+		struct clk_core *c;
 		struct clk_pcom *p;
 		struct clk_hw *hw;
 		struct clk_init_data init;
arch/arm/mach-mv78xx0/common.c +1 -1
index e6ac679..fee2643 100644
@@ -164,7 +164,7 @@ void __init mv78xx0_map_io(void)
 /*****************************************************************************
  * CLK tree
  ****************************************************************************/
-static struct clk *tclk;
+static struct clk_core *tclk;
 
 static void __init clk_init(void)
 {
arch/arm/mach-omap2/board-cm-t35.c +1 -1
index 018353d..0f41427 100644
@@ -551,7 +551,7 @@ static struct regulator_consumer_supply cm_t35_camera_supplies[] = {
 
 static void __init cm_t35_init_camera(void)
 {
-	struct clk *clk;
+	struct clk_core *clk;
 
 	clk = clk_register_fixed_rate(NULL, "mt9t001-clkin", NULL, CLK_IS_ROOT,
 				      48000000);
arch/arm/mach-omap2/cclock3xxx_data.c +185 -186

1,447 lines not on this page · raw message

arch/arm/mach-omap2/clkt2xxx_dpll.c +2 -3
index 82572e2..d7bbbb6 100644
@@ -11,7 +11,6 @@
 
 #include <linux/kernel.h>
 #include <linux/errno.h>
-#include <linux/clk.h>
 #include <linux/io.h>
 
 #include "clock.h"
@@ -22,7 +21,7 @@
 
 /**
  * _allow_idle - enable DPLL autoidle bits
- * @clk: struct clk * of the DPLL to operate on
+ * @clk: struct clk_core * of the DPLL to operate on
  *
  * Enable DPLL automatic idle control.  The DPLL will enter low-power
  * stop when its downstream clocks are gated.  No return value.
@@ -39,7 +38,7 @@ static void _allow_idle(struct clk_hw_omap *clk)
 
 /**
  * _deny_idle - prevent DPLL from automatically idling
- * @clk: struct clk * of the DPLL to operate on
+ * @clk: struct clk_core * of the DPLL to operate on
  *
  * Disable DPLL automatic idle control.  No return value.
  */
arch/arm/mach-omap2/clkt2xxx_dpllcore.c +2 -3
index 59cf310..9a60ce2 100644
@@ -22,7 +22,6 @@
 
 #include <linux/kernel.h>
 #include <linux/errno.h>
-#include <linux/clk.h>
 #include <linux/io.h>
 
 #include "clock.h"
@@ -48,7 +47,7 @@ static struct clk_hw_omap *dpll_core_ck;
  * Returns the CORE_CLK rate.  CORE_CLK can have one of three rate
  * sources on OMAP2xxx: the DPLL CLKOUT rate, DPLL CLKOUTX2, or 32KHz
  * (the latter is unusual).  This currently should be called with
- * struct clk *dpll_ck, which is a composite clock of dpll_ck and
+ * struct clk_core *dpll_ck, which is a composite clock of dpll_ck and
  * core_ck.
  */
 unsigned long omap2xxx_clk_get_core_rate(void)
@@ -179,7 +178,7 @@ int omap2_reprogram_dpllcore(struct clk_hw *hw, unsigned long rate,
 
 /**
  * omap2xxx_clkt_dpllcore_init - clk init function for dpll_ck
- * @clk: struct clk *dpll_ck
+ * @clk: struct clk_core *dpll_ck
  *
  * Store a local copy of @clk in dpll_core_ck so other code can query
  * the core rate without having to clk_get(), which can sleep.  Must
arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c +5 -6
index 85e0b0c0..d621a4c 100644
@@ -28,7 +28,6 @@
 
 #include <linux/kernel.h>
 #include <linux/errno.h>
-#include <linux/clk.h>
 #include <linux/io.h>
 #include <linux/cpufreq.h>
 #include <linux/slab.h>
@@ -198,14 +197,14 @@ void omap2xxx_clkt_vps_check_bootloader_rates(void)
  */
 void omap2xxx_clkt_vps_late_init(void)
 {
-	struct clk *c;
+	struct clk_core *c;
 
-	c = clk_get(NULL, "sys_ck");
+	c = clk_provider_get(NULL, "sys_ck");
 	if (IS_ERR(c)) {
 		WARN(1, "could not locate sys_ck\n");
 	} else {
-		sys_ck_rate = clk_get_rate(c);
-		clk_put(c);
+		sys_ck_rate = clk_provider_get_rate(c);
+		__clk_put(c);
 	}
 }
 
@@ -230,7 +229,7 @@ void omap2xxx_clkt_vps_init(void)
 {
 	struct clk_init_data init = { NULL };
 	struct clk_hw_omap *hw = NULL;
-	struct clk *clk;
+	struct clk_core *clk;
 	const char *parent_name = "mpu_ck";
 	struct clk_lookup *lookup = NULL;
 
arch/arm/mach-omap2/clkt34xx_dpll3m2.c +1 -2
index eb69acf..16ff4ed 100644
@@ -18,7 +18,6 @@
 
 #include <linux/kernel.h>
 #include <linux/errno.h>
-#include <linux/clk.h>
 #include <linux/io.h>
 
 #include "clock.h"
@@ -38,7 +37,7 @@
 
 /**
  * omap3_core_dpll_m2_set_rate - set CORE DPLL M2 divider
- * @clk: struct clk * of DPLL to set
+ * @clk: struct clk_core * of DPLL to set
  * @rate: rounded target rate
  *
  * Program the DPLL M2 divider with the rounded target rate.  Returns
arch/arm/mach-omap2/clkt_clksel.c +23 -23

154 lines not on this page · raw message

arch/arm/mach-omap2/clkt_dpll.c +4 -4
index f251a14..36f263d 100644
@@ -56,7 +56,7 @@
 
 /*
  * _dpll_test_fint - test whether an Fint value is valid for the DPLL
- * @clk: DPLL struct clk to test
+ * @clk: DPLL struct clk_core to test
  * @n: divider value (N) to test
  *
  * Tests whether a particular divider @n will result in a valid DPLL
@@ -215,7 +215,7 @@ u8 omap2_init_dpll_parent(struct clk_hw *hw)
 	v &= dd->enable_mask;
 	v >>= __ffs(dd->enable_mask);
 
-	/* Reparent the struct clk in case the dpll is in bypass */
+	/* Reparent the struct clk_core in case the dpll is in bypass */
 	if (_omap2_dpll_is_in_bypass(v))
 		return 1;
 
@@ -224,7 +224,7 @@ u8 omap2_init_dpll_parent(struct clk_hw *hw)
 
 /**
  * omap2_get_dpll_rate - returns the current DPLL CLKOUT rate
- * @clk: struct clk * of a DPLL
+ * @clk: struct clk_core * of a DPLL
  *
  * DPLLs can be locked or bypassed - basically, enabled or disabled.
  * When locked, the DPLL output depends on the M and N values.  When
@@ -270,7 +270,7 @@ unsigned long omap2_get_dpll_rate(struct clk_hw_omap *clk)
 
 /**
  * omap2_dpll_round_rate - round a target rate for an OMAP DPLL
- * @clk: struct clk * for a DPLL
+ * @clk: struct clk_core * for a DPLL
  * @target_rate: desired DPLL clock rate
  *
  * Given a DPLL and a desired target rate, round the target rate to a
arch/arm/mach-omap2/clock.c +26 -26

160 lines not on this page · raw message

arch/arm/mach-omap2/clock.h +9 -9
index 4592a27..7068684 100644
@@ -40,7 +40,7 @@ struct omap_clk {
 struct clockdomain;
 
 #define DEFINE_STRUCT_CLK(_name, _parent_array_name, _clkops_name)	\
-	static struct clk _name = {				\
+	static struct clk_core _name = {				\
 		.name = #_name,					\
 		.hw = &_name##_hw.hw,				\
 		.parent_names = _parent_array_name,		\
@@ -50,7 +50,7 @@ struct clockdomain;
 
 #define DEFINE_STRUCT_CLK_FLAGS(_name, _parent_array_name,	\
 				_clkops_name, _flags)		\
-	static struct clk _name = {				\
+	static struct clk_core _name = {				\
 		.name = #_name,					\
 		.hw = &_name##_hw.hw,				\
 		.parent_names = _parent_array_name,		\
@@ -70,7 +70,7 @@ struct clockdomain;
 #define DEFINE_CLK_OMAP_MUX(_name, _clkdm_name, _clksel,	\
 			    _clksel_reg, _clksel_mask,		\
 			    _parent_names, _ops)		\
-	static struct clk _name;				\
+	static struct clk_core _name;				\
 	static struct clk_hw_omap _name##_hw = {		\
 		.hw = {						\
 			.clk = &_name,				\
@@ -86,7 +86,7 @@ struct clockdomain;
 				 _clksel_reg, _clksel_mask,	\
 				 _enable_reg, _enable_bit,	\
 				 _hwops, _parent_names, _ops)	\
-	static struct clk _name;				\
+	static struct clk_core _name;				\
 	static struct clk_hw_omap _name##_hw = {		\
 		.hw = {						\
 			.clk = &_name,				\
@@ -142,14 +142,14 @@ struct clksel_rate {
 
 /**
  * struct clksel - available parent clocks, and a pointer to their divisors
- * @parent: struct clk * to a possible parent clock
+ * @parent: struct clk_core * to a possible parent clock
  * @rates: available divisors for this parent clock
  *
  * A struct clksel is always associated with one or more struct clks
  * and one or more struct clksel_rates.
  */
 struct clksel {
-	struct clk		 *parent;
+	struct clk_core		 *parent;
 	const struct clksel_rate *rates;
 };
 
@@ -208,8 +208,8 @@ void omap2_clk_dflt_find_idlest(struct clk_hw_omap *clk,
 				void __iomem **idlest_reg,
 				u8 *idlest_bit, u8 *idlest_val);
 int omap2_clk_enable_autoidle_all(void);
-int omap2_clk_allow_idle(struct clk *clk);
-int omap2_clk_deny_idle(struct clk *clk);
+int omap2_clk_allow_idle(struct clk_core *clk);
+int omap2_clk_deny_idle(struct clk_core *clk);
 int omap2_clk_switch_mpurate_at_boot(const char *mpurate_ck_name);
 void omap2_clk_print_new_rates(const char *hfclkin_ck_name,
 			       const char *core_ck_name,
@@ -247,7 +247,7 @@ extern const struct clksel_rate gpt_32k_rates[];
 extern const struct clksel_rate gpt_sys_rates[];
 extern const struct clksel_rate gfx_l3_rates[];
 extern const struct clksel_rate dsp_ick_rates[];
-extern struct clk dummy_ck;
+extern struct clk_core dummy_ck;
 
 extern const struct clk_hw_omap_ops clkhwops_iclk_wait;
 extern const struct clk_hw_omap_ops clkhwops_wait;
arch/arm/mach-omap2/clock3xxx.c +11 -12
index 0b02b41..8d1b843 100644
@@ -18,7 +18,6 @@
 
 #include <linux/kernel.h>
 #include <linux/errno.h>
-#include <linux/clk.h>
 #include <linux/io.h>
 
 #include "soc.h"
@@ -37,7 +36,7 @@
 #define DPLL5_FREQ_FOR_USBHOST		120000000
 
 /* needed by omap3_core_dpll_m2_set_rate() */
-struct clk *sdrc_ick_p, *arm_fck_p;
+struct clk_core *sdrc_ick_p, *arm_fck_p;
 int omap3_dpll4_set_rate(struct clk_hw *hw, unsigned long rate,
 				unsigned long parent_rate)
 {
@@ -56,20 +55,20 @@ int omap3_dpll4_set_rate(struct clk_hw *hw, unsigned long rate,
 
 void __init omap3_clk_lock_dpll5(void)
 {
-	struct clk *dpll5_clk;
-	struct clk *dpll5_m2_clk;
+	struct clk_core *dpll5_clk;
+	struct clk_core *dpll5_m2_clk;
 
-	dpll5_clk = clk_get(NULL, "dpll5_ck");
-	clk_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST);
-	clk_prepare_enable(dpll5_clk);
+	dpll5_clk = clk_provider_get(NULL, "dpll5_ck");
+	clk_provider_set_rate(dpll5_clk, DPLL5_FREQ_FOR_USBHOST);
+	clk_provider_prepare_enable(dpll5_clk);
 
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

arch/arm/mach-omap2/clock3xxx.h +2 -2
index 78d9f56..063fbf1 100644

Lines of this file are not shown. View the raw message.

arch/arm/mach-omap2/clock_common_data.c +1 -1
index ef4d21b..31e3e79 100644

Lines of this file are not shown. View the raw message.

arch/arm/mach-omap2/clockdomain.c +4 -5
index 2da3b5e..dd89095 100644

Lines of this file are not shown. View the raw message.

arch/arm/mach-omap2/clockdomain.h +2 -2
index 82c37b1..f1a2cad 100644

Lines of this file are not shown. View the raw message.

arch/arm/mach-omap2/display.c +2 -3
index 0f9e479..ff1f6c1 100644

Lines of this file are not shown. View the raw message.

arch/arm/mach-omap2/dpll3xxx.c +14 -15
index ac3d789..39c3861 100644

Lines of this file are not shown. View the raw message.

arch/arm/mach-omap2/dpll44xx.c +2 -3
index 4613f1e..726b254 100644

Lines of this file are not shown. View the raw message.

arch/arm/mach-omap2/mcbsp.c +2 -3
index b4ac3af..1424c90 100644

Lines of this file are not shown. View the raw message.

arch/arm/mach-omap2/omap_device.c +4 -5
index f138a62..c5386a4 100644

Lines of this file are not shown. View the raw message.

arch/arm/mach-omap2/omap_hwmod.c +21 -21

42 lines not on this page · raw message

arch/arm/mach-omap2/omap_hwmod.h +6 -6
index 0f97d63..46ffd06 100644

Lines of this file are not shown. View the raw message.

arch/arm/mach-omap2/pm24xx.c +6 -6
index fe01c5a..56e5e77 100644

Lines of this file are not shown. View the raw message.

arch/arm/mach-orion5x/common.c +1 -1
index 6bbb7b5..6be2d2d 100644

Lines of this file are not shown. View the raw message.

arch/arm/mach-shmobile/clock.c +4 -5
index ed415dc..827f746 100644

Lines of this file are not shown. View the raw message.

arch/arm/mach-vexpress/spc.c +2 -2
index f61158c..e497df6 100644

Lines of this file are not shown. View the raw message.

arch/arm/plat-orion/common.c +10 -11
index 961b593..abf63ce 100644

Lines of this file are not shown. View the raw message.

arch/arm/plat-orion/include/plat/common.h +6 -6
index d9a24f6..44f1bbe 100644

Lines of this file are not shown. View the raw message.

arch/powerpc/platforms/512x/clock-commonclk.c +24 -24

48 lines not on this page · raw message

drivers/clk/at91/clk-main.c +12 -12
index 59fa3cc..11bcdb1 100644

Lines of this file are not shown. View the raw message.

drivers/clk/at91/clk-master.c +3 -3
index c1af80b..95ae1b6 100644

Lines of this file are not shown. View the raw message.

drivers/clk/at91/clk-peripheral.c +6 -6
index 597fed4..cdf8e8a 100644

Lines of this file are not shown. View the raw message.

drivers/clk/at91/clk-pll.c +3 -3
index 6ec79db..6a1b900 100644

Lines of this file are not shown. View the raw message.

drivers/clk/at91/clk-plldiv.c +3 -3
index ea22656..f8204d8 100644

Lines of this file are not shown. View the raw message.

drivers/clk/at91/clk-programmable.c +5 -5
index 62e2509..b72e98c 100644

Lines of this file are not shown. View the raw message.

drivers/clk/at91/clk-slow.c +12 -12
index 0300c46..d50fe02 100644

Lines of this file are not shown. View the raw message.

drivers/clk/at91/clk-smd.c +3 -3
index 144d47e..8820b84 100644

Lines of this file are not shown. View the raw message.

drivers/clk/at91/clk-system.c +3 -3
index 8c96307..770d9bf 100644

Lines of this file are not shown. View the raw message.

drivers/clk/at91/clk-usb.c +10 -10
index 24b5b02..94b5871 100644

Lines of this file are not shown. View the raw message.

drivers/clk/at91/clk-utmi.c +3 -3
index ae3263b..0502050 100644

Lines of this file are not shown. View the raw message.

drivers/clk/bcm/clk-kona-setup.c +3 -3
index e5aeded..122e7b0 100644

Lines of this file are not shown. View the raw message.

drivers/clk/bcm/clk-kona.c +6 -6
index 95af2e6..a301aa9 100644

Lines of this file are not shown. View the raw message.

drivers/clk/bcm/clk-kona.h +1 -1
index 2537b30..c2d0152 100644

Lines of this file are not shown. View the raw message.

drivers/clk/berlin/berlin2-avpll.c +2 -2
index fd0f26c..488d986 100644

Lines of this file are not shown. View the raw message.

drivers/clk/berlin/berlin2-avpll.h +2 -2
index a37f506..216eee7 100644

Lines of this file are not shown. View the raw message.

drivers/clk/berlin/berlin2-div.c +1 -1
index 81ff97f..c673082 100644

Lines of this file are not shown. View the raw message.

drivers/clk/berlin/berlin2-div.h +1 -1
index 15e3384..3ddb87a 100644

Lines of this file are not shown. View the raw message.

drivers/clk/berlin/berlin2-pll.c +1 -1
index bdc506b..b7a3016 100644

Lines of this file are not shown. View the raw message.

drivers/clk/berlin/berlin2-pll.h +1 -1
index 8831ce2..6b6a6ed 100644

Lines of this file are not shown. View the raw message.

drivers/clk/berlin/bg2.c +6 -7
index 4c81e09..49ecb3e 100644

Lines of this file are not shown. View the raw message.

drivers/clk/berlin/bg2q.c +4 -5
index 748da9b..33cc08b 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-axi-clkgen.c +1 -2
index 1127ee4..d91550c 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-axm5516.c +2 -2
index d2f1e11..3dc6e58 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-bcm2835.c +1 -1
index 6b950ca..f25e85e 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-composite.c +5 -6
index b9355da..d7322fa 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-conf.c +8 -9
index d36a7b3..c9231cd 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-divider.c +4 -4
index 18a9de2..3c78139 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-efm32gg.c +1 -2
index bac2ddf..3240887 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-fixed-factor.c +3 -3
index d9e3f67..ae1fef0 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-fixed-rate.c +4 -4
index 0fc56ab..56c0ced 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-fractional-divider.c +2 -2
index ede685c..8104683 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-gate.c +2 -2
index 4a58c55..429d302 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-highbank.c +4 -4
index 2e7e9d9..cad2fba 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-ls1x.c +8 -8
index f20b750..796043c 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-max77686.c +5 -5
index 3d7e8dd..42fa43a 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-moxart.c +4 -4
index 30a3b69..c503c09 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-mux.c +3 -4
index 4f96ff3..538c455 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-nomadik.c +7 -8
index 05e04ce..91855d3 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-nspire.c +2 -2
index a378db7..e9c43f4 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-palmas.c +3 -4
index 781630e..8febd8c 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-ppc-corenet.c +4 -4
index 8e58edf..5619ee9 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-s2mps11.c +3 -3
index b7797fb..17fc7e1 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-si5351.c +9 -8
index 3b2a66f..57c9eb5 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-si570.c +2 -2
index fc167b3..f0eec4e 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-twl6040.c +1 -2
index 1ada79a..d24a8a2 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-u300.c +6 -7
index 406bfc1..392bcbf 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-vt8500.c +2 -2
index 37e9288..e5fb933 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-wm831x.c +3 -4
index b131041..84ce873 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk-xgene.c +6 -6
index dd8a62d..ce3ed34 100644

Lines of this file are not shown. View the raw message.

drivers/clk/clk.h +2 -2
index c798138..d278572 100644

Lines of this file are not shown. View the raw message.

drivers/clk/hisilicon/clk-hi3620.c +4 -5
index 339945d..26f11a3 100644

Lines of this file are not shown. View the raw message.

drivers/clk/hisilicon/clk-hip04.c +0 -1
index 132b57a..e8403c0 100644

Lines of this file are not shown. View the raw message.

drivers/clk/hisilicon/clk.c +8 -9
index a078e84..00b7c9c 100644

Lines of this file are not shown. View the raw message.

drivers/clk/hisilicon/clk.h +1 -1
index 31083ff..f7fc4b9 100644

Lines of this file are not shown. View the raw message.

drivers/clk/hisilicon/clkgate-separated.c +2 -3
index b03d5a7..5db5ba6 100644

Lines of this file are not shown. View the raw message.

drivers/clk/keystone/gate.c +3 -4
index 86f1e36..6bb211a 100644

Lines of this file are not shown. View the raw message.

drivers/clk/keystone/pll.c +5 -6
index 0dd8a4b..2e31895 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mmp/clk-apbc.c +2 -3
index d14120e..4a1de49 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mmp/clk-apmu.c +2 -3
index abe182b..cbc0712 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mmp/clk-frac.c +2 -2
index 23a56f5..0386cdd 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mmp/clk-mmp2.c +7 -7
index b2721ca..98bd73f 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mmp/clk-pxa168.c +6 -6
index 014396b..e4f50ab 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mmp/clk-pxa910.c +6 -6
index 9efc6a4..b5c215e 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mmp/clk.h +4 -4
index ab86dd4..1477e61 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mvebu/clk-corediv.c +2 -2
index d1e5863..1be15c4 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mvebu/clk-cpu.c +4 -4
index 3821a88..59a40c7 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mvebu/common.c +7 -8
index 8145c4e..f6e14f8 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mvebu/kirkwood.c +3 -3
index 99550f2..5d0978b 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mxs/clk-div.c +2 -3
index 90e1da9..73ca1e8 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mxs/clk-frac.c +2 -3
index e6aa6b5..65cedf8 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mxs/clk-imx23.c +2 -3
index 9fc9359..43f2d31 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mxs/clk-imx28.c +2 -3
index a6c3501..e6d70ac 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mxs/clk-pll.c +2 -3
index fadae41..e0f94ac 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mxs/clk-ref.c +2 -3
index 4adeed6..af75c3f 100644

Lines of this file are not shown. View the raw message.

drivers/clk/mxs/clk.h +8 -9
index ef10ad9..19b9dc3 100644

Lines of this file are not shown. View the raw message.

drivers/clk/qcom/clk-rcg.c +4 -4
index b638c58..59f118c 100644

Lines of this file are not shown. View the raw message.

drivers/clk/qcom/clk-rcg2.c +7 -7
index cd185d5..6aac1ec 100644

Lines of this file are not shown. View the raw message.

drivers/clk/qcom/clk-regmap.c +1 -1
index a58ba39..2a98040 100644

Lines of this file are not shown. View the raw message.

drivers/clk/qcom/clk-regmap.h +1 -1
index 491a63d..89258cb 100644

Lines of this file are not shown. View the raw message.

drivers/clk/qcom/common.c +3 -3
index eeb3eea..afd40ea 100644

Lines of this file are not shown. View the raw message.

drivers/clk/qcom/gcc-apq8084.c +1 -1
index ee52eb1..27af0cd 100644

Lines of this file are not shown. View the raw message.

drivers/clk/qcom/gcc-ipq806x.c +1 -1
index 4032e51..f31f095 100644

Lines of this file are not shown. View the raw message.

drivers/clk/qcom/gcc-msm8660.c +1 -1
index 0c4b727..2d41fdb 100644

Lines of this file are not shown. View the raw message.

drivers/clk/qcom/gcc-msm8960.c +1 -1
index 007534f..ed8f8f5 100644

Lines of this file are not shown. View the raw message.

drivers/clk/qcom/gcc-msm8974.c +1 -1
index 7af7c18..8326b1f 100644

Lines of this file are not shown. View the raw message.

drivers/clk/qcom/mmcc-msm8960.c +3 -3
index 2e80a21..bb60d61 100644

Lines of this file are not shown. View the raw message.

drivers/clk/rockchip/clk-pll.c +4 -5
index f2a1c7a..414bff2 100644

Lines of this file are not shown. View the raw message.

drivers/clk/rockchip/clk-rk3188.c +1 -1
index 732118e..b0ca609 100644

Lines of this file are not shown. View the raw message.

drivers/clk/rockchip/clk-rk3288.c +1 -1
index 038b1aa..b8992dd 100644

Lines of this file are not shown. View the raw message.

drivers/clk/rockchip/clk-rockchip.c +1 -1
index 4cf838d5..faa8dfa 100644

Lines of this file are not shown. View the raw message.

drivers/clk/rockchip/clk.c +11 -12
index d9c6db2..dfe3ddb 100644

Lines of this file are not shown. View the raw message.

drivers/clk/rockchip/clk.h +2 -3
index 2b0bca1..7f713eb 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-exynos-audss.c +8 -8
index 13eae14c..f5639bf 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-exynos-clkout.c +4 -5
index 3a7cb25..0ad7dee 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-exynos3250.c +0 -1
index dc85f8e..5742e76 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-exynos4.c +3 -4
index ac163d7..5d77da2 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-exynos5250.c +0 -1
index 70ec3d2..623e68f 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-exynos5260.c +0 -1
index ce3de97..5a3d623 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-exynos5410.c +0 -1
index 231475b..546b32f 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-exynos5420.c +0 -1
index 848d602..0229cc9 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-exynos5440.c +0 -1
index 00d1d00..8adeaa1 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-pll.c +3 -3
index b07fad2..aaf234a 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-pll.h +1 -1
index c0ed4d4..81af344 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-s3c2410-dclk.c +15 -15
index 0449cc0..05354bd 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-s3c2410.c +0 -1
index 5d2f034..af15156 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-s3c2412.c +0 -1
index 34af09f..7e6cc95 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-s3c2443.c +0 -1
index c92f853..7eaaa68 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-s3c64xx.c +0 -1
index 0f590e5..7dad675 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk-s5pv210-audss.c +8 -8
index a8053b4..f7b77e5 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk.c +11 -11
index deab84d..68133fa 100644

Lines of this file are not shown. View the raw message.

drivers/clk/samsung/clk.h +1 -2
index 66ab36b..58b1215 100644

Lines of this file are not shown. View the raw message.

drivers/clk/shmobile/clk-div6.c +1 -1
index f065f69..c6712fb 100644

Lines of this file are not shown. View the raw message.

drivers/clk/shmobile/clk-emev2.c +2 -2
index 6c7c929..2e3a45b 100644

Lines of this file are not shown. View the raw message.

drivers/clk/shmobile/clk-mstp.c +3 -3
index 2d2fe77..2659676 100644

Lines of this file are not shown. View the raw message.

drivers/clk/shmobile/clk-r8a7740.c +3 -3
index 1e2eaae..8889e6a 100644

Lines of this file are not shown. View the raw message.

drivers/clk/shmobile/clk-r8a7779.c +3 -3
index 652ecac..96b51b1 100644

Lines of this file are not shown. View the raw message.

drivers/clk/shmobile/clk-rcar-gen2.c +5 -5
index e996425..45a0712 100644

Lines of this file are not shown. View the raw message.

drivers/clk/shmobile/clk-rz.c +3 -3
index 7e68e86..414e20e 100644

Lines of this file are not shown. View the raw message.

drivers/clk/sirf/clk-atlas6.c +1 -2
index d63b76c..3b07a02 100644

Lines of this file are not shown. View the raw message.

drivers/clk/sirf/clk-common.c +15 -15
index 37af51c..05f5040 100644

Lines of this file are not shown. View the raw message.

drivers/clk/sirf/clk-prima2.c +1 -2
index 6968e2e..869bc8c 100644

Lines of this file are not shown. View the raw message.

drivers/clk/socfpga/clk-gate.c +1 -2
index dd3a78c..5d00dee 100644

Lines of this file are not shown. View the raw message.

drivers/clk/socfpga/clk-periph.c +1 -2
index 46531c3..1bcb275 100644

Lines of this file are not shown. View the raw message.

drivers/clk/socfpga/clk-pll.c +2 -3
index de6da95..ba7073f 100644

Lines of this file are not shown. View the raw message.

drivers/clk/spear/clk-aux-synth.c +4 -4
index bdfb442..18334c3 100644

Lines of this file are not shown. View the raw message.

drivers/clk/spear/clk-frac-synth.c +2 -2
index dffd4ce..bce2c0e 100644

Lines of this file are not shown. View the raw message.

drivers/clk/spear/clk-gpt-synth.c +2 -2
index 1afc18c..f8e13f3 100644

Lines of this file are not shown. View the raw message.

drivers/clk/spear/clk-vco-pll.c +4 -4
index 1b9b65b..226f2ec 100644

Lines of this file are not shown. View the raw message.

drivers/clk/spear/clk.h +7 -7
index 9317376..777322e 100644

Lines of this file are not shown. View the raw message.

drivers/clk/spear/spear1310_clock.c +1 -2
index 4daa597..58206e0 100644

Lines of this file are not shown. View the raw message.

drivers/clk/spear/spear1340_clock.c +1 -2
index 5a5c664..704301c 100644

Lines of this file are not shown. View the raw message.

drivers/clk/spear/spear3xx_clock.c +8 -9
index bb5f387..40d1b08 100644

Lines of this file are not shown. View the raw message.

drivers/clk/spear/spear6xx_clock.c +1 -2
index 4f649c9..364a8d3 100644

Lines of this file are not shown. View the raw message.

drivers/clk/st/clk-flexgen.c +6 -6
index 2282cef..699f7a1 100644

Lines of this file are not shown. View the raw message.

drivers/clk/st/clkgen-fsyn.c +11 -11
index af94ed8..ceda1f2 100644

Lines of this file are not shown. View the raw message.

drivers/clk/st/clkgen-mux.c +16 -16
index 79dc40b..d2a951f 100644

Lines of this file are not shown. View the raw message.

drivers/clk/st/clkgen-pll.c +17 -17
index 29769d7..32bac02 100644

Lines of this file are not shown. View the raw message.

drivers/clk/sunxi/clk-a10-hosc.c +1 -1
index 0481d5d..c5e4c41 100644

Lines of this file are not shown. View the raw message.

drivers/clk/sunxi/clk-a20-gmac.c +1 -1
index 5296fd6..63c7dd5 100644

Lines of this file are not shown. View the raw message.

drivers/clk/sunxi/clk-factors.c +2 -2
index 2057c8a..bb2d4b2 100644

Lines of this file are not shown. View the raw message.

drivers/clk/sunxi/clk-sun6i-apb0-gates.c +1 -1
index e10d052..f29b06e 100644

Lines of this file are not shown. View the raw message.

drivers/clk/sunxi/clk-sun6i-apb0.c +1 -1
index 1fa2337..5e4649e 100644

Lines of this file are not shown. View the raw message.

drivers/clk/sunxi/clk-sun6i-ar100.c +3 -3
index eca8ca0..984d5d0 100644

Lines of this file are not shown. View the raw message.

drivers/clk/sunxi/clk-sun8i-apb0.c +1 -1
index 1f5ba9b..fa308fd 100644

Lines of this file are not shown. View the raw message.

drivers/clk/sunxi/clk-sunxi.c +9 -9
index b654b7b..44c4470 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk-audio-sync.c +2 -2
index c0f7843..53c3488 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk-divider.c +2 -3
index 290f9c1..c69a728 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk-periph-gate.c +2 -3
index 0aa8830..d59200f 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk-periph.c +4 -5
index 9e899c18..34a60fd 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk-pll-out.c +2 -3
index 3598987..3adbc24 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk-pll.c +20 -21

41 lines not on this page · raw message

drivers/clk/tegra/clk-super.c +2 -3
index 2fd924d..0d11346 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk-tegra-audio.c +2 -3
index 5c38aab..038a22e 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk-tegra-fixed.c +4 -5
index f3b7738..5ee486a 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk-tegra-periph.c +6 -7
index 37f32c4..5e17ad4 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk-tegra-pmc.c +2 -3
index 08b21c1..ddd39ca 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk-tegra-super-gen4.c +4 -5
index feb3201..9d1cdaa 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk-tegra114.c +5 -6
index f760f31..00a2897 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk-tegra124.c +3 -4
index 9525c68..bf481c8 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk-tegra20.c +6 -7
index dace2b1..6e7d5e2 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk-tegra30.c +4 -5
index 5bbacd0..1e9f733 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk.c +12 -13
index f87c609..d5963f6 100644

Lines of this file are not shown. View the raw message.

drivers/clk/tegra/clk.h +19 -19
index 16ec8d6..3093aa4 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/apll.c +4 -4
index 72d9727..a162c21 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/clk-2xxx.c +4 -4
index c808ab3..a48fe6f 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/clk-33xx.c +9 -9
index 028b337..0988f1e 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/clk-3xxx.c +4 -4
index 0d1750a..58ef20e 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/clk-43xx.c +4 -4
index 3795fce..1277452 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/clk-44xx.c +8 -8
index 02517a8..1adc399 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/clk-54xx.c +13 -12
index 5e18399..5b603b5 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/clk-7xx.c +14 -14
index 62ac8f6..9dba0bb 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/clk-dra7-atl.c +3 -3
index 4a65b41..029a0d3 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/clk.c +1 -1
index b1a6f71..d88a70d0 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/clockdomain.c +2 -2
index f1e0038..6bc75d8 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/composite.c +1 -1
index 19d8980..2cbee34 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/divider.c +3 -3
index e6aa10d..1c41515 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/dpll.c +4 -4
index 79791e1..e1f74cc 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/fixed-factor.c +1 -1
index c2c8a28..2aa2701 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/gate.c +1 -1
index b326d27..dd1b813 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/interface.c +1 -1
index 9c3e8c4..e2f2bc0 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ti/mux.c +3 -3
index e9d650e..7456198 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ux500/abx500-clk.c +1 -2
index e7bd62c..f27be78 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ux500/clk-prcc.c +4 -4
index bd4769a..7eb055f 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ux500/clk-prcmu.c +8 -8
index e2d63bc..bac54c9 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ux500/clk-sysctrl.c +5 -5
index e364c9d..dc6608a 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ux500/clk.h +11 -12
index a2bb92d..acb50f8 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ux500/u8500_clk.c +1 -2
index 80069c3..708589f 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ux500/u8500_of_clk.c +6 -7
index 7b55ef8..61efb85 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ux500/u8540_clk.c +1 -2
index 20c8add..a508845 100644

Lines of this file are not shown. View the raw message.

drivers/clk/ux500/u9540_clk.c +0 -1
index 4479478..89055ae 100644

Lines of this file are not shown. View the raw message.

drivers/clk/versatile/clk-icst.c +2 -3
index bc96f10..d5719e0 100644

Lines of this file are not shown. View the raw message.

drivers/clk/versatile/clk-icst.h +1 -1
index 04e6f0a..ede867b 100644

Lines of this file are not shown. View the raw message.

drivers/clk/versatile/clk-impd1.c +9 -10
index 1cc1330..46680db 100644

Lines of this file are not shown. View the raw message.

drivers/clk/versatile/clk-realview.c +1 -2
index c8b5231..524cba5 100644

Lines of this file are not shown. View the raw message.

drivers/clk/versatile/clk-sp810.c +16 -14
index c6e86a9..9256d25 100644

Lines of this file are not shown. View the raw message.

drivers/clk/versatile/clk-versatile.c +1 -2
index a76981e..1bdd542 100644

Lines of this file are not shown. View the raw message.

drivers/clk/versatile/clk-vexpress-osc.c +1 -1
index 529a59c..c9e175f 100644

Lines of this file are not shown. View the raw message.

drivers/clk/versatile/clk-vexpress.c +3 -3
index 2d5e1b4..e77f3d5 100644

Lines of this file are not shown. View the raw message.

drivers/clk/x86/clk-lpt.c +1 -2
index 812f83f..fbb6807 100644

Lines of this file are not shown. View the raw message.

drivers/clk/zynq/clkc.c +11 -11
index 246cf12..0efdd9a 100644

Lines of this file are not shown. View the raw message.

drivers/clk/zynq/pll.c +2 -2
index cec9759..5176f65 100644

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/msm/hdmi/hdmi_phy_8960.c +1 -2
index 902d768..8e97702 100644

Lines of this file are not shown. View the raw message.

drivers/media/platform/exynos4-is/media-dev.c +8 -9
index 2620c48..2fdadd8 100644

Lines of this file are not shown. View the raw message.

drivers/media/platform/exynos4-is/media-dev.h +3 -4
index 0321454..f24dac6 100644

Lines of this file are not shown. View the raw message.

drivers/media/platform/omap3isp/isp.h +1 -1
index 2c314ee..5fcedd6 100644

Lines of this file are not shown. View the raw message.

drivers/rtc/rtc-hym8563.c +2 -2
index b936bb4..ea21bd1 100644

Lines of this file are not shown. View the raw message.

drivers/staging/imx-drm/imx-tve.c +13 -14
index c628fcd..458170b 100644

Lines of this file are not shown. View the raw message.

include/asm-generic/clkdev.h +3 -3
index 90a32a6..4320225 100644

Lines of this file are not shown. View the raw message.

include/linux/clk/ti.h +5 -5
index e8d8a35..6b9e6b4 100644

Lines of this file are not shown. View the raw message.

include/linux/clk/zynq.h +1 -1
index a990a59..6c35291 100644

Lines of this file are not shown. View the raw message.

include/linux/platform_data/si5351.h +2 -2
index a947ab8..4b34c69 100644

Lines of this file are not shown. View the raw message.

sound/soc/mxs/mxs-saif.c +2 -2
index 231d7e7..a24367d 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 6 lines
1.9.3

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

Part of the diff is not shown here. View the raw message.

#3 lore raw

Re: [PATCH v9 2/6] clk: Move all drivers to use internal API

Quoting Tomeu Vizoso (2014-09-03 08:31:57)

Quoted 11 lines

In preparation to change the public API to return a per-user clk structure, remove any usage of this public API from the clock implementations.

The reason for having this in a separate commit from the one that introduces the implementation of the new functions is to separate the changes generated with Coccinelle from the rest, and keep the patches' size reasonable.

Hi Tomeu,

Looks like the Coccinelle script had a false-positive. asm-generic/clkdev.h was converted from clk->clk_core and this blowed up clock drivers for architectures that don't provide an asm-specific clkdev.h implementation. This fixes x86's LPSS and a Microblaze driver.

I've rolled the following fix into your 2/9 patch. No action is necessary.

Regards,
Mike

include/asm-generic/clkdev.h +3 -3
index 4320225..90a32a6 100644
@@ -15,10 +15,10 @@
 
 #include <linux/slab.h>
 
-struct clk_core;
+struct clk;
 
-static inline int __clk_get(struct clk_core *clk) { return 1; }
-static inline void __clk_put(struct clk_core *clk) { }
+static inline int __clk_get(struct clk *clk) { return 1; }
+static inline void __clk_put(struct clk *clk) { }
 
 static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
 {

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

#4 lore raw

PATCH v9 2/6 clk: Move all drivers to use internal API

Quoting Mike Turquette (2014-09-07 23:13:55)

Quoted 36 lines

Quoting Tomeu Vizoso (2014-09-03 08:31:57)

Quoted 11 lines

In preparation to change the public API to return a per-user clk structure, remove any usage of this public API from the clock implementations.

The reason for having this in a separate commit from the one that introduces the implementation of the new functions is to separate the changes generated with Coccinelle from the rest, and keep the patches' size reasonable.

Hi Tomeu,

Looks like the Coccinelle script had a false-positive. asm-generic/clkdev.h was converted from clk->clk_core and this blowed up clock drivers for architectures that don't provide an asm-specific clkdev.h implementation. This fixes x86's LPSS and a Microblaze driver.

I've rolled the following fix into your 2/9 patch. No action is necessary.

Regards,
Mike

include/asm-generic/clkdev.h +0 -0
index 4320225..90a32a6 100644
@@ -15,10 +15,10 @@
 
 #include <linux/slab.h>
 

include/asm-generic/clkdev.h line 24

Quoted 10 lines
include/asm-generic/clkdev.h +3 -3
-struct clk_core;
+struct clk;
 
-static inline int __clk_get(struct clk_core *clk) { return 1; }
-static inline void __clk_put(struct clk_core *clk) { }
+static inline int __clk_get(struct clk *clk) { return 1; }
+static inline void __clk_put(struct clk *clk) { }
 
 static inline struct clk_lookup_alloc *__clkdev_alloc(size_t size)
 {

Please disregard the above patch. I might have jumped the gun on this one. I've posted an alternative (and hopefully correct) fix here:

http://lkml.kernel.org/r/<[email protected]>

Regards,
Mike

#5 lore raw

PATCH v9 3/6 clk: use struct clk only for external API

In reply to Tomeu Vizoso

In order to provide per-user accounting, this separates the struct clk used in the common clock framework into two structures 'struct clk_core' and 'struct clk'. struct clk_core will be used for internal manipulation and struct clk will be used in the clock API implementation.

In this patch, struct clk is simply renamed to struct clk_core and a new struct clk is implemented which simply wraps it. In the next patch, the new struct clk will be used to implement per-user clock enable accounting.

Based on previous work by Rabin Vincent <[email protected]>.

NOTE: with this patch, clk_get_parent() behaves like clk_get(), i.e. it needs to be matched with a clk_put(). Otherwise, memory will leak.

---

v9: * Removed superfluous variable

v7: * convert clk_is_enabled to clk_core
* add clk_provider_notifier_[un]register

v4: * export clk_to_clk_core so mach-msm can use it for clk_reset
* add clk_provider_round_rate, for mach-imx
* fix build with !CONFIG_COMMON_CLK
* keep handling NULL struct clk gracefully as before

v3: * Allocate and release the per-user struct clk
* Have clk_core_to_clk return any error it's passed, so calls to it can be chained
* Add provider API for enable and disable
* Remove clk_free_clk for now
* Have clk_to_clk_core be an inline function to benefit of type-checking
* Have devres wrap the clk struct instead of clk_core
* Rename clk_core_to_clk to __clk_create_clk to make more clear that it allocates

---
 arch/arm/mach-msm/clock.c    |   2 +-
 drivers/clk/clk-devres.c     |  31 ++
 drivers/clk/clk.c            | 669 ++++++++++++++++++++++++++-----------------
 drivers/clk/clk.h            |   6 +
 drivers/clk/clkdev.c         | 123 ++++++--
 include/linux/clk-private.h  |  38 +--
 include/linux/clk-provider.h | 164 ++++++-----
 include/linux/clk.h          |  32 ++-
 include/linux/clkdev.h       |  24 +-
 9 files changed, 701 insertions(+), 388 deletions(-)
arch/arm/mach-msm/clock.c +1 -1
index 35ea02b5..1de0b5a 100644
@@ -21,7 +21,7 @@
 
 int clk_reset(struct clk *clk, enum clk_reset_action action)
 {
-	struct clk_hw *hw = __clk_get_hw(clk);
+	struct clk_hw *hw = __clk_get_hw(clk_to_clk_core(clk));
 	struct msm_clk *m = to_msm_clk(hw);
 	return m->reset(hw, action);
 }
drivers/clk/clk-devres.c +31 -0
index 8f57154..79cd4d3 100644
@@ -5,10 +5,14 @@
  */
 
 #include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/clk-provider.h>
 #include <linux/device.h>
 #include <linux/export.h>
 #include <linux/gfp.h>
 
+#include "clk.h"
+
 static void devm_clk_release(struct device *dev, void *res)
 {
 	clk_put(*(struct clk **)res);
@@ -34,6 +38,33 @@ struct clk *devm_clk_get(struct device *dev, const char *id)
 }
 EXPORT_SYMBOL(devm_clk_get);
 
+#if defined(CONFIG_COMMON_CLK)
+static void devm_clk_core_release(struct device *dev, void *res)
+{
+	__clk_put(*(struct clk_core **)res);
+}
+
+struct clk_core *devm_clk_provider_get(struct device *dev, const char *id)
+{
+	struct clk_core **ptr, *clk;
+
+	ptr = devres_alloc(devm_clk_core_release, sizeof(*ptr), GFP_KERNEL);
+	if (!ptr)
+		return ERR_PTR(-ENOMEM);
+
+	clk = clk_provider_get(dev, id);
+	if (!IS_ERR(clk)) {
+		*ptr = clk;
+		devres_add(dev, ptr);
+	} else {
+		devres_free(ptr);
+	}
+
+	return clk;
+}
+EXPORT_SYMBOL(devm_clk_provider_get);
+#endif
+
 static int devm_clk_match(struct device *dev, void *res, void *data)
 {
 	struct clk **c = res;
drivers/clk/clk.c +407 -262

1,367 lines not on this page · raw message

drivers/clk/clk.h +6 -0
index d278572..3b3068b 100644
@@ -9,9 +9,15 @@
  * published by the Free Software Foundation.
  */
 
+#include <linux/clk-private.h>
+
 #if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
 struct clk_core *of_clk_get_by_clkspec(struct of_phandle_args *clkspec);
 struct clk_core *__of_clk_get_from_provider(struct of_phandle_args *clkspec);
 void of_clk_lock(void);
 void of_clk_unlock(void);
 #endif
+
+#if defined(CONFIG_COMMON_CLK)
+struct clk *__clk_create_clk(struct clk_core *clk_core);
+#endif
drivers/clk/clkdev.c +98 -25

246 lines not on this page · raw message

include/linux/clk-private.h +21 -17
index efbf70b..2c1ece9 100644
@@ -28,20 +28,20 @@
 
 struct module;
 
-struct clk {
+struct clk_core {
 	const char		*name;
 	const struct clk_ops	*ops;
 	struct clk_hw		*hw;
 	struct module		*owner;
-	struct clk		*parent;
+	struct clk_core		*parent;
 	const char		**parent_names;
-	struct clk		**parents;
+	struct clk_core		**parents;
 	u8			num_parents;
 	u8			new_parent_index;
 	unsigned long		rate;
 	unsigned long		new_rate;
-	struct clk		*new_parent;
-	struct clk		*new_child;
+	struct clk_core		*new_parent;
+	struct clk_core		*new_child;
 	unsigned long		flags;
 	unsigned int		enable_count;
 	unsigned int		prepare_count;
@@ -55,6 +55,10 @@ struct clk {
 	struct kref		ref;
 };
 
+struct clk {
+	struct clk_core	*core;
+};
+
 /*
  * DOC: Basic clock implementations common to many platforms
  *
@@ -66,7 +70,7 @@ struct clk {
 
 #define DEFINE_CLK(_name, _ops, _flags, _parent_names,		\
 		_parents)					\
-	static struct clk _name = {				\
+	static struct clk_core _name = {				\
 		.name = #_name,					\
 		.ops = &_ops,					\
 		.hw = &_name##_hw.hw,				\
@@ -78,7 +82,7 @@ struct clk {
 
 #define DEFINE_CLK_FIXED_RATE(_name, _flags, _rate,		\
 				_fixed_rate_flags)		\
-	static struct clk _name;				\
+	static struct clk_core _name;				\
 	static const char *_name##_parent_names[] = {};		\
 	static struct clk_fixed_rate _name##_hw = {		\
 		.hw = {						\
@@ -93,11 +97,11 @@ struct clk {
 #define DEFINE_CLK_GATE(_name, _parent_name, _parent_ptr,	\
 				_flags, _reg, _bit_idx,		\
 				_gate_flags, _lock)		\
-	static struct clk _name;				\
+	static struct clk_core _name;				\
 	static const char *_name##_parent_names[] = {		\
 		_parent_name,					\
 	};							\
-	static struct clk *_name##_parents[] = {		\
+	static struct clk_core *_name##_parents[] = {		\
 		_parent_ptr,					\
 	};							\
 	static struct clk_gate _name##_hw = {			\
@@ -115,11 +119,11 @@ struct clk {
 #define _DEFINE_CLK_DIVIDER(_name, _parent_name, _parent_ptr,	\
 				_flags, _reg, _shift, _width,	\
 				_divider_flags, _table, _lock)	\
-	static struct clk _name;				\
+	static struct clk_core _name;				\
 	static const char *_name##_parent_names[] = {		\
 		_parent_name,					\
 	};							\
-	static struct clk *_name##_parents[] = {		\
+	static struct clk_core *_name##_parents[] = {		\
 		_parent_ptr,					\
 	};							\
 	static struct clk_divider _name##_hw = {		\
@@ -154,7 +158,7 @@ struct clk {
 #define DEFINE_CLK_MUX(_name, _parent_names, _parents, _flags,	\
 				_reg, _shift, _width,		\
 				_mux_flags, _lock)		\
-	static struct clk _name;				\
+	static struct clk_core _name;				\
 	static struct clk_mux _name##_hw = {			\
 		.hw = {						\
 			.clk = &_name,				\
@@ -171,11 +175,11 @@ struct clk {
 #define DEFINE_CLK_FIXED_FACTOR(_name, _parent_name,		\
 				_parent_ptr, _flags,		\
 				_mult, _div)			\
-	static struct clk _name;				\
+	static struct clk_core _name;				\
 	static const char *_name##_parent_names[] = {		\
 		_parent_name,					\
 	};							\
-	static struct clk *_name##_parents[] = {		\
+	static struct clk_core *_name##_parents[] = {		\
 		_parent_ptr,					\
 	};							\
 	static struct clk_fixed_factor _name##_hw = {		\
@@ -196,7 +200,7 @@ struct clk {
  * Initializes the lists in struct clk, queries the hardware for the
  * parent and rate and sets them both.
  *
- * Any struct clk passed into __clk_init must have the following members
+ * Any struct clk_core passed into __clk_init must have the following members
  * populated:
  * 	.name
  * 	.ops
@@ -210,9 +214,9 @@ struct clk {
  *
  * Returns 0 on success, otherwise an error code.
  */
-int __clk_init(struct device *dev, struct clk *clk);
+int __clk_init(struct device *dev, struct clk_core *clk);
 
-struct clk *__clk_register(struct device *dev, struct clk_hw *hw);
+struct clk_core *__clk_register(struct device *dev, struct clk_hw *hw);
 
 #endif /* CONFIG_COMMON_CLK */
 #endif /* CLK_PRIVATE_H */
include/linux/clk-provider.h +90 -74

308 lines not on this page · raw message

include/linux/clk.h +29 -3
index fb5e097..f46a2eb 100644
@@ -22,6 +22,8 @@ struct clk;
 
 #ifdef CONFIG_COMMON_CLK
 
+struct clk_core;
+
 /**
  * DOC: clk notifier callback types
  *
@@ -56,7 +58,7 @@ struct clk;
  * @notifier_head.
  */
 struct clk_notifier {
-	struct clk			*clk;
+	struct clk_core			*clk;
 	struct srcu_notifier_head	notifier_head;
 	struct list_head		node;
 };
@@ -73,7 +75,7 @@ struct clk_notifier {
  * current rate (this was done to optimize the implementation).
  */
 struct clk_notifier_data {
-	struct clk		*clk;
+	struct clk_core		*clk;
 	unsigned long		old_rate;
 	unsigned long		new_rate;
 };
@@ -307,6 +309,14 @@ struct clk *clk_get_parent(struct clk *clk);
  */
 struct clk *clk_get_sys(const char *dev_id, const char *con_id);
 
+/**
+ * clk_get_name - get a clock's name
+ * @clk: clock source
+ *
+ * Returns the name of the provided clock.
+ */
+const char *clk_get_name(struct clk *clk);
+
 #else /* !CONFIG_HAVE_CLK */
 
 static inline struct clk *clk_get(struct device *dev, const char *id)
@@ -398,7 +408,8 @@ struct of_phandle_args;
 #if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
 struct clk *of_clk_get(struct device_node *np, int index);
 struct clk *of_clk_get_by_name(struct device_node *np, const char *name);
-struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec);
+struct clk_core *of_clk_provider_get_by_name(struct device_node *np, const char *name);
+struct clk_core *of_clk_get_from_provider(struct of_phandle_args *clkspec);
 #else
 static inline struct clk *of_clk_get(struct device_node *np, int index)
 {
@@ -409,6 +420,21 @@ static inline struct clk *of_clk_get_by_name(struct device_node *np,
 {
 	return ERR_PTR(-ENOENT);
 }
+
+#if defined(CONFIG_COMMON_CLK)
+static inline struct clk_core *of_clk_provider_get_by_name(struct device_node *np,
+							   const char *name)
+{
+	return ERR_PTR(-ENOENT);
+}
+#else
+static inline struct clk *of_clk_provider_get_by_name(struct device_node *np,
+						      const char *name)
+{
+	return ERR_PTR(-ENOENT);
+}
+#endif /* CONFIG_COMMON_CLK */
+
 #endif
 
 #endif
include/linux/clkdev.h +18 -6
index 94bad77..a6c5d67 100644
@@ -17,11 +17,23 @@
 struct clk;
 struct device;
 
+/*
+ * To avoid a mass-rename of all non-common clock implementations (spread out
+ * in arch-specific code), we let them use struct clk for both the internal and
+ * external view.
+ */
+#ifdef CONFIG_COMMON_CLK
+struct clk_core;
+#define clk_core_t struct clk_core
+#else
+#define clk_core_t struct clk
+#endif
+
 struct clk_lookup {
 	struct list_head	node;
 	const char		*dev_id;
 	const char		*con_id;
-	struct clk		*clk;
+	clk_core_t		*clk;
 };
 
 #define CLKDEV_INIT(d, n, c)	\
@@ -31,7 +43,7 @@ struct clk_lookup {
 		.clk = c,	\
 	}
 
-struct clk_lookup *clkdev_alloc(struct clk *clk, const char *con_id,
+struct clk_lookup *clkdev_alloc(clk_core_t *clk, const char *con_id,
 	const char *dev_fmt, ...);
 
 void clkdev_add(struct clk_lookup *cl);
@@ -40,12 +52,12 @@ void clkdev_drop(struct clk_lookup *cl);
 void clkdev_add_table(struct clk_lookup *, size_t);
 int clk_add_alias(const char *, const char *, char *, struct device *);
 
-int clk_register_clkdev(struct clk *, const char *, const char *, ...);
-int clk_register_clkdevs(struct clk *, struct clk_lookup *, size_t);
+int clk_register_clkdev(clk_core_t *, const char *, const char *, ...);
+int clk_register_clkdevs(clk_core_t *, struct clk_lookup *, size_t);
 
 #ifdef CONFIG_COMMON_CLK
-int __clk_get(struct clk *clk);
-void __clk_put(struct clk *clk);
+int __clk_get(struct clk_core *clk);
+void __clk_put(struct clk_core *clk);
 #endif
 
 #endif
Signature · 1 line
1.9.3
#6 lore raw

PATCH v9 4/6 clk: per-user clock accounting for debug

When a clock has multiple users, the WARNING on imbalance of enable/disable may not show the guilty party since although they may have commited the error earlier, the warning is emitted later when some other user, presumably innocent, disables the clock.

Provide per-user clock enable/disable accounting and disabler tracking in order to help debug these problems.

Based on previous work by Rabin Vincent <[email protected]>.

---
 drivers/clk/clk.c           | 38 ++++++++++++++++++++++++++++++++++----
 drivers/clk/clk.h           |  3 ++-
 drivers/clk/clkdev.c        | 14 ++++++++++----
 include/linux/clk-private.h |  5 +++++
 4 files changed, 51 insertions(+), 9 deletions(-)
drivers/clk/clk.c +34 -4
index ce84b1f..61a3492 100644
@@ -543,7 +543,8 @@ static int clk_disable_unused(void)
 }
 late_initcall_sync(clk_disable_unused);
 
-struct clk *__clk_create_clk(struct clk_core *clk_core)
+struct clk *__clk_create_clk(struct clk_core *clk_core, const char *dev,
+			     const char *con)
 {
 	struct clk *clk;
 
@@ -556,6 +557,8 @@ struct clk *__clk_create_clk(struct clk_core *clk_core)
 		return ERR_PTR(-ENOMEM);
 
 	clk->core = clk_core;
+	clk->dev_id = dev;
+	clk->con_id = con;
 
 	return clk;
 }
@@ -936,10 +939,25 @@ EXPORT_SYMBOL_GPL(clk_provider_disable);
  */
 void clk_disable(struct clk *clk_user)
 {
+	struct clk_core *clk;
+	unsigned long flags;
+
 	if (IS_ERR_OR_NULL(clk_user))
 		return;
 
-	clk_provider_disable(clk_to_clk_core(clk_user));
+	clk = clk_to_clk_core(clk_user);
+
+	flags = clk_enable_lock();
+	if (!WARN(clk_user->enable_count == 0,
+		  "incorrect disable clk dev %s con %s last disabler %pF\n",
+		  clk_user->dev_id, clk_user->con_id, clk_user->last_disable)) {
+
+		clk_user->last_disable = __builtin_return_address(0);
+		clk_user->enable_count--;
+
+		__clk_disable(clk);
+	}
+	clk_enable_unlock(flags);
 }
 EXPORT_SYMBOL_GPL(clk_disable);
 
@@ -1000,10 +1018,22 @@ EXPORT_SYMBOL_GPL(clk_provider_enable);
  */
 int clk_enable(struct clk *clk_user)
 {
+	struct clk_core *clk;
+	unsigned long flags;
+	int ret;
+
 	if (!clk_user)
 		return 0;
 
-	return clk_provider_enable(clk_to_clk_core(clk_user));
+	clk = clk_to_clk_core(clk_user);
+
+	flags = clk_enable_lock();
+	ret = __clk_enable(clk);
+	if (!ret)
+		clk_user->enable_count++;
+	clk_enable_unlock(flags);
+
+	return ret;
 }
 EXPORT_SYMBOL_GPL(clk_enable);
 
@@ -1698,7 +1728,7 @@ struct clk *clk_get_parent(struct clk *clk_user)
 	clk = clk_to_clk_core(clk_user);
 	parent = clk_provider_get_parent(clk);
 
-	return __clk_create_clk(parent);
+	return __clk_create_clk(parent, clk_user->dev_id, clk_user->con_id);
 }
 EXPORT_SYMBOL_GPL(clk_get_parent);
 
drivers/clk/clk.h +2 -1
index 3b3068b..49eff38 100644
@@ -19,5 +19,6 @@ void of_clk_unlock(void);
 #endif
 
 #if defined(CONFIG_COMMON_CLK)
-struct clk *__clk_create_clk(struct clk_core *clk_core);
+struct clk *__clk_create_clk(struct clk_core *clk_core, const char *dev,
+			     const char *con);
 #endif
drivers/clk/clkdev.c +10 -4
index 080b3df..f7b352a 100644
@@ -76,7 +76,9 @@ struct clk_core *of_clk_provider_get(struct device_node *np, int index)
 
 struct clk *of_clk_get(struct device_node *np, int index)
 {
-	return __clk_create_clk(of_clk_provider_get(np, index));
+	struct clk_core *clk = of_clk_provider_get(np, index);
+
+	return __clk_create_clk(clk, np->full_name, NULL);
 }
 EXPORT_SYMBOL(of_clk_get);
 
@@ -129,7 +131,9 @@ struct clk_core *of_clk_provider_get_by_name(struct device_node *np, const char
  */
 struct clk *of_clk_get_by_name(struct device_node *np, const char *name)
 {
-	return __clk_create_clk(of_clk_provider_get_by_name(np, name));
+	struct clk_core *clk = of_clk_provider_get_by_name(np, name);
+
+	return __clk_create_clk(clk, np->full_name, NULL);
 }
 EXPORT_SYMBOL(of_clk_get_by_name);
 #endif
@@ -201,7 +205,7 @@ struct clk *clk_get_sys(const char *dev_id, const char *con_id)
 #if defined(CONFIG_COMMON_CLK)
 	struct clk_core *clk = clk_provider_get_sys(dev_id, con_id);
 
-	return __clk_create_clk(clk);
+	return __clk_create_clk(clk, dev_id, con_id);
 #else
 	struct clk_lookup *cl;
 
@@ -241,7 +245,9 @@ EXPORT_SYMBOL(clk_provider_get);
 struct clk *clk_get(struct device *dev, const char *con_id)
 {
 #if defined(CONFIG_COMMON_CLK)
-	return __clk_create_clk(clk_provider_get(dev, con_id));
+        const char *dev_id = dev ? dev_name(dev) : NULL;
+
+	return __clk_create_clk(clk_provider_get(dev, con_id), dev_id, con_id);
 #else
 	const char *dev_id = dev ? dev_name(dev) : NULL;
 	struct clk *clk;
include/linux/clk-private.h +5 -0
index 2c1ece9..ce6a528 100644
@@ -57,6 +57,11 @@ struct clk_core {
 
 struct clk {
 	struct clk_core	*core;
+	const char	*dev_id;
+	const char	*con_id;
+
+	unsigned int	enable_count;
+	void		*last_disable;
 };
 
 /*
Signature · 1 line
1.9.3
#7 lore raw

PATCH v9 5/6 clk: Add floor and ceiling constraints to clock rates

In reply to Tomeu Vizoso

Adds a way for clock consumers to set maximum and minimum rates. This can be used for thermal drivers to set ceiling rates, or by misc. drivers to set floor rates to assure a minimum performance level.

---

v9: * Apply first all the floor constraints, then the ceiling constraints.
* WARN on ceiling constraints below the current floor, for a given user clk

v5: * Move the storage of constraints to the per-user clk struct, as suggested
by Stephen Warren.

---
 drivers/clk/clk.c           | 43 +++++++++++++++++++++++++++++++++++++++++++
 drivers/clk/clk.h           |  1 +
 drivers/clk/clkdev.c        |  2 +-
 include/linux/clk-private.h |  5 +++++
 include/linux/clk.h         | 18 ++++++++++++++++++
 5 files changed, 68 insertions(+), 1 deletion(-)
drivers/clk/clk.c +43 -0
index 61a3492..3a961c6 100644
@@ -560,6 +560,8 @@ struct clk *__clk_create_clk(struct clk_core *clk_core, const char *dev,
 	clk->dev_id = dev;
 	clk->con_id = con;
 
+	hlist_add_head(&clk->child_node, &clk_core->per_user_clks);
+
 	return clk;
 }
 
@@ -1625,6 +1627,7 @@ static void clk_change_rate(struct clk_core *clk)
 int clk_provider_set_rate(struct clk_core *clk, unsigned long rate)
 {
 	struct clk_core *top, *fail_clk;
+	struct clk *clk_user;
 	int ret = 0;
 
 	if (!clk)
@@ -1633,6 +1636,15 @@ int clk_provider_set_rate(struct clk_core *clk, unsigned long rate)
 	/* prevent racing with updates to the clock topology */
 	clk_prepare_lock();
 
+	hlist_for_each_entry(clk_user, &clk->per_user_clks, child_node) {
+		rate = max(rate, clk_user->floor_constraint);
+	}
+
+	hlist_for_each_entry(clk_user, &clk->per_user_clks, child_node) {
+		if (clk_user->ceiling_constraint > 0)
+			rate = min(rate, clk_user->ceiling_constraint);
+	}
+
 	/* bail early if nothing to do */
 	if (rate == clk_provider_get_rate(clk))
 		goto out;
@@ -1699,6 +1711,29 @@ int clk_set_rate(struct clk *clk_user, unsigned long rate)
 }
 EXPORT_SYMBOL_GPL(clk_set_rate);
 
+int clk_set_floor_rate(struct clk *clk_user, unsigned long rate)
+{
+	struct clk_core *clk = clk_to_clk_core(clk_user);
+
+	clk_user->floor_constraint = rate;
+	return clk_provider_set_rate(clk, clk_provider_get_rate(clk));
+}
+EXPORT_SYMBOL_GPL(clk_set_floor_rate);
+
+int clk_set_ceiling_rate(struct clk *clk_user, unsigned long rate)
+{
+	struct clk_core *clk = clk_to_clk_core(clk_user);
+
+	WARN(rate > 0 && rate < clk_user->floor_constraint,
+	     "clk %s dev %s con %s: new ceiling %lu lower than existing floor %lu\n",
+	     __clk_get_name(clk), clk_user->dev_id, clk_user->con_id, rate,
+	     clk_user->floor_constraint);
+
+	clk_user->ceiling_constraint = rate;
+	return clk_provider_set_rate(clk, clk_provider_get_rate(clk));
+}
+EXPORT_SYMBOL_GPL(clk_set_ceiling_rate);
+
 struct clk_core *clk_provider_get_parent(struct clk_core *clk)
 {
 	struct clk_core *parent;
@@ -2043,6 +2078,8 @@ int __clk_init(struct device *dev, struct clk_core *clk)
 			}
 	 }
 
+	INIT_HLIST_HEAD(&clk->per_user_clks);
+
 	/*
 	 * optional platform-specific magic
 	 *
@@ -2493,6 +2530,12 @@ int clk_notifier_unregister(struct clk *clk_user, struct notifier_block *nb)
 }
 EXPORT_SYMBOL_GPL(clk_notifier_unregister);
 
+void __clk_free_clk(struct clk *clk_user)
+{
+	hlist_del(&clk_user->child_node);
+	kfree(clk_user);
+}
+
 #ifdef CONFIG_OF
 /**
  * struct of_clk_provider - Clock provider registration structure
drivers/clk/clk.h +1 -0
index 49eff38..005deb3 100644
@@ -21,4 +21,5 @@ void of_clk_unlock(void);
 #if defined(CONFIG_COMMON_CLK)
 struct clk *__clk_create_clk(struct clk_core *clk_core, const char *dev,
 			     const char *con);
+void __clk_free_clk(struct clk *clk_user);
 #endif
drivers/clk/clkdev.c +1 -1
index f7b352a..89193de 100644
@@ -270,7 +270,7 @@ void clk_put(struct clk *clk)
 #if defined(CONFIG_COMMON_CLK)
 	clk_core_t *core = clk_to_clk_core(clk);
 
-	kfree(clk);
+	__clk_free_clk(clk);
 	__clk_put(core);
 #else
 	__clk_put(clk);
include/linux/clk-private.h +5 -0
index ce6a528..8126046 100644
@@ -48,6 +48,7 @@ struct clk_core {
 	unsigned long		accuracy;
 	struct hlist_head	children;
 	struct hlist_node	child_node;
+	struct hlist_head	per_user_clks;
 	unsigned int		notifier_count;
 #ifdef CONFIG_DEBUG_FS
 	struct dentry		*dentry;
@@ -62,6 +63,10 @@ struct clk {
 
 	unsigned int	enable_count;
 	void		*last_disable;
+
+	unsigned long	floor_constraint;
+	unsigned long	ceiling_constraint;
+	struct hlist_node child_node;
 };
 
 /*
include/linux/clk.h +18 -0
index f46a2eb..066b100 100644
@@ -275,6 +275,24 @@ long clk_round_rate(struct clk *clk, unsigned long rate);
 int clk_set_rate(struct clk *clk, unsigned long rate);
 
 /**
+ * clk_set_floor_rate - set a minimum clock rate for a clock source
+ * @clk: clock source
+ * @rate: desired minimum clock rate in Hz
+ *
+ * Returns success (0) or negative errno.
+ */
+int clk_set_floor_rate(struct clk *clk, unsigned long rate);
+
+/**
+ * clk_set_ceiling_rate - set a maximum clock rate for a clock source
+ * @clk: clock source
+ * @rate: desired maximum clock rate in Hz
+ *
+ * Returns success (0) or negative errno.
+ */
+int clk_set_ceiling_rate(struct clk *clk, unsigned long rate);
+
+/**
  * clk_set_parent - set the parent clock source for this clock
  * @clk: clock source
  * @parent: parent clock source
Signature · 1 line
1.9.3
#8 lore raw

Re: [PATCH v9 5/6] clk: Add floor and ceiling constraints to clock rates

Quoted 27 lines · Tomeu Vizoso

Adds a way for clock consumers to set maximum and minimum rates. This can be used for thermal drivers to set ceiling rates, or by misc. drivers to set floor rates to assure a minimum performance level.

---

v9: * Apply first all the floor constraints, then the ceiling constraints.
* WARN on ceiling constraints below the current floor, for a given user clk

v5: * Move the storage of constraints to the per-user clk struct, as suggested
by Stephen Warren.

---
 drivers/clk/clk.c           | 43 +++++++++++++++++++++++++++++++++++++++++++
 drivers/clk/clk.h           |  1 +
 drivers/clk/clkdev.c        |  2 +-
 include/linux/clk-private.h |  5 +++++
 include/linux/clk.h         | 18 ++++++++++++++++++
 5 files changed, 68 insertions(+), 1 deletion(-)
drivers/clk/clk.c +0 -0
index 61a3492..3a961c6 100644

drivers/clk/clk.c struct clk *__clk_create_clk(struct clk_core *clk_core, const char *dev, · line 564

Quoted 5 lines
drivers/clk/clk.c +2 -0
@@ -560,6 +560,8 @@ struct clk *__clk_create_clk(struct clk_core *clk_core, const char *dev,
 	clk->dev_id = dev;
 	clk->con_id = con;
 
+	hlist_add_head(&clk->child_node, &clk_core->per_user_clks);
+

How is this safe with another thread that may be traversing the list? Or even two threads calling clk_get_parent() at the same time?

Quoted 28 lines
drivers/clk/clk.c +10 -0
 	return clk;
 }
 
@@ -1625,6 +1627,7 @@ static void clk_change_rate(struct clk_core *clk)
 int clk_provider_set_rate(struct clk_core *clk, unsigned long rate)
 {
 	struct clk_core *top, *fail_clk;
+	struct clk *clk_user;
 	int ret = 0;
 
 	if (!clk)
@@ -1633,6 +1636,15 @@ int clk_provider_set_rate(struct clk_core *clk, unsigned long rate)
 	/* prevent racing with updates to the clock topology */
 	clk_prepare_lock();
 
+	hlist_for_each_entry(clk_user, &clk->per_user_clks, child_node) {
+		rate = max(rate, clk_user->floor_constraint);
+	}
+
+	hlist_for_each_entry(clk_user, &clk->per_user_clks, child_node) {
+		if (clk_user->ceiling_constraint > 0)
+			rate = min(rate, clk_user->ceiling_constraint);
+	}
+
 	/* bail early if nothing to do */
 	if (rate == clk_provider_get_rate(clk))
 		goto out;

drivers/clk/clk.c int clk_set_rate(struct clk *clk_user, unsigned long rate) · line 1719

Quoted 9 lines
drivers/clk/clk.c +6 -0
@@ -1699,6 +1711,29 @@ int clk_set_rate(struct clk *clk_user, unsigned long rate)
 }
 EXPORT_SYMBOL_GPL(clk_set_rate);
 
+int clk_set_floor_rate(struct clk *clk_user, unsigned long rate)
+{
+	struct clk_core *clk = clk_to_clk_core(clk_user);
+
+	clk_user->floor_constraint = rate;
+	return clk_provider_set_rate(clk, clk_provider_get_rate(clk));

It would be nice if this was also locked around so that the floor_constraint or ceiling_constraint doesn't change while another thread is iterating the list. I guess we'll get by though because eventually things will settle and either this thread here will set the "final" rate, or the other thread in clk_provider_set_rate() will have already set the final rate. It just seems wrong to not hold the lock while updating what is supposed to be protected by the prepare lock.

Quoted 6 lines
drivers/clk/clk.c +6 -0
+}
+EXPORT_SYMBOL_GPL(clk_set_floor_rate);
+
+int clk_set_ceiling_rate(struct clk *clk_user, unsigned long rate)
+{
+	struct clk_core *clk = clk_to_clk_core(clk_user);

drivers/clk/clk.c int clk_set_rate(struct clk *clk_user, unsigned long rate) · line 1735

Quoted 10 lines
drivers/clk/clk.c +10 -0
+
+	WARN(rate > 0 && rate < clk_user->floor_constraint,
+	     "clk %s dev %s con %s: new ceiling %lu lower than existing floor %lu\n",
+	     __clk_get_name(clk), clk_user->dev_id, clk_user->con_id, rate,
+	     clk_user->floor_constraint);
+
+	clk_user->ceiling_constraint = rate;
+	return clk_provider_set_rate(clk, clk_provider_get_rate(clk));
+}
+EXPORT_SYMBOL_GPL(clk_set_ceiling_rate);

Maybe I'm late to this patch series given that Mike applied it, but I wonder why we wouldn't just have one API that takes a min and a max, i.e. clk_set_rate_range(clk, min, max)? Then clk_set_rate() is a small wrapper on top that just sets min and max to the same value.

Signature · 2 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
#9 lore raw

Re: [PATCH v9 5/6] clk: Add floor and ceiling constraints to clock rates

Quoting Stephen Boyd (2014-09-03 16:39:37)

Quoted 11 lines · Tomeu Vizoso
Quoted 10 lines
drivers/clk/clk.c +10 -0
+int clk_set_ceiling_rate(struct clk *clk_user, unsigned long rate)
+{
+     struct clk_core *clk = clk_to_clk_core(clk_user);
+
+     WARN(rate > 0 && rate < clk_user->floor_constraint,
+          "clk %s dev %s con %s: new ceiling %lu lower than existing floor %lu\n",
+          __clk_get_name(clk), clk_user->dev_id, clk_user->con_id, rate,
+          clk_user->floor_constraint);
+
+     clk_user->ceiling_constraint = rate;
Quoted 8 lines

drivers/clk/clk.c int clk_set_rate(struct clk *clk_user, unsigned long rate) · line 1735

Quoted 3 lines
drivers/clk/clk.c +3 -0
+     return clk_provider_set_rate(clk, clk_provider_get_rate(clk));
+}
+EXPORT_SYMBOL_GPL(clk_set_ceiling_rate);

Maybe I'm late to this patch series given that Mike applied it, but I wonder why we wouldn't just have one API that takes a min and a max, i.e. clk_set_rate_range(clk, min, max)? Then clk_set_rate() is a small wrapper on top that just sets min and max to the same value.

We certainly can have that. But being able to easily adjust a floor or ceiling value seems like a good thing to me, and that is what these functions do.

If we decide to have a clk_set_rate_range (where we perhaps pass zero in for a value that we do not wish to constrain) then I imagine that clk_set_ceiling_rate and clk_set_floor_rate will simply become a wrapper for that function. No harm having it both ways. If one way of doing things falls out of favor we can always cull it and update all the users.

Regards,
Mike

#10 lore raw

Re: [PATCH v9 5/6] clk: Add floor and ceiling constraints to clock rates

Quoted 25 lines · Mike Turquette

Quoting Stephen Boyd (2014-09-03 16:39:37)

Quoted 11 lines · Tomeu Vizoso
Quoted 10 lines
drivers/clk/clk.c +10 -0
+int clk_set_ceiling_rate(struct clk *clk_user, unsigned long rate)
+{
+     struct clk_core *clk = clk_to_clk_core(clk_user);
+
+     WARN(rate > 0 && rate < clk_user->floor_constraint,
+          "clk %s dev %s con %s: new ceiling %lu lower than existing floor %lu\n",
+          __clk_get_name(clk), clk_user->dev_id, clk_user->con_id, rate,
+          clk_user->floor_constraint);
+
+     clk_user->ceiling_constraint = rate;
Quoted 8 lines

drivers/clk/clk.c int clk_set_rate(struct clk *clk_user, unsigned long rate) · line 1735

Quoted 3 lines
drivers/clk/clk.c +3 -0
+     return clk_provider_set_rate(clk, clk_provider_get_rate(clk));
+}
+EXPORT_SYMBOL_GPL(clk_set_ceiling_rate);

Maybe I'm late to this patch series given that Mike applied it, but I wonder why we wouldn't just have one API that takes a min and a max, i.e. clk_set_rate_range(clk, min, max)? Then clk_set_rate() is a small wrapper on top that just sets min and max to the same value.

We certainly can have that. But being able to easily adjust a floor or ceiling value seems like a good thing to me, and that is what these functions do.

Quoted 6 lines

If we decide to have a clk_set_rate_range (where we perhaps pass zero in for a value that we do not wish to constrain) then I imagine that clk_set_ceiling_rate and clk_set_floor_rate will simply become a wrapper for that function. No harm having it both ways. If one way of doing things falls out of favor we can always cull it and update all the users.

I opted for separate functions because in the specific use cases I thought of, any user will be interested in setting either a floor or a ceiling constraint, but not both.

Regards,

Tomeu

#11 lore raw

Re: [PATCH v9 5/6] clk: Add floor and ceiling constraints to clock rates

In reply to Stephen Boyd
Quoted 10 lines · Stephen Boyd
Quoted 9 lines · Tomeu Vizoso
drivers/clk/clk.c +0 -0
index 61a3492..3a961c6 100644
@@ -560,6 +560,8 @@ struct clk *__clk_create_clk(struct clk_core *clk_core, const char *dev,
 	clk->dev_id = dev;
 	clk->con_id = con;
 
Quoted 5 lines

drivers/clk/clk.c struct clk *__clk_create_clk(struct clk_core *clk_core, const char *dev, · line 564

Quoted 2 lines
drivers/clk/clk.c +2 -0
+	hlist_add_head(&clk->child_node, &clk_core->per_user_clks);
+

How is this safe with another thread that may be traversing the list? Or even two threads calling clk_get_parent() at the same time?

Good point, will take the prepare lock.

Quoted 7 lines

drivers/clk/clk.c int clk_set_rate(struct clk *clk_user, unsigned long rate) · line 1719

Quoted 6 lines
drivers/clk/clk.c +6 -0
+int clk_set_floor_rate(struct clk *clk_user, unsigned long rate)
+{
+	struct clk_core *clk = clk_to_clk_core(clk_user);
+
+	clk_user->floor_constraint = rate;
+	return clk_provider_set_rate(clk, clk_provider_get_rate(clk));
Quoted 7 lines

It would be nice if this was also locked around so that the floor_constraint or ceiling_constraint doesn't change while another thread is iterating the list. I guess we'll get by though because eventually things will settle and either this thread here will set the "final" rate, or the other thread in clk_provider_set_rate() will have already set the final rate. It just seems wrong to not hold the lock while updating what is supposed to be protected by the prepare lock.

Yeah, I also lean towards having an explicit lock, as having a more deterministic behaviour can be quite helpful when debugging.

Thanks,

Tomeu

#12 lore raw

PATCH v9 6/6 clk: Warn of unbalanced clk_prepare() calls

In reply to Tomeu Vizoso

The warning will display the clock user that is trying to unprepare the clock, and the location of the last unprepare call.

---

v8: * Patch added

---
 drivers/clk/clk.c           | 22 ++++++++++++++++++++--
 include/linux/clk-private.h |  3 +++
 2 files changed, 23 insertions(+), 2 deletions(-)
drivers/clk/clk.c +20 -2
index 3a961c6..3018f37 100644
@@ -834,7 +834,17 @@ void clk_unprepare(struct clk *clk_user)
 	if (IS_ERR_OR_NULL(clk_user))
 		return;
 
-	clk_provider_unprepare(clk_to_clk_core(clk_user));
+	clk_prepare_lock();
+	if (!WARN(clk_user->prepare_count == 0,
+		  "incorrect unprepare clk dev %s con %s last caller of unprepare %pF\n",
+		  clk_user->dev_id, clk_user->con_id, clk_user->last_unprepare)) {
+
+		clk_user->last_unprepare = __builtin_return_address(0);
+		clk_user->prepare_count--;
+
+		__clk_unprepare(clk_to_clk_core(clk_user));
+	}
+	clk_prepare_unlock();
 }
 EXPORT_SYMBOL_GPL(clk_unprepare);
 
@@ -890,10 +900,18 @@ EXPORT_SYMBOL_GPL(clk_provider_prepare);
  */
 int clk_prepare(struct clk *clk_user)
 {
+	int ret;
+
 	if (!clk_user)
 		return 0;
 
-	return clk_provider_prepare(clk_to_clk_core(clk_user));
+	clk_prepare_lock();
+	ret = __clk_prepare(clk_to_clk_core(clk_user));
+	if (!ret)
+		clk_user->prepare_count++;
+	clk_prepare_unlock();
+
+	return ret;
 }
 EXPORT_SYMBOL_GPL(clk_prepare);
 
include/linux/clk-private.h +3 -0
index 8126046..cf93bde 100644
@@ -64,6 +64,9 @@ struct clk {
 	unsigned int	enable_count;
 	void		*last_disable;
 
+	unsigned int	prepare_count;
+	void		*last_unprepare;
+
 	unsigned long	floor_constraint;
 	unsigned long	ceiling_constraint;
 	struct hlist_node child_node;
Signature · 1 line
1.9.3
#13 lore raw

v9 cover Per-user clock constraints

In reply to Tomeu Vizoso

Quoting Tomeu Vizoso (2014-09-03 08:29:07)

Quoted 6 lines

Hi,

I'm sending this v9 in order to fix a few build errors found by Intel's 0day build farm. Notable changes are:

* Changes to mxs-saif.c have been folded into 2/6, in order for bisectability to be preserved.

Quoted 7 lines

* All floor constraints are applied first, then all ceiling constraints. This is to keep the behavior deterministic and to prevent any situation in which floor constraints could trump over ceiling constraints.

* A WARN has been added to flag inconsistent ranges of constraints.

* Redundant includes of linux/clk.h have been removed.

These series depend on Mike's patches at [0] and is rebased on top of today's clk-next.

Applied to clk-next! Thanks much for your hard work on this series. It has turned out pretty nice. And thanks to Rabin for the original proposal and to Andrew Lunn for helping to resolve the Kirkwood issues.

I would not be surprised if we have to fix some stuff up leading up to the next merge window. The split between struct clk and struct clk_core will likely cause some of the pending patches on the list to break and I might ask for your help with the Coccinelle script ;-)

I guess we'll know soon if things start to explode once this hits linux-next...

Thanks again,
Mike

Quoted 327 lines

Follows the original cover letter blurb:

I'm retaking Rabin's patches [1] for splitting the clk API in two: one API for clk consumers and another for providers. The consumer API uses a clk structure that just keeps track of the consumer and has a reference to the actual clk_core struct, which is used internally.

I have kept a patch from Rabin that aims to aid in debugging nested enable/disable calls, though my personal aim is to allow more than one consumer to influence the final, effective frequency rate. For now this is limited to setting floor and ceiling constraints, with the short-term aim of allowing devfreq and thermal drivers to set floor and ceiling frequencies on the memory clock, respectively.

For those functions in the consumer clk API that were called from providers, I have added variants to clk-provider.h that are the same only that accept a clk_core instead. These functions are prefixed with clk_provider_.

Patch 1/7 just adds a bunch of defines with the goal of having all the renames in their own commit while preserving git-bisectability, with patch 3/7 containing the rename itself as generated by the Coccinelle script in [2]. Patch 2/7 is needed because sound/soc/mxs/mxs-saif.c calls both the consumer and the provider API. The actual implementation of the API split comes in patch 4/7. I will be happy to organize the refactoring differently if anybody has a better idea.

Patch 5/7 warns when there's an unbalanced usage of the enable and disable APIs, and patch 6/7 adds the API for setting floor and ceiling frequencies, per consumer. Patch 7/7 will warn when prepare/unprepare are used unbalanced, printing the code location of the last call to unprepare.

[0] http://thread.gmane.org/gmane.linux.kernel/1778132
[1] http://thread.gmane.org/gmane.linux.kernel/1402006
[2] http://cgit.collabora.com/git/user/tomeu/linux.git/log/?h=clk-refactoring-9

Thanks,

Tomeu

Tomeu Vizoso (6):
clk: Add temporary mapping to the existing API
clk: Move all drivers to use internal API
clk: use struct clk only for external API
clk: per-user clock accounting for debug
clk: Add floor and ceiling constraints to clock rates
clk: Warn of unbalanced clk_prepare() calls

 arch/arm/mach-dove/common.c                   |  10 +-
 arch/arm/mach-imx/clk-busy.c                  |   9 +-
 arch/arm/mach-imx/clk-fixup-div.c             |   4 +-
 arch/arm/mach-imx/clk-fixup-mux.c             |   4 +-
 arch/arm/mach-imx/clk-gate2.c                 |   4 +-
 arch/arm/mach-imx/clk-imx1.c                  |   3 +-
 arch/arm/mach-imx/clk-imx21.c                 |   3 +-
 arch/arm/mach-imx/clk-imx25.c                 |   9 +-
 arch/arm/mach-imx/clk-imx27.c                 |   5 +-
 arch/arm/mach-imx/clk-imx31.c                 |  11 +-
 arch/arm/mach-imx/clk-imx35.c                 |  23 +-
 arch/arm/mach-imx/clk-imx51-imx53.c           |  78 +--
 arch/arm/mach-imx/clk-imx6q.c                 |  54 +-
 arch/arm/mach-imx/clk-imx6sl.c                |  14 +-
 arch/arm/mach-imx/clk-imx6sx.c                |  98 ++--
 arch/arm/mach-imx/clk-pfd.c                   |   5 +-
 arch/arm/mach-imx/clk-pllv1.c                 |   5 +-
 arch/arm/mach-imx/clk-pllv2.c                 |   5 +-
 arch/arm/mach-imx/clk-pllv3.c                 |   5 +-
 arch/arm/mach-imx/clk-vf610.c                 |  43 +-
 arch/arm/mach-imx/clk.c                       |  11 +-
 arch/arm/mach-imx/clk.h                       |  42 +-
 arch/arm/mach-msm/clock-pcom.c                |   2 +-
 arch/arm/mach-msm/clock.c                     |   2 +-
 arch/arm/mach-mv78xx0/common.c                |   2 +-
 arch/arm/mach-omap2/board-cm-t35.c            |   2 +-
 arch/arm/mach-omap2/cclock3xxx_data.c         | 371 +++++++------
 arch/arm/mach-omap2/clkt2xxx_dpll.c           |   5 +-
 arch/arm/mach-omap2/clkt2xxx_dpllcore.c       |   5 +-
 arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c  |  11 +-
 arch/arm/mach-omap2/clkt34xx_dpll3m2.c        |   3 +-
 arch/arm/mach-omap2/clkt_clksel.c             |  46 +-
 arch/arm/mach-omap2/clkt_dpll.c               |   8 +-
 arch/arm/mach-omap2/clock.c                   |  52 +-
 arch/arm/mach-omap2/clock.h                   |  18 +-
 arch/arm/mach-omap2/clock3xxx.c               |  23 +-
 arch/arm/mach-omap2/clock3xxx.h               |   4 +-
 arch/arm/mach-omap2/clock_common_data.c       |   2 +-
 arch/arm/mach-omap2/clockdomain.c             |   9 +-
 arch/arm/mach-omap2/clockdomain.h             |   4 +-
 arch/arm/mach-omap2/display.c                 |   6 +-
 arch/arm/mach-omap2/dpll3xxx.c                |  29 +-
 arch/arm/mach-omap2/dpll44xx.c                |   5 +-
 arch/arm/mach-omap2/mcbsp.c                   |   5 +-
 arch/arm/mach-omap2/omap_device.c             |  10 +-
 arch/arm/mach-omap2/omap_hwmod.c              |  42 +-
 arch/arm/mach-omap2/omap_hwmod.h              |  12 +-
 arch/arm/mach-omap2/pm24xx.c                  |  12 +-
 arch/arm/mach-orion5x/common.c                |   2 +-
 arch/arm/mach-shmobile/clock.c                |  10 +-
 arch/arm/mach-vexpress/spc.c                  |   4 +-
 arch/arm/plat-orion/common.c                  |  22 +-
 arch/arm/plat-orion/include/plat/common.h     |  12 +-
 arch/powerpc/platforms/512x/clock-commonclk.c |  48 +-
 drivers/clk/at91/clk-main.c                   |  24 +-
 drivers/clk/at91/clk-master.c                 |   6 +-
 drivers/clk/at91/clk-peripheral.c             |  12 +-
 drivers/clk/at91/clk-pll.c                    |   6 +-
 drivers/clk/at91/clk-plldiv.c                 |   6 +-
 drivers/clk/at91/clk-programmable.c           |  10 +-
 drivers/clk/at91/clk-slow.c                   |  24 +-
 drivers/clk/at91/clk-smd.c                    |   6 +-
 drivers/clk/at91/clk-system.c                 |   6 +-
 drivers/clk/at91/clk-usb.c                    |  20 +-
 drivers/clk/at91/clk-utmi.c                   |   6 +-
 drivers/clk/bcm/clk-kona-setup.c              |   6 +-
 drivers/clk/bcm/clk-kona.c                    |  12 +-
 drivers/clk/bcm/clk-kona.h                    |   2 +-
 drivers/clk/berlin/berlin2-avpll.c            |   4 +-
 drivers/clk/berlin/berlin2-avpll.h            |   4 +-
 drivers/clk/berlin/berlin2-div.c              |   2 +-
 drivers/clk/berlin/berlin2-div.h              |   2 +-
 drivers/clk/berlin/berlin2-pll.c              |   2 +-
 drivers/clk/berlin/berlin2-pll.h              |   2 +-
 drivers/clk/berlin/bg2.c                      |  14 +-
 drivers/clk/berlin/bg2q.c                     |  10 +-
 drivers/clk/clk-axi-clkgen.c                  |   3 +-
 drivers/clk/clk-axm5516.c                     |   4 +-
 drivers/clk/clk-bcm2835.c                     |   2 +-
 drivers/clk/clk-composite.c                   |  11 +-
 drivers/clk/clk-conf.c                        |  18 +-
 drivers/clk/clk-devres.c                      |  31 ++
 drivers/clk/clk-divider.c                     |   8 +-
 drivers/clk/clk-efm32gg.c                     |   3 +-
 drivers/clk/clk-fixed-factor.c                |   6 +-
 drivers/clk/clk-fixed-rate.c                  |   8 +-
 drivers/clk/clk-fractional-divider.c          |   4 +-
 drivers/clk/clk-gate.c                        |   4 +-
 drivers/clk/clk-highbank.c                    |   8 +-
 drivers/clk/clk-ls1x.c                        |  16 +-
 drivers/clk/clk-max77686.c                    |  10 +-
 drivers/clk/clk-moxart.c                      |   8 +-
 drivers/clk/clk-mux.c                         |   7 +-
 drivers/clk/clk-nomadik.c                     |  15 +-
 drivers/clk/clk-nspire.c                      |   4 +-
 drivers/clk/clk-palmas.c                      |   7 +-
 drivers/clk/clk-ppc-corenet.c                 |   8 +-
 drivers/clk/clk-s2mps11.c                     |   6 +-
 drivers/clk/clk-si5351.c                      |  17 +-
 drivers/clk/clk-si570.c                       |   4 +-
 drivers/clk/clk-twl6040.c                     |   3 +-
 drivers/clk/clk-u300.c                        |  13 +-
 drivers/clk/clk-vt8500.c                      |   4 +-
 drivers/clk/clk-wm831x.c                      |   7 +-
 drivers/clk/clk-xgene.c                       |  12 +-
 drivers/clk/clk.c                             | 724 +++++++++++++++++---------
 drivers/clk/clk.h                             |  12 +-
 drivers/clk/clkdev.c                          | 130 ++++-
 drivers/clk/hisilicon/clk-hi3620.c            |   9 +-
 drivers/clk/hisilicon/clk-hip04.c             |   1 -
 drivers/clk/hisilicon/clk.c                   |  17 +-
 drivers/clk/hisilicon/clk.h                   |   2 +-
 drivers/clk/hisilicon/clkgate-separated.c     |   5 +-
 drivers/clk/keystone/gate.c                   |   7 +-
 drivers/clk/keystone/pll.c                    |  11 +-
 drivers/clk/mmp/clk-apbc.c                    |   5 +-
 drivers/clk/mmp/clk-apmu.c                    |   5 +-
 drivers/clk/mmp/clk-frac.c                    |   4 +-
 drivers/clk/mmp/clk-mmp2.c                    |  14 +-
 drivers/clk/mmp/clk-pxa168.c                  |  12 +-
 drivers/clk/mmp/clk-pxa910.c                  |  12 +-
 drivers/clk/mmp/clk.h                         |   8 +-
 drivers/clk/mvebu/clk-corediv.c               |   4 +-
 drivers/clk/mvebu/clk-cpu.c                   |   8 +-
 drivers/clk/mvebu/common.c                    |  15 +-
 drivers/clk/mvebu/kirkwood.c                  |   6 +-
 drivers/clk/mxs/clk-div.c                     |   5 +-
 drivers/clk/mxs/clk-frac.c                    |   5 +-
 drivers/clk/mxs/clk-imx23.c                   |   5 +-
 drivers/clk/mxs/clk-imx28.c                   |   5 +-
 drivers/clk/mxs/clk-pll.c                     |   5 +-
 drivers/clk/mxs/clk-ref.c                     |   5 +-
 drivers/clk/mxs/clk.h                         |  17 +-
 drivers/clk/qcom/clk-rcg.c                    |   8 +-
 drivers/clk/qcom/clk-rcg2.c                   |  14 +-
 drivers/clk/qcom/clk-regmap.c                 |   2 +-
 drivers/clk/qcom/clk-regmap.h                 |   2 +-
 drivers/clk/qcom/common.c                     |   6 +-
 drivers/clk/qcom/gcc-apq8084.c                |   2 +-
 drivers/clk/qcom/gcc-ipq806x.c                |   2 +-
 drivers/clk/qcom/gcc-msm8660.c                |   2 +-
 drivers/clk/qcom/gcc-msm8960.c                |   2 +-
 drivers/clk/qcom/gcc-msm8974.c                |   2 +-
 drivers/clk/qcom/mmcc-msm8960.c               |   6 +-
 drivers/clk/rockchip/clk-pll.c                |   9 +-
 drivers/clk/rockchip/clk-rk3188.c             |   2 +-
 drivers/clk/rockchip/clk-rk3288.c             |   2 +-
 drivers/clk/rockchip/clk-rockchip.c           |   2 +-
 drivers/clk/rockchip/clk.c                    |  23 +-
 drivers/clk/rockchip/clk.h                    |   5 +-
 drivers/clk/samsung/clk-exynos-audss.c        |  16 +-
 drivers/clk/samsung/clk-exynos-clkout.c       |   9 +-
 drivers/clk/samsung/clk-exynos3250.c          |   1 -
 drivers/clk/samsung/clk-exynos4.c             |   7 +-
 drivers/clk/samsung/clk-exynos5250.c          |   1 -
 drivers/clk/samsung/clk-exynos5260.c          |   1 -
 drivers/clk/samsung/clk-exynos5410.c          |   1 -
 drivers/clk/samsung/clk-exynos5420.c          |   1 -
 drivers/clk/samsung/clk-exynos5440.c          |   1 -
 drivers/clk/samsung/clk-pll.c                 |   6 +-
 drivers/clk/samsung/clk-pll.h                 |   2 +-
 drivers/clk/samsung/clk-s3c2410-dclk.c        |  30 +-
 drivers/clk/samsung/clk-s3c2410.c             |   1 -
 drivers/clk/samsung/clk-s3c2412.c             |   1 -
 drivers/clk/samsung/clk-s3c2443.c             |   1 -
 drivers/clk/samsung/clk-s3c64xx.c             |   1 -
 drivers/clk/samsung/clk-s5pv210-audss.c       |  16 +-
 drivers/clk/samsung/clk.c                     |  22 +-
 drivers/clk/samsung/clk.h                     |   3 +-
 drivers/clk/shmobile/clk-div6.c               |   2 +-
 drivers/clk/shmobile/clk-emev2.c              |   4 +-
 drivers/clk/shmobile/clk-mstp.c               |   6 +-
 drivers/clk/shmobile/clk-r8a7740.c            |   6 +-
 drivers/clk/shmobile/clk-r8a7779.c            |   6 +-
 drivers/clk/shmobile/clk-rcar-gen2.c          |  10 +-
 drivers/clk/shmobile/clk-rz.c                 |   6 +-
 drivers/clk/sirf/clk-atlas6.c                 |   3 +-
 drivers/clk/sirf/clk-common.c                 |  30 +-
 drivers/clk/sirf/clk-prima2.c                 |   3 +-
 drivers/clk/socfpga/clk-gate.c                |   3 +-
 drivers/clk/socfpga/clk-periph.c              |   3 +-
 drivers/clk/socfpga/clk-pll.c                 |   5 +-
 drivers/clk/spear/clk-aux-synth.c             |   8 +-
 drivers/clk/spear/clk-frac-synth.c            |   4 +-
 drivers/clk/spear/clk-gpt-synth.c             |   4 +-
 drivers/clk/spear/clk-vco-pll.c               |   8 +-
 drivers/clk/spear/clk.h                       |  14 +-
 drivers/clk/spear/spear1310_clock.c           |   3 +-
 drivers/clk/spear/spear1340_clock.c           |   3 +-
 drivers/clk/spear/spear3xx_clock.c            |  17 +-
 drivers/clk/spear/spear6xx_clock.c            |   3 +-
 drivers/clk/st/clk-flexgen.c                  |  12 +-
 drivers/clk/st/clkgen-fsyn.c                  |  22 +-
 drivers/clk/st/clkgen-mux.c                   |  32 +-
 drivers/clk/st/clkgen-pll.c                   |  34 +-
 drivers/clk/sunxi/clk-a10-hosc.c              |   2 +-
 drivers/clk/sunxi/clk-a20-gmac.c              |   2 +-
 drivers/clk/sunxi/clk-factors.c               |   4 +-
 drivers/clk/sunxi/clk-sun6i-apb0-gates.c      |   2 +-
 drivers/clk/sunxi/clk-sun6i-apb0.c            |   2 +-
 drivers/clk/sunxi/clk-sun6i-ar100.c           |   6 +-
 drivers/clk/sunxi/clk-sun8i-apb0.c            |   2 +-
 drivers/clk/sunxi/clk-sunxi.c                 |  18 +-
 drivers/clk/tegra/clk-audio-sync.c            |   4 +-
 drivers/clk/tegra/clk-divider.c               |   5 +-
 drivers/clk/tegra/clk-periph-gate.c           |   5 +-
 drivers/clk/tegra/clk-periph.c                |   9 +-
 drivers/clk/tegra/clk-pll-out.c               |   5 +-
 drivers/clk/tegra/clk-pll.c                   |  41 +-
 drivers/clk/tegra/clk-super.c                 |   5 +-
 drivers/clk/tegra/clk-tegra-audio.c           |   5 +-
 drivers/clk/tegra/clk-tegra-fixed.c           |   9 +-
 drivers/clk/tegra/clk-tegra-periph.c          |  13 +-
 drivers/clk/tegra/clk-tegra-pmc.c             |   5 +-
 drivers/clk/tegra/clk-tegra-super-gen4.c      |   9 +-
 drivers/clk/tegra/clk-tegra114.c              |  11 +-
 drivers/clk/tegra/clk-tegra124.c              |   7 +-
 drivers/clk/tegra/clk-tegra20.c               |  13 +-
 drivers/clk/tegra/clk-tegra30.c               |   9 +-
 drivers/clk/tegra/clk.c                       |  25 +-
 drivers/clk/tegra/clk.h                       |  38 +-
 drivers/clk/ti/apll.c                         |   8 +-
 drivers/clk/ti/clk-2xxx.c                     |   8 +-
 drivers/clk/ti/clk-33xx.c                     |  18 +-
 drivers/clk/ti/clk-3xxx.c                     |   8 +-
 drivers/clk/ti/clk-43xx.c                     |   8 +-
 drivers/clk/ti/clk-44xx.c                     |  16 +-
 drivers/clk/ti/clk-54xx.c                     |  25 +-
 drivers/clk/ti/clk-7xx.c                      |  28 +-
 drivers/clk/ti/clk-dra7-atl.c                 |   6 +-
 drivers/clk/ti/clk.c                          |   2 +-
 drivers/clk/ti/clockdomain.c                  |   4 +-
 drivers/clk/ti/composite.c                    |   2 +-
 drivers/clk/ti/divider.c                      |   6 +-
 drivers/clk/ti/dpll.c                         |   8 +-
 drivers/clk/ti/fixed-factor.c                 |   2 +-
 drivers/clk/ti/gate.c                         |   2 +-
 drivers/clk/ti/interface.c                    |   2 +-
 drivers/clk/ti/mux.c                          |   6 +-
 drivers/clk/ux500/abx500-clk.c                |   3 +-
 drivers/clk/ux500/clk-prcc.c                  |   8 +-
 drivers/clk/ux500/clk-prcmu.c                 |  16 +-
 drivers/clk/ux500/clk-sysctrl.c               |  10 +-
 drivers/clk/ux500/clk.h                       |  23 +-
 drivers/clk/ux500/u8500_clk.c                 |   3 +-
 drivers/clk/ux500/u8500_of_clk.c              |  13 +-
 drivers/clk/ux500/u8540_clk.c                 |   3 +-
 drivers/clk/ux500/u9540_clk.c                 |   1 -
 drivers/clk/versatile/clk-icst.c              |   5 +-
 drivers/clk/versatile/clk-icst.h              |   2 +-
 drivers/clk/versatile/clk-impd1.c             |  19 +-
 drivers/clk/versatile/clk-realview.c          |   3 +-
 drivers/clk/versatile/clk-sp810.c             |  30 +-
 drivers/clk/versatile/clk-versatile.c         |   3 +-
 drivers/clk/versatile/clk-vexpress-osc.c      |   2 +-
 drivers/clk/versatile/clk-vexpress.c          |   6 +-
 drivers/clk/x86/clk-lpt.c                     |   3 +-
 drivers/clk/zynq/clkc.c                       |  22 +-
 drivers/clk/zynq/pll.c                        |   4 +-
 drivers/gpu/drm/msm/hdmi/hdmi_phy_8960.c      |   3 +-
 drivers/media/platform/exynos4-is/media-dev.c |  18 +-
 drivers/media/platform/exynos4-is/media-dev.h |   7 +-
 drivers/media/platform/omap3isp/isp.h         |   2 +-
 drivers/rtc/rtc-hym8563.c                     |   4 +-
 drivers/staging/imx-drm/imx-tve.c             |  27 +-
 include/asm-generic/clkdev.h                  |   6 +-
 include/linux/clk-private.h                   |  51 +-
 include/linux/clk-provider.h                  | 137 +++--
 include/linux/clk.h                           |  50 +-
 include/linux/clk/ti.h                        |  10 +-
 include/linux/clk/zynq.h                      |   3 +-
 include/linux/clkdev.h                        |  24 +-
 include/linux/platform_data/si5351.h          |   4 +-
 sound/soc/mxs/mxs-saif.c                      |   4 +-
 274 files changed, 2276 insertions(+), 1859 deletions(-)
Signature · 1 line
1.9.3
#14 lore raw
Quoted 11 lines · Mike Turquette

Quoting Tomeu Vizoso (2014-09-03 08:29:07)

Quoted 10 lines

Hi,

I'm sending this v9 in order to fix a few build errors found by Intel's 0day build farm. Notable changes are:

* Changes to mxs-saif.c have been folded into 2/6, in order for bisectability to be preserved.

* All floor constraints are applied first, then all ceiling constraints. This is to keep the behavior deterministic and to prevent any situation in which floor constraints could trump over ceiling constraints.

* A WARN has been added to flag inconsistent ranges of constraints.

Quoted 7 lines
Quoted 3 lines

* Redundant includes of linux/clk.h have been removed.

These series depend on Mike's patches at [0] and is rebased on top of today's clk-next.

Applied to clk-next! Thanks much for your hard work on this series. It has turned out pretty nice. And thanks to Rabin for the original proposal and to Andrew Lunn for helping to resolve the Kirkwood issues.

Indeed, I'm very grateful at all the help that these series have gotten along the way.

Quoted 4 lines

I would not be surprised if we have to fix some stuff up leading up to the next merge window. The split between struct clk and struct clk_core will likely cause some of the pending patches on the list to break and I might ask for your help with the Coccinelle script ;-)

I have the same feeling, but I think we should be able to deal with them fairly quickly and painlessly. Since yesterday I haven't gotten any 0day build error, but I'm not sure the build bots have tried my branch yet.

Thanks,

Tomeu

Quoted 333 lines

I guess we'll know soon if things start to explode once this hits linux-next...

Thanks again,
Mike

Quoted 327 lines

Follows the original cover letter blurb:

I'm retaking Rabin's patches [1] for splitting the clk API in two: one API for clk consumers and another for providers. The consumer API uses a clk structure that just keeps track of the consumer and has a reference to the actual clk_core struct, which is used internally.

I have kept a patch from Rabin that aims to aid in debugging nested enable/disable calls, though my personal aim is to allow more than one consumer to influence the final, effective frequency rate. For now this is limited to setting floor and ceiling constraints, with the short-term aim of allowing devfreq and thermal drivers to set floor and ceiling frequencies on the memory clock, respectively.

For those functions in the consumer clk API that were called from providers, I have added variants to clk-provider.h that are the same only that accept a clk_core instead. These functions are prefixed with clk_provider_.

Patch 1/7 just adds a bunch of defines with the goal of having all the renames in their own commit while preserving git-bisectability, with patch 3/7 containing the rename itself as generated by the Coccinelle script in [2]. Patch 2/7 is needed because sound/soc/mxs/mxs-saif.c calls both the consumer and the provider API. The actual implementation of the API split comes in patch 4/7. I will be happy to organize the refactoring differently if anybody has a better idea.

Patch 5/7 warns when there's an unbalanced usage of the enable and disable APIs, and patch 6/7 adds the API for setting floor and ceiling frequencies, per consumer. Patch 7/7 will warn when prepare/unprepare are used unbalanced, printing the code location of the last call to unprepare.

[0] http://thread.gmane.org/gmane.linux.kernel/1778132
[1] http://thread.gmane.org/gmane.linux.kernel/1402006
[2] http://cgit.collabora.com/git/user/tomeu/linux.git/log/?h=clk-refactoring-9

Thanks,

Tomeu

Tomeu Vizoso (6):
clk: Add temporary mapping to the existing API
clk: Move all drivers to use internal API
clk: use struct clk only for external API
clk: per-user clock accounting for debug
clk: Add floor and ceiling constraints to clock rates
clk: Warn of unbalanced clk_prepare() calls

 arch/arm/mach-dove/common.c                   |  10 +-
 arch/arm/mach-imx/clk-busy.c                  |   9 +-
 arch/arm/mach-imx/clk-fixup-div.c             |   4 +-
 arch/arm/mach-imx/clk-fixup-mux.c             |   4 +-
 arch/arm/mach-imx/clk-gate2.c                 |   4 +-
 arch/arm/mach-imx/clk-imx1.c                  |   3 +-
 arch/arm/mach-imx/clk-imx21.c                 |   3 +-
 arch/arm/mach-imx/clk-imx25.c                 |   9 +-
 arch/arm/mach-imx/clk-imx27.c                 |   5 +-
 arch/arm/mach-imx/clk-imx31.c                 |  11 +-
 arch/arm/mach-imx/clk-imx35.c                 |  23 +-
 arch/arm/mach-imx/clk-imx51-imx53.c           |  78 +--
 arch/arm/mach-imx/clk-imx6q.c                 |  54 +-
 arch/arm/mach-imx/clk-imx6sl.c                |  14 +-
 arch/arm/mach-imx/clk-imx6sx.c                |  98 ++--
 arch/arm/mach-imx/clk-pfd.c                   |   5 +-
 arch/arm/mach-imx/clk-pllv1.c                 |   5 +-
 arch/arm/mach-imx/clk-pllv2.c                 |   5 +-
 arch/arm/mach-imx/clk-pllv3.c                 |   5 +-
 arch/arm/mach-imx/clk-vf610.c                 |  43 +-
 arch/arm/mach-imx/clk.c                       |  11 +-
 arch/arm/mach-imx/clk.h                       |  42 +-
 arch/arm/mach-msm/clock-pcom.c                |   2 +-
 arch/arm/mach-msm/clock.c                     |   2 +-
 arch/arm/mach-mv78xx0/common.c                |   2 +-
 arch/arm/mach-omap2/board-cm-t35.c            |   2 +-
 arch/arm/mach-omap2/cclock3xxx_data.c         | 371 +++++++------
 arch/arm/mach-omap2/clkt2xxx_dpll.c           |   5 +-
 arch/arm/mach-omap2/clkt2xxx_dpllcore.c       |   5 +-
 arch/arm/mach-omap2/clkt2xxx_virt_prcm_set.c  |  11 +-
 arch/arm/mach-omap2/clkt34xx_dpll3m2.c        |   3 +-
 arch/arm/mach-omap2/clkt_clksel.c             |  46 +-
 arch/arm/mach-omap2/clkt_dpll.c               |   8 +-
 arch/arm/mach-omap2/clock.c                   |  52 +-
 arch/arm/mach-omap2/clock.h                   |  18 +-
 arch/arm/mach-omap2/clock3xxx.c               |  23 +-
 arch/arm/mach-omap2/clock3xxx.h               |   4 +-
 arch/arm/mach-omap2/clock_common_data.c       |   2 +-
 arch/arm/mach-omap2/clockdomain.c             |   9 +-
 arch/arm/mach-omap2/clockdomain.h             |   4 +-
 arch/arm/mach-omap2/display.c                 |   6 +-
 arch/arm/mach-omap2/dpll3xxx.c                |  29 +-
 arch/arm/mach-omap2/dpll44xx.c                |   5 +-
 arch/arm/mach-omap2/mcbsp.c                   |   5 +-
 arch/arm/mach-omap2/omap_device.c             |  10 +-
 arch/arm/mach-omap2/omap_hwmod.c              |  42 +-
 arch/arm/mach-omap2/omap_hwmod.h              |  12 +-
 arch/arm/mach-omap2/pm24xx.c                  |  12 +-
 arch/arm/mach-orion5x/common.c                |   2 +-
 arch/arm/mach-shmobile/clock.c                |  10 +-
 arch/arm/mach-vexpress/spc.c                  |   4 +-
 arch/arm/plat-orion/common.c                  |  22 +-
 arch/arm/plat-orion/include/plat/common.h     |  12 +-
 arch/powerpc/platforms/512x/clock-commonclk.c |  48 +-
 drivers/clk/at91/clk-main.c                   |  24 +-
 drivers/clk/at91/clk-master.c                 |   6 +-
 drivers/clk/at91/clk-peripheral.c             |  12 +-
 drivers/clk/at91/clk-pll.c                    |   6 +-
 drivers/clk/at91/clk-plldiv.c                 |   6 +-
 drivers/clk/at91/clk-programmable.c           |  10 +-
 drivers/clk/at91/clk-slow.c                   |  24 +-
 drivers/clk/at91/clk-smd.c                    |   6 +-
 drivers/clk/at91/clk-system.c                 |   6 +-
 drivers/clk/at91/clk-usb.c                    |  20 +-
 drivers/clk/at91/clk-utmi.c                   |   6 +-
 drivers/clk/bcm/clk-kona-setup.c              |   6 +-
 drivers/clk/bcm/clk-kona.c                    |  12 +-
 drivers/clk/bcm/clk-kona.h                    |   2 +-
 drivers/clk/berlin/berlin2-avpll.c            |   4 +-
 drivers/clk/berlin/berlin2-avpll.h            |   4 +-
 drivers/clk/berlin/berlin2-div.c              |   2 +-
 drivers/clk/berlin/berlin2-div.h              |   2 +-
 drivers/clk/berlin/berlin2-pll.c              |   2 +-
 drivers/clk/berlin/berlin2-pll.h              |   2 +-
 drivers/clk/berlin/bg2.c                      |  14 +-
 drivers/clk/berlin/bg2q.c                     |  10 +-
 drivers/clk/clk-axi-clkgen.c                  |   3 +-
 drivers/clk/clk-axm5516.c                     |   4 +-
 drivers/clk/clk-bcm2835.c                     |   2 +-
 drivers/clk/clk-composite.c                   |  11 +-
 drivers/clk/clk-conf.c                        |  18 +-
 drivers/clk/clk-devres.c                      |  31 ++
 drivers/clk/clk-divider.c                     |   8 +-
 drivers/clk/clk-efm32gg.c                     |   3 +-
 drivers/clk/clk-fixed-factor.c                |   6 +-
 drivers/clk/clk-fixed-rate.c                  |   8 +-
 drivers/clk/clk-fractional-divider.c          |   4 +-
 drivers/clk/clk-gate.c                        |   4 +-
 drivers/clk/clk-highbank.c                    |   8 +-
 drivers/clk/clk-ls1x.c                        |  16 +-
 drivers/clk/clk-max77686.c                    |  10 +-
 drivers/clk/clk-moxart.c                      |   8 +-
 drivers/clk/clk-mux.c                         |   7 +-
 drivers/clk/clk-nomadik.c                     |  15 +-
 drivers/clk/clk-nspire.c                      |   4 +-
 drivers/clk/clk-palmas.c                      |   7 +-
 drivers/clk/clk-ppc-corenet.c                 |   8 +-
 drivers/clk/clk-s2mps11.c                     |   6 +-
 drivers/clk/clk-si5351.c                      |  17 +-
 drivers/clk/clk-si570.c                       |   4 +-
 drivers/clk/clk-twl6040.c                     |   3 +-
 drivers/clk/clk-u300.c                        |  13 +-
 drivers/clk/clk-vt8500.c                      |   4 +-
 drivers/clk/clk-wm831x.c                      |   7 +-
 drivers/clk/clk-xgene.c                       |  12 +-
 drivers/clk/clk.c                             | 724 +++++++++++++++++---------
 drivers/clk/clk.h                             |  12 +-
 drivers/clk/clkdev.c                          | 130 ++++-
 drivers/clk/hisilicon/clk-hi3620.c            |   9 +-
 drivers/clk/hisilicon/clk-hip04.c             |   1 -
 drivers/clk/hisilicon/clk.c                   |  17 +-
 drivers/clk/hisilicon/clk.h                   |   2 +-
 drivers/clk/hisilicon/clkgate-separated.c     |   5 +-
 drivers/clk/keystone/gate.c                   |   7 +-
 drivers/clk/keystone/pll.c                    |  11 +-
 drivers/clk/mmp/clk-apbc.c                    |   5 +-
 drivers/clk/mmp/clk-apmu.c                    |   5 +-
 drivers/clk/mmp/clk-frac.c                    |   4 +-
 drivers/clk/mmp/clk-mmp2.c                    |  14 +-
 drivers/clk/mmp/clk-pxa168.c                  |  12 +-
 drivers/clk/mmp/clk-pxa910.c                  |  12 +-
 drivers/clk/mmp/clk.h                         |   8 +-
 drivers/clk/mvebu/clk-corediv.c               |   4 +-
 drivers/clk/mvebu/clk-cpu.c                   |   8 +-
 drivers/clk/mvebu/common.c                    |  15 +-
 drivers/clk/mvebu/kirkwood.c                  |   6 +-
 drivers/clk/mxs/clk-div.c                     |   5 +-
 drivers/clk/mxs/clk-frac.c                    |   5 +-
 drivers/clk/mxs/clk-imx23.c                   |   5 +-
 drivers/clk/mxs/clk-imx28.c                   |   5 +-
 drivers/clk/mxs/clk-pll.c                     |   5 +-
 drivers/clk/mxs/clk-ref.c                     |   5 +-
 drivers/clk/mxs/clk.h                         |  17 +-
 drivers/clk/qcom/clk-rcg.c                    |   8 +-
 drivers/clk/qcom/clk-rcg2.c                   |  14 +-
 drivers/clk/qcom/clk-regmap.c                 |   2 +-
 drivers/clk/qcom/clk-regmap.h                 |   2 +-
 drivers/clk/qcom/common.c                     |   6 +-
 drivers/clk/qcom/gcc-apq8084.c                |   2 +-
 drivers/clk/qcom/gcc-ipq806x.c                |   2 +-
 drivers/clk/qcom/gcc-msm8660.c                |   2 +-
 drivers/clk/qcom/gcc-msm8960.c                |   2 +-
 drivers/clk/qcom/gcc-msm8974.c                |   2 +-
 drivers/clk/qcom/mmcc-msm8960.c               |   6 +-
 drivers/clk/rockchip/clk-pll.c                |   9 +-
 drivers/clk/rockchip/clk-rk3188.c             |   2 +-
 drivers/clk/rockchip/clk-rk3288.c             |   2 +-
 drivers/clk/rockchip/clk-rockchip.c           |   2 +-
 drivers/clk/rockchip/clk.c                    |  23 +-
 drivers/clk/rockchip/clk.h                    |   5 +-
 drivers/clk/samsung/clk-exynos-audss.c        |  16 +-
 drivers/clk/samsung/clk-exynos-clkout.c       |   9 +-
 drivers/clk/samsung/clk-exynos3250.c          |   1 -
 drivers/clk/samsung/clk-exynos4.c             |   7 +-
 drivers/clk/samsung/clk-exynos5250.c          |   1 -
 drivers/clk/samsung/clk-exynos5260.c          |   1 -
 drivers/clk/samsung/clk-exynos5410.c          |   1 -
 drivers/clk/samsung/clk-exynos5420.c          |   1 -
 drivers/clk/samsung/clk-exynos5440.c          |   1 -
 drivers/clk/samsung/clk-pll.c                 |   6 +-
 drivers/clk/samsung/clk-pll.h                 |   2 +-
 drivers/clk/samsung/clk-s3c2410-dclk.c        |  30 +-
 drivers/clk/samsung/clk-s3c2410.c             |   1 -
 drivers/clk/samsung/clk-s3c2412.c             |   1 -
 drivers/clk/samsung/clk-s3c2443.c             |   1 -
 drivers/clk/samsung/clk-s3c64xx.c             |   1 -
 drivers/clk/samsung/clk-s5pv210-audss.c       |  16 +-
 drivers/clk/samsung/clk.c                     |  22 +-
 drivers/clk/samsung/clk.h                     |   3 +-
 drivers/clk/shmobile/clk-div6.c               |   2 +-
 drivers/clk/shmobile/clk-emev2.c              |   4 +-
 drivers/clk/shmobile/clk-mstp.c               |   6 +-
 drivers/clk/shmobile/clk-r8a7740.c            |   6 +-
 drivers/clk/shmobile/clk-r8a7779.c            |   6 +-
 drivers/clk/shmobile/clk-rcar-gen2.c          |  10 +-
 drivers/clk/shmobile/clk-rz.c                 |   6 +-
 drivers/clk/sirf/clk-atlas6.c                 |   3 +-
 drivers/clk/sirf/clk-common.c                 |  30 +-
 drivers/clk/sirf/clk-prima2.c                 |   3 +-
 drivers/clk/socfpga/clk-gate.c                |   3 +-
 drivers/clk/socfpga/clk-periph.c              |   3 +-
 drivers/clk/socfpga/clk-pll.c                 |   5 +-
 drivers/clk/spear/clk-aux-synth.c             |   8 +-
 drivers/clk/spear/clk-frac-synth.c            |   4 +-
 drivers/clk/spear/clk-gpt-synth.c             |   4 +-
 drivers/clk/spear/clk-vco-pll.c               |   8 +-
 drivers/clk/spear/clk.h                       |  14 +-
 drivers/clk/spear/spear1310_clock.c           |   3 +-
 drivers/clk/spear/spear1340_clock.c           |   3 +-
 drivers/clk/spear/spear3xx_clock.c            |  17 +-
 drivers/clk/spear/spear6xx_clock.c            |   3 +-
 drivers/clk/st/clk-flexgen.c                  |  12 +-
 drivers/clk/st/clkgen-fsyn.c                  |  22 +-
 drivers/clk/st/clkgen-mux.c                   |  32 +-
 drivers/clk/st/clkgen-pll.c                   |  34 +-
 drivers/clk/sunxi/clk-a10-hosc.c              |   2 +-
 drivers/clk/sunxi/clk-a20-gmac.c              |   2 +-
 drivers/clk/sunxi/clk-factors.c               |   4 +-
 drivers/clk/sunxi/clk-sun6i-apb0-gates.c      |   2 +-
 drivers/clk/sunxi/clk-sun6i-apb0.c            |   2 +-
 drivers/clk/sunxi/clk-sun6i-ar100.c           |   6 +-
 drivers/clk/sunxi/clk-sun8i-apb0.c            |   2 +-
 drivers/clk/sunxi/clk-sunxi.c                 |  18 +-
 drivers/clk/tegra/clk-audio-sync.c            |   4 +-
 drivers/clk/tegra/clk-divider.c               |   5 +-
 drivers/clk/tegra/clk-periph-gate.c           |   5 +-
 drivers/clk/tegra/clk-periph.c                |   9 +-
 drivers/clk/tegra/clk-pll-out.c               |   5 +-
 drivers/clk/tegra/clk-pll.c                   |  41 +-
 drivers/clk/tegra/clk-super.c                 |   5 +-
 drivers/clk/tegra/clk-tegra-audio.c           |   5 +-
 drivers/clk/tegra/clk-tegra-fixed.c           |   9 +-
 drivers/clk/tegra/clk-tegra-periph.c          |  13 +-
 drivers/clk/tegra/clk-tegra-pmc.c             |   5 +-
 drivers/clk/tegra/clk-tegra-super-gen4.c      |   9 +-
 drivers/clk/tegra/clk-tegra114.c              |  11 +-
 drivers/clk/tegra/clk-tegra124.c              |   7 +-
 drivers/clk/tegra/clk-tegra20.c               |  13 +-
 drivers/clk/tegra/clk-tegra30.c               |   9 +-
 drivers/clk/tegra/clk.c                       |  25 +-
 drivers/clk/tegra/clk.h                       |  38 +-
 drivers/clk/ti/apll.c                         |   8 +-
 drivers/clk/ti/clk-2xxx.c                     |   8 +-
 drivers/clk/ti/clk-33xx.c                     |  18 +-
 drivers/clk/ti/clk-3xxx.c                     |   8 +-
 drivers/clk/ti/clk-43xx.c                     |   8 +-
 drivers/clk/ti/clk-44xx.c                     |  16 +-
 drivers/clk/ti/clk-54xx.c                     |  25 +-
 drivers/clk/ti/clk-7xx.c                      |  28 +-
 drivers/clk/ti/clk-dra7-atl.c                 |   6 +-
 drivers/clk/ti/clk.c                          |   2 +-
 drivers/clk/ti/clockdomain.c                  |   4 +-
 drivers/clk/ti/composite.c                    |   2 +-
 drivers/clk/ti/divider.c                      |   6 +-
 drivers/clk/ti/dpll.c                         |   8 +-
 drivers/clk/ti/fixed-factor.c                 |   2 +-
 drivers/clk/ti/gate.c                         |   2 +-
 drivers/clk/ti/interface.c                    |   2 +-
 drivers/clk/ti/mux.c                          |   6 +-
 drivers/clk/ux500/abx500-clk.c                |   3 +-
 drivers/clk/ux500/clk-prcc.c                  |   8 +-
 drivers/clk/ux500/clk-prcmu.c                 |  16 +-
 drivers/clk/ux500/clk-sysctrl.c               |  10 +-
 drivers/clk/ux500/clk.h                       |  23 +-
 drivers/clk/ux500/u8500_clk.c                 |   3 +-
 drivers/clk/ux500/u8500_of_clk.c              |  13 +-
 drivers/clk/ux500/u8540_clk.c                 |   3 +-
 drivers/clk/ux500/u9540_clk.c                 |   1 -
 drivers/clk/versatile/clk-icst.c              |   5 +-
 drivers/clk/versatile/clk-icst.h              |   2 +-
 drivers/clk/versatile/clk-impd1.c             |  19 +-
 drivers/clk/versatile/clk-realview.c          |   3 +-
 drivers/clk/versatile/clk-sp810.c             |  30 +-
 drivers/clk/versatile/clk-versatile.c         |   3 +-
 drivers/clk/versatile/clk-vexpress-osc.c      |   2 +-
 drivers/clk/versatile/clk-vexpress.c          |   6 +-
 drivers/clk/x86/clk-lpt.c                     |   3 +-
 drivers/clk/zynq/clkc.c                       |  22 +-
 drivers/clk/zynq/pll.c                        |   4 +-
 drivers/gpu/drm/msm/hdmi/hdmi_phy_8960.c      |   3 +-
 drivers/media/platform/exynos4-is/media-dev.c |  18 +-
 drivers/media/platform/exynos4-is/media-dev.h |   7 +-
 drivers/media/platform/omap3isp/isp.h         |   2 +-
 drivers/rtc/rtc-hym8563.c                     |   4 +-
 drivers/staging/imx-drm/imx-tve.c             |  27 +-
 include/asm-generic/clkdev.h                  |   6 +-
 include/linux/clk-private.h                   |  51 +-
 include/linux/clk-provider.h                  | 137 +++--
 include/linux/clk.h                           |  50 +-
 include/linux/clk/ti.h                        |  10 +-
 include/linux/clk/zynq.h                      |   3 +-
 include/linux/clkdev.h                        |  24 +-
 include/linux/platform_data/si5351.h          |   4 +-
 sound/soc/mxs/mxs-saif.c                      |   4 +-
 274 files changed, 2276 insertions(+), 1859 deletions(-)
Signature · 1 line
1.9.3