mirror of
https://github.com/joel16/android_kernel_sony_msm8994.git
synced 2024-12-02 17:26:48 +00:00
cnss: Set the default state of WLAN_EN GPIO to low
Change the default state of WLAN_EN GPIO from high to low. It will be pulled high when CNSS platform driver probes and PCIe enumeration has to be started after it by CNSS platform driver, otherwise WLAN chip cannot be enabled correctly. Change-Id: I9c665b50a4494422035cde80f9d392de5ce1a143 Signed-off-by: Yue Ma <yuem@codeaurora.org>
This commit is contained in:
parent
609c8181a8
commit
578c01b09f
@ -19,6 +19,7 @@ Required properties:
|
||||
- pinctrl-names: Names corresponding to the numbered pinctrl states
|
||||
- pinctrl-<n>: Pinctrl states as described in
|
||||
bindings/pinctrl/pinctrl-bindings.txt
|
||||
- qcom,wlan-rc-num: PCIe root complex number which WLAN chip is attached to
|
||||
|
||||
Optional properties:
|
||||
- qcom,notify-modem-status: Boolean property to decide whether modem
|
||||
@ -37,4 +38,5 @@ Example:
|
||||
wlan-soc-swreg-supply = <&pma8084_l27>;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&cnss_default>;
|
||||
qcom,wlan-rc-num = <0>;
|
||||
};
|
||||
|
@ -641,7 +641,7 @@
|
||||
label = "cnss_pins";
|
||||
cnss_default: default {
|
||||
drive-strength = <16>;
|
||||
bias-pull-up;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -5409,6 +5409,7 @@
|
||||
qcom,notify-modem-status;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&cnss_default>;
|
||||
qcom,wlan-rc-num = <0>;
|
||||
|
||||
qcom,msm-bus,name = "msm-cnss";
|
||||
qcom,msm-bus,num-cases = <4>;
|
||||
|
@ -2246,6 +2246,7 @@
|
||||
qcom,notify-modem-status;
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&cnss_default>;
|
||||
qcom,wlan-rc-num = <1>;
|
||||
|
||||
qcom,msm-bus,name = "msm-cnss";
|
||||
qcom,msm-bus,num-cases = <4>;
|
||||
|
@ -86,6 +86,7 @@ static struct cnss_fw_files FW_FILES_DEFAULT = {
|
||||
#define POWER_ON_DELAY 2000
|
||||
#define WLAN_ENABLE_DELAY 10000
|
||||
#define WLAN_RECOVERY_DELAY 1000
|
||||
#define PCIE_ENABLE_DELAY 100000
|
||||
|
||||
#define CNSS_PINCTRL_STATE_ACTIVE "default"
|
||||
|
||||
@ -1303,6 +1304,7 @@ static int cnss_probe(struct platform_device *pdev)
|
||||
struct esoc_desc *desc;
|
||||
const char *client_desc;
|
||||
struct device *dev = &pdev->dev;
|
||||
u32 rc_num;
|
||||
|
||||
if (penv)
|
||||
return -ENODEV;
|
||||
@ -1317,7 +1319,7 @@ static int cnss_probe(struct platform_device *pdev)
|
||||
penv->gpio_info.name = WLAN_EN_GPIO_NAME;
|
||||
penv->gpio_info.num = 0;
|
||||
penv->gpio_info.state = WLAN_EN_LOW;
|
||||
penv->gpio_info.init = WLAN_EN_HIGH;
|
||||
penv->gpio_info.init = WLAN_EN_LOW;
|
||||
penv->gpio_info.prop = false;
|
||||
penv->vreg_info.wlan_reg = NULL;
|
||||
penv->vreg_info.state = VREG_OFF;
|
||||
@ -1327,6 +1329,21 @@ static int cnss_probe(struct platform_device *pdev)
|
||||
if (ret)
|
||||
goto err_get_wlan_res;
|
||||
|
||||
cnss_wlan_gpio_set(&penv->gpio_info, WLAN_EN_HIGH);
|
||||
usleep(WLAN_ENABLE_DELAY);
|
||||
|
||||
ret = of_property_read_u32(dev->of_node, "qcom,wlan-rc-num", &rc_num);
|
||||
if (ret) {
|
||||
pr_err("%s: Failed to find PCIe RC number!\n", __func__);
|
||||
goto err_get_rc;
|
||||
}
|
||||
|
||||
ret = msm_pcie_enumerate(rc_num);
|
||||
if (ret) {
|
||||
pr_err("%s: Failed to enable PCIe RC%x!\n", __func__, rc_num);
|
||||
goto err_pcie_enumerate;
|
||||
}
|
||||
|
||||
penv->pcie_link_state = PCIE_LINK_UP;
|
||||
|
||||
penv->notify_modem_status =
|
||||
@ -1438,6 +1455,9 @@ err_subsys_reg:
|
||||
devm_unregister_esoc_client(&pdev->dev, penv->esoc_desc);
|
||||
|
||||
err_esoc_reg:
|
||||
err_pcie_enumerate:
|
||||
err_get_rc:
|
||||
cnss_wlan_gpio_set(&penv->gpio_info, WLAN_EN_LOW);
|
||||
cnss_wlan_release_resources();
|
||||
|
||||
err_get_wlan_res:
|
||||
|
@ -104,4 +104,5 @@ extern void *wcnss_prealloc_get(unsigned int size);
|
||||
extern int wcnss_prealloc_put(void *ptr);
|
||||
#endif
|
||||
|
||||
extern int msm_pcie_enumerate(u32 rc_idx);
|
||||
#endif /* _NET_CNSS_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user