deliverable/linux.git
8 years agoclk: at91: Remove CLK_IS_ROOT
Stephen Boyd [Tue, 1 Mar 2016 18:59:46 +0000 (10:59 -0800)] 
clk: at91: Remove CLK_IS_ROOT

This flag is a no-op now. Remove usage of the flag.

Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: bcm: Remove CLK_IS_ROOT
Stephen Boyd [Tue, 1 Mar 2016 18:59:47 +0000 (10:59 -0800)] 
clk: bcm: Remove CLK_IS_ROOT

This flag is a no-op now. Remove usage of the flag.

Cc: Lee Jones <lee@kernel.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoMerge tag 'imx-clk-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo...
Stephen Boyd [Wed, 2 Mar 2016 01:30:36 +0000 (17:30 -0800)] 
Merge tag 'imx-clk-4.6' of git://git./linux/kernel/git/shawnguo/linux into clk-next

Pull i.MX clk updates from Shawn Guo:

The i.MX clock update for 4.6:
- Add the clock driver support for the latest i.MX6 family SoCs
  addition - i.MX6QP.
- Clean up the whitespace in i.MX6UL clock driver and add the missing
  KPP clock.
- Correct pwm7 clock name in i.MX6UL clock driver.

* tag 'imx-clk-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux:
  clk: imx: add kpp clock for i.MX6UL
  clk: imx: whitespace cleanup; no functional change
  clk: imx: correct pwm7 clock name in driver for i.MX6UL
  clk: imx: Add clock support for imx6qp

8 years agoMerge tag 'sunxi-clocks-for-4.6' of https://git.kernel.org/pub/scm/linux/kernel/git...
Stephen Boyd [Wed, 2 Mar 2016 22:31:42 +0000 (14:31 -0800)] 
Merge tag 'sunxi-clocks-for-4.6' of https://git./linux/kernel/git/mripard/linux into clk-next

Pull Allwinner clk updates from Maxime Ripard:

Allwinner clocks additions for 4.6

A bunch of things, mostly:
  - Finally switched everything over to OF_CLK_DECLARE, which should remove
    orphans clocks entirely
  - Reworked the clk-factors to be able to add new parameters
  - Improved the error reporting
  - A bunch of new clocks for new SoCs.

* tag 'sunxi-clocks-for-4.6' of https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux: (25 commits)
  clk: sunxi: Add apb0 gates for H3
  clk: sunxi: Improve divs_clk error handling and reporting
  clk: sunxi: improve divider_clk error handling and reporting
  clk: sunxi: improve mux_clk error handling and reporting
  clk: sunxi: Fix sun8i-a23-apb0-clk divider flags
  clk: sunxi: Remove clk_register_clkdev calls
  clk: sunxi: Remove old probe and protection code
  clk: sunxi: convert current clocks registration to CLK_OF_DECLARE
  clk: sunxi: Make clocks setup functions take const pointer
  clk: sunxi: Make clocks setup functions return their clock
  clk: sunxi: improve error reporting for the mux clock
  clk: sunxi: don't mark sun6i_ar100_data __initconst
  clk: sunxi: add bus gates for A83T
  clk: sunxi: Add apb0 gates for A83T
  clk: sunxi: rewrite sun8i-a23-mbus-clk using the simpler composite clk
  clk: sunxi: rewrite sun6i-ar100 using factors clk
  clk: sunxi: rewrite sun6i-a31-ahb1-clk using factors clk with custom recalc
  clk: sunxi: factors: Drop round_rate from clk ops
  clk: sunxi: factors: Support custom formulas
  clk: sunxi: factors: Consolidate get_factors parameters into a struct
  ...

8 years agoclk: qcom: msm8960: Fix ce3_src register offset
Stephen Boyd [Wed, 2 Mar 2016 01:26:48 +0000 (17:26 -0800)] 
clk: qcom: msm8960: Fix ce3_src register offset

The offset seems to have been copied from the sata clk. Fix it so
that enabling the crypto engine source clk works.

Tested-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Fixes: 5f775498bdc4 ("clk: qcom: Fully support apq8064 global clock control")
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoMerge branch 'clk-ti' into clk-next
Michael Turquette [Wed, 2 Mar 2016 00:23:40 +0000 (16:23 -0800)] 
Merge branch 'clk-ti' into clk-next

Conflicts:
drivers/clk/Kconfig

8 years agoclk: ti: Fix some errors found by static checkers
Stephen Boyd [Tue, 1 Mar 2016 18:51:42 +0000 (10:51 -0800)] 
clk: ti: Fix some errors found by static checkers

drivers/clk/ti/clk-814x.c:34:12: warning: symbol 'dm814x_adpll_early_init' was not declared. Should it be static?
drivers/clk/ti/clk-814x.c:58:12: warning: symbol 'dm814x_adpll_enable_init_clocks' was not declared. Should it be static?
drivers/clk/ti/adpll.c:465 ti_adpll_recalc_rate() warn: should '__readw(d->regs + 20) << 18' be a 64 bit type?
drivers/clk/ti/adpll.c:945 ti_adpll_probe() error: we previously assumed 'd->clocks' could be null (see line 921)

The last one looks like a real bug because we don't return an
error on allocation failure.

Cc: Tero Kristo <t-kristo@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: ti: Allow COMPILE_TEST to build selected drivers
Tony Lindgren [Fri, 26 Feb 2016 17:45:03 +0000 (09:45 -0800)] 
clk: ti: Allow COMPILE_TEST to build selected drivers

The arch independent drivers can be build testeed with
COMPILE_TEST. Let's allow that for drivers/clk/ti.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
8 years agoclk: ti: Add support for dm814x ADPLL
Tony Lindgren [Fri, 26 Feb 2016 17:35:05 +0000 (09:35 -0800)] 
clk: ti: Add support for dm814x ADPLL

On dm814x we have 13 ADPLLs with 3 to 4 outputs on each. The
ADPLLs have several dividers and muxes controlled by a shared
control register for each PLL.

Note that for the clocks to work as device drivers for booting on
dm814x, this patch depends on "ARM: OMAP2+: Change core_initcall
levels to postcore_initcall" that has already been merged.

Also note that this patch does not implement clk_set_rate for the
PLL, that will be posted later on when available.

Cc: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
8 years agoclk: qcom: Fix pre-divider usage for pixel RCG
Archit Taneja [Sun, 28 Feb 2016 10:07:17 +0000 (15:37 +0530)] 
clk: qcom: Fix pre-divider usage for pixel RCG

The clk_rcg_pixel_set_rate clk_op sets up the pre-divider by reading
its current value from the NS register.

Using the pre-divider wasn't really intended when creating these ops.
The pixel RCG was only intended to achieve fractional multiplication
provided in the pixel_table array. Leaving the pre-divider to the
existing register value results in a wrong pixel clock when the
bootloader sets up the display. This was left unidentified because
the IFC6410 Plus board on which this was verified didn't have a
bootloader that configured the display.

