aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/irda
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 /drivers/net/irda
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 'drivers/net/irda')
-rw-r--r--drivers/net/irda/pxaficp_ir.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c
index 2272156af31e..d6d5361f0936 100644
--- a/drivers/net/irda/pxaficp_ir.c
+++ b/drivers/net/irda/pxaficp_ir.c
@@ -134,7 +134,7 @@ static int pxa_irda_set_speed(struct pxa_irda *si, int speed)
134 DCSR(si->rxdma) &= ~DCSR_RUN; 134 DCSR(si->rxdma) &= ~DCSR_RUN;
135 /* disable FICP */ 135 /* disable FICP */
136 ICCR0 = 0; 136 ICCR0 = 0;
137 pxa_set_cken(CKEN13_FICP, 0); 137 pxa_set_cken(CKEN_FICP, 0);
138 138
139 /* set board transceiver to SIR mode */ 139 /* set board transceiver to SIR mode */
140 si->pdata->transceiver_mode(si->dev, IR_SIRMODE); 140 si->pdata->transceiver_mode(si->dev, IR_SIRMODE);
@@ -144,7 +144,7 @@ static int pxa_irda_set_speed(struct pxa_irda *si, int speed)
144 pxa_gpio_mode(GPIO47_STTXD_MD); 144 pxa_gpio_mode(GPIO47_STTXD_MD);
145 145
146 /* enable the STUART clock */ 146 /* enable the STUART clock */
147 pxa_set_cken(CKEN5_STUART, 1); 147 pxa_set_cken(CKEN_STUART, 1);
148 } 148 }
149 149
150 /* disable STUART first */ 150 /* disable STUART first */
@@ -169,7 +169,7 @@ static int pxa_irda_set_speed(struct pxa_irda *si, int speed)
169 /* disable STUART */ 169 /* disable STUART */
170 STIER = 0; 170 STIER = 0;
171 STISR = 0; 171 STISR = 0;
172 pxa_set_cken(CKEN5_STUART, 0); 172 pxa_set_cken(CKEN_STUART, 0);
173 173
174 /* disable FICP first */ 174 /* disable FICP first */
175 ICCR0 = 0; 175 ICCR0 = 0;
@@ -182,7 +182,7 @@ static int pxa_irda_set_speed(struct pxa_irda *si, int speed)
182 pxa_gpio_mode(GPIO47_ICPTXD_MD); 182 pxa_gpio_mode(GPIO47_ICPTXD_MD);
183 183
184 /* enable the FICP clock */ 184 /* enable the FICP clock */
185 pxa_set_cken(CKEN13_FICP, 1); 185 pxa_set_cken(CKEN_FICP, 1);
186 186
187 si->speed = speed; 187 si->speed = speed;
188 pxa_irda_fir_dma_rx_start(si); 188 pxa_irda_fir_dma_rx_start(si);
@@ -593,7 +593,7 @@ static void pxa_irda_shutdown(struct pxa_irda *si)
593 /* disable STUART SIR mode */ 593 /* disable STUART SIR mode */
594 STISR = 0; 594 STISR = 0;
595 /* disable the STUART clock */ 595 /* disable the STUART clock */
596 pxa_set_cken(CKEN5_STUART, 0); 596 pxa_set_cken(CKEN_STUART, 0);
597 597
598 /* disable DMA */ 598 /* disable DMA */
599 DCSR(si->txdma) &= ~DCSR_RUN; 599 DCSR(si->txdma) &= ~DCSR_RUN;
@@ -601,7 +601,7 @@ static void pxa_irda_shutdown(struct pxa_irda *si)
601 /* disable FICP */ 601 /* disable FICP */
602 ICCR0 = 0; 602 ICCR0 = 0;
603 /* disable the FICP clock */ 603 /* disable the FICP clock */
604 pxa_set_cken(CKEN13_FICP, 0); 604 pxa_set_cken(CKEN_FICP, 0);
605 605
606 DRCMR17 = 0; 606 DRCMR17 = 0;
607 DRCMR18 = 0; 607 DRCMR18 = 0;