Commit graph

32 commits

Author SHA1 Message Date
Paulo Miguel Almeida
2d19e698e7 staging: pi433: remove rf69_get_flag function resolving enum conflict
The reason why rf69_get_flag() existed was to provide a high-level way
to obtain values out of 1 (of 2) flags registers using bit masking. The
idea was to map the possible flag values found in the data sheet like
shown in page 70 of the RFM69HCW datasheet.

However, due to the fact that enums values in C must be unique, there
was a naming conflict on 'fifo_not_empty' which is used by the
tx_start_condition enum. So the author decided to create a 'fifo_empty'
one which would negate the value that comes from the flag register as
the solution to that conflict (which is very confusing).

this patch removes rf69_get_flag function which subsequently solves the
enum redeclaration problem so kernel developers can follow the data
sheet more easily.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Link: https://lore.kernel.org/r/Yhla4a1Clpguoo2h@mail.google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-03-01 22:31:21 +01:00
Paulo Miguel Almeida
a0c43a4692 staging: pi433: add docs to packet_format and tx_start_condition enum
While pi433 driver deals with the nuances of the different possible
config combinations, it's hard (at first) to understand the rationale
for some of the tx/rx-related source code unless you're fairly familiar
with the rf69's inner workings.

This patch documents the expected behaviour and limits of both
packet_format and tx_start_condition enum fields.

Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com>
Link: https://lore.kernel.org/r/20211231001933.GA6779@mail.google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-01-03 14:30:01 +01:00
Nishad Kamdar
be5418d45b staging: pi433: Use the correct style for SPDX License Identifier
This patch corrects the SPDX License Identifier style in
header files related to pi433 radio module drivers.
It assigns explicit block comment to the SPDX License Identifier.

Changes made by using a script provided by Joe Perches here:
https://lkml.org/lkml/2019/2/7/46.

Suggested-by: Joe Perches <joe@perches.com>
Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
Link: https://lore.kernel.org/r/20200208083621.GA3797@nishad
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-02-09 16:23:02 -08:00
Michael Straube
7e9463709c staging: pi433: remove GPL boiler plate text
The SPDX identifier is a legally binding shorthand,
which can be used instead of the full boiler plate text.

All source and header files have SPDX identifiers.
Remove the GPL boiler plate text to reduce file size.

Signed-off-by: Michael Straube <straube.linux@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-20 10:53:54 +01:00
Valentin Vidic
ecfacacf3f staging: pi433: add SPDX-License-Identifier tag
Use GPL-2.0+ based on the license text in each of the files.

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-28 22:00:13 +09:00
Valentin Vidic
bcb4f0d75b staging: pi433: fix CamelCase for dagc enum
Fixes checkpatch warnings:

  CHECK: Avoid CamelCase: <normalMode>
  CHECK: Avoid CamelCase: <improve4LowModulationIndex>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-19 19:46:51 +01:00
Valentin Vidic
e4928ac29b staging: pi433: fix CamelCase for lnaGain enum
Fixes checkpatch warning:

  CHECK: Avoid CamelCase: <lnaGain>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-19 19:46:51 +01:00
Valentin Vidic
a9f83a65f1 staging: pi433: fix CamelCase for paRamp enum
Fixes checkpatch warning:

  CHECK: Avoid CamelCase: <paRamp>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06 04:22:17 -08:00
Valentin Vidic
cd9d5291bb staging: pi433: fix CamelCase for address_filtering enum
Fixes checkpatch warnings:

  CHECK: Avoid CamelCase: <filteringOff>
  CHECK: Avoid CamelCase: <nodeAddress>
  CHECK: Avoid CamelCase: <nodeOrBroadcastAddress>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06 04:22:17 -08:00
Valentin Vidic
53e0b83d01 staging: pi433: fix CamelCase for afterSyncInterrupt
Fixes checkpatch warning:

  CHECK: Avoid CamelCase: <afterSyncInterrupt>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06 04:22:17 -08:00
Valentin Vidic
1cd41fc3f3 staging: pi433: fix CamelCase for flag enum
Fixes checkpatch warnings:

  CHECK: Avoid CamelCase: <modeSwitchCompleted>
  CHECK: Avoid CamelCase: <readyToReceive>
  CHECK: Avoid CamelCase: <readyToSend>
  CHECK: Avoid CamelCase: <pllLocked>
  CHECK: Avoid CamelCase: <rssiExceededThreshold>
  CHECK: Avoid CamelCase: <syncAddressMatch>
  CHECK: Avoid CamelCase: <packetSent>
  CHECK: Avoid CamelCase: <crcOk>
  CHECK: Avoid CamelCase: <batteryLow>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06 04:22:16 -08:00
Valentin Vidic
c436ef3b9a staging: pi433: fix CamelCase for packetFormat enum
Fixes checkpatch warnings:

  CHECK: Avoid CamelCase: <packetFormat>
  CHECK: Avoid CamelCase: <packetLengthFix>
  CHECK: Avoid CamelCase: <packetLengthVar>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06 04:22:16 -08:00
Valentin Vidic
e69a0500f2 staging: pi433: fix CamelCase for addressFiltering
Fixes checkpatch warning:

  CHECK: Avoid CamelCase: <addressFiltering>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22 14:53:05 +01:00
Valentin Vidic
b52a5b7936 staging: pi433: fix CamelCase for thresholdDecrement
Fixes checkpatch warning:

  CHECK: Avoid CamelCase: <thresholdDecrement>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22 14:53:05 +01:00
