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

Commit 308f9fe3 authored by Maya Erez's avatar Maya Erez
Browse files

Revert "msm_11ad: keep rf_clk3 on during wil6210 activity"



This reverts commit 69c7b7f05838 ("msm_11ad: keep rf_clk3
on during wil6210 activity").
In case 11ad device controls refclk3 after FW download is completed,
it is safe to disable it from host and leave the GPIO control.
In addition, check the return value from msm_11ad_enable_clk.

Change-Id: Iee67284b71fab87c2b4a002d7e67d24ef83a9ac9
Signed-off-by: default avatarMaya Erez <merez@codeaurora.org>
parent 72d70e10
Loading
Loading
Loading
Loading
+26 −3
Original line number Diff line number Diff line
@@ -126,6 +126,7 @@ struct msm11ad_ctx {
	struct cpumask boost_cpu;

	bool keep_radio_on_during_sleep;
	int features;
};

static LIST_HEAD(dev_list);
@@ -1444,9 +1445,19 @@ static int ops_notify(void *handle, enum wil_platform_event evt)
		break;
	case WIL_PLATFORM_EVT_PRE_RESET:
		/*
		 * TODO: Enable rf_clk3 clock before resetting the device to
		 * ensure stable ref clock during the device reset
		 * Enable rf_clk3 clock before resetting the device to ensure
		 * stable ref clock during the device reset
		 */
		if (ctx->features &
		    BIT(WIL_PLATFORM_FEATURE_FW_EXT_CLK_CONTROL)) {
			rc = msm_11ad_enable_clk(ctx, &ctx->rf_clk3);
			if (rc) {
				dev_err(ctx->dev,
					"failed to enable clk, rc %d\n", rc);
				break;
			}
		}

		/* Re-enable L1 in case it was enabled in enumeration */
		if (ctx->l1_enabled_in_enum) {
			rc = msm_11ad_ctrl_aspm_l1(ctx, true);
@@ -1457,9 +1468,12 @@ static int ops_notify(void *handle, enum wil_platform_event evt)
		break;
	case WIL_PLATFORM_EVT_FW_RDY:
		/*
		 * TODO: Disable rf_clk3 clock after the device is up to allow
		 * Disable rf_clk3 clock after the device is up to allow
		 * the device to control it via its GPIO for power saving
		 */
		if (ctx->features &
		    BIT(WIL_PLATFORM_FEATURE_FW_EXT_CLK_CONTROL))
			msm_11ad_disable_clk(ctx, &ctx->rf_clk3);
		break;
	default:
		pr_debug("%s: Unhandled event %d\n", __func__, evt);
@@ -1485,6 +1499,14 @@ static int ops_get_capa(void *handle)
	return capa;
}

static void ops_set_features(void *handle, int features)
{
	struct msm11ad_ctx *ctx = (struct msm11ad_ctx *)handle;

	pr_debug("%s: features 0x%x\n", __func__, features);
	ctx->features = features;
}

void *msm_11ad_dev_init(struct device *dev, struct wil_platform_ops *ops,
			const struct wil_platform_rops *rops, void *wil_handle)
{
@@ -1525,6 +1547,7 @@ void *msm_11ad_dev_init(struct device *dev, struct wil_platform_ops *ops,
	ops->uninit = ops_uninit;
	ops->notify = ops_notify;
	ops->get_capa = ops_get_capa;
	ops->set_features = ops_set_features;

	return ctx;
}