Don't set the RCG pre-divider in freq_tbl to the existing NS register
value. Force it to 1 and only use the M/N counter to achieve the desired
fractional multiplication.

Cc: Vinay Simha <vinaysimha@inforcecomputing.com>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Tested-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: imx: add kpp clock for i.MX6UL
Lothar Waßmann [Tue, 12 Jan 2016 17:29:19 +0000 (18:29 +0100)] 
clk: imx: add kpp clock for i.MX6UL

Add the necessary clock to use the KPP interface on i.MX6UL.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
8 years agoclk: imx: whitespace cleanup; no functional change
Lothar Waßmann [Tue, 12 Jan 2016 17:29:18 +0000 (18:29 +0100)] 
clk: imx: whitespace cleanup; no functional change

remove whitespace before TAB.

Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Acked-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
8 years agoclk: h8300: Properly cast to __iomem pointer
Stephen Boyd [Mon, 22 Feb 2016 20:36:15 +0000 (12:36 -0800)] 
clk: h8300: Properly cast to __iomem pointer

Sparse complains here because we dropped the __iomem annotation
when casting the aligned address. Add __iomem back so that sparse
stops complaining.

Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: <uclinux-h8-devel@lists.sourceforge.jp>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agosimplefb: Remove impossible check for of_clk_get_parent_count() < 0
Stephen Boyd [Mon, 22 Feb 2016 19:14:25 +0000 (11:14 -0800)] 
simplefb: Remove impossible check for of_clk_get_parent_count() < 0

The check for < 0 is impossible now that
of_clk_get_parent_count() returns an unsigned int. Simplify the
code and update the types.

Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: <linux-fbdev@vger.kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agousb: dwc3: Remove impossible check for of_clk_get_parent_count() < 0
Stephen Boyd [Mon, 22 Feb 2016 19:12:47 +0000 (11:12 -0800)] 
usb: dwc3: Remove impossible check for of_clk_get_parent_count() < 0

The check for < 0 is impossible now that
of_clk_get_parent_count() returns an unsigned int. Simplify the
code and update the types.

Acked-by: Felipe Balbi <balbi@kernel.org>
Cc: <linux-usb@vger.kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: ti: Update for of_clk_get_parent_count() returning unsigned int
Stephen Boyd [Sat, 20 Feb 2016 01:49:23 +0000 (17:49 -0800)] 
clk: ti: Update for of_clk_get_parent_count() returning unsigned int

Change the types here to unsigned int instead of int and update
the checks for == 0 instead < 1 to be more explicit about what's
going on now that of_clk_get_parent_count() has changed return
types.

Cc: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: sunxi: Use proper type for of_clk_get_parent_count() return value
Stephen Boyd [Sat, 20 Feb 2016 01:44:27 +0000 (17:44 -0800)] 
clk: sunxi: Use proper type for of_clk_get_parent_count() return value

The return type of of_clk_get_parent_count() is an unsigned int
now, so let's update the code here to be more explicit about the
range of values we can test for.

Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: st: Remove impossible check for of_clk_get_parent_count() < 0
Stephen Boyd [Sat, 20 Feb 2016 01:43:30 +0000 (17:43 -0800)] 
clk: st: Remove impossible check for of_clk_get_parent_count() < 0

The checks for < 0 are impossible now that
of_clk_get_parent_count() returns an unsigned int. Simplify the
code and update the types.

Cc: Gabriel Fernandez <gabriel.fernandez@st.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: h8300: Remove impossible check for of_clk_get_parent_count()
Stephen Boyd [Sat, 20 Feb 2016 01:36:51 +0000 (17:36 -0800)] 
clk: h8300: Remove impossible check for of_clk_get_parent_count()

The checks for < 1 can be simplified now that
of_clk_get_parent_count() returns an unsigned int. Update the
code to reflect the int to unsigned int change.

Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: <uclinux-h8-devel@lists.sourceforge.jp>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: gpio: Remove impossible check for of_clk_get_parent_count() < 0
Stephen Boyd [Sat, 20 Feb 2016 01:31:52 +0000 (17:31 -0800)] 
clk: gpio: Remove impossible check for of_clk_get_parent_count() < 0

The check for < 0 is impossible now that
of_clk_get_parent_count() returns an unsigned int. Simplify the
code and update the type here.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: at91: Remove impossible checks for of_clk_get_parent_count()
Stephen Boyd [Sat, 20 Feb 2016 01:29:17 +0000 (17:29 -0800)] 
clk: at91: Remove impossible checks for of_clk_get_parent_count()

These checks for < 0 are impossible now that
of_clk_get_parent_count() returns an unsigned int. Change the
checks for == 0 and update the type.

Cc: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: Make of_clk_get_parent_count() return unsigned ints
Stephen Boyd [Fri, 19 Feb 2016 23:52:32 +0000 (15:52 -0800)] 
clk: Make of_clk_get_parent_count() return unsigned ints

Russell King recently pointed out a bug in the clk-gpio code
where it fails to register the clk if of_clk_get_parent_count()
returns an error because the "clocks" property isn't present in
the DT node. If we're trying to count parents from DT we'd like
to know the count, not if there is a "clocks" property or not.
Furthermore, some drivers are assigning the return value to their
clk_init_data::num_parents member which is unsigned, leading to
potentially large numbers of parents when the property isn't
present.

Let's change the API to return an unsigned int instead of an int.
All the callers just want to know the count anyway, and this
avoids the bug that was in the clk-gpio driver.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: Ignore disabled DT clock providers
Geert Uytterhoeven [Fri, 26 Feb 2016 15:54:31 +0000 (16:54 +0100)] 
clk: Ignore disabled DT clock providers

of_clk_init() uses for_each_matching_node_and_match() to find clock
providers, which returns all matching device nodes, whether they are
enabled or not. Hence clock providers that are disabled explicitly in DT
using e.g.

"status = "disabled";

are still activated.

Add a check to ignore device nodes that are not enabled, like
of_irq_init() does.

Reported-by: Ramesh Shanmugasundaram <ramesh.shanmugasundaram@bp.renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: skip unnecessary set_phase if nothing to do
Shawn Lin [Fri, 26 Feb 2016 01:25:52 +0000 (09:25 +0800)] 
clk: skip unnecessary set_phase if nothing to do

Let's compare the degrees from clk_set_rate with
clk->core->phase. If the requested degrees is already
there, skip the following steps.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
[sboyd@codeaurora.org: s/drgrees/degrees/ in commit text]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: bcm2835: added missing clock register definitions
Martin Sperl [Tue, 22 Dec 2015 20:13:08 +0000 (20:13 +0000)] 
clk: bcm2835: added missing clock register definitions

Added missing CTRL and DIV clock register definitions for:
PCM, SLIM, TCNT, TEC, TD0, TD1

