From: =?UTF-8?Q?Andreas_F=c3=a4rber?= Subject: Re: [PATCH lora-next 01/10] net: lora: sx1301: add register, bit-fields, and helpers for regmap Date: Wed, 8 Aug 2018 10:57:41 +0200 Message-ID: <6faee71e-1226-9f24-6e0d-46a9dbb4d6c2@suse.de> References: <1533663131-16313-1-git-send-email-ben.whitten@gmail.com> <1533663131-16313-2-git-send-email-ben.whitten@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: starnight@g.ncu.edu.tw, hasnain.virk@arm.com, netdev@vger.kernel.org, Ben Whitten To: Ben Whitten Return-path: Received: from mx2.suse.de ([195.135.220.15]:39478 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727083AbeHHLQ3 (ORCPT ); Wed, 8 Aug 2018 07:16:29 -0400 In-Reply-To: <1533663131-16313-2-git-send-email-ben.whitten@gmail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: Am 07.08.2018 um 19:32 schrieb Ben Whitten: > From: Ben Whitten > > The register and bit-field definitions are taken from the SX1301 > datasheet version 2.01 dated June 2014 with the revision information > 'First released version'. > > The reset state and RW capability of each field is not reflected in this > patch however from the datasheet: > "Bits and registers that are not documented are reserved. They may > include calibration values. It is important not to modify these bits and > registers. If specific bits must be changed in a register with reserved > bits, the register must be read first, specific bits modified while > masking reserved bits and then the register can be written." > > Then goes on to state: > "Reserved bits should be written with their reset state, they may be > read different states." > > Caching is currently disabled. > > The version is read back using regmap_read to verify regmap operation, > in doing so needs to be moved after priv and regmap allocation. > > Signed-off-by: Ben Whitten > --- > drivers/net/lora/Kconfig | 1 + > drivers/net/lora/sx1301.c | 282 +++++++++++++++++++++++++++++++++++++++++++--- > drivers/net/lora/sx1301.h | 169 +++++++++++++++++++++++++++ > 3 files changed, 439 insertions(+), 13 deletions(-) > create mode 100644 drivers/net/lora/sx1301.h My main concern about this patch is its sheer size. Normally for #defines the rule is not to add unused ones. Here I see for example FSK RSSI fields that we're surely not using yet. Any chance to strip this down some more? Regards, Andreas -- SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg)