aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Artamonow <mad_soft@inbox.ru>2009-03-15 14:13:16 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-03-15 16:08:18 -0400
commit104a416d80fca22284319b06eff87b6f632a3649 (patch)
tree9be3a552ba5814345c0ec8e1ee8abe47fea10bf7
parentddcd8c09001e66f78488bfc238ed5bd8441d4496 (diff)
[ARM] 5426/1: h3600: remove clr_h3600_egpio/set_h3600_egpio helpers
Replace all occurences with assign_h3600_egpio. Also simplify code a bit by replacing couple of if-else statements with one-line equivalents. Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mach-sa1100/h3600.c6
-rw-r--r--arch/arm/mach-sa1100/include/mach/h3600.h13
-rw-r--r--drivers/pcmcia/sa1100_h3600.c23
3 files changed, 11 insertions, 31 deletions
diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c
index 9f13f5bd57a..1fa0f58c07b 100644
--- a/arch/arm/mach-sa1100/h3600.c
+++ b/arch/arm/mach-sa1100/h3600.c
@@ -92,11 +92,7 @@ static int h3600_irda_set_power(struct device *dev, unsigned int state)
92 92
93static void h3600_irda_set_speed(struct device *dev, unsigned int speed) 93static void h3600_irda_set_speed(struct device *dev, unsigned int speed)
94{ 94{
95 if (speed < 4000000) { 95 assign_h3600_egpio(IPAQ_EGPIO_IR_FSEL, !(speed < 4000000));
96 clr_h3600_egpio(IPAQ_EGPIO_IR_FSEL);
97 } else {
98 set_h3600_egpio(IPAQ_EGPIO_IR_FSEL);
99 }
100} 96}
101 97
102static struct irda_platform_data h3600_irda_data = { 98static struct irda_platform_data h3600_irda_data = {
diff --git a/arch/arm/mach-sa1100/include/mach/h3600.h b/arch/arm/mach-sa1100/include/mach/h3600.h
index 8e8ccfc2f46..33fc4bcfd3e 100644
--- a/arch/arm/mach-sa1100/include/mach/h3600.h
+++ b/arch/arm/mach-sa1100/include/mach/h3600.h
@@ -105,19 +105,6 @@ static __inline__ void assign_h3600_egpio(enum ipaq_egpio_type x, int level)
105 ipaq_model_ops.control(x,level); 105 ipaq_model_ops.control(x,level);
106} 106}
107 107
108static __inline__ void clr_h3600_egpio(enum ipaq_egpio_type x)
109{
110 if (ipaq_model_ops.control)
111 ipaq_model_ops.control(x,0);
112}
113
114static __inline__ void set_h3600_egpio(enum ipaq_egpio_type x)
115{
116 if (ipaq_model_ops.control)
117 ipaq_model_ops.control(x,1);
118}
119
120
121#endif /* ASSEMBLY */ 108#endif /* ASSEMBLY */
122 109
123#endif /* _INCLUDE_H3600_H_ */ 110#endif /* _INCLUDE_H3600_H_ */
diff --git a/drivers/pcmcia/sa1100_h3600.c b/drivers/pcmcia/sa1100_h3600.c
index 6de4e1b41d6..0cc3748f375 100644
--- a/drivers/pcmcia/sa1100_h3600.c
+++ b/drivers/pcmcia/sa1100_h3600.c
@@ -37,9 +37,9 @@ static void h3600_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
37 soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); 37 soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs));
38 38
39 /* Disable CF bus: */ 39 /* Disable CF bus: */
40 clr_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON); 40 assign_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON, 0);
41 clr_h3600_egpio(IPAQ_EGPIO_OPT_ON); 41 assign_h3600_egpio(IPAQ_EGPIO_OPT_ON, 0);
42 set_h3600_egpio(IPAQ_EGPIO_OPT_RESET); 42 assign_h3600_egpio(IPAQ_EGPIO_OPT_RESET, 1);
43} 43}
44 44
45static void 45static void
@@ -79,10 +79,7 @@ h3600_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_
79 return -1; 79 return -1;
80 } 80 }
81 81
82 if (state->flags & SS_RESET) 82 assign_h3600_egpio(IPAQ_EGPIO_CARD_RESET, !!(state->flags & SS_RESET));
83 set_h3600_egpio(IPAQ_EGPIO_CARD_RESET);
84 else
85 clr_h3600_egpio(IPAQ_EGPIO_CARD_RESET);
86 83
87 /* Silently ignore Vpp, output enable, speaker enable. */ 84 /* Silently ignore Vpp, output enable, speaker enable. */
88 85
@@ -92,9 +89,9 @@ h3600_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_
92static void h3600_pcmcia_socket_init(struct soc_pcmcia_socket *skt) 89static void h3600_pcmcia_socket_init(struct soc_pcmcia_socket *skt)
93{ 90{
94 /* Enable CF bus: */ 91 /* Enable CF bus: */
95 set_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON); 92 assign_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON, 1);
96 set_h3600_egpio(IPAQ_EGPIO_OPT_ON); 93 assign_h3600_egpio(IPAQ_EGPIO_OPT_ON, 1);
97 clr_h3600_egpio(IPAQ_EGPIO_OPT_RESET); 94 assign_h3600_egpio(IPAQ_EGPIO_OPT_RESET, 0);
98 95
99 msleep(10); 96 msleep(10);
100 97
@@ -112,10 +109,10 @@ static void h3600_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt)
112 * socket 0 then socket 1. 109 * socket 0 then socket 1.
113 */ 110 */
114 if (skt->nr == 1) { 111 if (skt->nr == 1) {
115 clr_h3600_egpio(IPAQ_EGPIO_OPT_ON); 112 assign_h3600_egpio(IPAQ_EGPIO_OPT_ON, 0);
116 clr_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON); 113 assign_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON, 0);
117 /* hmm, does this suck power? */ 114 /* hmm, does this suck power? */
118 set_h3600_egpio(IPAQ_EGPIO_OPT_RESET); 115 assign_h3600_egpio(IPAQ_EGPIO_OPT_RESET, 1);
119 } 116 }
120} 117}
121 118