From patchwork Fri Oct 12 16:26:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Whitten X-Patchwork-Id: 983168 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Abz0ygka"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42WtWR4Rh3z9s3l for ; Sat, 13 Oct 2018 03:26:27 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728975AbeJLX7l (ORCPT ); Fri, 12 Oct 2018 19:59:41 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:35797 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728424AbeJLX7k (ORCPT ); Fri, 12 Oct 2018 19:59:40 -0400 Received: by mail-wr1-f68.google.com with SMTP id w5-v6so14087765wrt.2 for ; Fri, 12 Oct 2018 09:26:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=i6BdHYxfQUbjAh+69r7NUevAaVhIh44tlAPYOLQJJvw=; b=Abz0ygkapyS3zEmIOlTj52/ieR2YmNg7YC2tNpJPKENwoyybshUcRToMcWHNDmSH49 riJOS1poI64iNGUUht1NZyyKmmXZhnmh3RoiVo6bU3b3DaiUOovGgQfiIUu4fjWlG/6v GanWLbVmuOzQN8jOojxKx+vUCmiPc6ODZWNs76pZm27knuYwNdNyuWrhDd9h8WWSvN/1 lT7Q9XaT4B04C2BHxBdiYgQtxeORfUKU3Arb2HaoEcnhWIJdTKPDU9UlqZKczxbCC2v8 GdIwgTVN5XBok66yy0lKoIczUEKkl7gBN7NQ/uL1scfBHZ3A+KiIq550byTsKsbmS5yH iAYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=i6BdHYxfQUbjAh+69r7NUevAaVhIh44tlAPYOLQJJvw=; b=ZyiEC2brMXCUK3tlBsw0Ho2dPc538eqNpVHM4fZXVEhiS0JVQYvesoMiTfQTNq2ojm vcAYYwpsd++NE9WoBTFbTo69q3lghnwo5VxegTEa9i5tESUieWbBoN9u7Kw3OY7ooQFz 5UCA5uIf3x3EguGeYTg948TXqljN+3WRmGapnNAN3j2ThEt7zjllTl/qdx6bo6z7HKTm BMD3Q/Wgt0aIsei2u8+C4LcHsNysiQizFSzTYhD9JlsOVKg+cHam7unW8JLokS3nezyO 1UYtuG2X81wttfIkiGRKkSWNEpn+CCmM4+Ix8CQUi4atg/cXdfDV/MDWOtyinXbm/ows s+4A== X-Gm-Message-State: ABuFfojfCIBsLaYWP5k5GsTYHWJWOcTMDXeWYUBwbnvc22ih1CZcfhRa KXKDrReEqnurdaSpnMkyNagmthSoVlo= X-Google-Smtp-Source: ACcGV61y66pVFJ14WuG43Vf3R+otP2dVZ2EzqQpFGFiXX6qROejyw96EGlIRmRODKTDvzeORYWkAEQ== X-Received: by 2002:adf:ba06:: with SMTP id o6-v6mr5597909wrg.249.1539361583448; Fri, 12 Oct 2018 09:26:23 -0700 (PDT) Received: from Sarah.corp.lairdtech.com ([109.174.151.67]) by smtp.gmail.com with ESMTPSA id t198-v6sm1736842wmd.9.2018.10.12.09.26.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 12 Oct 2018 09:26:22 -0700 (PDT) From: Ben Whitten X-Google-Original-From: Ben Whitten To: afaerber@suse.de Cc: starnight@g.ncu.edu.tw, hasnain.virk@arm.com, netdev@vger.kernel.org, liuxuenetmail@gmail.com, shess@hessware.de, Ben Whitten Subject: [PATCH v3 lora-next 0/5] based on 4.19-rc7 migration to regmap and clk framewor Date: Fri, 12 Oct 2018 17:26:01 +0100 Message-Id: <1539361567-3602-1-git-send-email-ben.whitten@lairdtech.com> X-Mailer: git-send-email 2.7.4 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This series is designed to be applied to a lora-next which is based on v4.19-rc7, not what is currently upstream, there were no additional changes in this rebase. In this series we add the write variant to regmap_noinc then use it within the sx1301 driver to load firmware. We complete the sx1301 migration to regmap by replacing the SPI burst read and write with regmap_noinc_read and write. The various fields of the sx1301 are converted to regmap to pass the read modify write down to the regmap layer and reduce our code. The downside is that in the cases of the hand optimised multiple field writes at once within one register, however if it is desirable these can be replaced with regmap_update_bits. Apply the same regmap treatment for the radio device and allow it to register as a clock provider, this clock is enabled when the lora link is brought up as it is required prior to calibration of the concentrator. modprobe lora-sx125x lora-dev: init sx1301 spi0.0: SX1301 module probed sx125x_con spi0.0-a: SX125x version: 21 sx125x_con spi0.0-a: SX125x module probed sx125x_con spi0.0-b: SX125x version: 21 sx125x_con spi0.0-b: registering clkout sx125x_con spi0.0-b: SX125x module probed ip link set lora0 up sx125x_con spi0.0-b: enabling clkout Ben Whitten (5): regmap: Add regmap_noinc_write API net: lora: sx1301: replace burst spi functions with regmap_noinc net: lora: sx1301: convert to using regmap fields for bit ops net: lora: sx125x: convert to regmap fields net: lora: sx125x sx1301: allow radio to register as a clk provider drivers/base/regmap/internal.h | 3 + drivers/base/regmap/regmap.c | 77 ++++++++++++ drivers/net/lora/sx125x.c | 159 +++++++++++++++++++++++-- drivers/net/lora/sx1301.c | 257 ++++++++++++----------------------------- drivers/net/lora/sx1301.h | 50 +++++++- include/linux/regmap.h | 19 +++ 6 files changed, 369 insertions(+), 196 deletions(-)