diff options
author | Michael Buesch <mbuesch@freenet.de> | 2006-03-18 15:28:46 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-03-27 11:19:40 -0500 |
commit | 714eece7c7c300bbc5e8285890e7374958ca37f4 (patch) | |
tree | 7a589f5aa916eb5463dbc5d420ee9c161456695e /drivers/net/wireless/bcm43xx/bcm43xx_leds.c | |
parent | 4a1821e4c7a84569f788b7667affe2743317b63f (diff) |
[PATCH] bcm43xx: fix some gpio register trashing (hopefully :D)
Signed-off-by: Michael Buesch <mbuesch@freenet.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/bcm43xx/bcm43xx_leds.c')
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_leds.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_leds.c b/drivers/net/wireless/bcm43xx/bcm43xx_leds.c index 72a243aac6cb..c8f5ad75d2a6 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_leds.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_leds.c | |||
@@ -165,7 +165,7 @@ void bcm43xx_leds_exit(struct bcm43xx_private *bcm) | |||
165 | led = &(bcm->leds[i]); | 165 | led = &(bcm->leds[i]); |
166 | bcm43xx_led_blink_stop(led, 1); | 166 | bcm43xx_led_blink_stop(led, 1); |
167 | } | 167 | } |
168 | bcm43xx_leds_turn_off(bcm); | 168 | bcm43xx_leds_switch_all(bcm, 0); |
169 | } | 169 | } |
170 | 170 | ||
171 | void bcm43xx_leds_update(struct bcm43xx_private *bcm, int activity) | 171 | void bcm43xx_leds_update(struct bcm43xx_private *bcm, int activity) |
@@ -268,18 +268,26 @@ void bcm43xx_leds_update(struct bcm43xx_private *bcm, int activity) | |||
268 | bcm43xx_write16(bcm, BCM43xx_MMIO_GPIO_CONTROL, ledctl); | 268 | bcm43xx_write16(bcm, BCM43xx_MMIO_GPIO_CONTROL, ledctl); |
269 | } | 269 | } |
270 | 270 | ||
271 | void bcm43xx_leds_turn_off(struct bcm43xx_private *bcm) | 271 | void bcm43xx_leds_switch_all(struct bcm43xx_private *bcm, int on) |
272 | { | 272 | { |
273 | struct bcm43xx_led *led; | 273 | struct bcm43xx_led *led; |
274 | u16 ledctl = 0; | 274 | u16 ledctl; |
275 | int i; | 275 | int i; |
276 | int bit_on; | ||
276 | 277 | ||
278 | ledctl = bcm43xx_read16(bcm, BCM43xx_MMIO_GPIO_CONTROL); | ||
277 | for (i = 0; i < BCM43xx_NR_LEDS; i++) { | 279 | for (i = 0; i < BCM43xx_NR_LEDS; i++) { |
278 | led = &(bcm->leds[i]); | 280 | led = &(bcm->leds[i]); |
279 | if (led->behaviour == BCM43xx_LED_INACTIVE) | 281 | if (led->behaviour == BCM43xx_LED_INACTIVE) |
280 | continue; | 282 | continue; |
281 | if (led->activelow) | 283 | if (on) |
284 | bit_on = led->activelow ? 0 : 1; | ||
285 | else | ||
286 | bit_on = led->activelow ? 1 : 0; | ||
287 | if (bit_on) | ||
282 | ledctl |= (1 << i); | 288 | ledctl |= (1 << i); |
289 | else | ||
290 | ledctl &= ~(1 << i); | ||
283 | } | 291 | } |
284 | bcm43xx_write16(bcm, BCM43xx_MMIO_GPIO_CONTROL, ledctl); | 292 | bcm43xx_write16(bcm, BCM43xx_MMIO_GPIO_CONTROL, ledctl); |
285 | } | 293 | } |