- 07 2月, 2016 3 次提交
-
-
由 Stephen Boyd 提交于
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: NStephen Boyd <sboyd@codeaurora.org>
-
由 Stephen Boyd 提交于
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: NStephen Boyd <sboyd@codeaurora.org>
-
由 Stephen Boyd 提交于
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: NJyri 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: NStephen Boyd <sboyd@codeaurora.org>
-
- 03 2月, 2016 9 次提交
-
-
由 Insu Yun 提交于
If clock is already unregistered, it returns with holding lock. It needs to be unlocked. Signed-off-by: NInsu Yun <wuninsu@gmail.com> [sboyd@codeaurora.org: Use goto instead] Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Arnd Bergmann 提交于
The clk-vt8500.c driver would previously enter an endless loop when invalid settings got requested, this was now fixed. However, the driver will now return uninitialized data for a subset of those cases instead, as the gcc correctly warns: clk/clk-vt8500.c: In function 'wm8650_find_pll_bits': clk/clk-vt8500.c:423:12: error: 'best_div2' may be used uninitialized in this function [-Werror=maybe-uninitialized] *divisor2 = best_div2; ^ clk/clk-vt8500.c:422:12: error: 'best_div1' may be used uninitialized in this function [-Werror=maybe-uninitialized] *divisor1 = best_div1; ^ clk/clk-vt8500.c:421:14: error: 'best_mul' may be used uninitialized in this function [-Werror=maybe-uninitialized] *multiplier = best_mul; This reworks the error handling in the driver so we now return -EINVAL from clk_round_rate() and clk_set_rate() when we get impossible inputs. Signed-off-by: NArnd Bergmann <arnd@arndb.de> Fixes: 090341b0 ("clk: vt8500: fix sign of possible PLL values") Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
If clk_fetch_parent_index() fails, p_rate is unused. Move the assignment after the error checking. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
The clk_core_get_parent_by_index can be used as a helper function to simplify the implementation of clk_fetch_parent_index(). Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
If parent is given with NULL, clk_fetch_parent_index() could return a positive index value. Currently, parent is checked by the callers of this function, but it would be safer to do it in this function. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
This loop can be much simpler. If a new parent is available for orphan clocks, __clk_init_parent(orphan) can detect it. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
Currently, clk_register() never checks a circular parent looping, but clock providers could register such an insane clock topology. For example, "clk_a" could have "clk_b" as a parent, and vice versa. In this case, clk_core_reparent() creates a circular parent list and __clk_recalc_accuracies() calls itself recursively forever. The core infrastructure should be kind enough to bail out, showing an appropriate error message in such a case. This helps to easily find a bug in clock providers. (uh, I made such a silly mistake when I was implementing my clock providers first. I was upset because the kernel did not respond, without any error message.) This commit adds a new helper function, __clk_is_ancestor(). It returns true if the second argument is a possible ancestor of the first one. If a clock core is a possible ancestor of itself, it would make a loop when it were registered. That should be detected as an error. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
The translation from the index into clk_core is done by clk_core_get_parent_by_index(). The if-block for num_parents == 1 case is duplicating the code in the clk_core_get_parent_by_index(). Drop the "if (num_parents == 1)" from the special case. Instead, set the index to zero if .get_parent() is missing. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
The .get_parent is mandatory for multi-parent clocks. Move the check to __clk_core_init(), like other callback checkings. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> [sboyd@codeaurora.org: Squashed in error path handling, fix typos in commit message] Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
- 02 2月, 2016 9 次提交
-
-
由 Masahiro Yamada 提交于
These three cases let clk_register() fail. They should be considered as error messages. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
The core->parents is a cache to save expensive clock parent look-ups. It will be filled as needed later. We do not have to do it here. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
Drop the "if (!core->parents)" case and refactor the function a bit because core->parents is always allocated. (Strictly speaking, it is ZERO_SIZE_PTR if core->num_parents == 0, but such a case is omitted by the if-conditional above.) Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
Currently, __clk_core_init() allows failure of the kcalloc() for the core->parents. So, clk_fetch_parent_index() and __clk_init_parent() also try to allocate core->parents in case it has not been allocated yet. Scattering memory allocation here and there makes things complicated. Like other clk_core members, allocate core->parents in clk_register() and let it fail in case of memory shortage. If we cannot allocate such a small piece of memory, the system is already insane. There is no point to postpone the memory allocation. Also, allocate core->parents regardless of core->num_parents. We want it even if core->num_parents == 1 because clk_fetch_parent_index() might be called against the clk_core with a single parent. If core->num_parents == 0, core->parents is set to ZERO_SIZE_PTR. It is harmless because no access happens to core->parents in such a case. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
Now, the clock parent is not "struct clk *", but "struct clk_core *". Of course, the size of a pointer is always same, but strictly speaking, sizeof(struct clk *) should be sizeof(struct clk_core *) here. This mismatch happened when we split the structure into struct clk and struct clk_core. For the potential possibility of future renaming, sizeof(*core->parents) would be better. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
This if-block has been here since the introduction of the common clock framework. Now no clock drivers are statically initialized. core->parent is always NULL at this point. Drop the redundant check and the confusing comment. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
Now this function takes clk_core as its argument. __clk_core_init() would be more suitable for the name of this function. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
The argument clk_user is used only for the clk_user->core. The rest of this function only takes care of clk_core. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
The "struct device *dev" is not used at all in this function. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
- 30 1月, 2016 19 次提交
-
-
由 Stephen Boyd 提交于
* clk-fixes: clk: rockchip: rk3368: fix some clock gates clk: rockchip: rk3036: rename emac ext source clock clk: rockchip: rk3036: fix the div offset for emac clock clk: rockchip: rk3036: fix uarts clock error clk: rockchip: rk3036: fix the FLAGs for clock mux
-
由 Stephen Boyd 提交于
Merge tag 'v4.5-rockchip-clkfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip into clk-fixes Pull rockchip fixes from Heiko Stuebner: Fixes for wrong register offsets in both rk3036 and rk3368. Also rename the external input for the emac on rk3036, which should still be ok to do, as that binding was only introduced during this merge-window. * tag 'v4.5-rockchip-clkfixes1' of git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip: clk: rockchip: rk3368: fix some clock gates clk: rockchip: rk3036: rename emac ext source clock clk: rockchip: rk3036: fix the div offset for emac clock clk: rockchip: rk3036: fix uarts clock error clk: rockchip: rk3036: fix the FLAGs for clock mux
-
由 Arnd Bergmann 提交于
My previous patch fixed some warnings about printing a couple of variables that are always uninitialized in quadfs_pll_fs660c32_set_rate(), but I now got a warning that only shows up in some configurations (i.e. without gcc -Os) about the params.ndiv being used uninitialized in the error case: drivers/clk/st/clkgen-fsyn.c: In function 'quadfs_pll_fs660c32_set_rate': drivers/clk/st/clkgen-fsyn.c:584:75: warning: 'params.ndiv' may be used uninitialized in this function [-Wmaybe-uninitialized] drivers/clk/st/clkgen-fsyn.c:574:16: note: 'params.ndiv' was declared here This changes the error handling so we bail for invalid arguments rather than continuing with uninitialized data. Signed-off-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Stephen Boyd 提交于
The size of unsigned long on 64-bit architectures is equal to the size of u64, so this check is impossible there. This throws off static checkers: drivers/clk/clk-axi-clkgen.c:331 axi_clkgen_recalc_rate() warn: impossible condition '(tmp > (~0)) => (0-u64max > u64max)' Let's change this code to use min_t() instead so that we get the same effect on architectures where sizeof(unsigned long) doesn't equal sizeof(u64). Cc: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Lars-Peter Clausen 提交于
The clock generator has two clock inputs that can be used as the reference clock. Add support for switching between them at runtime. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Lars-Peter Clausen 提交于
Version 1 of the axi-clkgen core has not been used in new designs for over two years now. This is a soft peripheral used in FPGAs and anybody who has updated their kernel to the latest version will also have updated the bitstream containing the clock generator. So it should be safe to drop support for this now. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 LABBE Corentin 提交于
of_match_device could return NULL, and so cause a NULL pointer dereference later. Even if the probability of this case is very low, fixing it made static analyzers happy. Solving this with of_device_get_match_data made also code simplier. Reported-by: coverity (CID 1324137) Signed-off-by: NLABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 LABBE Corentin 提交于
The palmas_clks_of_match_data structures are never modified. This patch constify them. Signed-off-by: NLABBE Corentin <clabbe.montjoie@gmail.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
Because _next_div() returns a valid divider, there is no need to consult _is_valid_div() for the validity of the divider in every iteration. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Andrzej Hajda 提交于
With unsigned values underflow in loops can occur resulting in theoretically infinite loops. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576Signed-off-by: NAndrzej Hajda <a.hajda@samsung.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
Allow to unregister fixed rate clock. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Masahiro Yamada 提交于
Allow to unregister fixed factor clock. Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Srinivas Kandagatla 提交于
This clock is required for loading the qdsp firmware. Signed-off-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Stephen Boyd 提交于
* clk-iproc: clk: iproc: Remove __init from header clk: iproc: Add support for Cygnus audio clocks Documentation: dt-bindings: Add DT bindings for Cygnus audio clock
-
由 Ray Jui 提交于
Remove __init macro from all function prototypes in clk-iproc.h Signed-off-by: NRay Jui <rjui@broadcom.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Simran Rai 提交于
This patch adds support for Broadcom Cygnus audio PLL and leaf clocks Signed-off-by: NSimran Rai <ssimran@broadcom.com> Reviewed-by: NScott Branden <sbranden@broadcom.com> Signed-off-by: NRay Jui <rjui@broadcom.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 Simran Rai 提交于
This patch adds audio clock device tree binding documentation to an existing Cygnus clock DT bindings document. Signed-off-by: NSimran Rai <ssimran@broadcom.com> Reviewed-by: NRay Jui <rjui@broadcom.com> Reviewed-by: NLori Hikichi <lhikichi@broadcom.com> Reviewed-by: NScott Branden <sbranden@broadcom.com> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 James Liao 提交于
Move all vendor's Kconfig into CCF menu section to prevent new drivers putting their Kconfig files in a wrong place. Some Kconfigs need to be modified at the same time to avoid build warnings. Signed-off-by: NJames Liao <jamesjj.liao@mediatek.com> Acked-by: NSylwester Nawrocki <s.nawrocki@samsung.com> [sboyd@codeaurora.org: Fix typos in commit message] Acked-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-
由 James Liao 提交于
mtk_clk_register_composite() may leak memory due to some error handling path don't free all allocated memory. This patch free all pointers that may allocate memory before error return. And it's safe because kfree() can handle NULL pointers. Signed-off-by: NJames Liao <jamesjj.liao@mediatek.com> Reviewed-by: NDaniel Kurtz <djkurtz@chromium.org> Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
-