aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authorIan Molton <spyro@f2s.com>2008-07-08 05:32:08 -0400
committerIan Molton <spyro@f2s.com>2008-07-10 05:28:43 -0400
commited847782f6459a5c94aa0c9f93679f6a4176a47a (patch)
tree6a08b8a941ef60b22ab404bb5803fa23a3e30cc8 /arch/arm/mach-pxa
parentaa9ae8eb1a917c8794bceef0a8e6ff1f4d7c46de (diff)
Clocklib: Provide for GPIO 12 clock on PXA
Signed-off-by: Ian Molton <spyro@f2s.com>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/clock.h9
-rw-r--r--arch/arm/mach-pxa/pxa25x.c24
2 files changed, 33 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/clock.h b/arch/arm/mach-pxa/clock.h
index 83cbfaba485d..32d0c074b351 100644
--- a/arch/arm/mach-pxa/clock.h
+++ b/arch/arm/mach-pxa/clock.h
@@ -47,6 +47,15 @@ struct clk {
47 .other = _other, \ 47 .other = _other, \
48 } 48 }
49 49
50#define INIT_CLK(_name, _ops, _rate, _delay, _dev) \
51 { \
52 .name = _name, \
53 .dev = _dev, \
54 .ops = _ops, \
55 .rate = _rate, \
56 .delay = _delay, \
57 }
58
50extern const struct clkops clk_cken_ops; 59extern const struct clkops clk_cken_ops;
51 60
52void clk_cken_enable(struct clk *clk); 61void clk_cken_enable(struct clk *clk);
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c
index 90b441f5df5a..034d3a6c31d8 100644
--- a/arch/arm/mach-pxa/pxa25x.c
+++ b/arch/arm/mach-pxa/pxa25x.c
@@ -109,6 +109,29 @@ static const struct clkops clk_pxa25x_lcd_ops = {
109 .getrate = clk_pxa25x_lcd_getrate, 109 .getrate = clk_pxa25x_lcd_getrate,
110}; 110};
111 111
112static unsigned long gpio12_config_32k[] = {
113 GPIO12_32KHz,
114};
115
116static unsigned long gpio12_config_gpio[] = {
117 GPIO12_GPIO,
118};
119
120static void clk_gpio12_enable(struct clk *clk)
121{
122 pxa2xx_mfp_config(gpio12_config_32k, 1);
123}
124
125static void clk_gpio12_disable(struct clk *clk)
126{
127 pxa2xx_mfp_config(gpio12_config_gpio, 1);
128}
129
130static const struct clkops clk_pxa25x_gpio12_ops = {
131 .enable = clk_gpio12_enable,
132 .disable = clk_gpio12_disable,
133};
134
112/* 135/*
113 * 3.6864MHz -> OST, GPIO, SSP, PWM, PLLs (95.842MHz, 147.456MHz) 136 * 3.6864MHz -> OST, GPIO, SSP, PWM, PLLs (95.842MHz, 147.456MHz)
114 * 95.842MHz -> MMC 19.169MHz, I2C 31.949MHz, FICP 47.923MHz, USB 47.923MHz 137 * 95.842MHz -> MMC 19.169MHz, I2C 31.949MHz, FICP 47.923MHz, USB 47.923MHz
@@ -128,6 +151,7 @@ static struct clk pxa25x_clks[] = {
128 INIT_CKEN("UARTCLK", BTUART, 14745600, 1, &pxa_device_btuart.dev), 151 INIT_CKEN("UARTCLK", BTUART, 14745600, 1, &pxa_device_btuart.dev),
129 INIT_CKEN("UARTCLK", STUART, 14745600, 1, NULL), 152 INIT_CKEN("UARTCLK", STUART, 14745600, 1, NULL),
130 INIT_CKEN("UDCCLK", USB, 47923000, 5, &pxa25x_device_udc.dev), 153 INIT_CKEN("UDCCLK", USB, 47923000, 5, &pxa25x_device_udc.dev),
154 INIT_CLK("GPIO12_CLK", &clk_pxa25x_gpio12_ops, 32768, 0, NULL),
131 INIT_CKEN("MMCCLK", MMC, 19169000, 0, &pxa_device_mci.dev), 155 INIT_CKEN("MMCCLK", MMC, 19169000, 0, &pxa_device_mci.dev),
132 INIT_CKEN("I2CCLK", I2C, 31949000, 0, &pxa_device_i2c.dev), 156 INIT_CKEN("I2CCLK", I2C, 31949000, 0, &pxa_device_i2c.dev),
133 157