diff options
author | Luciano Coelho <coelho@ti.com> | 2012-05-10 05:13:26 -0400 |
---|---|---|
committer | Luciano Coelho <coelho@ti.com> | 2012-06-05 08:55:14 -0400 |
commit | b8422dcb865befc5d2d7c21e8427eedf32558fea (patch) | |
tree | f51c347a53fb1a647a0c85cd25ebda82e8bc4427 /drivers/net/wireless/ti/wl18xx/main.c | |
parent | 872b345fbaef290f890d0bbd34b78ab50269980f (diff) |
wl18xx: add hw_init operation
Add wl18xx-specific HW initialization operation and create acx.[ch]
files to support that.
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Diffstat (limited to 'drivers/net/wireless/ti/wl18xx/main.c')
-rw-r--r-- | drivers/net/wireless/ti/wl18xx/main.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/drivers/net/wireless/ti/wl18xx/main.c b/drivers/net/wireless/ti/wl18xx/main.c index ae71131a4bba..1e0719c7ccb9 100644 --- a/drivers/net/wireless/ti/wl18xx/main.c +++ b/drivers/net/wireless/ti/wl18xx/main.c | |||
@@ -33,6 +33,7 @@ | |||
33 | 33 | ||
34 | #include "reg.h" | 34 | #include "reg.h" |
35 | #include "conf.h" | 35 | #include "conf.h" |
36 | #include "acx.h" | ||
36 | #include "tx.h" | 37 | #include "tx.h" |
37 | #include "wl18xx.h" | 38 | #include "wl18xx.h" |
38 | 39 | ||
@@ -473,6 +474,36 @@ static void wl18xx_tx_immediate_completion(struct wl1271 *wl) | |||
473 | wl18xx_tx_immediate_complete(wl); | 474 | wl18xx_tx_immediate_complete(wl); |
474 | } | 475 | } |
475 | 476 | ||
477 | static int wl18xx_hw_init(struct wl1271 *wl) | ||
478 | { | ||
479 | int ret; | ||
480 | u32 host_cfg_bitmap = HOST_IF_CFG_RX_FIFO_ENABLE | | ||
481 | HOST_IF_CFG_ADD_RX_ALIGNMENT; | ||
482 | |||
483 | u32 sdio_align_size = 0; | ||
484 | |||
485 | /* Enable Tx SDIO padding */ | ||
486 | if (wl->quirks & WLCORE_QUIRK_TX_BLOCKSIZE_ALIGN) { | ||
487 | host_cfg_bitmap |= HOST_IF_CFG_TX_PAD_TO_SDIO_BLK; | ||
488 | sdio_align_size = WL12XX_BUS_BLOCK_SIZE; | ||
489 | } | ||
490 | |||
491 | /* Enable Rx SDIO padding */ | ||
492 | if (wl->quirks & WLCORE_QUIRK_RX_BLOCKSIZE_ALIGN) { | ||
493 | host_cfg_bitmap |= HOST_IF_CFG_RX_PAD_TO_SDIO_BLK; | ||
494 | sdio_align_size = WL12XX_BUS_BLOCK_SIZE; | ||
495 | } | ||
496 | |||
497 | ret = wl18xx_acx_host_if_cfg_bitmap(wl, host_cfg_bitmap, | ||
498 | sdio_align_size, | ||
499 | WL18XX_TX_HW_BLOCK_SPARE, | ||
500 | WL18XX_HOST_IF_LEN_SIZE_FIELD); | ||
501 | if (ret < 0) | ||
502 | return ret; | ||
503 | |||
504 | return ret; | ||
505 | } | ||
506 | |||
476 | static struct wlcore_ops wl18xx_ops = { | 507 | static struct wlcore_ops wl18xx_ops = { |
477 | .identify_chip = wl18xx_identify_chip, | 508 | .identify_chip = wl18xx_identify_chip, |
478 | .boot = wl18xx_boot, | 509 | .boot = wl18xx_boot, |
@@ -485,6 +516,7 @@ static struct wlcore_ops wl18xx_ops = { | |||
485 | .get_rx_packet_len = wl18xx_get_rx_packet_len, | 516 | .get_rx_packet_len = wl18xx_get_rx_packet_len, |
486 | .tx_immediate_compl = wl18xx_tx_immediate_completion, | 517 | .tx_immediate_compl = wl18xx_tx_immediate_completion, |
487 | .tx_delayed_compl = NULL, | 518 | .tx_delayed_compl = NULL, |
519 | .hw_init = wl18xx_hw_init, | ||
488 | }; | 520 | }; |
489 | 521 | ||
490 | int __devinit wl18xx_probe(struct platform_device *pdev) | 522 | int __devinit wl18xx_probe(struct platform_device *pdev) |