Register information taken from:
https://rawgit.com/msperl/rpi-registers/master/rpi-registers.html#CM
which extracted the information from the header files shared by
Broadcom/rpi foundation in this file:
http://www.broadcom.com/docs/support/videocore/Brcm_Android_ICS_Graphics_Stack.tar.gz

Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: shmobile: Remove ARCH_SHMOBILE_MULTI
Simon Horman [Tue, 23 Feb 2016 00:57:31 +0000 (09:57 +0900)] 
clk: shmobile: Remove ARCH_SHMOBILE_MULTI

As of 9b5ba0df4ea4 ("ARM: shmobile: Introduce ARCH_RENESAS") all platforms
that use Renesas clock drivers now select ARCH_RENESAS. As it is present in
drivers/clk/Makefile ARCH_SHMOBILE_MULTI may now be removed.

This is part of an ongoing process to migrate from ARCH_SHMOBILE to
ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Acked-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoMerge tag 'clk-samsung-4.6' of git://linuxtv.org/snawrocki/samsung into clk-next
Stephen Boyd [Thu, 25 Feb 2016 23:18:12 +0000 (15:18 -0800)] 
Merge tag 'clk-samsung-4.6' of git://linuxtv.org/snawrocki/samsung into clk-next

Pull Samsung clk driver changes from Sylwester Nawrocki:

Mostly correction of errors in the exynos5433 SoC
clocks definition, dropping read-only registers
from the suspend/resume register save/restore list
and exposition of two clocks required for the
exynos5433 HDMI subsystem operation.

* tag 'clk-samsung-4.6' of git://linuxtv.org/snawrocki/samsung:
  clk: samsung: exynos5433: Fix wrong registers of PCLK_GSCL_SMMU clocks
  clk: samsung: exynos5433: Fix mout_aclk_cam1*_user clocks definition
  clk: samsung: exynos5433: Drop RO registers from the save/restore lists
  clk: samsung: exynos5433: Fix definitions of SCLK ISP SENSOR0 clocks
  clk: samsung: exynos5433: Fix definitions of MUX_SEL_CAM04 clocks
  clk: samsung: exynos5433: Fix typos in *_ISP_MPWM clock names
  clk/samsung: exynos5433: add pclk_decon clock
  clk/samsung: exynos5433: add definitions of HDMI-PHY output clocks

8 years agoclk: mvebu: Move corediv config to mvebu config
Kevin Smith [Thu, 11 Feb 2016 16:54:00 +0000 (16:54 +0000)] 
clk: mvebu: Move corediv config to mvebu config

The core clock does not depend on corediv, so enabling corediv
based on the clock is not really correct.  Move the corediv
config option from the clock driver Kconfig to the mvebu Kconfig
so that it can be enabled by the MACH option instead.

This also enables corediv on Armada 375 and 38X, which was
previously missing.

Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Gregory CLEMENT <gregory.clement@free-electrons.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: mvebu: Remove corediv clock from Armada XP
Kevin Smith [Thu, 11 Feb 2016 16:53:52 +0000 (16:53 +0000)] 
clk: mvebu: Remove corediv clock from Armada XP

There is no corediv clock on Armada XP, so this is unnecessary.

Signed-off-by: Kevin Smith <kevin.smith@elecsyscorp.com>
Acked-by: Michael Turquette <mturquette@baylibre.com>
Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: versatile: sp810: support reentrance
Linus Walleij [Wed, 24 Feb 2016 08:39:11 +0000 (09:39 +0100)] 
clk: versatile: sp810: support reentrance

Despite care take to allocate clocks state containers the
SP810 driver actually just supports creating one instance:
all clocks registered for every instance will end up with the
exact same name and __clk_init() will fail.

Rename the timclken<0> .. timclken<n> to sp810_<instance>_<n>
so every clock on every instance gets a unique name.

This is necessary for the RealView PBA8 which has two SP810
blocks: the second block will not register its clocks unless
every clock on every instance is unique and results in boot
logs like this:

------------[ cut here ]------------
WARNING: CPU: 0 PID: 0 at ../drivers/clk/versatile/clk-sp810.c:137
  clk_sp810_of_setup+0x110/0x154()
Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted
4.5.0-rc2-00030-g352718fc39f6-dirty #225
Hardware name: ARM RealView Machine (Device Tree Support)
[<c00167f8>] (unwind_backtrace) from [<c0013204>]
             (show_stack+0x10/0x14)
[<c0013204>] (show_stack) from [<c01a049c>]
             (dump_stack+0x84/0x9c)
[<c01a049c>] (dump_stack) from [<c0024990>]
             (warn_slowpath_common+0x74/0xb0)
[<c0024990>] (warn_slowpath_common) from [<c0024a68>]
             (warn_slowpath_null+0x1c/0x24)
[<c0024a68>] (warn_slowpath_null) from [<c051eb44>]
             (clk_sp810_of_setup+0x110/0x154)
[<c051eb44>] (clk_sp810_of_setup) from [<c051e3a4>]
             (of_clk_init+0x12c/0x1c8)
[<c051e3a4>] (of_clk_init) from [<c0504714>]
             (time_init+0x20/0x2c)
[<c0504714>] (time_init) from [<c0501b18>]
             (start_kernel+0x244/0x3c4)
[<c0501b18>] (start_kernel) from [<7000807c>] (0x7000807c)
---[ end trace cb88537fdc8fa200 ]---

Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Pawel Moll <pawel.moll@arm.com>
Fixes: 6e973d2c4385 "clk: vexpress: Add separate SP810 driver"
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: Get rid of HAVE_MACH_CLKDEV
Stephen Boyd [Wed, 27 Jan 2016 22:17:00 +0000 (14:17 -0800)] 
clk: Get rid of HAVE_MACH_CLKDEV

This config was used for the ARM port so that it could use a
machine specific clkdev.h include, but those are all gone now.
The MIPS architecture is the last user, and from what I can tell
it doesn't actually use it anyway, so let's remove the config all
together.

Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: <linux-mips@linux-mips.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Joshua Henderson <joshua.henderson@microchip.com>
8 years agoMerge branch 'clk-ipq4019' into clk-next
Stephen Boyd [Thu, 25 Feb 2016 22:32:27 +0000 (14:32 -0800)] 
Merge branch 'clk-ipq4019' into clk-next

* clk-ipq4019:
  clk: qcom: Add IPQ4019 Global Clock Controller support

8 years agoclk: qcom: Add IPQ4019 Global Clock Controller support
Varadarajan Narayanan [Thu, 19 Nov 2015 23:19:29 +0000 (17:19 -0600)] 
clk: qcom: Add IPQ4019 Global Clock Controller support

This patch adds support for the global clock controller found on
the IPQ4019 based devices. This includes UART, I2C, SPI etc.

