Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c8f90ab4 authored by Sarada Prasanna Garnayak's avatar Sarada Prasanna Garnayak Committed by Gerrit - the friendly Code Review server
Browse files

wcnss: remove the wcn external gpio configuration support



The wcn external gpio configuration has moved to WLAN firmware
code. To avoid the gpio resource request conflict and power offload
failure between wcnss platform driver and WLAN firmware.
Remove external gpio configuration from the wcnss platform driver.

Change-Id: Iaef979437d9e48d66a5e9e2fc88bc5783fed7480
Signed-off-by: default avatarSarada Prasanna Garnayak <sgarna@codeaurora.org>
parent eb61a053
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -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;
+2 −53
Original line number Diff line number Diff line
@@ -102,45 +102,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)
{
@@ -459,8 +420,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;
		}

@@ -526,8 +486,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;
		}

@@ -675,12 +634,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);
@@ -703,8 +656,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);
@@ -721,8 +672,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;
}
+0 −19
Original line number Diff line number Diff line
@@ -2810,25 +2810,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)) {
+0 −6
Original line number Diff line number Diff line
@@ -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;