linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* AT91SAM9260: How to output PCK0 clock on a GPIO pin
@ 2009-08-31 15:32 Pedro I. Sanchez
  2009-08-31 16:58 ` Stephen Munnings
  0 siblings, 1 reply; 17+ messages in thread
From: Pedro I. Sanchez @ 2009-08-31 15:32 UTC (permalink / raw)
  To: linux-arm-kernel

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

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2009-08-31 21:09 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-31 15:32 AT91SAM9260: How to output PCK0 clock on a GPIO pin Pedro I. Sanchez
2009-08-31 16:58 ` 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

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).