mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Jürgen Beisert" <jbe@pengutronix.de>
To: barebox@lists.infradead.org
Subject: Re: [PATCH 04/17] ARM: MXS: Add MXS specific clk types
Date: Fri, 21 Jun 2013 14:14:25 +0200	[thread overview]
Message-ID: <201306211414.25514.jbe@pengutronix.de> (raw)
In-Reply-To: <1371711261-10039-5-git-send-email-s.hauer@pengutronix.de>

With the following patch on top of [PATCH 04/17]:

diff --git a/drivers/clk/mxs/clk-ref.c b/drivers/clk/mxs/clk-ref.c
index d62ebfc..7ff5527 100644
--- a/drivers/clk/mxs/clk-ref.c
+++ b/drivers/clk/mxs/clk-ref.c
@@ -40,6 +40,17 @@ struct clk_ref {
 #define SET	0x4
 #define CLR	0x8
 
+static int clk_ref_is_enabled(struct clk *clk)
+{
+	struct clk_ref *ref = to_clk_ref(clk);
+	u32 reg = readl(ref->reg);
+
+	if (reg & 1 << ((ref->idx + 1) * 8 - 1))
+		return 0;
+
+	return 1;
+}
+
 static int clk_ref_enable(struct clk *clk)
 {
 	struct clk_ref *ref = to_clk_ref(clk);
@@ -118,6 +129,7 @@ static int clk_ref_set_rate(struct clk *clk, unsigned long rate,
 }
 
 static const struct clk_ops clk_ref_ops = {
+	.is_enabled	= clk_ref_is_enabled,
 	.enable		= clk_ref_enable,
 	.disable	= clk_ref_disable,
 	.recalc_rate	= clk_ref_recalc_rate,

...I get the expected output at runtime (e.g. CPU and EMI clocks get
reported as 'enabled'):

luma:/ clk_dump
ref_xtal (rate 24000000, enabled)
    pll (rate 480000000, enabled)
        ref_cpu (rate 454736842, enabled) <---------
            cpu_pll (rate 454736842, enabled)
                cpu (rate 454736842, enabled)
                    hbus (rate 151578947, enabled)
        ref_emi (rate 261818181, enabled) <---------
            emi_pll (rate 130909090, enabled)
                emi_sel (rate 130909090, enabled)
                    emi (rate 130909090, enabled)
        ref_pix (rate 480000000, disabled)
            lcdif_sel (rate 480000000, disabled)
                lcdif_div (rate 480000000, disabled)
                    lcdif (rate 480000000, disabled)
        ref_io (rate 480000000, enabled)
            ssp_sel (rate 480000000, enabled)
                ssp_div (rate 96000000, enabled)
                    ssp (rate 96000000, enabled)
        spdif_div (rate 120000000, enabled)
            spdif (rate 120000000, disabled)
    saif_sel (rate 24000000, enabled)
        saif_div (rate 366, enabled)
            saif (rate 366, disabled)
    gpmi_sel (rate 24000000, enabled)
        gpmi_div (rate 24000000, enabled)
            gpmi (rate 24000000, disabled)
    etm_sel (rate 24000000, enabled)
        etm_div (rate 24000000, enabled)
            etm (rate 24000000, disabled)
    cpu_xtal (rate 24000000, enabled)
    xbus (rate 24000000, enabled)
    emi_xtal (rate 24000000, enabled)
    clk32k_div (rate 32000, enabled)
        clk32k (rate 32000, enabled)
            adc (rate 2000, enabled)
    rtc (rate 31250, enabled)
    dri (rate 24000000, disabled)
    pwm (rate 24000000, disabled)
    filt (rate 24000000, disabled)
    uart (rate 24000000, enabled)

jbe

-- 
Pengutronix e.K.                              | Juergen Beisert             |
Linux Solutions for Science and Industry      | Phone: +49-5121-206917-5128 |
Peiner Str. 6-8, 31137 Hildesheim, Germany    | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686              | http://www.pengutronix.de/  |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2013-06-21 12:14 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-20  6:54 [PATCH] convert MXS to common clk Sascha Hauer
2013-06-20  6:54 ` [PATCH 01/17] clk: divider: Add onebased divider support Sascha Hauer
2013-06-20  6:54 ` [PATCH 02/17] clk: gate: Add inverted gate support Sascha Hauer
2013-06-20  6:54 ` [PATCH 03/17] clk: add prototype for clk_is_enabled Sascha Hauer
2013-06-20  6:54 ` [PATCH 04/17] ARM: MXS: Add MXS specific clk types Sascha Hauer
2013-06-21 12:14   ` Jürgen Beisert [this message]
2013-06-20  6:54 ` [PATCH 05/17] ARM: MXS: add clk drivers Sascha Hauer
2013-06-20  6:54 ` [PATCH 06/17] ARM: MXS: remove board specific clock setups Sascha Hauer
2013-06-20  6:54 ` [PATCH 07/17] mci: mxs: Use dev_* Sascha Hauer
2013-06-20  6:54 ` [PATCH 08/17] net: fec: Use clk API unconditionally Sascha Hauer
2013-06-20  6:54 ` [PATCH 09/17] mci: mxs: use common clk API Sascha Hauer
2013-06-20  6:54 ` [PATCH 10/17] mtd: gpmi-nand: switch to clk support Sascha Hauer
2013-06-20  6:54 ` [PATCH 11/17] serial: auart: Use " Sascha Hauer
2013-06-20  6:54 ` [PATCH 12/17] serial: stm: " Sascha Hauer
2013-06-20  6:54 ` [PATCH 13/17] spi: mxs: " Sascha Hauer
2013-06-20  6:54 ` [PATCH 14/17] ARM: MXS: octotp: switch to " Sascha Hauer
2013-06-20  6:54 ` [PATCH 15/17] ARM: MXS: remove imx_enable_enetclk Sascha Hauer
2013-06-20  6:54 ` [PATCH 16/17] video: stm: switch to clk support Sascha Hauer
2013-06-20  6:54 ` [PATCH 17/17] ARM: MXS: remove old clock support Sascha Hauer

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=201306211414.25514.jbe@pengutronix.de \
    --to=jbe@pengutronix.de \
    --cc=barebox@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox