Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 160787
b: refs/heads/master
c: db58e90
h: refs/heads/master
i:
  160785: ed51225
  160783: e33ecae
v: v3
  • Loading branch information
wanzongshun authored and Russell King committed Jul 17, 2009
1 parent bb2c264 commit 9a31bed
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d2c241955095b129459985a8c02d85b70984b945
refs/heads/master: db58e90fdbe9d12b431ae8d8e856961ce75d74f0
18 changes: 18 additions & 0 deletions trunk/arch/arm/mach-w90x900/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

#include "clock.h"

#define SUBCLK 0x24

static DEFINE_SPINLOCK(clocks_lock);

int clk_enable(struct clk *clk)
Expand Down Expand Up @@ -68,6 +70,22 @@ void w90x900_clk_enable(struct clk *clk, int enable)
__raw_writel(clken, W90X900_VA_CLKPWR);
}

void w90x900_subclk_enable(struct clk *clk, int enable)
{
unsigned int clocks = clk->cken;
unsigned long clken;

clken = __raw_readl(W90X900_VA_CLKPWR + SUBCLK);

if (enable)
clken |= clocks;
else
clken &= ~clocks;

__raw_writel(clken, W90X900_VA_CLKPWR + SUBCLK);
}


void clks_register(struct clk_lookup *clks, size_t num)
{
int i;
Expand Down
8 changes: 8 additions & 0 deletions trunk/arch/arm/mach-w90x900/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <asm/clkdev.h>

void w90x900_clk_enable(struct clk *clk, int enable);
void w90x900_subclk_enable(struct clk *clk, int enable);
void clks_register(struct clk_lookup *clks, size_t num);

struct clk {
Expand All @@ -27,6 +28,13 @@ struct clk clk_##_name = { \
.cken = (1 << _ctrlbit), \
}

#define DEFINE_SUBCLK(_name, _ctrlbit) \
struct clk clk_##_name = { \
.enable = w90x900_subclk_enable, \
.cken = (1 << _ctrlbit), \
}


#define DEF_CLKLOOK(_clk, _devname, _conname) \
{ \
.clk = _clk, \
Expand Down
6 changes: 6 additions & 0 deletions trunk/arch/arm/mach-w90x900/w90p910.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,12 @@ static struct map_desc w90p910_iodesc[] __initdata = {
static DEFINE_CLK(lcd, 0);
static DEFINE_CLK(audio, 1);
static DEFINE_CLK(fmi, 4);
static DEFINE_SUBCLK(ms, 0);
static DEFINE_SUBCLK(sd, 1);
static DEFINE_CLK(dmac, 5);
static DEFINE_CLK(atapi, 6);
static DEFINE_CLK(emc, 7);
static DEFINE_SUBCLK(rmii, 2);
static DEFINE_CLK(usbd, 8);
static DEFINE_CLK(usbh, 9);
static DEFINE_CLK(g2d, 10);;
Expand All @@ -75,9 +78,12 @@ static struct clk_lookup w90p910_clkregs[] = {
DEF_CLKLOOK(&clk_lcd, "w90p910-lcd", NULL),
DEF_CLKLOOK(&clk_audio, "w90p910-audio", NULL),
DEF_CLKLOOK(&clk_fmi, "w90p910-fmi", NULL),
DEF_CLKLOOK(&clk_ms, "w90p910-fmi", "MS"),
DEF_CLKLOOK(&clk_sd, "w90p910-fmi", "SD"),
DEF_CLKLOOK(&clk_dmac, "w90p910-dmac", NULL),
DEF_CLKLOOK(&clk_atapi, "w90p910-atapi", NULL),
DEF_CLKLOOK(&clk_emc, "w90p910-emc", NULL),
DEF_CLKLOOK(&clk_rmii, "w90p910-emc", "RMII"),
DEF_CLKLOOK(&clk_usbd, "w90p910-usbd", NULL),
DEF_CLKLOOK(&clk_usbh, "w90p910-usbh", NULL),
DEF_CLKLOOK(&clk_g2d, "w90p910-g2d", NULL),
Expand Down

0 comments on commit 9a31bed

Please sign in to comment.