Re: [RESEND PATCH v1 4/4] clk: rockchip: rk3036: fix and add node id for emac clock

2015-12-28 Thread Yakir Yang
Hi Heiko, On 12/28/2015 08:41 PM, Heiko Stübner wrote: Hi, Am Montag, 28. Dezember 2015, 17:03:53 schrieb Xing Zheng: Due to referred old version TRM, there is incorrect emac clock node, we should fix it. The SEL_21_9 is the parent of SEL_21_4. In the emac driver, we need to refer HCLK_MAC,

[PATCH v2,RESEND] clk: uniphier: add clock drivers for UniPhier SoCs

2015-12-28 Thread Masahiro Yamada
This is the initial commit for the UniPhier clock drivers, including support for PH1-sLD3, PH1-LD4, PH1-Pro4, PH1-sLD8, PH1-Pro5, and ProXstream2/PH1-LD6b. To improve the code maintainability, the driver consists of common functions (clk-uniphier-core.c) and clock data arrays needed to support

[RESEND PATCH v1 2/4] clk: rockchip: rk3036: fix uarts clock error

2015-12-28 Thread Xing Zheng
Due to a copy-paste error the uart1 and uart2 clock div set incorrect, we should to fix it. Signed-off-by: Xing Zheng --- drivers/clk/rockchip/clk-rk3036.c |8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/rockchip/clk-rk3036.c

[PATCH v2 03/16] clk: rename __clk_init() into __clk_core_init()

2015-12-28 Thread 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: Masahiro Yamada --- Changes in v2: None drivers/clk/clk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff

[PATCH v2 15/16] clk: simplify clk_fetch_parent_index() function

2015-12-28 Thread 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: Masahiro Yamada --- Changes in v2: None drivers/clk/clk.c | 18 ++ 1 file changed, 2 insertions(+), 16

[PATCH v2 16/16] clk: slightly optimize clk_core_set_parent()

2015-12-28 Thread Masahiro Yamada
If clk_fetch_parent_index() fails, p_rate is unused. Move the assignment after the error checking. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/clk/clk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/clk.c

[PATCH v2 14/16] clk: make sure parent is not NULL in clk_fetch_parent_index()

2015-12-28 Thread 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: Masahiro Yamada --- Changes in v2: - Fix a

[PATCH v2 07/16] clk: simplify clk_core_get_parent_by_index()

2015-12-28 Thread 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: Masahiro Yamada

[RESEND PATCH v2 09/16] clk: replace pr_warn() with pr_err() for fatal cases

2015-12-28 Thread Masahiro Yamada
These three cases let clk_register() fail. They should be considered as error messages. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/clk/clk.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/clk/clk.c

[RESEND PATCH v2 11/16] clk: simplify __clk_init_parent()

2015-12-28 Thread 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()

[RESEND PATCH v2 02/16] clk: change the argument of __clk_init() into pointer to clk_core

2015-12-28 Thread 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: Masahiro Yamada --- Changes in v2: None drivers/clk/clk.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff

[PATCH v2 08/16] clk: drop the initial core->parents look-ups from __clk_core_init()

2015-12-28 Thread 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: Masahiro Yamada --- Changes in v2: None drivers/clk/clk.c | 11 --- 1 file changed, 11 deletions(-)

[PATCH v2 09/16] clk: replace pr_warn() with pr_err() for fatal cases

2015-12-28 Thread Masahiro Yamada
These three cases let clk_register() fail. They should be considered as error messages. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/clk/clk.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/clk/clk.c

[PATCH v2 01/16] clk: remove unused first argument of __clk_init()

2015-12-28 Thread Masahiro Yamada
The "struct device *dev" is not used at all in this function. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/clk/clk.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index

[RESEND PATCH v1 0/4] fix some clock configuration for the RK3036 platform

2015-12-28 Thread Xing Zheng
Hi: In the development work, we found that some of the previous incorrect clock configuration on the RK3036 platform, we should fix them. Xing Zheng (4): clk: rockchip: rk3036: fix the FLAGs for clock mux clk: rockchip: rk3036: fix uarts clock error clk: rockchip: rk3036: rename emac

[RESEND PATCH v1 3/4] clk: rockchip: rk3036: rename emac ext source clock

2015-12-28 Thread Xing Zheng
There is only support rmii in the RK3036, so we should use the correct ext clock name. Signed-off-by: Xing Zheng --- drivers/clk/rockchip/clk-rk3036.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/rockchip/clk-rk3036.c

[RESEND PATCH v1 1/4] clk: rockchip: rk3036: fix the FLAGs for clock mux

2015-12-28 Thread Xing Zheng
The DFLAGS are used for the clock dividers, the CLKSEL_CON flags of COMPOSITE_NODIV type should be MFLAGS. Signed-off-by: Xing Zheng --- drivers/clk/rockchip/clk-rk3036.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git

[PATCH v2 10/16] clk: move checking .git_parent to __clk_core_init()

2015-12-28 Thread Masahiro Yamada
The .git_parent is mandatory for multi-parent clocks. Move the check to __clk_core_init(), like other callback checkings. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/clk/clk.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-)

[PATCH v2 13/16] clk: walk the orphan clock list more simply

2015-12-28 Thread 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: Masahiro Yamada --- Changes in v2: None drivers/clk/clk.c | 21 ++--- 1 file changed, 6 insertions(+), 15

[PATCH v2 12/16] clk: avoid circular clock topology

2015-12-28 Thread 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()

[PATCH v2 04/16] clk: remove unnecessary !core->parents conditional

2015-12-28 Thread 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: Masahiro Yamada ---

[RESEND PATCH v2 14/16] clk: make sure parent is not NULL in clk_fetch_parent_index()

2015-12-28 Thread 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: Masahiro Yamada --- Changes in v2: - Fix a

[RESEND PATCH v2 13/16] clk: walk the orphan clock list more simply

2015-12-28 Thread 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: Masahiro Yamada --- Changes in v2: None drivers/clk/clk.c | 21 ++--- 1 file changed, 6 insertions(+), 15

[RESEND PATCH v2 15/16] clk: simplify clk_fetch_parent_index() function

2015-12-28 Thread 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: Masahiro Yamada --- Changes in v2: None drivers/clk/clk.c | 18 ++ 1 file changed, 2 insertions(+), 16

[RESEND PATCH v2 10/16] clk: move checking .git_parent to __clk_core_init()

2015-12-28 Thread Masahiro Yamada
The .git_parent is mandatory for multi-parent clocks. Move the check to __clk_core_init(), like other callback checkings. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/clk/clk.c | 12 +--- 1 file changed, 5 insertions(+), 7 deletions(-)

[RESEND PATCH v2 08/16] clk: drop the initial core->parents look-ups from __clk_core_init()

2015-12-28 Thread 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: Masahiro Yamada --- Changes in v2: None drivers/clk/clk.c | 11 --- 1 file changed, 11 deletions(-)

[PATCH] clk: sunxi: Fix mod0 clock calculation to return stable results and check divisor size limits

2015-12-28 Thread Marcus Weseloh
This patch fixes some problems in the mod0 clock calculation. It has the potential to break stuff, as the issues explained below had the effect that clk_set_rate would always return successfully, sometimes setting a frequency that is higher than the requested value. Code that "accidentally worked"