20 Apr, 2016
1 commit
-
Add registration APIs in the clk gate code to return struct
clk_hw pointers instead of struct clk pointers. This way we hide
the struct clk pointer from providers unless they need to use
consumer facing APIs.Signed-off-by: Stephen Boyd
30 Jan, 2016
1 commit
-
to_clk_*(_hw) macros have been repeatedly defined in many places.
This patch moves all the to_clk_*(_hw) definitions in the common
clock framework to public header clk-provider.h, and drop the local
definitions.Signed-off-by: Geliang Tang
Signed-off-by: Stephen Boyd
29 Jul, 2015
1 commit
-
The basic clock types use conditional locking for the register
accessor spinlocks. Add __acquire() and __release() markings in
the right locations so that sparse isn't tripped up on the
conditional locking.drivers/clk/clk-mux.c:68:12: warning: context imbalance in 'clk_mux_set_parent' - different lock contexts for basic block
drivers/clk/clk-divider.c:379:12: warning: context imbalance in 'clk_divider_set_rate' - different lock contexts for basic block
drivers/clk/clk-gate.c:71:9: warning: context imbalance in 'clk_gate_endisable' - different lock contexts for basic block
drivers/clk/clk-fractional-divider.c:36:9: warning: context imbalance in 'clk_fd_recalc_rate' - different lock contexts for basic block
drivers/clk/clk-fractional-divider.c:68:12: warning: context imbalance in 'clk_fd_set_rate' - different lock contexts for basic blockCc: Andy Shevchenko
Signed-off-by: Stephen Boyd
15 May, 2015
1 commit
-
Printing an error on kmalloc() failures is unnecessary. Remove
the print and use *ptr in sizeof() for future-proof code.Signed-off-by: Stephen Boyd
21 Jan, 2015
1 commit
-
In case CLK_GATE_HIWORD_MASK flag is passed to clk_register_gate(), the bit #
should be no higher than 15, however the corresponding check is obviously off-
by-one.Fixes: 045779942c04 ("clk: gate: add CLK_GATE_HIWORD_MASK")
Signed-off-by: Sergei Shtylyov
Signed-off-by: Michael Turquette
18 Jan, 2015
1 commit
-
The common clk_register_{divider,gate,mux} functions allocated memory
for internal data which wasn't freed anywhere. Drivers using these
helpers could only unregister clocks but the memory would still leak.Add corresponding unregister functions which will release all resources.
Signed-off-by: Krzysztof Kozlowski
Reviewed-by: Stephen Boyd
Signed-off-by: Michael Turquette
28 Sep, 2014
1 commit
-
Setting 'flags' to zero will be certainly a misleading way to avoid
warning of 'flags' may be used uninitialized. uninitialized_var is
a correct way because the warning is a false possitive.Signed-off-by: Xiubo Li
Signed-off-by: Mike Turquette
28 Aug, 2013
1 commit
-
the common clock drivers were motivated/initiated by ARM development
and apparently assume little endian peripheralswrap register/peripherals access in the common code (div, gate, mux)
in preparation of adding COMMON_CLK support for other platformsSigned-off-by: Gerhard Sittig
Signed-off-by: Mike Turquette
17 Aug, 2013
1 commit
-
These registration calls may be used by loadable modules. Export them.
Signed-off-by: Mike Turquette
16 Jun, 2013
1 commit
-
In Rockchip Cortex-A9 based chips, they don't use paradigm of
reading-changing-writing the register contents. Instead they
use a hiword mask to indicate the changed bits.When b1 should be set as gate, it also needs to indicate the change
by setting hiword mask (b1 << 16).The patch adds gate flag for this usage.
Signed-off-by: Heiko Stuebner
Signed-off-by: Haojian Zhuang
Signed-off-by: Mike Turquette
12 Jul, 2012
1 commit
-
Most platforms end up using a mix of basic clock types and
some which use clk_hw_foo struct for filling in custom platform
information when the clocks don't fit into basic types supported.In platform code, its useful to know if a clock is using a basic
type or clk_hw_foo, which helps platforms know if they can
safely use to_clk_hw_foo to derive the clk_hw_foo pointer from
clk_hw.Mark all basic clocks with a CLK_IS_BASIC flag.
Signed-off-by: Rajendra Nayak
Signed-off-by: Mike Turquette
02 May, 2012
1 commit
-
Create a struct clk_init_data to hold all data that needs to be passed from
the platfrom specific driver to the common clock framework during clock
registration. Add a pointer to this struct inside clk_hw.This has several advantages:
* Completely hides struct clk from many clock platform drivers and static
clock initialization code that don't care for static initialization of
the struct clks.
* For platforms that want to do complete static initialization, it removed
the need to directly mess with the struct clk's fields while still
allowing to statically allocate struct clk. This keeps the code more
future proof even if they include clk-private.h.
* Simplifies the generic clk_register() function and allows adding optional
fields in the future without modifying the function signature.
* Simplifies the static initialization of clocks on all platforms by
removing the need for forward delcarations or convoluted macros.Signed-off-by: Saravana Kannan
[mturquette@linaro.org: kept DEFINE_CLK_* macros and __clk_init]
Signed-off-by: Mike Turquette
Cc: Andrew Lunn
Cc: Rob Herring
Cc: Russell King
Cc: Jeremy Kerr
Cc: Thomas Gleixner
Cc: Arnd Bergman
Cc: Paul Walmsley
Cc: Shawn Guo
Cc: Sascha Hauer
Cc: Jamie Iles
Cc: Richard Zhao
Cc: Saravana Kannan
Cc: Magnus Damm
Cc: Mark Brown
Cc: Linus Walleij
Cc: Stephen Boyd
Cc: Amit Kucheria
Cc: Deepak Saxena
Cc: Grant Likely
25 Apr, 2012
4 commits
-
This patch tries to remove duplicate code for clk_gate clocks. This creates
another routine clk_gate_endisable() which will take care of enable/disable
clock with knowledge of CLK_GATE_SET_TO_DISABLE flag.It works on following logic:
For enabling clock, enable = 1
set2dis = 1 -> clear bit -> set = 0
set2dis = 0 -> set bit -> set = 1For disabling clock, enable = 0
set2dis = 1 -> set bit -> set = 1
set2dis = 0 -> clear bit -> set = 0So, result is always: enable xor set2dis.
Signed-off-by: Viresh Kumar
Signed-off-by: Mike Turquette -
This patch is the basic clk version of 'clk: core: copy parent_names &
return error codes'.The registration functions are changed to allow the core code to copy
the array of strings and allow platforms to declare those arrays as
__initdata.This patch also converts all of the basic clk registration functions to
return error codes which better aligns them with the existing clk.h api.Signed-off-by: Mike Turquette
-
The clk_ops of basic clks should have "const" to match the definition
in "struct clk" and clk_register prototype.Signed-off-by: Shawn Guo
Signed-off-by: Mike Turquette -
It makes no sense to have EXPORT_SYMBOL_GPL on static functions.
Signed-off-by: Shawn Guo
Signed-off-by: Mike Turquette
17 Mar, 2012
1 commit
-
Many platforms support simple gateable clocks, fixed-rate clocks,
adjustable divider clocks and multi-parent multiplexer clocks.This patch introduces basic clock types for the above-mentioned hardware
which share some common characteristics.Based on original work by Jeremy Kerr and contribution by Jamie Iles.
Dividers and multiplexor clocks originally contributed by Richard Zhao &
Sascha Hauer.Signed-off-by: Mike Turquette
Signed-off-by: Mike Turquette
Reviewed-by: Andrew Lunn
Tested-by: Andrew Lunn
Reviewed-by: Rob Herring
Cc: Russell King
Cc: Jeremy Kerr
Cc: Thomas Gleixner
Cc: Arnd Bergman
Cc: Paul Walmsley
Cc: Shawn Guo
Cc: Sascha Hauer
Cc: Jamie Iles
Cc: Richard Zhao
Cc: Saravana Kannan
Cc: Magnus Damm
Cc: Mark Brown
Cc: Linus Walleij
Cc: Stephen Boyd
Cc: Amit Kucheria
Cc: Deepak Saxena
Cc: Grant Likely
Signed-off-by: Arnd Bergmann