clk_core *),
> GFP_KERNEL);
> if (!core->parents) {
> ret = -ENOMEM;
> goto out;
You are doing the similar thing as mine.
See
https://patchwork.kernel.org/patch/7925571/
This series gives a big confli
Allow to unregister fixed factor clock.
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
drivers/clk/clk-fixed-factor.c | 13 +
include/linux/clk-provider.h | 1 +
2 files changed, 14 insertions(+)
diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/c
Allow to unregister fixed rate clock.
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
drivers/clk/clk-fixed-rate.c | 13 +
include/linux/clk-provider.h | 2 +-
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/clk-fixed-rate.c b/d
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: Masahiro Yamada <yamada.masah...@socionext.com>
---
drivers/clk/clk-divider.c | 5 ++---
1 file changed, 2 insertions(+), 3 del
Hi Michael,
2015-12-31 10:35 GMT+09:00 Michael Turquette <mturque...@baylibre.com>:
> Hello Yamada-san,
>
> Quoting Masahiro Yamada (2015-12-28 02:20:58)
>> diff --git a/drivers/clk/uniphier/Kconfig b/drivers/clk/uniphier/Kconfig
>> new file mode 100644
>> index
each SoC.
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
Changes in v2:
- split emmc_hw_reset
- make SD clock rate-controllable
- add CLK_SET_RATE_PARENT flag to mux, gate, fixed-factor clocks
MAINTAINERS | 1 +
drivers/clk/K
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 <yamada.masah...@socionext.com>
---
Changes in v2: None
drivers/clk/clk.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
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 <yamada.masah...@socionext.com>
---
Changes in v2: None
drivers/clk/clk.c | 18 ++
1 file changed, 2 insertions(
If clk_fetch_parent_index() fails, p_rate is unused. Move the
assignment after the error checking.
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
Changes in v2: None
drivers/clk/clk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/c
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 <yamada.masah...@socionext.com>
---
Changes in v2:
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 <yamada.
These three cases let clk_register() fail. They should be considered
as error messages.
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
Changes in v2: None
drivers/clk/clk.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/c
get_parent() is missing.
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
Changes in v2: None
drivers/clk/clk.c | 38 --
1 file changed, 4 insertions(+), 34 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 4ad0a36
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 <yamada.masah...@socionext.com>
---
Changes in v2: None
drivers/clk/clk.c | 13 +
1 file changed, 5 insertions(+), 8 deletions
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 <yamada.masah...@socionext.com>
---
Changes in v2: None
drivers/clk/clk.c | 11 ---
1 file changed, 11
These three cases let clk_register() fail. They should be considered
as error messages.
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
Changes in v2: None
drivers/clk/clk.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/c
The "struct device *dev" is not used at all in this function.
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
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
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 <yamada.masah...@socionext.com>
---
Changes in v2: None
drivers/clk/clk.c | 12 +---
1 file changed, 5 insertions(+), 7 del
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 <yamada.masah...@socionext.com>
---
Changes in v2: None
drivers/clk/clk.c | 21 ++---
1 file changed, 6 insertions(
n it were registered. That should be detected
as an error.
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
Changes in v2: None
drivers/clk/clk.c | 40
1 file changed, 40 insertions(+)
diff --git a/drivers/clk/clk.c b/drivers/clk/cl
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 <yamada.masah...@socione
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 <yamada.masah...@socionext.com>
---
Changes in v2:
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 <yamada.masah...@socionext.com>
---
Changes in v2: None
drivers/clk/clk.c | 21 ++---
1 file changed, 6 insertions(
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 <yamada.masah...@socionext.com>
---
Changes in v2: None
drivers/clk/clk.c | 18 ++
1 file changed, 2 insertions(
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 <yamada.masah...@socionext.com>
---
Changes in v2: None
drivers/clk/clk.c | 12 +---
1 file changed, 5 insertions(+), 7 del
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 <yamada.masah...@socionext.com>
---
Changes in v2: None
drivers/clk/clk.c | 11 ---
1 file changed, 11
each SoC.
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
MAINTAINERS | 1 +
drivers/clk/Kconfig | 1 +
drivers/clk/Makefile | 1 +
drivers/clk/uniphier/Kconfig | 35 ++
drive
lt; 1>;
};
Currently, of_clk_get_parent_name(consumer_np, 0) returns "clka"
(and of_clk_get_parent_name(consumer_np, 1) also returns "clka",
this is correct). Because the "clock-indices" in the clock parent
does not contain <0>, of_clk_get_parent_name(co
Hi Stephen,
2015-12-01 9:58 GMT+09:00 Stephen Boyd <sb...@codeaurora.org>:
> On 11/30, Masahiro Yamada wrote:
>> Currently, of_clk_get_parent_name() returns a wrong parent clock name
>> when "clock-indices" property exists and the target index is not
>> found
2015-12-01 9:49 GMT+09:00 Stephen Boyd <sb...@codeaurora.org>:
> On 11/24, Masahiro Yamada wrote:
>> Hi Stephen,
>>
>>
>> 2015-11-22 14:44 GMT+09:00 Masahiro Yamada <yamada.masah...@socionext.com>:
>> > Hi Stephen,
>> >
>> >
*/
> if (!vp)
> return NULL;
>
> I guess I prefer the latter approach here.
>
No.
Neither of your two suggestions works because they are false positive.
With your way, if "clock-indices" does not exist, of_clk_get_parent_name()
would return NULL; in this cas
lt; 1>;
};
Currently, of_clk_get_parent_name(consumer_np, 0) returns "clka"
(and of_clk_get_parent_name(consumer_np, 1) also returns "clka",
this is correct). Because the "clock-indices" in the clock parent
does not contain <0>, of_clk_get_parent_name(co
If clk_fetch_parent_index() fails, p_rate is unused. Move the
assignment after the error checking.
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
drivers/clk/clk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/clk.c b/drivers/clk
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 <yamada.masah...@socionext.com>
---
drivers/clk/clk.c | 11 ---
1 file changed, 11 deletions(-)
diff --git
These three cases let clk_register() fail. They should be considered
as error messages.
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
drivers/clk/clk.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk
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 <yamada.masah...@socionext.com>
---
drivers/clk/clk.c | 13 +
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/dr
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 <yamada.masah...@socionext.com>
---
drivers/clk/clk.c | 12 +---
1 file changed, 5 insertions(+), 7 deletions(-)
diff
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 <yamada.masah...@socionext.com>
---
drivers/clk/clk.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drive
get_parent() is missing.
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
drivers/clk/clk.c | 38 --
1 file changed, 4 insertions(+), 34 deletions(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 486f6d4..ef6fedb 100644
--- a/d
>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 cas
Hi Stephen,
2015-11-21 2:45 GMT+09:00 Stephen Boyd <sb...@codeaurora.org>:
> On 11/20, Masahiro Yamada wrote:
>> Currently, of_clk_get_parent_name() returns a wrong parent clock name
>> when "clock-indices" property exists and the given index is not found
>>
Hi Stephen,
2015-11-21 9:37 GMT+09:00 Stephen Boyd <sb...@codeaurora.org>:
> On 11/20, Masahiro Yamada wrote:
>> Currently, there is no function to get the clock name of the given
>> node. Create a new helper function, of_clk_get_name(). This is
>> useful to get
This minor refactoring does not change the function behavior.
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
drivers/clk/clk.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index f13c3f4..764aca2
ame(): get the name of the parent clock
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
I want to use of_clk_get_name() for my clk drivers for my SoCs,
which I will submit later.
I found this helper function is useful.
drivers/clk/clk.c
uot;myclocktype";
#clock-cells = <1>;
clock-indices = <1>, <3>;
clock-output-names = "clka", "clkb";
};
Currently, of_clk_get_parent_name(np, 0) returns "clka", but should
return NULL because "clock-ind
This if-block can be dropped because the of_parse_phandle_with_args()
in the following line returns -EINVAL for negative index.
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
drivers/clk/clk.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/clk/clk.c b/d
so
I am wondering if it could be supported in common parts.
Or, any other good solution exists?
--
Best Regards
Masahiro Yamada
--
To unsubscribe from this list: send the line "unsubscribe linux-clk" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
This code is unreadable due to the blank line between if and else
blocks.
Signed-off-by: Masahiro Yamada <yamada.masah...@socionext.com>
---
drivers/clk/clk-mux.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c
index 7
Hi Philipp,
2015-11-02 22:24 GMT+09:00 Philipp Zabel <p.za...@pengutronix.de>:
> Hi Masahiro,
>
> Am Montag, den 02.11.2015, 22:05 +0900 schrieb Masahiro Yamada:
>> Hi Philipp,
>>
>>
>> I searched for the reset controller entry in MAINTAINERS.
&
49 matches
Mail list logo