Signed-off-by: Pradeep Banavathi <pradeepb@codeaurora.org>
Signed-off-by: Senthilkumar N L <snlakshm@codeaurora.org>
Signed-off-by: Varadarajan Narayanan <varada@codeaurora.org>
Signed-off-by: Matthew McClintock <mmcclint@codeaurora.org>
Acked-by: Andy Gross <andy.gross@linaro.org>
[sboyd@codeaurora.org: Drop 0x16024 enable_reg in crypto_ahb]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: shmobile: Free 'clock' on error path
Stephen Boyd [Thu, 25 Feb 2016 20:18:25 +0000 (12:18 -0800)] 
clk: shmobile: Free 'clock' on error path

We forgot to free this clock when we return early in this code.

Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: sunxi: Add apb0 gates for H3
Krzysztof Adamski [Mon, 22 Feb 2016 13:03:25 +0000 (14:03 +0100)] 
clk: sunxi: Add apb0 gates for H3

This patch adds support for APB0 in H3. It seems to be compatible with
earlier SOCs. apb0 gates controls R_ block peripherals (R_PIO, R_IR,
etc).

Since this gates behave just like any Allwinner clock gate, add a generic
compatible that can be reused if we don't have any clock to protect.

Signed-off-by: Krzysztof Adamski <k@japko.eu>
[Maxime: Removed the H3 compatible from the simple-gates driver, reworked
         the commit log a bit]
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agoclk: samsung: exynos5433: Fix wrong registers of PCLK_GSCL_SMMU clocks
Jonghwa Lee [Wed, 6 May 2015 12:24:20 +0000 (21:24 +0900)] 
clk: samsung: exynos5433: Fix wrong registers of PCLK_GSCL_SMMU clocks

This fixes register assignment in the CLK_PCLK_SMMU_GSCL{1,2}
clocks definition.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
8 years agoclk: samsung: exynos5433: Fix mout_aclk_cam1*_user clocks definition
Sylwester Nawrocki [Fri, 6 Nov 2015 11:55:30 +0000 (12:55 +0100)] 
clk: samsung: exynos5433: Fix mout_aclk_cam1*_user clocks definition

Control bits for the ACLK_CAM1_552_USER and ACLK_CAM1_400_USER
mux clocks are in MUX_SEL_CAM10, not MUX_SEL_CAM01 register.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
8 years agoclk: samsung: exynos5433: Drop RO registers from the save/restore lists
Sylwester Nawrocki [Tue, 26 May 2015 10:55:50 +0000 (12:55 +0200)] 
clk: samsung: exynos5433: Drop RO registers from the save/restore lists

Restoring read-only registers is of not much effect, drop them
from the respective lists.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
8 years agoclk: samsung: exynos5433: Fix definitions of SCLK ISP SENSOR0 clocks
Marek Szyprowski [Tue, 21 Jul 2015 12:37:57 +0000 (14:37 +0200)] 
clk: samsung: exynos5433: Fix definitions of SCLK ISP SENSOR0 clocks

This fixes bit field offsets in the CMU_TOP CLK_DIV_SCLK_ISP_SENSOR_{A,B}
clock definitions.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
8 years agoclk: samsung: exynos5433: Fix definitions of MUX_SEL_CAM04 clocks
Sylwester Nawrocki [Wed, 27 May 2015 13:04:43 +0000 (15:04 +0200)] 
clk: samsung: exynos5433: Fix definitions of MUX_SEL_CAM04 clocks

This corrects assignment of bit offsets of the MUX_SEL_CAM04 register
to the respective mux clocks.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
8 years agoclk: shmobile: check for failure
Sudip Mukherjee [Tue, 23 Feb 2016 09:30:03 +0000 (15:00 +0530)] 
clk: shmobile: check for failure

We were not checking the return from devm_add_action() which can fail.
Start using the helper devm_add_action_or_reset() and return directly
as we know that the cleanup has been done by this helper.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: samsung: exynos5433: Fix typos in *_ISP_MPWM clock names
Sylwester Nawrocki [Wed, 18 Feb 2015 16:31:35 +0000 (17:31 +0100)] 
clk: samsung: exynos5433: Fix typos in *_ISP_MPWM clock names

This fixes "MPWM" -> "WPWM" typo in 3 *ISP_MWPM clock definitions.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
8 years agoclk: Update some outdated comments
Stephen Boyd [Mon, 22 Feb 2016 23:43:41 +0000 (15:43 -0800)] 
clk: Update some outdated comments

__clk_init() was renamed to __clk_core_init() but these comments
weren't updated.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoRevert "clk: avoid circular clock topology"
Stephen Boyd [Mon, 22 Feb 2016 23:01:39 +0000 (15:01 -0800)] 
Revert "clk: avoid circular clock topology"

This reverts commit 858d5881564026cbc4e6f5e25ae878a27df5d4c9.

Joachim reports that this commit breaks lpc18xx boot. This is
because the hardware has circular clk topology where PLLs can
feed into dividers and the same dividers can feed into the PLLs.
The hardware is designed this way so that you can choose to put
the divider before the PLL or after the PLL depending on what you
configure to be the parent of the divider and what you configure
to be the parent of the PLL.

So let's drop this patch for now because we have hardware that
actually has loops. A future patch could check for circular
parents when we change parents and fail the switch, but that's
probably best left to some debugging Kconfig option so that we
don't suffer the sanity checking cost all the time.

Reported-by: Joachim Eastwood <manabian@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: socfpga: allow for multiple parents on Arria10 periph clocks
Dinh Nguyen [Mon, 22 Feb 2016 21:52:46 +0000 (15:52 -0600)] 
clk: socfpga: allow for multiple parents on Arria10 periph clocks

There are some Arria10 clocks of type "altr,socfpga-a10-perip-clk" that can
have multiple parents. Fix up the __socfpga_periph_init() to call
of_clk_parent_fill() that will return the appropriate number of parents.

Also, update __socfpga_gate_init() to call of_clk_parent_fill() helper
function.

Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: ti: dpll: convert DPLL support code to use clk_hw instead of clk ptrs
Tero Kristo [Sat, 20 Feb 2016 11:24:26 +0000 (13:24 +0200)] 
clk: ti: dpll: convert DPLL support code to use clk_hw instead of clk ptrs

Convert DPLL support code to use clk_hw pointers for reference and bypass
clocks. This allows us to use clk_hw_* APIs for accessing any required
parameters for these clocks, avoiding some locking problems at least with
DPLL enable code; this used clk_get_rate which uses mutex but isn't
good under clk_enable / clk_disable.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoMerge branch 'clk-fixes' into clk-next
Stephen Boyd [Mon, 22 Feb 2016 22:16:24 +0000 (14:16 -0800)] 
Merge branch 'clk-fixes' into clk-next

* clk-fixes:
  clk: ti: omap3+: dpll: use non-locking version of clk_get_rate

8 years agoclk: qcom: msm8960: fix ce3_core clk enable register
Srinivas Kandagatla [Mon, 22 Feb 2016 11:43:39 +0000 (11:43 +0000)] 
clk: qcom: msm8960: fix ce3_core clk enable register

