Loading Documentation/devicetree/bindings/cnss/cnss-sdio-wlan.txt +5 −3 Original line number Diff line number Diff line Loading @@ -2,21 +2,23 @@ This platform driver adds support for the CNSS subsystem used for SDIO based Wi-Fi devices. It also adds support to manage two 1.8V voltage regulators and WLAN power enable 3.3V PMIC GPIO. The main purpose of this regulators and WLAN power enable 3.3V regulators. The main purpose of this device tree entry below is to invoke the CNSS SDIO platform driver and provide handle to the WLAN power enable 3.3V pmic GPIO and two 1.8V PMIC voltage regulator resources. Required properties: - compatible: "qcom,cnss_sdio" - wlan-pmic-gpio: 3.3V PMIC GPIO for external power supply. - vdd-wlan-supply: phandle to the WLAN vdd regulator device tree node. - vdd-wlan-dsrc-supply: phandle to the WLAN dsrc vdd regulator device tree node. - vdd-wlan-io-supply: phandle to the WLAN IO regulator device tree node. - vdd-wlan-xtal-supply: phandle to the WLAM XTAL regulator device tree node. Example: qcom,cnss-sdio { compatible = "qcom,cnss_sdio"; cnss_sdio,wlan-pmic-gpio = <&pm8019_gpios 3 0>; vdd-wlan-supply = <&rome_vreg>; vdd-wlan-dsrc-supply = <&sdcard_ext_vreg>; vdd-wlan-io-supply = <&mdm9607_l11>; vdd-wlan-xtal-supply = <&mdm9607_l2>; }; arch/arm/boot/dts/qcom/mdm9607-pinctrl.dtsi +2 −2 Original line number Diff line number Diff line Loading @@ -181,11 +181,11 @@ sdc1_wlan_gpio { sdc1_wlan_gpio_active: sdc1_wlan_gpio_active { mux { pins = "gpio38"; pins = "gpio38", "gpio25"; function = "gpio"; }; config { pins = "gpio38"; pins = "gpio38", "gpio25"; output-high; drive-strength = <8>; bias-pull-up; Loading arch/arm/boot/dts/qcom/mdm9607.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -500,6 +500,7 @@ qcom,cnss-sdio { compatible = "qcom,cnss_sdio"; vdd-wlan-supply = <&rome_vreg>; vdd-wlan-dsrc-supply = <&sdcard_ext_vreg>; vdd-wlan-io-supply = <&mdm9607_l11>; vdd-wlan-xtal-supply = <&mdm9607_l2>; }; Loading drivers/net/wireless/cnss/cnss_sdio.c +52 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <linux/slab.h> #define WLAN_VREG_NAME "vdd-wlan" #define WLAN_VREG_DSRC_NAME "vdd-wlan-dsrc" #define WLAN_VREG_IO_NAME "vdd-wlan-io" #define WLAN_VREG_XTAL_NAME "vdd-wlan-xtal" Loading Loading @@ -53,6 +54,7 @@ struct cnss_sdio_regulator { struct regulator *wlan_io; struct regulator *wlan_xtal; struct regulator *wlan_vreg; struct regulator *wlan_vreg_dsrc; }; static struct cnss_sdio_data { Loading Loading @@ -217,6 +219,40 @@ static int cnss_sdio_configure_wlan_enable_regulator(void) err_vdd_vreg_regulator: regulator_put(cnss_pdata->regulator.wlan_vreg); return error; } static int cnss_sdio_configure_wlan_enable_dsrc_regulator(void) { int error; struct device *dev = &cnss_pdata->pdev->dev; if (of_get_property( cnss_pdata->pdev->dev.of_node, WLAN_VREG_DSRC_NAME "-supply", NULL)) { cnss_pdata->regulator.wlan_vreg_dsrc = regulator_get( &cnss_pdata->pdev->dev, WLAN_VREG_DSRC_NAME); if (IS_ERR(cnss_pdata->regulator.wlan_vreg_dsrc)) { error = PTR_ERR(cnss_pdata->regulator.wlan_vreg_dsrc); dev_err(dev, "VDD-VREG-DSRC get failed error=%d\n", error); return error; } error = regulator_enable(cnss_pdata->regulator.wlan_vreg_dsrc); if (error) { dev_err(dev, "VDD-VREG-DSRC enable failed error=%d\n", error); goto err_vdd_vreg_dsrc_regulator; } } return 0; err_vdd_vreg_dsrc_regulator: regulator_put(cnss_pdata->regulator.wlan_vreg_dsrc); return error; } Loading Loading @@ -298,9 +334,11 @@ static void cnss_sdio_release_resource(void) if (cnss_pdata->regulator.wlan_xtal) regulator_put(cnss_pdata->regulator.wlan_xtal); if (cnss_pdata->regulator.wlan_vreg) regulator_put(cnss_pdata->regulator.wlan_xtal); regulator_put(cnss_pdata->regulator.wlan_vreg); if (cnss_pdata->regulator.wlan_io) regulator_put(cnss_pdata->regulator.wlan_io); if (cnss_pdata->regulator.wlan_vreg_dsrc) regulator_put(cnss_pdata->regulator.wlan_vreg_dsrc); } static int cnss_sdio_probe(struct platform_device *pdev) Loading Loading @@ -348,9 +386,22 @@ static int cnss_sdio_probe(struct platform_device *pdev) } } if (of_get_property( cnss_pdata->pdev->dev.of_node, WLAN_VREG_DSRC_NAME "-supply", NULL)) { error = cnss_sdio_configure_wlan_enable_dsrc_regulator(); if (error) { dev_err(&pdev->dev, "Failed to enable wlan dsrc enable regulator\n"); goto err_wlan_dsrc_enable_regulator; } } dev_info(&pdev->dev, "CNSS SDIO Driver registered"); return 0; err_wlan_dsrc_enable_regulator: regulator_put(cnss_pdata->regulator.wlan_vreg_dsrc); err_wlan_enable_regulator: regulator_put(cnss_pdata->regulator.wlan_vreg); err_wlan_enable_gpio: Loading Loading
Documentation/devicetree/bindings/cnss/cnss-sdio-wlan.txt +5 −3 Original line number Diff line number Diff line Loading @@ -2,21 +2,23 @@ This platform driver adds support for the CNSS subsystem used for SDIO based Wi-Fi devices. It also adds support to manage two 1.8V voltage regulators and WLAN power enable 3.3V PMIC GPIO. The main purpose of this regulators and WLAN power enable 3.3V regulators. The main purpose of this device tree entry below is to invoke the CNSS SDIO platform driver and provide handle to the WLAN power enable 3.3V pmic GPIO and two 1.8V PMIC voltage regulator resources. Required properties: - compatible: "qcom,cnss_sdio" - wlan-pmic-gpio: 3.3V PMIC GPIO for external power supply. - vdd-wlan-supply: phandle to the WLAN vdd regulator device tree node. - vdd-wlan-dsrc-supply: phandle to the WLAN dsrc vdd regulator device tree node. - vdd-wlan-io-supply: phandle to the WLAN IO regulator device tree node. - vdd-wlan-xtal-supply: phandle to the WLAM XTAL regulator device tree node. Example: qcom,cnss-sdio { compatible = "qcom,cnss_sdio"; cnss_sdio,wlan-pmic-gpio = <&pm8019_gpios 3 0>; vdd-wlan-supply = <&rome_vreg>; vdd-wlan-dsrc-supply = <&sdcard_ext_vreg>; vdd-wlan-io-supply = <&mdm9607_l11>; vdd-wlan-xtal-supply = <&mdm9607_l2>; };
arch/arm/boot/dts/qcom/mdm9607-pinctrl.dtsi +2 −2 Original line number Diff line number Diff line Loading @@ -181,11 +181,11 @@ sdc1_wlan_gpio { sdc1_wlan_gpio_active: sdc1_wlan_gpio_active { mux { pins = "gpio38"; pins = "gpio38", "gpio25"; function = "gpio"; }; config { pins = "gpio38"; pins = "gpio38", "gpio25"; output-high; drive-strength = <8>; bias-pull-up; Loading
arch/arm/boot/dts/qcom/mdm9607.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -500,6 +500,7 @@ qcom,cnss-sdio { compatible = "qcom,cnss_sdio"; vdd-wlan-supply = <&rome_vreg>; vdd-wlan-dsrc-supply = <&sdcard_ext_vreg>; vdd-wlan-io-supply = <&mdm9607_l11>; vdd-wlan-xtal-supply = <&mdm9607_l2>; }; Loading
drivers/net/wireless/cnss/cnss_sdio.c +52 −1 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <linux/slab.h> #define WLAN_VREG_NAME "vdd-wlan" #define WLAN_VREG_DSRC_NAME "vdd-wlan-dsrc" #define WLAN_VREG_IO_NAME "vdd-wlan-io" #define WLAN_VREG_XTAL_NAME "vdd-wlan-xtal" Loading Loading @@ -53,6 +54,7 @@ struct cnss_sdio_regulator { struct regulator *wlan_io; struct regulator *wlan_xtal; struct regulator *wlan_vreg; struct regulator *wlan_vreg_dsrc; }; static struct cnss_sdio_data { Loading Loading @@ -217,6 +219,40 @@ static int cnss_sdio_configure_wlan_enable_regulator(void) err_vdd_vreg_regulator: regulator_put(cnss_pdata->regulator.wlan_vreg); return error; } static int cnss_sdio_configure_wlan_enable_dsrc_regulator(void) { int error; struct device *dev = &cnss_pdata->pdev->dev; if (of_get_property( cnss_pdata->pdev->dev.of_node, WLAN_VREG_DSRC_NAME "-supply", NULL)) { cnss_pdata->regulator.wlan_vreg_dsrc = regulator_get( &cnss_pdata->pdev->dev, WLAN_VREG_DSRC_NAME); if (IS_ERR(cnss_pdata->regulator.wlan_vreg_dsrc)) { error = PTR_ERR(cnss_pdata->regulator.wlan_vreg_dsrc); dev_err(dev, "VDD-VREG-DSRC get failed error=%d\n", error); return error; } error = regulator_enable(cnss_pdata->regulator.wlan_vreg_dsrc); if (error) { dev_err(dev, "VDD-VREG-DSRC enable failed error=%d\n", error); goto err_vdd_vreg_dsrc_regulator; } } return 0; err_vdd_vreg_dsrc_regulator: regulator_put(cnss_pdata->regulator.wlan_vreg_dsrc); return error; } Loading Loading @@ -298,9 +334,11 @@ static void cnss_sdio_release_resource(void) if (cnss_pdata->regulator.wlan_xtal) regulator_put(cnss_pdata->regulator.wlan_xtal); if (cnss_pdata->regulator.wlan_vreg) regulator_put(cnss_pdata->regulator.wlan_xtal); regulator_put(cnss_pdata->regulator.wlan_vreg); if (cnss_pdata->regulator.wlan_io) regulator_put(cnss_pdata->regulator.wlan_io); if (cnss_pdata->regulator.wlan_vreg_dsrc) regulator_put(cnss_pdata->regulator.wlan_vreg_dsrc); } static int cnss_sdio_probe(struct platform_device *pdev) Loading Loading @@ -348,9 +386,22 @@ static int cnss_sdio_probe(struct platform_device *pdev) } } if (of_get_property( cnss_pdata->pdev->dev.of_node, WLAN_VREG_DSRC_NAME "-supply", NULL)) { error = cnss_sdio_configure_wlan_enable_dsrc_regulator(); if (error) { dev_err(&pdev->dev, "Failed to enable wlan dsrc enable regulator\n"); goto err_wlan_dsrc_enable_regulator; } } dev_info(&pdev->dev, "CNSS SDIO Driver registered"); return 0; err_wlan_dsrc_enable_regulator: regulator_put(cnss_pdata->regulator.wlan_vreg_dsrc); err_wlan_enable_regulator: regulator_put(cnss_pdata->regulator.wlan_vreg); err_wlan_enable_gpio: Loading