Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751859AbdLBPOQ (ORCPT ); Sat, 2 Dec 2017 10:14:16 -0500 Received: from dd39320.kasserver.com ([85.13.155.146]:32912 "EHLO dd39320.kasserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751747AbdLBPOP (ORCPT ); Sat, 2 Dec 2017 10:14:15 -0500 From: Marcus Wolf To: gregkh@linuxfoundation.org, dan.carpenter@oracle.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Cc: Marcus Wolf Subject: [PATCH] staging: pi433: Removed some obsolete or duplicated defines; moved two defines to better locations Date: Sat, 2 Dec 2017 17:14:08 +0200 Message-Id: <1512227648-16008-1-git-send-email-linux@wolf-entwicklungen.de> X-Mailer: git-send-email 1.7.10.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2709 Lines: 73 The define FIFO_SIZE was moved to rf69_registers.h. Although it is not a register, it is a value, that is given by hardware (like the registers). The define FIFO_THRESHOLD was moved to pi433_if.c, since it is a value, that is freely choosen by the interface implementation. The better the response time of the driver, the lower threshold can be set. Signed-off-by: Marcus Wolf --- drivers/staging/pi433/pi433_if.c | 1 + drivers/staging/pi433/rf69.c | 1 - drivers/staging/pi433/rf69.h | 5 ----- drivers/staging/pi433/rf69_registers.h | 5 +++++ 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c index 2a205c6..292f121 100644 --- a/drivers/staging/pi433/pi433_if.c +++ b/drivers/staging/pi433/pi433_if.c @@ -59,6 +59,7 @@ #define MAX_MSG_SIZE 900 /* min: FIFO_SIZE! */ #define MSG_FIFO_SIZE 65536 /* 65536 = 2^16 */ #define NUM_DIO 2 +#define FIFO_THRESHOLD 15 /* in byte */ static dev_t pi433_dev; static DEFINE_IDR(pi433_idr); diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c index 767b565..ec4b540 100644 --- a/drivers/staging/pi433/rf69.c +++ b/drivers/staging/pi433/rf69.c @@ -31,7 +31,6 @@ #include "rf69_registers.h" #define F_OSC 32000000 /* in Hz */ -#define FIFO_SIZE 66 /* in byte */ /*-------------------------------------------------------------------------*/ diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h index 5c0c956..645c8df 100644 --- a/drivers/staging/pi433/rf69.h +++ b/drivers/staging/pi433/rf69.h @@ -20,11 +20,6 @@ #include "rf69_enum.h" #include "rf69_registers.h" -#define F_OSC 32000000 /* in Hz */ -#define FREQUENCY 433920000 /* in Hz, modifying this value impacts CE certification */ -#define FIFO_SIZE 66 /* in byte */ -#define FIFO_THRESHOLD 15 /* in byte */ - int rf69_set_mode(struct spi_device *spi, enum mode mode); int rf69_set_data_mode(struct spi_device *spi, enum dataMode dataMode); int rf69_set_modulation(struct spi_device *spi, enum modulation modulation); diff --git a/drivers/staging/pi433/rf69_registers.h b/drivers/staging/pi433/rf69_registers.h index 6335d42..cffafd1 100644 --- a/drivers/staging/pi433/rf69_registers.h +++ b/drivers/staging/pi433/rf69_registers.h @@ -16,6 +16,11 @@ */ /*******************************************/ +/* size of the hardware fifo */ +/*******************************************/ +#define FIFO_SIZE 66 + +/*******************************************/ /* RF69 register addresses */ /*******************************************/ #define REG_FIFO 0x00 -- 1.7.10.4