diff --git a/Documentation/devicetree/bindings/wcnss/wcnss-wlan.txt b/Documentation/devicetree/bindings/wcnss/wcnss-wlan.txt index 46cbc5206be4..77d6bf06ee26 100644 --- a/Documentation/devicetree/bindings/wcnss/wcnss-wlan.txt +++ b/Documentation/devicetree/bindings/wcnss/wcnss-wlan.txt @@ -66,8 +66,6 @@ to use for VBATT feature. register is available or not. - qcom,wcn-external-gpio-support: boolean flag to determine 3.3v gpio support for pronto hardware for a target. -- qcom,wcn-external-gpio: The wcnss wlan module 3.3v external GPIO for -the pronto hardware. Example: @@ -89,7 +87,6 @@ Example: gpios = <&msmgpio 36 0>, <&msmgpio 37 0>, <&msmgpio 38 0>, <&msmgpio 39 0>, <&msmgpio 40 0>; - qcom,wcn-external-gpio = <&msmgpio 64 0>; qcom,wcn-external-gpio-support; qcom,has-48mhz-xo; qcom,is-pronto-vt; diff --git a/drivers/net/wireless/wcnss/wcnss_vreg.c b/drivers/net/wireless/wcnss/wcnss_vreg.c index 613f6fbc786c..d0a74744f70a 100644 --- a/drivers/net/wireless/wcnss/wcnss_vreg.c +++ b/drivers/net/wireless/wcnss/wcnss_vreg.c @@ -101,45 +101,6 @@ enum { IRIS_3610 }; -static int wcnss_external_gpio_set_state(bool state) -{ - int ret; - struct wcnss_wlan_config *cfg = wcnss_get_wlan_config(); - - if (!cfg) - return -EINVAL; - - if (state) { - ret = gpio_request(cfg->wcn_external_gpio, - WCNSS_EXTERNAL_GPIO_NAME); - if (ret) { - pr_err("%s: Can't get GPIO %s, ret = %d\n", - __func__, WCNSS_EXTERNAL_GPIO_NAME, ret); - return ret; - } - - ret = gpio_direction_output(cfg->wcn_external_gpio, - WCNSS_EXTERNAL_GPIO_DIR_OUT); - if (ret) { - pr_err("%s: Can't set GPIO %s direction, ret = %d\n", - __func__, WCNSS_EXTERNAL_GPIO_NAME, ret); - gpio_free(cfg->wcn_external_gpio); - return ret; - } - - gpio_set_value(cfg->wcn_external_gpio, - WCNSS_EXTERNAL_GPIO_HIGH); - } else { - gpio_set_value(cfg->wcn_external_gpio, WCNSS_EXTERNAL_GPIO_LOW); - gpio_free(cfg->wcn_external_gpio); - } - - pr_debug("%s: %d gpio is now %s\n", __func__, - cfg->wcn_external_gpio, - state ? "enabled" : "disabled"); - - return 0; -} int xo_auto_detect(u32 reg) { @@ -457,8 +418,7 @@ static void wcnss_vregs_off(struct vregs_info regulators[], uint size, continue; if (cfg->wcn_external_gpio_support) { - if (!memcmp(regulators[i].name, VDD_PA, - sizeof(VDD_PA))) + if (!memcmp(regulators[i].name, VDD_PA, sizeof(VDD_PA))) continue; } @@ -524,8 +484,7 @@ static int wcnss_vregs_on(struct device *dev, for (i = 0; i < size; i++) { if (cfg->wcn_external_gpio_support) { - if (!memcmp(regulators[i].name, VDD_PA, - sizeof(VDD_PA))) + if (!memcmp(regulators[i].name, VDD_PA, sizeof(VDD_PA))) continue; } @@ -673,12 +632,6 @@ int wcnss_wlan_power(struct device *dev, down(&wcnss_power_on_lock); if (on) { - if (cfg->wcn_external_gpio_support) { - rc = wcnss_external_gpio_set_state(true); - if (rc) - return rc; - } - /* RIVA regulator settings */ rc = wcnss_core_vregs_on(dev, hw_type, cfg); @@ -701,8 +654,6 @@ int wcnss_wlan_power(struct device *dev, } else if (is_power_on) { is_power_on = false; - if (cfg->wcn_external_gpio_support) - wcnss_external_gpio_set_state(false); configure_iris_xo(dev, cfg, WCNSS_WLAN_SWITCH_OFF, NULL); wcnss_iris_vregs_off(hw_type, cfg); @@ -719,8 +670,6 @@ fail_iris_on: wcnss_core_vregs_off(hw_type, cfg); fail_wcnss_on: - if (cfg->wcn_external_gpio_support) - wcnss_external_gpio_set_state(false); up(&wcnss_power_on_lock); return rc; } diff --git a/drivers/net/wireless/wcnss/wcnss_wlan.c b/drivers/net/wireless/wcnss/wcnss_wlan.c index 4a08979c249b..e99d46ca51b0 100644 --- a/drivers/net/wireless/wcnss/wcnss_wlan.c +++ b/drivers/net/wireless/wcnss/wcnss_wlan.c @@ -2771,25 +2771,6 @@ wcnss_trigger_config(struct platform_device *pdev) wlan_cfg->wcn_external_gpio_support = of_property_read_bool(node, "qcom,wcn-external-gpio-support"); - if (wlan_cfg->wcn_external_gpio_support) { - if (of_find_property(node, WCNSS_EXTERNAL_GPIO_NAME, NULL)) { - wlan_cfg->wcn_external_gpio = - of_get_named_gpio( - pdev->dev.of_node, - WCNSS_EXTERNAL_GPIO_NAME, - 0); - if (!gpio_is_valid(wlan_cfg->wcn_external_gpio)) { - pr_err("%s: Invalid %s num defined in DT\n", - __func__, WCNSS_EXTERNAL_GPIO_NAME); - ret = -EINVAL; - goto fail; - } - } else { - pr_err("%s: %s prop not defined in DT node\n", - __func__, WCNSS_EXTERNAL_GPIO_NAME); - goto fail; - } - } if (of_property_read_u32(node, "qcom,wlan-rx-buff-count", &penv->wlan_rx_buff_count)) { diff --git a/include/linux/wcnss_wlan.h b/include/linux/wcnss_wlan.h index dbde018af4c6..e0c47f8b06bf 100644 --- a/include/linux/wcnss_wlan.h +++ b/include/linux/wcnss_wlan.h @@ -20,11 +20,6 @@ #define IRIS_REGULATORS 4 #define PRONTO_REGULATORS 3 -#define WCNSS_EXTERNAL_GPIO_NAME "qcom,wcn-external-gpio" -#define WCNSS_EXTERNAL_GPIO_HIGH 1 -#define WCNSS_EXTERNAL_GPIO_LOW 0 -#define WCNSS_EXTERNAL_GPIO_DIR_OUT 1 - enum wcnss_opcode { WCNSS_WLAN_SWITCH_OFF = 0, WCNSS_WLAN_SWITCH_ON, @@ -44,7 +39,6 @@ struct vregs_level { struct wcnss_wlan_config { bool wcn_external_gpio_support; - int wcn_external_gpio; int use_48mhz_xo; int is_pronto_vadc; int is_pronto_v3;