From 01573e231f18eb2d99162747186f59511f56b64d Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Fri, 08 Dec 2023 10:40:48 +0000 Subject: [PATCH] 移去rt --- kernel/net/rfkill/rfkill-wlan.c | 42 ++++++++++++++++++++---------------------- 1 files changed, 20 insertions(+), 22 deletions(-) diff --git a/kernel/net/rfkill/rfkill-wlan.c b/kernel/net/rfkill/rfkill-wlan.c index 2108d6d..89d9787 100644 --- a/kernel/net/rfkill/rfkill-wlan.c +++ b/kernel/net/rfkill/rfkill-wlan.c @@ -216,6 +216,7 @@ return 0; } +EXPORT_SYMBOL(rfkill_get_wifi_power_state); /************************************************************************** * @@ -233,9 +234,6 @@ bool toggle = false; LOG("%s: %d\n", __func__, on); - - if (!on && primary_sdio_host) - mmc_pwrseq_power_off(primary_sdio_host); if (!mrfkill) { LOG("%s: rfkill-wlan driver has not Successful initialized\n", @@ -271,12 +269,17 @@ regulator_set_voltage(ldo, 3000000, 3000000); LOG("%s: %s enabled\n", __func__, ldostr); ret = regulator_enable(ldo); + if (ret) + LOG("ldo enable failed\n"); wifi_power_state = 1; LOG("wifi turn on power.\n"); } else { LOG("%s: %s disabled\n", __func__, ldostr); - while (regulator_is_enabled(ldo) > 0) + while (regulator_is_enabled(ldo) > 0) { ret = regulator_disable(ldo); + if (ret) + LOG("ldo disable failed\n"); + } wifi_power_state = 0; LOG("wifi shut off power.\n"); } @@ -316,11 +319,6 @@ } wifi_power_state = 0; - - if (!rfkill_get_bt_power_state(&bt_power, &toggle)) { - LOG("%s: toggle = %s\n", __func__, toggle ? "true" : "false"); - } - if (toggle) { if (!bt_power) { LOG("%s: wifi will set vbat to low\n", __func__); @@ -342,10 +340,9 @@ * Wifi Sdio Detect Func * *************************************************************************/ -extern int mmc_host_rescan(struct mmc_host *host, int val, int irq_type); int rockchip_wifi_set_carddetect(int val) { - return mmc_host_rescan(NULL, val, 1); + return 0; } EXPORT_SYMBOL(rockchip_wifi_set_carddetect); @@ -439,7 +436,7 @@ addr[5]); ret = rk_vendor_write(WIFI_MAC_ID, addr, 6); if (ret != 0) { - LOG("%s: rk_vendor_write failed %d\n" + LOG("%s: rk_vendor_write failed %d\n", __func__, ret); memset(addr, 0, 6); return -1; @@ -562,7 +559,8 @@ __func__); strcpy(wifi_chip_type_string, "rkwifi"); } else { - strcpy(wifi_chip_type_string, strings); + if (strings && strlen(strings) < 64) + strcpy(wifi_chip_type_string, strings); } LOG("%s: wifi_chip_type = %s\n", __func__, wifi_chip_type_string); @@ -860,11 +858,6 @@ if (ret) goto fail_alloc; - ret = rfkill_rk_setup_gpio(&pdata->power_n, wlan_name, - "wlan_poweren"); - if (ret) - goto fail_alloc; - ret = rfkill_rk_setup_gpio(&pdata->reset_n, wlan_name, "wlan_reset"); if (ret) @@ -878,11 +871,7 @@ #ifdef CONFIG_SDIO_KEEPALIVE if (gpio_is_valid(pdata->power_n.io) && - primary_sdio_host && primary_sdio_host->support_chip_alive) gpio_direction_output(pdata->power_n.io, pdata->power_n.enable); -#else - if (gpio_is_valid(pdata->power_n.io)) - gpio_direction_output(pdata->power_n.io, !pdata->power_n.enable); #endif @@ -935,6 +924,14 @@ return 0; } +static void rfkill_wlan_shutdown(struct platform_device *pdev) +{ + LOG("Enter %s\n", __func__); + + rockchip_wifi_power(0); + rfkill_set_wifi_bt_power(0); +} + static int rfkill_wlan_suspend(struct platform_device *pdev, pm_message_t state) { LOG("Enter %s\n", __func__); @@ -958,6 +955,7 @@ static struct platform_driver rfkill_wlan_driver = { .probe = rfkill_wlan_probe, .remove = rfkill_wlan_remove, + .shutdown = rfkill_wlan_shutdown, .suspend = rfkill_wlan_suspend, .resume = rfkill_wlan_resume, .driver = { -- Gitblit v1.6.2