Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 91211
b: refs/heads/master
c: 60bfe7f
h: refs/heads/master
i:
  91209: dde54b4
  91207: 1ad0c73
v: v3
  • Loading branch information
Mark Brown authored and Russell King committed Apr 19, 2008
1 parent b12512a commit 8845db8
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 27b98a671ff4cda89ba279452115000da59a9067
refs/heads/master: 60bfe7fa3dc13fe90d273371b65ae3ec89583c52
30 changes: 28 additions & 2 deletions trunk/arch/arm/mach-pxa/pxa3xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,25 @@ unsigned int pxa3xx_get_memclk_frequency_10khz(void)
return (clk / 10000);
}

/*
* Return the current AC97 clock frequency.
*/
static unsigned long clk_pxa3xx_ac97_getrate(struct clk *clk)
{
unsigned long rate = 312000000;
unsigned long ac97_div;

ac97_div = AC97_DIV;

/* This may loose precision for some rates but won't for the
* standard 24.576MHz.
*/
rate /= (ac97_div >> 12) & 0x7fff;
rate *= (ac97_div & 0xfff);

return rate;
}

/*
* Return the current HSIO bus clock frequency
*/
Expand Down Expand Up @@ -156,6 +175,12 @@ static const struct clkops clk_pxa3xx_hsio_ops = {
.getrate = clk_pxa3xx_hsio_getrate,
};

static const struct clkops clk_pxa3xx_ac97_ops = {
.enable = clk_pxa3xx_cken_enable,
.disable = clk_pxa3xx_cken_disable,
.getrate = clk_pxa3xx_ac97_getrate,
};

static void clk_pout_enable(struct clk *clk)
{
OSCC |= OSCC_PEN;
Expand Down Expand Up @@ -197,8 +222,9 @@ static struct clk pxa3xx_clks[] = {
.delay = 70,
},

PXA3xx_CK("LCDCLK", LCD, &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev),
PXA3xx_CK("CAMCLK", CAMERA, &clk_pxa3xx_hsio_ops, NULL),
PXA3xx_CK("LCDCLK", LCD, &clk_pxa3xx_hsio_ops, &pxa_device_fb.dev),
PXA3xx_CK("CAMCLK", CAMERA, &clk_pxa3xx_hsio_ops, NULL),
PXA3xx_CK("AC97CLK", AC97, &clk_pxa3xx_ac97_ops, NULL),

PXA3xx_CKEN("UARTCLK", FFUART, 14857000, 1, &pxa_device_ffuart.dev),
PXA3xx_CKEN("UARTCLK", BTUART, 14857000, 1, &pxa_device_btuart.dev),
Expand Down

0 comments on commit 8845db8

Please sign in to comment.