All of lore.kernel.org
 help / color / mirror / Atom feed
From: Archit Taneja <architt@codeaurora.org>
To: Stephen Boyd <sboyd@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: Mon, 19 Oct 2015 10:15:36 +0530	[thread overview]
Message-ID: <56247570.5040200@codeaurora.org> (raw)
In-Reply-To: <20151016220538.GB10182@codeaurora.org>



On 10/17/2015 03:35 AM, Stephen Boyd wrote:
> 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 +

Thanks for the clean up!

Archit

>
> ----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;
>   }
>
>

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
Forum, hosted by The Linux Foundation

  reply	other threads:[~2015-10-19  4:45 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
2015-10-19  4:45     ` Archit Taneja [this message]
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=56247570.5040200@codeaurora.org \
    --to=architt@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=robdclark@gmail.com \
    --cc=sboyd@codeaurora.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.