platform_zte_zx296716_sdio.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2016 - 2018 Realtek Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. *****************************************************************************/
  15. #include <linux/printk.h> /* pr_info(() */
  16. #include <linux/delay.h> /* msleep() */
  17. #include "platform_zte_zx296716_sdio.h" /* sdio_reinit() and etc */
  18. /*
  19. * Return:
  20. * 0: power on successfully
  21. * others: power on failed
  22. */
  23. int platform_wifi_power_on(void)
  24. {
  25. int ret = 0;
  26. pr_info("######%s: disable--1--\n", __func__);
  27. extern_wifi_set_enable(0);
  28. /*msleep(500);*/ /* add in function:extern_wifi_set_enable */
  29. pr_info("######%s: enable--2---\n", __func__);
  30. extern_wifi_set_enable(1);
  31. /*msleep(500);*/
  32. sdio_reinit();
  33. return ret;
  34. }
  35. void platform_wifi_power_off(void)
  36. {
  37. int card_val;
  38. pr_info("######%s:\n", __func__);
  39. #ifdef CONFIG_A16T03_BOARD
  40. card_val = sdio_host_is_null();
  41. if (card_val)
  42. remove_card();
  43. #endif /* CONFIG_A16T03_BOARD */
  44. extern_wifi_set_enable(0);
  45. /*msleep(500);*/
  46. }