From: psanchez@fosstel.com (Pedro I. Sanchez)
To: linux-arm-kernel@lists.infradead.org
Subject: AT91SAM9260: How to output PCK0 clock on a GPIO pin
Date: Mon, 31 Aug 2009 11:32:38 -0400 [thread overview]
Message-ID: <fb43ffa34296dae697dbadb98e53bdc1@colcan.ca> (raw)
Hello,
I'm trying to get a clock on pin PC6 of my AT1SAM9260-based board and I
would like some advice on how to do it. For all purposes this board can be
considered to be a clone of the sam9260ek evaluation board.
I see doing this as a two-step process: First, link pin PC6 to the PCK0
clock. Second, program and enable the clock. My kernel module has the
following code (I'm using kernel 2.26.29.3):
Step 1:
at91_set_A_periph(AT91_PIN_PC6, 0);
I'm taking this piece of code from somewhere else. is this all I need to do
for step 1?
Step 2:
pck0 = clk_get(NULL, "pck0");
if (IS_ERR(pck0)) {
pr_err("%s: Failed to get PCK0\n", __func__);
ret = PTR_ERR(pck0);
goto err;
}
pllb = clk_get(NULL, "pllb");
if (IS_ERR(pllb)) {
pr_err("%s: Failed to get PLLB\n", __func__);
ret = PTR_ERR(pllb);
goto err_pllb;
}
ret = clk_set_parent(pck0, pllb);
if (ret != 0) {
pr_err("%s: Failed to set PCK0 parent\n", __func__);
goto err_parent;
}
clk_set_rate(pck0, 11289600);
clk_enable(pck0);
clk_put(pllb);
Neither step fails. Step 2 gives me a printout "PCK0 rate 6000000Hz" which
is not what I expected, some clock divisor must be in the way, but at least
it is a clock of some kind. Unfortunately nothing is output on pin PC6.
Could you provide me with some advice on how to do this properly?
Thank you,
--
Pedro
--
Pedro I. Sanchez
next reply other threads:[~2009-08-31 15:32 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-31 15:32 Pedro I. Sanchez [this message]
2009-08-31 16:58 ` AT91SAM9260: How to output PCK0 clock on a GPIO pin Stephen Munnings
2009-08-31 18:27 ` Pedro I. Sanchez
2009-08-31 18:44 ` Stephen Munnings
2009-08-31 19:02 ` Pedro I. Sanchez
2009-08-31 19:13 ` Stephen Munnings
2009-08-31 19:21 ` Pedro I. Sanchez
2009-08-31 19:33 ` Sergey Matyukevich
2009-08-31 19:58 ` Stephen Munnings
2009-08-31 20:37 ` Pedro I. Sanchez
2009-08-31 20:44 ` Stephen Munnings
2009-08-31 21:09 ` Pedro I. Sanchez
2009-08-31 20:03 ` Pedro I. Sanchez
2009-08-31 20:33 ` Ryan Mallon
2009-08-31 20:46 ` Pedro I. Sanchez
2009-08-31 20:35 ` Sergey Matyukevich
2009-08-31 21:06 ` Pedro I. Sanchez
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=fb43ffa34296dae697dbadb98e53bdc1@colcan.ca \
--to=psanchez@fosstel.com \
--cc=linux-arm-kernel@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 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.