summaryrefslogtreecommitdiff
path: root/include/linux/clkdev.h
AgeCommit message (Collapse)AuthorFilesLines
2015-05-06clkdev: add clkdev_create() helperRussell King1-0/+3
Add a helper to allocate and add a clk_lookup structure. This can not only be used in several places in clkdev.c to simplify the code, but more importantly, can be used by callers of the clkdev code to simplify their clkdev creation and registration. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-05-06clkdev: const-ify connection id to clk_add_alias()Russell King1-1/+1
The connection id is only passed to clk_get() which is already const. Const-ify this argument too. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2015-05-06clkdev: use clk_hw internallyRussell King1-0/+1
clk_add_alias() calls clk_get() followed by clk_put() but in between those two calls it saves away the struct clk pointer to a clk_lookup structure. This leaves the 'clk' member of the clk_lookup pointing at freed memory on configurations where CONFIG_COMMON_CLK=y. This is a problem because clk_get_sys() will eventually try to dereference the freed pointer by calling __clk_get_hw() on it. Fix this by saving away the struct clk_hw pointer instead of the struct clk pointer so that when we try to create a per-user struct clk in clk_get_sys() we don't dereference a junk pointer. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-12-04clk: Add common __clk_get(), __clk_put() implementationsSylwester Nawrocki1-0/+5
This patch adds common __clk_get(), __clk_put() clkdev helpers that replace their platform specific counterparts when the common clock API is used. The owner module pointer field is added to struct clk so a reference to the clock supplier module can be taken by the clock consumers. The owner module is assigned while the clock is being registered, in functions _clk_register() and __clk_register(). Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
2012-05-02CLKDEV: provide helpers for common clock frameworkRussell King1-0/+3
The common clock framework allocates clocks dynamically. Provide a set of helpers to streamline the clkdev registration of the clock lookups to avoid repetitive code sequences. Reviewed-by: Viresh Kumar <viresh.kumar@st.com> Tested-by: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2011-10-13ARM: 7131/1: clkdev: Add Common Macro for clk_lookupPadmavathi Venna1-0/+7
Added a standardized macro CLKDEV_INIT which can used across all the platforms to support clkdev Suggested-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Kukjin Kim <kgene.kim@samsung.com> Signed-off-by: Padmavathi Venna <padma.v@samsung.com> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2010-11-26ARM: 6483/1: arm & sh: factorised duplicated clkdev.cJean-Christop PLAGNIOL-VILLARD1-0/+36
factorise some generic infrastructure to assist looking up struct clks for the ARM & SH architecture. as the code is identical at 99% put the arch specific code for allocation as example in asm/clkdev.h Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Acked-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>