From: Stephen Boyd <sboyd@codeaurora.org>
To: Archit Taneja <architt@codeaurora.org>
Cc: linux-arm-msm@vger.kernel.org, robdclark@gmail.com
Subject: Re: [PATCH 1/2] clk: qcom: clk-rcg: Add customized clk_ops for DSI RCGs
Date: Fri, 16 Oct 2015 15:05:38 -0700 [thread overview]
Message-ID: <20151016220538.GB10182@codeaurora.org> (raw)
In-Reply-To: <1444827285-25233-2-git-send-email-architt@codeaurora.org>
On 10/14, Archit Taneja wrote:
> DSI specific RCG clocks required customized clk_ops. There are
> a total of 4 RCGs per DSI block: DSI, BYTE, ESC and PIXEL.
>
> There are a total of 2 clocks coming from the DSI PLL, which serve as
> inputs to these RCGs. The BYTE and ESC RCGs are fed by one of the
> post dividers of DSI1 or DSI2 PLLs, and the DSI and PIXEL RCGs are fed by
> another divider of the PLL.
>
> In each of the 2 groups above, only one of the clocks sets its parent.
> These are BYTE RCG and DSI RCG for each of the groups respectively, as
> shown in the diagram below.
>
> The DSI and BYTE RCGs serve as bypass clocks. We create a new set of ops
> clk_rcg_bypass2_ops, which are like the regular bypass ops, but don't
> take in a freq table, since the DSI driver using these clocks is
> parent-able.
>
> The PIXEL RCG needs to derive the required pixel clock using dsixpll.
> It parses a m/n frac table to retrieve the correct clock.
>
> The ESC RCG doesn't have a frac M/N block, it can just apply a pre-
> divider. Its ops simply check if the required clock rate can be
> achieved by the pre-divider.
>
> +-------------------+
> | |---dsixpllbyte---o---> To byte RCG
> | | | (sets parent rate)
> | | |
> | | |
> | DSI 1/2 PLL | |
> | | o---> To esc RCG
> | | (doesn't set parent rate)
> | |
> | |----dsixpll-----o---> To dsi RCG
> +-------------------+ | (sets parent rate)
> ( x = 1, 2 ) |
> |
> o---> To pixel rcg
> (doesn't set parent rate)
>
> Signed-off-by: Archit Taneja <architt@codeaurora.org>
> ---
Applied to clk-next +
----8<----
diff --git a/drivers/clk/qcom/clk-rcg.c b/drivers/clk/qcom/clk-rcg.c
index 46ff9f25cd97..bfbb28f450c2 100644
--- a/drivers/clk/qcom/clk-rcg.c
+++ b/drivers/clk/qcom/clk-rcg.c
@@ -564,7 +564,7 @@ static int clk_rcg_bypass2_set_rate(struct clk_hw *hw, unsigned long rate,
ret = regmap_read(rcg->clkr.regmap, rcg->ns_reg, &ns);
if (ret)
- goto err;
+ return ret;
src = ns_to_src(&rcg->s, ns);
f.pre_div = ns_to_pre_div(&rcg->p, ns) + 1;
@@ -576,7 +576,6 @@ static int clk_rcg_bypass2_set_rate(struct clk_hw *hw, unsigned long rate,
}
}
-err:
return -EINVAL;
}
@@ -636,7 +635,7 @@ static int clk_rcg_pixel_set_rate(struct clk_hw *hw, unsigned long rate,
ret = regmap_read(rcg->clkr.regmap, rcg->ns_reg, &ns);
if (ret)
- goto err;
+ return ret;
src = ns_to_src(&rcg->s, ns);
f.pre_div = ns_to_pre_div(&rcg->p, ns) + 1;
@@ -662,7 +661,6 @@ static int clk_rcg_pixel_set_rate(struct clk_hw *hw, unsigned long rate,
return __clk_rcg_set_rate(rcg, &f);
}
-err:
return -EINVAL;
}
@@ -711,7 +709,7 @@ static int clk_rcg_esc_set_rate(struct clk_hw *hw, unsigned long rate,
ret = regmap_read(rcg->clkr.regmap, rcg->ns_reg, &ns);
if (ret)
- goto err;
+ return ret;
ns = ns_to_src(&rcg->s, ns);
@@ -729,7 +727,6 @@ static int clk_rcg_esc_set_rate(struct clk_hw *hw, unsigned long rate,
return __clk_rcg_set_rate(rcg, &f);
}
-err:
return -EINVAL;
}
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2015-10-16 22:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-14 12:54 [PATCH 0/2] clk: qcom: Add DSI clocks for MSM8960/APQ8064 Archit Taneja
2015-10-14 12:54 ` [PATCH 1/2] clk: qcom: clk-rcg: Add customized clk_ops for DSI RCGs Archit Taneja
2015-10-16 22:05 ` Stephen Boyd [this message]
2015-10-19 4:45 ` Archit Taneja
2015-10-14 12:54 ` [PATCH 2/2] clk: qcom: mmcc-8960: Add DSI related clocks Archit Taneja
2015-10-16 22:06 ` 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=20151016220538.GB10182@codeaurora.org \
--to=sboyd@codeaurora.org \
--cc=architt@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=robdclark@gmail.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).