aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorEric Miao <eric.y.miao@gmail.com>2007-04-04 23:07:20 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2007-04-21 18:14:01 -0400
commit7053acbd78336abf5d4bc3d8a875a03624cfb83f (patch)
tree76dff22217a91d40c1d44292c0454d31cad55f15 /sound/soc
parenta79220b7633b3926a9bd3527bdac3f04dbe6845c (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 'sound/soc')
-rw-r--r--sound/soc/pxa/pxa2xx-ac97.c12
-rw-r--r--sound/soc/pxa/pxa2xx-i2s.c4
2 files changed, 8 insertions, 8 deletions
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index 1bbbeff84ef0..b222755763e7 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -256,7 +256,7 @@ static int pxa2xx_ac97_suspend(struct platform_device *pdev,
256 struct snd_soc_cpu_dai *dai) 256 struct snd_soc_cpu_dai *dai)
257{ 257{
258 GCR |= GCR_ACLINK_OFF; 258 GCR |= GCR_ACLINK_OFF;
259 pxa_set_cken(CKEN2_AC97, 0); 259 pxa_set_cken(CKEN_AC97, 0);
260 return 0; 260 return 0;
261} 261}
262 262
@@ -271,7 +271,7 @@ static int pxa2xx_ac97_resume(struct platform_device *pdev,
271 /* Use GPIO 113 as AC97 Reset on Bulverde */ 271 /* Use GPIO 113 as AC97 Reset on Bulverde */
272 pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT); 272 pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
273#endif 273#endif
274 pxa_set_cken(CKEN2_AC97, 1); 274 pxa_set_cken(CKEN_AC97, 1);
275 return 0; 275 return 0;
276} 276}
277 277
@@ -296,14 +296,14 @@ static int pxa2xx_ac97_probe(struct platform_device *pdev)
296 /* Use GPIO 113 as AC97 Reset on Bulverde */ 296 /* Use GPIO 113 as AC97 Reset on Bulverde */
297 pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT); 297 pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
298#endif 298#endif
299 pxa_set_cken(CKEN2_AC97, 1); 299 pxa_set_cken(CKEN_AC97, 1);
300 return 0; 300 return 0;
301 301
302 err: 302 err:
303 if (CKEN & CKEN2_AC97) { 303 if (CKEN & CKEN_AC97) {
304 GCR |= GCR_ACLINK_OFF; 304 GCR |= GCR_ACLINK_OFF;
305 free_irq(IRQ_AC97, NULL); 305 free_irq(IRQ_AC97, NULL);
306 pxa_set_cken(CKEN2_AC97, 0); 306 pxa_set_cken(CKEN_AC97, 0);
307 } 307 }
308 return ret; 308 return ret;
309} 309}
@@ -312,7 +312,7 @@ static void pxa2xx_ac97_remove(struct platform_device *pdev)
312{ 312{
313 GCR |= GCR_ACLINK_OFF; 313 GCR |= GCR_ACLINK_OFF;
314 free_irq(IRQ_AC97, NULL); 314 free_irq(IRQ_AC97, NULL);
315 pxa_set_cken(CKEN2_AC97, 0); 315 pxa_set_cken(CKEN_AC97, 0);
316} 316}
317 317
318static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream, 318static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream,
diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c
index 575a6137c040..50c5c83f67db 100644
--- a/sound/soc/pxa/pxa2xx-i2s.c
+++ b/sound/soc/pxa/pxa2xx-i2s.c
@@ -149,7 +149,7 @@ static int pxa2xx_i2s_hw_params(struct snd_pcm_substream *substream,
149 pxa_gpio_mode(gpio_bus[pxa_i2s.master].tx); 149 pxa_gpio_mode(gpio_bus[pxa_i2s.master].tx);
150 pxa_gpio_mode(gpio_bus[pxa_i2s.master].frm); 150 pxa_gpio_mode(gpio_bus[pxa_i2s.master].frm);
151 pxa_gpio_mode(gpio_bus[pxa_i2s.master].clk); 151 pxa_gpio_mode(gpio_bus[pxa_i2s.master].clk);
152 pxa_set_cken(CKEN8_I2S, 1); 152 pxa_set_cken(CKEN_I2S, 1);
153 pxa_i2s_wait(); 153 pxa_i2s_wait();
154 154
155 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) 155 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
@@ -234,7 +234,7 @@ static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream)
234 if (SACR1 & (SACR1_DREC | SACR1_DRPL)) { 234 if (SACR1 & (SACR1_DREC | SACR1_DRPL)) {
235 SACR0 &= ~SACR0_ENB; 235 SACR0 &= ~SACR0_ENB;
236 pxa_i2s_wait(); 236 pxa_i2s_wait();
237 pxa_set_cken(CKEN8_I2S, 0); 237 pxa_set_cken(CKEN_I2S, 0);
238 } 238 }
239} 239}
240 240