From: Stephen Boyd <sboyd@codeaurora.org>
To: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Cc: linux-kernel@vger.kernel.org,
Mike Turquette <mturquette@linaro.org>,
Javier Martinez Canillas <javier.martinez@collabora.co.uk>,
Paul Walmsley <paul@pwsan.com>, Tony Lindgren <tony@atomide.com>,
Russell King <linux@arm.linux.org.uk>,
linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v10 2/3] clk: Make clk API return per-user struct clk instances
Date: Tue, 20 Jan 2015 16:14:15 -0800 [thread overview]
Message-ID: <20150121001415.GE27202@codeaurora.org> (raw)
In-Reply-To: <1421760306-6301-3-git-send-email-tomeu.vizoso@collabora.com>
On 01/20, Tomeu Vizoso wrote:
> diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> index 97f3425..e867d6a 100644
> --- a/drivers/clk/clk.c
> +++ b/drivers/clk/clk.c
> @@ -1719,6 +1817,31 @@ out:
>
> return ret;
> }
> +
> +/**
> + * clk_set_parent - switch the parent of a mux clk
> + * @clk: the mux clk whose input we are switching
> + * @parent: the new input to clk
> + *
> + * Re-parent clk to use parent as its new input source. If clk is in
> + * prepared state, the clk will get enabled for the duration of this call. If
> + * that's not acceptable for a specific clk (Eg: the consumer can't handle
> + * that, the reparenting is glitchy in hardware, etc), use the
> + * CLK_SET_PARENT_GATE flag to allow reparenting only when clk is unprepared.
> + *
> + * After successfully changing clk's parent clk_set_parent will update the
> + * clk topology, sysfs topology and propagate rate recalculation via
> + * __clk_recalc_rates.
> + *
> + * Returns 0 on success, -EERROR otherwise.
> + */
> +int clk_set_parent(struct clk *clk, struct clk *parent)
> +{
> + if (!clk || !parent)
> + return 0;
This is a behavior change, although it's very possible nobody
cares besides clk.c itself. Before this change
clk_set_parent(clk, NULL) would orphan the clock and move it to
the orphan list. Now we're going to do nothing. We should keep
the original behavior, although I don't know why anybody would
want to orphan a clock from a driver. The only place I think
we're using this correctly is on the clock unregistration path.
> +
> + return clk_core_set_parent(clk->core, parent->core);
> +}
> EXPORT_SYMBOL_GPL(clk_set_parent);
>
> /**
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-01-21 0:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1421760306-6301-1-git-send-email-tomeu.vizoso@collabora.com>
2015-01-20 13:24 ` [PATCH v10 2/3] clk: Make clk API return per-user struct clk instances Tomeu Vizoso
2015-01-21 0:14 ` Stephen Boyd [this message]
2015-01-20 13:24 ` [PATCH v10 3/3] clk: Add rate constraints to clocks Tomeu Vizoso
2015-01-21 0:46 ` Stephen Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150121001415.GE27202@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=javier.martinez@collabora.co.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mturquette@linaro.org \
--cc=paul@pwsan.com \
--cc=tomeu.vizoso@collabora.com \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).