diff options
Diffstat (limited to 'drivers/net/wireless/libertas/if_sdio.c')
-rw-r--r-- | drivers/net/wireless/libertas/if_sdio.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index 485a8d406525..9716728a33cb 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c | |||
@@ -831,6 +831,58 @@ out: | |||
831 | return ret; | 831 | return ret; |
832 | } | 832 | } |
833 | 833 | ||
834 | static int if_sdio_enter_deep_sleep(struct lbs_private *priv) | ||
835 | { | ||
836 | int ret = -1; | ||
837 | struct cmd_header cmd; | ||
838 | |||
839 | memset(&cmd, 0, sizeof(cmd)); | ||
840 | |||
841 | lbs_deb_sdio("send DEEP_SLEEP command\n"); | ||
842 | ret = __lbs_cmd(priv, CMD_802_11_DEEP_SLEEP, &cmd, sizeof(cmd), | ||
843 | lbs_cmd_copyback, (unsigned long) &cmd); | ||
844 | if (ret) | ||
845 | lbs_pr_err("DEEP_SLEEP cmd failed\n"); | ||
846 | |||
847 | mdelay(200); | ||
848 | return ret; | ||
849 | } | ||
850 | |||
851 | static int if_sdio_exit_deep_sleep(struct lbs_private *priv) | ||
852 | { | ||
853 | struct if_sdio_card *card = priv->card; | ||
854 | int ret = -1; | ||
855 | |||
856 | lbs_deb_enter(LBS_DEB_SDIO); | ||
857 | sdio_claim_host(card->func); | ||
858 | |||
859 | sdio_writeb(card->func, HOST_POWER_UP, CONFIGURATION_REG, &ret); | ||
860 | if (ret) | ||
861 | lbs_pr_err("sdio_writeb failed!\n"); | ||
862 | |||
863 | sdio_release_host(card->func); | ||
864 | lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); | ||
865 | return ret; | ||
866 | } | ||
867 | |||
868 | static int if_sdio_reset_deep_sleep_wakeup(struct lbs_private *priv) | ||
869 | { | ||
870 | struct if_sdio_card *card = priv->card; | ||
871 | int ret = -1; | ||
872 | |||
873 | lbs_deb_enter(LBS_DEB_SDIO); | ||
874 | sdio_claim_host(card->func); | ||
875 | |||
876 | sdio_writeb(card->func, 0, CONFIGURATION_REG, &ret); | ||
877 | if (ret) | ||
878 | lbs_pr_err("sdio_writeb failed!\n"); | ||
879 | |||
880 | sdio_release_host(card->func); | ||
881 | lbs_deb_leave_args(LBS_DEB_SDIO, "ret %d", ret); | ||
882 | return ret; | ||
883 | |||
884 | } | ||
885 | |||
834 | /*******************************************************************/ | 886 | /*******************************************************************/ |
835 | /* SDIO callbacks */ | 887 | /* SDIO callbacks */ |
836 | /*******************************************************************/ | 888 | /*******************************************************************/ |
@@ -859,6 +911,7 @@ static void if_sdio_interrupt(struct sdio_func *func) | |||
859 | * Ignore the define name, this really means the card has | 911 | * Ignore the define name, this really means the card has |
860 | * successfully received the command. | 912 | * successfully received the command. |
861 | */ | 913 | */ |
914 | card->priv->is_activity_detected = 1; | ||
862 | if (cause & IF_SDIO_H_INT_DNLD) | 915 | if (cause & IF_SDIO_H_INT_DNLD) |
863 | lbs_host_to_card_done(card->priv); | 916 | lbs_host_to_card_done(card->priv); |
864 | 917 | ||
@@ -998,6 +1051,9 @@ static int if_sdio_probe(struct sdio_func *func, | |||
998 | 1051 | ||
999 | priv->card = card; | 1052 | priv->card = card; |
1000 | priv->hw_host_to_card = if_sdio_host_to_card; | 1053 | priv->hw_host_to_card = if_sdio_host_to_card; |
1054 | priv->enter_deep_sleep = if_sdio_enter_deep_sleep; | ||
1055 | priv->exit_deep_sleep = if_sdio_exit_deep_sleep; | ||
1056 | priv->reset_deep_sleep_wakeup = if_sdio_reset_deep_sleep_wakeup; | ||
1001 | 1057 | ||
1002 | priv->fw_ready = 1; | 1058 | priv->fw_ready = 1; |
1003 | 1059 | ||