This patch corrects the enable register offset which is actually 0x36cc
instead of 0x36c4

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Fixes: 5f775498bdc4 ("clk: qcom: Fully support apq8064 global clock control")
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: ti: omap3+: dpll: use non-locking version of clk_get_rate
Tero Kristo [Sat, 20 Feb 2016 11:12:57 +0000 (13:12 +0200)] 
clk: ti: omap3+: dpll: use non-locking version of clk_get_rate

As the code in this file is being executed within irq context in some
cases, we must avoid the clk_get_rate which uses mutex internally.
Switch the code to use clk_hw_get_rate instead which is non-locking.

This fixes an issue where PM runtime will hang the system if enabled
with a serial console before a suspend-resume cycle.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Tested-by: Tony Lindgren <tony@atomide.com>
Fixes: a53ad8ef3dcc ("clk: ti: Convert to clk_hw based provider APIs")
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoMerge branch 'clk-samsung' into clk-next
Michael Turquette [Mon, 22 Feb 2016 18:24:40 +0000 (10:24 -0800)] 
Merge branch 'clk-samsung' into clk-next

8 years agoclk: samsung: Don't build ARMv8 clock drivers on ARMv7
Krzysztof Kozlowski [Tue, 16 Feb 2016 06:20:31 +0000 (15:20 +0900)] 
clk: samsung: Don't build ARMv8 clock drivers on ARMv7

Currently the Exynos5433 (ARMv8 SoC) clock driver depends on ARCH_EXYNOS
so it is built also on ARMv7. This does not bring any kind of benefit.
There won't be a single kernel image for ARMv7 and ARMv8 SoCs (like
multi_v7 for ARMv7).

Instead build clock drivers only for respective SoC's architecture.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
8 years agoclk: sunxi: Improve divs_clk error handling and reporting
Andre Przywara [Tue, 16 Feb 2016 10:46:08 +0000 (10:46 +0000)] 
clk: sunxi: Improve divs_clk error handling and reporting

We catch errors in the base clock registration, failure to ioremap
and failures in the final of_clk_add_provider() call.
Also we unmap the registers when we need to rollback.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agoclk: sunxi: improve divider_clk error handling and reporting
Andre Przywara [Tue, 16 Feb 2016 10:46:07 +0000 (10:46 +0000)] 
clk: sunxi: improve divider_clk error handling and reporting

We now report a failing ioremap, failing output names parsing,
failures in table registration and in the final step.
Also there was a bug where clk_register_divider_table() would return
an ERR_PTR value instead of NULL, which we were checking for.
We now implement proper rollback in case of an error.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agoclk: sunxi: improve mux_clk error handling and reporting
Andre Przywara [Tue, 16 Feb 2016 10:46:06 +0000 (10:46 +0000)] 
clk: sunxi: improve mux_clk error handling and reporting

We now catch and report a failing ioremap, also a failure in the final
step of the clock registration is now handled and reported.
Also warnings are turned into errors.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agoMerge branch 'clk-shmobile-for-v4.6' of git://git.kernel.org/pub/scm/linux/kernel...
Michael Turquette [Fri, 19 Feb 2016 17:46:31 +0000 (09:46 -0800)] 
Merge branch 'clk-shmobile-for-v4.6' of git://git./linux/kernel/git/geert/renesas-drivers into clk-next

8 years agoMerge branch 'clk-fixes' into clk-next
Stephen Boyd [Fri, 19 Feb 2016 03:17:29 +0000 (19:17 -0800)] 
Merge branch 'clk-fixes' into clk-next

* clk-fixes:
  clk: gpio: Really allow an optional clock= DT property
  Revert "clk: qcom: Specify LE device endianness"

8 years agoclk: gpio: Really allow an optional clock= DT property
Stephen Boyd [Fri, 19 Feb 2016 03:07:44 +0000 (19:07 -0800)] 
clk: gpio: Really allow an optional clock= DT property

We mis-merged the original patch from Russell here and so the
patch went almost all the way, except that we still failed to
probe when there wasn't a clocks property in the DT node. Allow
that case by making a negative value from
of_clk_get_parent_count() into "no parents", like the original
patch did.

Fixes: 7ed88aa2efa5 ("clk: fix clk-gpio.c with optional clock= DT property")
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Michael Turquette <mturquette@baylibre.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: imx: correct pwm7 clock name in driver for i.MX6UL
Anatolij Gustschin [Wed, 17 Feb 2016 18:48:19 +0000 (19:48 +0100)] 
clk: imx: correct pwm7 clock name in driver for i.MX6UL

Don't capitalize p in the pwm7 clock name.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
8 years agoclk: shmobile: r8a7795: Add INTC-EX clock
Magnus Damm [Thu, 18 Feb 2016 07:14:03 +0000 (16:14 +0900)] 
clk: shmobile: r8a7795: Add INTC-EX clock

Add the "intc-ex" clock to the r8a7795 CPG MSSR driver.

According to information from the hardware team the INTC-EX
parent clock is CP. The next data sheet version will include
this information.

Signed-off-by: Magnus Damm <damm+renesas@opensource.se>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
8 years agoclk: Make of_clk_get_from_provider() available to modules
Andrew F. Davis [Fri, 12 Feb 2016 18:50:16 +0000 (12:50 -0600)] 
clk: Make of_clk_get_from_provider() available to modules

Export symbol of_clk_get_from_provider so it can be used in
loadable kernel modules

Signed-off-by: Andrew F. Davis <afd@ti.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
8 years agoclk: samsung: Enable COMPILE_TEST for Samsung clocks
Krzysztof Kozlowski [Tue, 16 Feb 2016 06:20:30 +0000 (15:20 +0900)] 
clk: samsung: Enable COMPILE_TEST for Samsung clocks

Enable the COMPILE_TEST to get build coverage of some of Samsung clock
controller drivers. Still some of them will be built only if
appropriate SoC is chosen (like SOC_EXYNOS4415 or ARCH_S3C64XX).

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Andi Shyti <andi.shyti@samsung.com>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
8 years agoMerge branch 'clk-bcm2835' into clk-next
Michael Turquette [Tue, 16 Feb 2016 20:31:51 +0000 (12:31 -0800)] 
Merge branch 'clk-bcm2835' into clk-next

8 years agoclk: bcm2835: Reuse CLK_DIVIDER_MAX_AT_ZERO for recalc_rate()
Eric Anholt [Tue, 16 Feb 2016 03:03:58 +0000 (19:03 -0800)] 
clk: bcm2835: Reuse CLK_DIVIDER_MAX_AT_ZERO for recalc_rate()

We were rolling this ourselves, but clk-divider can do it now.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
8 years agoclk: bcm2835: Fix setting of PLL divider clock rates
Eric Anholt [Tue, 16 Feb 2016 03:03:57 +0000 (19:03 -0800)] 
clk: bcm2835: Fix setting of PLL divider clock rates

Our dividers weren't being set successfully because CM_PASSWORD wasn't
included in the register write.  It looks easier to just compute the
divider to write ourselves than to update clk-divider for the ability
to OR in some arbitrary bits on write.

