2011-04-03 10:53:16

by Shahar Levi

[permalink] [raw]
Subject: [PATCH v2] wl12xx: Set correct REF CLK and TCXO CLK values to the FW

Fix mismatch between the REF CLK and TCXO CLK information that is
set in the platform data and the NVS, so we override what comes
from the NVS and replace it with what comes from the platform data.

Signed-off-by: Shahar Levi <[email protected]>
---
drivers/net/wireless/wl12xx/cmd.c | 11 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/wl12xx/cmd.c b/drivers/net/wireless/wl12xx/cmd.c
index 2468044..beb9f88 100644
--- a/drivers/net/wireless/wl12xx/cmd.c
+++ b/drivers/net/wireless/wl12xx/cmd.c
@@ -129,6 +129,9 @@ int wl1271_cmd_general_parms(struct wl1271 *wl)
if (gp->tx_bip_fem_auto_detect)
answer = true;

+ /* Override the REF CLK from the NVS with the one from platform data */
+ gen_parms->general_params.ref_clock = wl->ref_clock;
+
ret = wl1271_cmd_test(wl, gen_parms, sizeof(*gen_parms), answer);
if (ret < 0) {
wl1271_warning("CMD_INI_FILE_GENERAL_PARAM failed");
@@ -168,6 +171,14 @@ int wl128x_cmd_general_parms(struct wl1271 *wl)
if (gp->tx_bip_fem_auto_detect)
answer = true;

+ /*
+ * Override the REF&TCXO CLKs from the NVS with the one from platform
+ * data.
+ * FW use the relevant CLK (REF or TCXO) according to the boot sequence
+ */
+ gen_parms->general_params.ref_clock = wl->ref_clock;
+ gen_parms->general_params.tcxo_ref_clock = wl->tcxo_clock;
+
ret = wl1271_cmd_test(wl, gen_parms, sizeof(*gen_parms), answer);
if (ret < 0) {
wl1271_warning("CMD_INI_FILE_GENERAL_PARAM failed");
--
1.7.0.4



2011-04-20 17:58:37

by Luciano Coelho

[permalink] [raw]
Subject: Re: [PATCH v2] wl12xx: Set correct REF CLK and TCXO CLK values to the FW

On Sun, 2011-04-03 at 13:54 +0300, Shahar Levi wrote:
> Fix mismatch between the REF CLK and TCXO CLK information that is
> set in the platform data and the NVS, so we override what comes
> from the NVS and replace it with what comes from the platform data.
>
> Signed-off-by: Shahar Levi <[email protected]>
> ---

Applied with a small fix in a comment. Thank you!

--
Cheers,
Luca.