Valentin Vidic
6252016c86 staging: pi433: fix CamelCase for txStartCondition
Fixes checkpatch warning:

  CHECK: Avoid CamelCase: <txStartCondition>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22 14:53:05 +01:00
Valentin Vidic
0b89706583 staging: pi433: fix CamelCase for Ohm identifiers
Fixes checkpatch warnings:

  CHECK: Avoid CamelCase: <fiftyOhm>
  CHECK: Avoid CamelCase: <twohundretOhm>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-16 15:35:04 +01:00
Valentin Vidic
370d7ce625 staging: pi433: fix CamelCase for antennaImpedance
Fixes checkpatch warnings:

  CHECK: Avoid CamelCase: <antennaImpedance>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-16 15:35:04 +01:00
Valentin Vidic
0b9acf7ddb staging: pi433: fix CamelCase for payload identifiers
Fixes checkpatch warnings:

  CHECK: Avoid CamelCase: <payloadLength>
  CHECK: Avoid CamelCase: <payloadReady>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:32:27 +01:00
Valentin Vidic
b167a524d2 staging: pi433: fix CamelCase for maxMinus variables
Fixes checkpatch warnings:

  CHECK: Avoid CamelCase: <maxMinus12>
  CHECK: Avoid CamelCase: <maxMinus24>
  CHECK: Avoid CamelCase: <maxMinus36>
  CHECK: Avoid CamelCase: <maxMinus48>
  CHECK: Avoid CamelCase: <maxMinus6>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:32:23 +01:00
Marcin Ciupak
f235bcfe6a staging: pi433: remove unused rf69_set_dc_cut_off_frequency* functions
The following functions:
* rf69_set_dc_cut_off_frequency,
* rf69_set_dc_cut_off_frequency_intern,
* rf69_set_dc_cut_off_frequency_during_afc
are unused and should be removed along with type enum dcc_percent which
was used only by these functions.

Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-21 18:29:59 +01:00
Marcin Ciupak
9924a8339f staging: pi433: remove unused rf69_set_ook_threshold_type function
Function rf69_set_ook_threshold_type is unused and should be removed
along with type enum thresholdType which was used only by that function.

Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-21 18:29:59 +01:00
Marcin Ciupak
418e175a99 staging: pi433: remove unused rf69_set_ook_threshold_step function
Function rf69_set_ook_threshold_step is unused and should be removed
along with type enum thresholdStep which was used only by that function.

Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-21 18:29:59 +01:00
Valentin Vidic
acf71f8dfc staging: pi433: fix CamelCase for fifo variables
Fixes checkpatch warnings:

  CHECK: Avoid CamelCase: <fifoEmpty>
  CHECK: Avoid CamelCase: <fifoFillCondition>
  CHECK: Avoid CamelCase: <fifoFull>
  CHECK: Avoid CamelCase: <fifoLevel>
  CHECK: Avoid CamelCase: <fifoLevelBelowThreshold>
  CHECK: Avoid CamelCase: <fifoNotEmpty>
  CHECK: Avoid CamelCase: <fifoOverrun>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-21 18:17:05 +01:00
Valentin Vidic
6106cfbd05 staging: pi433: fix CamelCase for dccPercent variables
Fixes checkpatch warning:

  CHECK: Avoid CamelCase: <dccPercent>

Signed-off-by: Valentin Vidic <Valentin.Vidic@CARNet.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-19 15:14:58 +01:00
Marcin Ciupak
1c12da3576 staging: pi433: Fix missing 'undefined' value in enum modulation
It is possible that rf69_get_modulation() function will return
'undefined' value and this value is missing in enum modulation. Fix this
by adding appropriate entry in enum modulation.

Signed-off-by: Marcin Ciupak <marcin.s.ciupak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-08 16:36:35 +01:00
Simon Sandström
534a2610e1 staging: pi433: Move enum option_on_off to pi433_if.h
The enum is now only used for ioctl, so move it pi433_if.h.

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 22:07:23 +01:00
Simon Sandström
b92025a80c staging: pi433: Remove enum data_mode
Call rf69_set_data_mode with DATAMODUL_MODE value directly.

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 22:07:23 +01:00
Simon Sandström
494b11b662 staging: pi433: Rename enum modShaping in rf69_enum.h
Renames enum modShaping and its values to get rid of checkpatch.pl
warnings: "Avoid CamelCase: <modShaping>".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 16:14:11 +01:00
Simon Sandström
d423c80929 staging: pi433: Rename enum optionOnOff in rf69_enum.h
Renames the enum optionOnOff and its values optionOn, optionOff to enum
option_on_off and OPTION_ON, OPTION_OFF. Fixes checkpatch.pl warnings:
"Avoid CamelCase: <optionOnOff>, <optionOn>, <optionOff>".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 16:03:52 +01:00
Simon Sandström
21a9758984 staging: pi433: Fix indentation in rf69_enum.h
Basically just 's/    /\t/', to fix checkpatch.pl warnings:
"please, no spaces at the start of a line".

Signed-off-by: Simon Sandström <simon@nikanor.nu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-06 16:02:13 +01:00
Luca Söthe
8d05bce217 staging: pi433: Fixed coding style issues with braces
Removed a few new lines after enum and struct names
because of the following bracket.

Signed-off-by: Luca Söthe <luca@acul.me>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28 14:07:15 +01:00
Marcus Wolf
874bcba65f staging: pi433: New driver
Added a driver for the pi433 radio module
(see https://www.pi433.de/en.html for details).

Signed-off-by: Marcus Wolf <linux@Wolf-Entwicklungen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-16 16:58:13 +02:00