Fixes about half of the video modes on my HDMI monitor (everything
except 720x400).

Cc: stable@vger.kernel.org
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
8 years agoclk: sunxi: Fix sun8i-a23-apb0-clk divider flags
Chen-Yu Tsai [Mon, 15 Feb 2016 09:40:19 +0000 (17:40 +0800)] 
clk: sunxi: Fix sun8i-a23-apb0-clk divider flags

The APB0 clock on A23 is a zero-based divider, not a power-of-two based
divider.

Note that this patch does not apply cleanly to kernels before 4.5-rc1,
which added CLK_OF_DECLARE support to this driver.

Fixes: 57a1fbf28424 ("clk: sunxi: Add A23 APB0 divider clock support")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agoclk: shmobile: cpg-mssr: Update serial port clock in example
Geert Uytterhoeven [Tue, 20 Oct 2015 08:21:49 +0000 (10:21 +0200)] 
clk: shmobile: cpg-mssr: Update serial port clock in example

Cfr. commit a9ec81f4ed5c05db ("serial: sh-sci: Drop the interface
clock").

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Michael Turquette <mturquette@baylibre.com>
8 years agoMerge tag 'v4.6-rockchip-clk1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind...
Michael Turquette [Mon, 15 Feb 2016 19:59:45 +0000 (11:59 -0800)] 
Merge tag 'v4.6-rockchip-clk1' of git://git./linux/kernel/git/mmind/linux-rockchip into clk-next

Introduction of a factor type and a variant containing a gate
to be able to also declare factor clocks in their correct
place in the clock tree instead of having to register factor
clocks in the init callback separately. And as always some more
clock-ids and non-regression fixes for mistakes introduced in
past kernel releases.

8 years agoclk: imx: Add clock support for imx6qp
Bai Ping [Tue, 2 Feb 2016 10:01:34 +0000 (18:01 +0800)] 
clk: imx: Add clock support for imx6qp

most of the clock tree structures on i.MX6 Quad Plus are
same as on i.MX6Q. there still some differences between
these two SOCs. compared to the i.XM6Q, the differents of
clocks on i.MX6QP is mainly on:

1. New clock gate added to support the PRE and PRG modules
2. 24MHz OSC clock option added to the UART, IPG, ECSPI, and
   CAN clock roots.
3. MMDC channel 1 clock gate is now controllable.
4. clock gating added to the LDB_DIx_IPU clocks on i.MX6QP
5. EMI clock root divider fix
6. other updates fo CSCMRx, CSCDRx and CS2CDR registers.

detailed infomation, please refer to the i.MX6QP RM.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
8 years agoRevert "clk: qcom: Specify LE device endianness"
Stephen Boyd [Fri, 12 Feb 2016 17:21:13 +0000 (09:21 -0800)] 
Revert "clk: qcom: Specify LE device endianness"

This reverts commit 329cabcecf94d8d7821e729dda284ba9dec44c87.

The commit that caused us to specify LE device endianness here,
29bb45f25ff3 (regmap-mmio: Use native endianness for read/write,
2015-10-29), has been reverted in mainline so now when we specify
LE it actively breaks big endian kernels because the byte
swapping in regmap-mmio is incorrect. Let's revert this change
because it will 1) fix the big endian kernels and 2) be redundant
to specify LE because that will become the default soon.

Cc: Kevin Hilman <khilman@linaro.org>
Tested-by: Kevin Hilman <khilman@baylibre.com>
Cc: Mark Brown <broonie@kernel.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: qcom: mmcc8974: Use gdscs .parent and remove genpd calls
Rajendra Nayak [Tue, 1 Dec 2015 16:12:16 +0000 (21:42 +0530)] 
clk: qcom: mmcc8974: Use gdscs .parent and remove genpd calls

With gdsc driver capable of handling hierarchical power domains,
specify oxili_gdsc as parent of oxilicx_gdsc.

Remove all direct calls to genpd from the mmcc clock driver. The
adding and removing of subdomains is now handled from within
the gdsc driver.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: qcom: gdsc: Add mmcc gdscs for msm8996 family
Rajendra Nayak [Tue, 1 Dec 2015 16:12:15 +0000 (21:42 +0530)] 
clk: qcom: gdsc: Add mmcc gdscs for msm8996 family

Add all gdsc data which are part of mmcc on msm8996 family

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: qcom: gdsc: Add GDSCs in msm8996 GCC
Rajendra Nayak [Tue, 1 Dec 2015 16:12:14 +0000 (21:42 +0530)] 
clk: qcom: gdsc: Add GDSCs in msm8996 GCC

Add all data for the GDSCs which are part of msm8996 GCC block

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: qcom: gdsc: Add support for votable gdscs
Rajendra Nayak [Tue, 1 Dec 2015 16:12:13 +0000 (21:42 +0530)] 
clk: qcom: gdsc: Add support for votable gdscs

Some gdscs might be controlled via voting registers and might not
really disable when the kernel intends to disable them (due to other
votes keeping them enabled)
Mark these gdscs with a flag for we do not check/wait on a disable
status for these gdscs within the kernel disable callback.

Also at boot, if these GDSCs are found to be ON, we make sure we
vote for them before we inform the genpd framework about their
status. If genpd gets no users, it then disables (removes the vote)
them as part of genpd_poweroff_unused()

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: qcom: gdsc: Add support for gdscs with gds hw controller
Rajendra Nayak [Tue, 1 Dec 2015 16:12:12 +0000 (21:42 +0530)] 
clk: qcom: gdsc: Add support for gdscs with gds hw controller

Some gdsc power domains can have a gds_hw_controller block inside
to help ensure all slave devices within the power domain are idle
before the gdsc is actually switched off.
This is mainly useful in power domains which host a MMU, in which
case its necessary to make sure there are no outstanding MMU operations
or pending bus transactions before the power domain is turned off.

In gdscs with gds_hw_controller block, its necessary to check the
gds_hw_ctrl status bits instead of the ones in gdscr, to determine
the state of the powerdomain.

While at it, also move away from using jiffies and use ktime APIs
instead for busy looping on status bits.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: qcom: gdsc: Add support for hierarchical power domains
Rajendra Nayak [Tue, 1 Dec 2015 16:12:11 +0000 (21:42 +0530)] 
clk: qcom: gdsc: Add support for hierarchical power domains

Some qcom SoCs' can have hierarchical power domains. Let the gdsc structs
specify the parents (if any) and the driver add genpd subdomains for them.

Signed-off-by: Rajendra Nayak <rnayak@codeaurora.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: sunxi: Remove clk_register_clkdev calls
Maxime Ripard [Tue, 2 Feb 2016 08:37:15 +0000 (09:37 +0100)] 
clk: sunxi: Remove clk_register_clkdev calls

