Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10218405imu; Sun, 30 Dec 2018 16:16:37 -0800 (PST) X-Google-Smtp-Source: AFSGD/VN+O1uAr8Lz1tx5o1MomglBNe79k+qV9KQqar7vpw21n8jeQzTS1tGnQq18qGw2qacCBMW X-Received: by 2002:a62:81c1:: with SMTP id t184mr37178659pfd.40.1546215397192; Sun, 30 Dec 2018 16:16:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546215397; cv=none; d=google.com; s=arc-20160816; b=xU/DbbusjMGeeDwycwRopq7OUf3Mkz9ToWEcQcoxlklHWYfuyP4Hf8PmV5xT6svwgG 7Jk9Njxjtz/vzL+KaE602mtgyw55FnvZcghWaWVn8snkCHIF2Ep8KQjDPvxws5u6Qbvb dTR7rJyrocskcyqEsmv4Jgp2B2yj6YAjm8Nn+fyMKzkQDvu7Eg5wK1tXsOgUG2+7pdVe og+enbA3J/OFyoQApjBYhlCC4d/Nlt9xzie3K+bhQwA9q1mx/JpyNRu+02DML405lO3I /x1gWHTUrlbCNPW9BTaZRtNBG4Wpm3IzYKMaS/evBKwNMvkPdderHg1Jx0JChBSm4QCX 7IUw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=y29z1ZNaa4ECcg4jJVMyvcCfDvJAd2VSxpC22CP3ibA=; b=C0RZaawu2AZyJ2w7fYLKEJ6j7BmSHlh3dhwl2yCUn8U35uYsDEHKFHueJ1pa6hFQyb ZNW2Q6sw2smafE2fGNY1v0tEW3RjRh13W+iUSYzTtwmBP/j8O4zZMl/p3nDApVIjQ217 bwpwYR7+sEa/+fjOFi5V6o6w4/DuKpZcO3Qhk0cjS2OXe2CiCj/RSj0rXdDiS+wVrtLv IwI4VLy0ppaGs54srtm7TAyOufTG3m7XztnSL2tESivOBCthJCkxz0gK1GddV+Vd2ECW D5QCVZYHIQa0FwGB0nQmsFyZ3b7oePo0XZA5PU+oBoKqzhH+mqDj6P92rXbUpu1GmEfC 3wYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=N4gUlM54; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k2si21686709pgh.63.2018.12.30.16.16.07; Sun, 30 Dec 2018 16:16:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=N4gUlM54; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726873AbeLaAOt (ORCPT + 99 others); Sun, 30 Dec 2018 19:14:49 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:37899 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725937AbeLaAOt (ORCPT ); Sun, 30 Dec 2018 19:14:49 -0500 Received: by mail-lf1-f66.google.com with SMTP id p86so17586874lfg.5 for ; Sun, 30 Dec 2018 16:14:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=y29z1ZNaa4ECcg4jJVMyvcCfDvJAd2VSxpC22CP3ibA=; b=N4gUlM542g4aQf7XkOD9UO+ueiF2s60lt5N2OEVYJOj/vVJIG9JlUgM64AOfmjIK8o coh9GviJAO6EtI739YTtGuryeyfw8cvm19j7lMjIvBx8zMFzcYi9XCxCK6i2RRe7oM86 ++MqFikL1uH5uVyHeaHOqSCDEJoSkOqKd3f+2z3MQlIRIW7+JCOUVY58vKRyyF6ulRbK W6AduQ94fyI3IX6CeMP/JWzwUXWsYGFIKafcaJFiAaYAUXkgtrb73CDoryzuEE9OdPst UwZF2aHKlpBZlp8QRbOHAVzbYHP2bnZgTnBRyBTOempbOiBjvDpgPtEEYbCxPsqLBP47 5M9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=y29z1ZNaa4ECcg4jJVMyvcCfDvJAd2VSxpC22CP3ibA=; b=pRKP7ZE41T6B3O9fy6Fki74SM9Yws07gc7cDY7Ggf8Vj7X3nS1Hdm1EDpy9qE2eRUT kB3ftS1sdiw2qKKHot+TtC9YTo16WXk3Vq3iKCaUYnMs4rPYkTzeX6NVIlY7G6S6umTL X6Iluhic2Zahutrs/T39M6M7mF/YdMziPn3xPqIrq2fqDta2FRTNyzOZkMPdtuCPSQvr xceWKyq8IhzzH4qmRSapjsIqLEMIePMs9qzDoyDPqlKhmGv/2843AYpgrCQ+YlipO516 MT9JIMc71GuONYUuMvDo0EkbRN7hCo6Xi57iFkZrMVLPudpUeAD+tP/bQFp6aO06xFor EbZA== X-Gm-Message-State: AA+aEWZ0rA4RK1U02wou0T9nlpKI9WVe0Acutdkd6tBnsSQvqfkcpkvo Ozf5CwAU6b2jeFAXkp+OA9e9tKouD/6Xc7L4r0M= X-Received: by 2002:a19:3fcf:: with SMTP id m198mr16917389lfa.106.1546215285898; Sun, 30 Dec 2018 16:14:45 -0800 (PST) MIME-Version: 1.0 References: <20181230084427.32623-1-afaerber@suse.de> In-Reply-To: <20181230084427.32623-1-afaerber@suse.de> From: Ben Whitten Date: Mon, 31 Dec 2018 00:14:34 +0000 Message-ID: Subject: Re: [PATCH lora-next] net: lora: sx1301: Fix radio SPI write To: =?UTF-8?Q?Andreas_F=C3=A4rber?= , Mark Brown Cc: linux-lpwan@lists.infradead.org, Ben Whitten , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org + Mark +linux-kernel On Sun, 30 Dec 2018 at 08:45, Andreas F=C3=A4rber wrote: > > When converting to regmap_bus we omitted the write flag, > rendering all sx125x register writes no-op. > > Signed-off-by: Andreas F=C3=A4rber > --- > drivers/net/lora/sx130x_radio.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/lora/sx130x_radio.c b/drivers/net/lora/sx130x_ra= dio.c > index 6c94d13cd4db..e7b2df808c1a 100644 > --- a/drivers/net/lora/sx130x_radio.c > +++ b/drivers/net/lora/sx130x_radio.c > @@ -9,6 +9,7 @@ > * Copyright (c) 2013 Semtech-Cycleo > */ > > +#include > #include > #include > #include > @@ -40,7 +41,7 @@ static int sx1301_regmap_bus_write(void *context, unsig= ned int reg, > ret =3D regmap_write(priv->regmap, cs, 0); > if (ret) > return ret; > - ret =3D regmap_write(priv->regmap, addr, reg); > + ret =3D regmap_write(priv->regmap, addr, BIT(7) | reg); Curious. Isn't the (read/write)_flag_mask, set in the regmap_config, a property of the device connected to the regmap_bus? I would have expected this to have been applied prior to passing to a regmap_bus call, surely the bus should only be concerned with transport? It will work in our case as our current hardware uses 1 in bit 7 but it will not if we ever see other radios with different masks. If the regmap_bus provider does need to apply the mask, can we get the end device regmap_config and apply it from there? Mark what are your thoughts on the route to take? Regards, Ben Whitten