[PATCH] staging: pi433: Removed some obsolete or duplicated defines; moved two defines to better locations

From: Marcus Wolf
Date: Sat Dec 02 2017 - 10:14:30 EST


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 <linux@xxxxxxxxxxxxxxxxxxxxx>
---
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