Now that our protection code doesn't use the global name lookup anymore, we
can remove the clkdev registrations.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agoclk: sunxi: Remove old probe and protection code
Maxime Ripard [Tue, 2 Feb 2016 08:07:37 +0000 (09:07 +0100)] 
clk: sunxi: Remove old probe and protection code

Now that we don't have any user left for the old registration code, we can
remove it.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agoclk: sunxi: convert current clocks registration to CLK_OF_DECLARE
Maxime Ripard [Tue, 2 Feb 2016 08:07:22 +0000 (09:07 +0100)] 
clk: sunxi: convert current clocks registration to CLK_OF_DECLARE

The current clock registration and protection code has a few drawbacks, the
two main ones being that we create a lot of orphans clock in the
registration phase, which will be troublesome when we will start being less
relaxed about them.

The protection code also relies on clkdev, which we don't really use but
for this particular case.

Fix both at the same time by moving everyone to the CLK_OF_DECLARE that
will probe our clock tree in the right and thus avoid orphans, and by
protecting directly the clock returned by our registration function.

Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agoclk: sunxi: Make clocks setup functions take const pointer
Maxime Ripard [Tue, 2 Feb 2016 08:47:11 +0000 (09:47 +0100)] 
clk: sunxi: Make clocks setup functions take const pointer

All the data structure that we pass to the clocks setup functions are
declared const, while our setup functions expects a regular pointer. This
was hidden by the fact that we cast a void * pointer back to these
structures, which made it go unnoticed.

Fix the functions prototype.

Acked-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agoclk: sunxi: Make clocks setup functions return their clock
Maxime Ripard [Tue, 2 Feb 2016 08:47:10 +0000 (09:47 +0100)] 
clk: sunxi: Make clocks setup functions return their clock

The clocks registration code in clk-sunxi was most of the time not
returning the struct clk (or struct clk array) that was registered,
preventing the users of such functions to manipulate it, for example to
protect it.

Make them return it so that we can start using it.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
8 years agoclk: lpc32xx: add HCLK PLL output configuration
Sylvain Lemieux [Wed, 10 Feb 2016 18:52:32 +0000 (13:52 -0500)] 
clk: lpc32xx: add HCLK PLL output configuration

This patch add the support to setup the HCLK PLL output
using the "assigned-clock-rates" parameter in the device tree.

If the option is not use, the clock setup by the kickstart
and/or bootloader remain unchanged.

The previous kernel version did not change the clock frequency
output setup by the kickstart and/or bootloader;
this version always setup the clock frequency output to 208MHz.

Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoMerge branch 'clk-fixes' into clk-next
Stephen Boyd [Wed, 10 Feb 2016 20:44:33 +0000 (12:44 -0800)] 
Merge branch 'clk-fixes' into clk-next

* clk-fixes:
  clk: versatile: mask VCO bits before writing

8 years agoclk: versatile: mask VCO bits before writing
Linus Walleij [Wed, 3 Feb 2016 13:47:08 +0000 (14:47 +0100)] 
clk: versatile: mask VCO bits before writing

The Versatile syscon ICST driver OR:s the bits into place but
forgets to mask the previous value, making the code only work
if the register is zero or giving haphazard results. Mask the
19 bits used by the Versatile syscon interface register.

Regression caused and now fixed by yours truly.

Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: linux-clk@vger.kernel.org
Fixes: 179c8fb3c2a6 ("clk: versatile-icst: convert to use regmap")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: lpc32xx: do not register clock "0"
Sylvain Lemieux [Tue, 9 Feb 2016 18:29:10 +0000 (13:29 -0500)] 
clk: lpc32xx: do not register clock "0"

The following errors are display in the console during the power-on:
[    0.000000] lpc32xx_usb_clk_init: failed to register (null) clock: -12
[    0.000000] lpc32xx_clk_init: failed to register (null) clock: -12

There is no need to register clock "0"; the first clock used is 1;

Signed-off-by: Sylvain Lemieux <slemieux@tycoint.com>
Acked-by: Vladimir Zapolskiy <vz@mleia.com>
[sboyd@codeaurora.org: s/prepare/register/]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: fix __clk_init_parent() for single parent clocks
Masahiro Yamada [Tue, 9 Feb 2016 11:19:14 +0000 (20:19 +0900)] 
clk: fix __clk_init_parent() for single parent clocks

Before commit b3d192d5121f ("clk: simplify __clk_init_parent()"),
__clk_init_parent() called .get_parent() only for multi-parent
clocks.  That commit changed the behavior to call .get_parent()
if available even for single-parent clocks and root clocks.

It turned out a problem because there are some single-parent clocks
that implement .get_parent() callback and return non-zero index.
The SOCFPGA clock is the case; the commit broke the SOCFPGA boards.

To keep the original behavior, invoke .get_parent() only when
num_parents is greater than 1.

Fixes: b3d192d5121f ("clk: simplify __clk_init_parent()")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reported-by: Dinh Nguyen <dinguyen@opensource.altera.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: qcom: common: check for failure
Sudip Mukherjee [Wed, 23 Dec 2015 12:27:20 +0000 (17:57 +0530)] 
clk: qcom: common: check for failure

We were not checking the return from devm_add_action() which can fail.
Start using the helper and devm_add_action_or_reset() and return
directly as we know that the cleanup has been done by this helper.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agodevm: add helper devm_add_action_or_reset()
Sudip Mukherjee [Wed, 23 Dec 2015 12:27:19 +0000 (17:57 +0530)] 
devm: add helper devm_add_action_or_reset()

Add a helper function devm_add_action_or_reset() which will internally
call devm_add_action(). But if devm_add_action() fails then it will
execute the action mentioned and return the error code.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: meson: Fix meson_clk_register_clks() signature type mismatch
Andreas Färber [Sun, 7 Feb 2016 21:13:03 +0000 (22:13 +0100)] 
clk: meson: Fix meson_clk_register_clks() signature type mismatch

As preparation for arm64 based mesongxbb, which pulls in this code once
enabling ARCH_MESON, fix a size_t vs. unsigned int type mismatch.
The loop uses a local unsigned int variable, so adopt that type,
matching the header.

Fixes: 7a29a869434e ("clk: meson: Add support for Meson clock controller")
Signed-off-by: Andreas Färber <afaerber@suse.de>
Acked-by: Carlo Caione <carlo@endlessm.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: socfpga: fix __init annotation
Arnd Bergmann [Mon, 8 Feb 2016 14:39:09 +0000 (15:39 +0100)] 
clk: socfpga: fix __init annotation

clang found a bug with the __socfpga_pll_init definition:

drivers/clk/socfpga/clk-pll-a10.c:77:15: error: '__section__' attribute only applies to functions and
      global variables

This moves the __init annotation to the right place so the function
actually gets discarded.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agodrivers/clk/Kconfig: Move the TI CDCE chips close together
Mike Looijmans [Tue, 3 Nov 2015 11:55:54 +0000 (12:55 +0100)] 
drivers/clk/Kconfig: Move the TI CDCE chips close together

