From patchwork Sun Jan 6 08:37:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 154840 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2355484ljp; Sun, 6 Jan 2019 00:38:40 -0800 (PST) X-Google-Smtp-Source: ALg8bN6C0sFOm/eIATEpcsQAT74NikrgYUoyd4e8ecikpcfefMw+dzBqt1gLw//CopdR/RmJTkMN X-Received: by 2002:a62:c185:: with SMTP id i127mr46615561pfg.43.1546763920743; Sun, 06 Jan 2019 00:38:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546763920; cv=none; d=google.com; s=arc-20160816; b=TOL4z3FMJxfvWWoLO1jZDViQvmMKf3rKzNI5jcUwpT5McdZz4zp7H2SLYPVM7H6dkm kGMS6lbVVjO6DIXky1REJMYcIVIX88Gbv1JWaHL5AXGJp9jUNt85z7nb0J/Yi4PWdq08 nOQZUFcL9om/U9IuZIVMYAHaUTD8SHQZQGQRv4KmE0dP+aqJLAWBQyhw9dtZfUxEKEML HMBN2f4I4+VIf5O0W8v71zPVrCB8oG0iXcOORWueGNw05+PuNxJTrNWQrlBCEUorFRB6 UNY46vytcmN1bM6cas/a2JphcNPJHI5yuYggg12JfjrLQ/1isrSzpq3y08m0HnU9KGyq cF6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=lSJS9ry3sAD4R7Zz91keM/H4BNx9oPf38mBRksDclX8=; b=zUYQV0CXjrecY04LHc5FM01J5CVvxeYCoEss97/m+glXvn49efDhP2ERVp0+OoorYC yNaSUH6rKOfDRyytyBavkTn9oSN0nfN5wlv7T9laoFwUPnNPulrRNfTT7iTvirmzAnz3 X2hz7KOaG+NirGS66em+LIo1nS8ZUZ+onc27pWWebHbluQkxM3ASeU+lJSKabA0TnkNE rJhpxbjySkobmfjgw3oHfTR3wxaMCyKjmJ3GQCeHRVTfm0lB6l3xKKIfQw0ZQxlyvZmq ZygwxgujitKqdpQTq7//Pt5+nJJnu91P385RbMmCSHSb5uk6hsfBFInhLpMJIFlgaMbS lsEw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s8si57027655plq.345.2019.01.06.00.38.40; Sun, 06 Jan 2019 00:38:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726673AbfAFIij (ORCPT + 10 others); Sun, 6 Jan 2019 03:38:39 -0500 Received: from mx2.suse.de ([195.135.220.15]:57244 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726537AbfAFIiG (ORCPT ); Sun, 6 Jan 2019 03:38:06 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 31AF1AE24; Sun, 6 Jan 2019 08:38:05 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-lpwan@lists.infradead.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Andrea?= =?utf-8?b?cyBGw6RyYmVy?= , Ben Whitten , "David S. Miller" Subject: [PATCH lora-next 08/11] net: lora: sx130x: Force regmap field write before reading status Date: Sun, 6 Jan 2019 09:37:51 +0100 Message-Id: <20190106083754.6004-9-afaerber@suse.de> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20190106083754.6004-1-afaerber@suse.de> References: <20190106083754.6004-1-afaerber@suse.de> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 Signed-off-by: Andreas Färber --- drivers/net/lora/sx130x.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.16.4 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;