aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx/wl1271_boot.c
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2009-10-12 08:08:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:48:04 -0400
commite8768eeb5993bf9695adb4afe4118b7fd5e307a3 (patch)
tree5148ff8752d786125c208008d50e01d33e4791c7 /drivers/net/wireless/wl12xx/wl1271_boot.c
parent732a1ad93e820768bb14732b8365493dbd69ecc8 (diff)
wl1271: Add top-register access functions
Add top register access function. Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Reviewed-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: Luciano Coelho <luciano.coelho@nokia.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/wl12xx/wl1271_boot.c')
-rw-r--r--drivers/net/wireless/wl12xx/wl1271_boot.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/drivers/net/wireless/wl12xx/wl1271_boot.c b/drivers/net/wireless/wl12xx/wl1271_boot.c
index 2eb7836c9ac1..1a3084cca9b8 100644
--- a/drivers/net/wireless/wl12xx/wl1271_boot.c
+++ b/drivers/net/wireless/wl12xx/wl1271_boot.c
@@ -419,34 +419,13 @@ static int wl1271_boot_run_firmware(struct wl1271 *wl)
419 419
420static int wl1271_boot_write_irq_polarity(struct wl1271 *wl) 420static int wl1271_boot_write_irq_polarity(struct wl1271 *wl)
421{ 421{
422 u32 polarity, status, i; 422 u32 polarity;
423 423
424 wl1271_reg_write32(wl, OCP_POR_CTR, OCP_REG_POLARITY); 424 polarity = wl1271_top_reg_read(wl, OCP_REG_POLARITY);
425 wl1271_reg_write32(wl, OCP_CMD, OCP_CMD_READ);
426
427 /* Wait until the command is complete (ie. bit 18 is set) */
428 for (i = 0; i < OCP_CMD_LOOP; i++) {
429 polarity = wl1271_reg_read32(wl, OCP_DATA_READ);
430 if (polarity & OCP_READY_MASK)
431 break;
432 }
433 if (i == OCP_CMD_LOOP) {
434 wl1271_error("OCP command timeout!");
435 return -EIO;
436 }
437
438 status = polarity & OCP_STATUS_MASK;
439 if (status != OCP_STATUS_OK) {
440 wl1271_error("OCP command failed (%d)", status);
441 return -EIO;
442 }
443 425
444 /* We use HIGH polarity, so unset the LOW bit */ 426 /* We use HIGH polarity, so unset the LOW bit */
445 polarity &= ~POLARITY_LOW; 427 polarity &= ~POLARITY_LOW;
446 428 wl1271_top_reg_write(wl, OCP_REG_POLARITY, polarity);
447 wl1271_reg_write32(wl, OCP_POR_CTR, OCP_REG_POLARITY);
448 wl1271_reg_write32(wl, OCP_DATA_WRITE, polarity);
449 wl1271_reg_write32(wl, OCP_CMD, OCP_CMD_WRITE);
450 429
451 return 0; 430 return 0;
452} 431}