There are two TI CDCE clock chips in this file. Move them close
together so they're easier to find.

No functional change, just cosmetic.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
[sboyd@codeaurora.org: Alphabetize]
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agodrivers/clk/Kconfig: Fix typo "Sypport" instead of "Support"
Mike Looijmans [Tue, 3 Nov 2015 11:55:53 +0000 (12:55 +0100)] 
drivers/clk/Kconfig: Fix typo "Sypport" instead of "Support"

Simple cosmetic fix.

Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoMerge branch 'clk-fixes' into clk-next
Stephen Boyd [Mon, 8 Feb 2016 22:01:10 +0000 (14:01 -0800)] 
Merge branch 'clk-fixes' into clk-next

* clk-fixes:
  clk: tegra: super: Fix sparse warnings for functions not declared as static
  clk: tegra: Fix sparse warnings for functions not declared as static
  clk: tegra: Fix sparse warning for pll_m
  clk: tegra: Use definition for pll_u override bit
  clk: tegra: Fix warning caused by pll_u failing to lock
  clk: tegra: Fix clock sources for Tegra210 EMC
  clk: tegra: Add the APB2APE audio clock on Tegra210
  clk: tegra: Add missing of_node_put()
  clk: tegra: Fix PLLE SS coefficients
  clk: tegra: Fix typos around clearing PLLE bits during enable
  clk: tegra: Do not disable PLLE when under hardware control
  clk: tegra: Fix pllx dyn step calculation
  clk: tegra: pll: Fix potential sleeping-while-atomic
  clk: tegra: Fix the misnaming of nvenc from msenc
  clk: tegra: Fix naming of MISC registers
  clk: tegra: Remove improper flags for lock_enable
  clk: tegra: Fix divider on VI_I2C

8 years agoMerge tag 'tegra-for-4.5-clk-fixes' of git://git.kernel.org/pub/scm/linux/kernel...
Stephen Boyd [Mon, 8 Feb 2016 21:50:32 +0000 (13:50 -0800)] 
Merge tag 'tegra-for-4.5-clk-fixes' of git://git./linux/kernel/git/tegra/linux into clk-fixes

Pull tegra fixes from Thierry Reding:

clk: tegra: Fixes for v4.5-rc3

This set contains a bunch of miscellaneous fixes that have accumulated
over the past couple of weeks, primarily for the Tegra210 support added
in v4.5-rc1.

* tag 'tegra-for-4.5-clk-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
  clk: tegra: super: Fix sparse warnings for functions not declared as static
  clk: tegra: Fix sparse warnings for functions not declared as static
  clk: tegra: Fix sparse warning for pll_m
  clk: tegra: Use definition for pll_u override bit
  clk: tegra: Fix warning caused by pll_u failing to lock
  clk: tegra: Fix clock sources for Tegra210 EMC
  clk: tegra: Add the APB2APE audio clock on Tegra210
  clk: tegra: Add missing of_node_put()
  clk: tegra: Fix PLLE SS coefficients
  clk: tegra: Fix typos around clearing PLLE bits during enable
  clk: tegra: Do not disable PLLE when under hardware control
  clk: tegra: Fix pllx dyn step calculation
  clk: tegra: pll: Fix potential sleeping-while-atomic
  clk: tegra: Fix the misnaming of nvenc from msenc
  clk: tegra: Fix naming of MISC registers
  clk: tegra: Remove improper flags for lock_enable
  clk: tegra: Fix divider on VI_I2C

8 years agoclk: shmobile: r8a7795: Add USB-DMAC clocks
Yoshihiro Shimoda [Mon, 1 Feb 2016 11:29:05 +0000 (20:29 +0900)] 
clk: shmobile: r8a7795: Add USB-DMAC clocks

Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
8 years agoclk: shmobile: r8a7795: Add SD divider support
Dirk Behme [Sat, 30 Jan 2016 06:33:59 +0000 (07:33 +0100)] 
clk: shmobile: r8a7795: Add SD divider support

This patch adds SD[0..3] clock divider support for R-Car Gen3 SoC.

Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
8 years agoclk: provider: Remove of_gpio_{gate,mux}_clk_setup() prototypes
Stephen Boyd [Sun, 7 Feb 2016 07:34:55 +0000 (23:34 -0800)] 
clk: provider: Remove of_gpio_{gate,mux}_clk_setup() prototypes

These functions either never existed or were only used in
OF_CLK_DECLARE() macros. Remove the dead prototypes.

Cc: Jyri Sarha <jsarha@ti.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: Deprecate CLK_IS_ROOT
Stephen Boyd [Wed, 3 Feb 2016 01:24:56 +0000 (17:24 -0800)] 
clk: Deprecate CLK_IS_ROOT

We don't use CLK_IS_ROOT but in a few places in the common clk
framework core. Let's replace those checks with a check for the
number of parents a clk has instead of the flag, freeing up one
flag for something else. We don't remove the flag yet so that
things keep building, but we'll remove it once all drivers have
removed their flag usage.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: gpio: Make into a platform driver
Stephen Boyd [Wed, 3 Feb 2016 01:09:26 +0000 (17:09 -0800)] 
clk: gpio: Make into a platform driver

clk_get() for DT based clks already returns EPROBE_DEFER when the
OF clk provider is not present. So having all this code in the
clk provider to return EPROBE_DEFER when the gpio isn't ready yet
can be replaced with a platform driver that doesn't add the clk
provider until the gpio can be requested. Get rid of the
OF_CLK_DECLARE and convert this to a platform driver instead.

Tested-by: Jyri Sarha <jsarha@ti.com>
Cc: Sergej Sawazki <ce3a@gmx.de>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Fabio Estevam <fabio.estevam@freescale.com>
Cc: Jon Nettleton <jon@solid-run.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
8 years agoclk: rockchip: convert manually created factor clocks to the new type
Heiko Stuebner [Sat, 20 Jun 2015 14:06:02 +0000 (16:06 +0200)] 
clk: rockchip: convert manually created factor clocks to the new type

Clean up the init code and move the creation of factor clocks to the
appropriate positions coming from the clock architecture diagrams.

This also unifies the artificial separation of the hclk_vcodec etc clocks
again.

We do keep the separate definition of some watchdog and usb480m pseudo
clocks for now, as they're not real factor clocks from the clock-tree
but placeholders for fixes to come (usb480m gets supplied by the
missing driver for the new usbphy type and the watchdog-gate is sitting
somewhere else together which we cannot model currently).

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
8 years agoclk: rockchip: add a factor clock type
Heiko Stuebner [Sat, 20 Jun 2015 11:08:57 +0000 (13:08 +0200)] 
clk: rockchip: add a factor clock type

Add a clock type for fixed factor clocks. This allows us to define fixed
factor clocks where they appear in the clock hierarchy instead of in the
init function.

The additional factor_gate type, finally allows us to model some last
parts of the clock tree correctly.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
This page took 0.059619 seconds and 5 git commands to generate.