diff mbox series

[lora-next,08/11] net: lora: sx130x: Force regmap field write before reading status

Message ID 20190106083754.6004-9-afaerber@suse.de
State Not Applicable
Delegated to: David Miller
Headers show
Series net: lora: sx130x: Fixes for enabling regcache | expand

Commit Message

Andreas Färber Jan. 6, 2019, 8:37 a.m. UTC
Ensure that the F_FORCE_HOST_RADIO_CTRL field gets written before we read
the AGC status register. Otherwise it returns status 01 instead of 87.

Cc: Ben Whitten <ben.whitten@gmail.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
---
 drivers/net/lora/sx130x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/net/lora/sx130x.c b/drivers/net/lora/sx130x.c
index a0759e277574..0a79548a7480 100644
--- a/drivers/net/lora/sx130x.c
+++ b/drivers/net/lora/sx130x.c
@@ -343,7 +343,7 @@  static int sx130x_agc_calibrate(struct sx130x_priv *priv)
 		return ret;
 	}
 
-	ret = sx130x_field_write(priv, F_FORCE_HOST_RADIO_CTRL, 0);
+	ret = sx130x_field_force_write(priv, F_FORCE_HOST_RADIO_CTRL, 0);
 	if (ret) {
 		dev_err(priv->dev, "force host control failed\n");
 		return ret;