[PATCH lora-next 08/11] net: lora: sx130x: Force regmap field write before reading status
From: Andreas FÃrber
Date: Sun Jan 06 2019 - 03:38:43 EST
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@xxxxxxxxx>
Signed-off-by: Andreas FÃrber <afaerber@xxxxxxx>
---
drivers/net/lora/sx130x.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.16.4