diff options
author | Eric Miao <eric.y.miao@gmail.com> | 2007-04-04 23:07:20 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-04-21 18:14:01 -0400 |
commit | 7053acbd78336abf5d4bc3d8a875a03624cfb83f (patch) | |
tree | 76dff22217a91d40c1d44292c0454d31cad55f15 /arch/arm/mach-pxa | |
parent | a79220b7633b3926a9bd3527bdac3f04dbe6845c (diff) |
[ARM] 4304/1: removes the unnecessary bit number from CKENnn_XXXX
This patch removes the unnecessary bit number from CKENnn_XXXX
definitions for PXA, so that
CKEN0_PWM0 --> CKEN_PWM0
CKEN1_PWM1 --> CKEN_PWM1
...
CKEN24_CAMERA --> CKEN_CAMERA
The reasons for the change of these defitions are:
1. they do not scale - they are currently valid for pxa2xx, but
definitely not valid for pxa3xx, e.g., pxa3xx has bit 3 for camera
instead of bit 24
2. they are unnecessary - the peripheral name within the definition
has already announced its usage, we don't need those bit numbers
to know which peripheral we are going to enable/disable clock for
3. they are inconvenient - think about this: a driver programmer
for pxa has to remember which bit in the CKEN register to turn
on/off
Another change in the patch is to make the definitions equal to its
clock bit index, so that
#define CKEN_CAMERA (24)
instead of
#define CKEN_CAMERA (1 << 24)
this change, however, will add a run-time bit shift operation in
pxa_set_cken(), but the benefit of this change is that it scales
when bit index exceeds 32, e.g., pxa3xx has two registers CKENA
and CKENB, totally 64 bit for this, suppose CAMERA clock enabling
bit is CKENB:10, one can simply define CKEN_CAMERA to be (32 + 10)
and so that pxa_set_cken() need minimum change to adapt to that.
Signed-off-by: eric miao <eric.y.miao@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r-- | arch/arm/mach-pxa/generic.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-pxa/lpd270.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-pxa/lubbock.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-pxa/mainstone.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-pxa/pxa27x.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-pxa/ssp.c | 12 |
6 files changed, 15 insertions, 15 deletions
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c index b8cb79f899d5..64b08b744f9f 100644 --- a/arch/arm/mach-pxa/generic.c +++ b/arch/arm/mach-pxa/generic.c | |||
@@ -164,9 +164,9 @@ void pxa_set_cken(int clock, int enable) | |||
164 | local_irq_save(flags); | 164 | local_irq_save(flags); |
165 | 165 | ||
166 | if (enable) | 166 | if (enable) |
167 | CKEN |= clock; | 167 | CKEN |= (1 << clock); |
168 | else | 168 | else |
169 | CKEN &= ~clock; | 169 | CKEN &= ~(1 << clock); |
170 | 170 | ||
171 | local_irq_restore(flags); | 171 | local_irq_restore(flags); |
172 | } | 172 | } |
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c index 8e27a64fa9f4..e3097664ffe1 100644 --- a/arch/arm/mach-pxa/lpd270.c +++ b/arch/arm/mach-pxa/lpd270.c | |||
@@ -234,7 +234,7 @@ static void lpd270_backlight_power(int on) | |||
234 | { | 234 | { |
235 | if (on) { | 235 | if (on) { |
236 | pxa_gpio_mode(GPIO16_PWM0_MD); | 236 | pxa_gpio_mode(GPIO16_PWM0_MD); |
237 | pxa_set_cken(CKEN0_PWM0, 1); | 237 | pxa_set_cken(CKEN_PWM0, 1); |
238 | PWM_CTRL0 = 0; | 238 | PWM_CTRL0 = 0; |
239 | PWM_PWDUTY0 = 0x3ff; | 239 | PWM_PWDUTY0 = 0x3ff; |
240 | PWM_PERVAL0 = 0x3ff; | 240 | PWM_PERVAL0 = 0x3ff; |
@@ -242,7 +242,7 @@ static void lpd270_backlight_power(int on) | |||
242 | PWM_CTRL0 = 0; | 242 | PWM_CTRL0 = 0; |
243 | PWM_PWDUTY0 = 0x0; | 243 | PWM_PWDUTY0 = 0x0; |
244 | PWM_PERVAL0 = 0x3FF; | 244 | PWM_PERVAL0 = 0x3FF; |
245 | pxa_set_cken(CKEN0_PWM0, 0); | 245 | pxa_set_cken(CKEN_PWM0, 0); |
246 | } | 246 | } |
247 | } | 247 | } |
248 | 248 | ||
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index 055de7f4f00a..6377b2e29ff0 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c | |||
@@ -220,7 +220,7 @@ static struct resource pxa_ssp_resources[] = { | |||
220 | 220 | ||
221 | static struct pxa2xx_spi_master pxa_ssp_master_info = { | 221 | static struct pxa2xx_spi_master pxa_ssp_master_info = { |
222 | .ssp_type = PXA25x_SSP, | 222 | .ssp_type = PXA25x_SSP, |
223 | .clock_enable = CKEN3_SSP, | 223 | .clock_enable = CKEN_SSP, |
224 | .num_chipselect = 0, | 224 | .num_chipselect = 0, |
225 | }; | 225 | }; |
226 | 226 | ||
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index 56d94d88d5ca..ed99a81b98f3 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c | |||
@@ -266,7 +266,7 @@ static void mainstone_backlight_power(int on) | |||
266 | { | 266 | { |
267 | if (on) { | 267 | if (on) { |
268 | pxa_gpio_mode(GPIO16_PWM0_MD); | 268 | pxa_gpio_mode(GPIO16_PWM0_MD); |
269 | pxa_set_cken(CKEN0_PWM0, 1); | 269 | pxa_set_cken(CKEN_PWM0, 1); |
270 | PWM_CTRL0 = 0; | 270 | PWM_CTRL0 = 0; |
271 | PWM_PWDUTY0 = 0x3ff; | 271 | PWM_PWDUTY0 = 0x3ff; |
272 | PWM_PERVAL0 = 0x3ff; | 272 | PWM_PERVAL0 = 0x3ff; |
@@ -274,7 +274,7 @@ static void mainstone_backlight_power(int on) | |||
274 | PWM_CTRL0 = 0; | 274 | PWM_CTRL0 = 0; |
275 | PWM_PWDUTY0 = 0x0; | 275 | PWM_PWDUTY0 = 0x0; |
276 | PWM_PERVAL0 = 0x3FF; | 276 | PWM_PERVAL0 = 0x3FF; |
277 | pxa_set_cken(CKEN0_PWM0, 0); | 277 | pxa_set_cken(CKEN_PWM0, 0); |
278 | } | 278 | } |
279 | } | 279 | } |
280 | 280 | ||
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index 74eeada1e2fc..c64bab49efc4 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -140,9 +140,9 @@ void pxa_cpu_pm_enter(suspend_state_t state) | |||
140 | extern void pxa_cpu_resume(void); | 140 | extern void pxa_cpu_resume(void); |
141 | 141 | ||
142 | if (state == PM_SUSPEND_STANDBY) | 142 | if (state == PM_SUSPEND_STANDBY) |
143 | CKEN = CKEN22_MEMC | CKEN9_OSTIMER | CKEN16_LCD |CKEN0_PWM0; | 143 | CKEN = CKEN_MEMC | CKEN_OSTIMER | CKEN_LCD | CKEN_PWM0; |
144 | else | 144 | else |
145 | CKEN = CKEN22_MEMC | CKEN9_OSTIMER; | 145 | CKEN = CKEN_MEMC | CKEN_OSTIMER; |
146 | 146 | ||
147 | /* ensure voltage-change sequencer not initiated, which hangs */ | 147 | /* ensure voltage-change sequencer not initiated, which hangs */ |
148 | PCFR &= ~PCFR_FVC; | 148 | PCFR &= ~PCFR_FVC; |
diff --git a/arch/arm/mach-pxa/ssp.c b/arch/arm/mach-pxa/ssp.c index 6cc202755fb4..71766ac0328b 100644 --- a/arch/arm/mach-pxa/ssp.c +++ b/arch/arm/mach-pxa/ssp.c | |||
@@ -52,13 +52,13 @@ struct ssp_info_ { | |||
52 | */ | 52 | */ |
53 | static const struct ssp_info_ ssp_info[PXA_SSP_PORTS] = { | 53 | static const struct ssp_info_ ssp_info[PXA_SSP_PORTS] = { |
54 | #if defined (CONFIG_PXA27x) | 54 | #if defined (CONFIG_PXA27x) |
55 | {IRQ_SSP, CKEN23_SSP1}, | 55 | {IRQ_SSP, CKEN_SSP1}, |
56 | {IRQ_SSP2, CKEN3_SSP2}, | 56 | {IRQ_SSP2, CKEN_SSP2}, |
57 | {IRQ_SSP3, CKEN4_SSP3}, | 57 | {IRQ_SSP3, CKEN_SSP3}, |
58 | #else | 58 | #else |
59 | {IRQ_SSP, CKEN3_SSP}, | 59 | {IRQ_SSP, CKEN_SSP}, |
60 | {IRQ_NSSP, CKEN9_NSSP}, | 60 | {IRQ_NSSP, CKEN_NSSP}, |
61 | {IRQ_ASSP, CKEN10_ASSP}, | 61 | {IRQ_ASSP, CKEN_ASSP}, |
62 | #endif | 62 | #endif |
63 | }; | 63 | }; |
64 | 64 | ||