Signed-off-by: Rishabh Hardas <rishabhhardas@xxxxxxxxx> --- drivers/staging/pi433/pi433_if.h | 36 ++++++++++++++++-------------------- drivers/staging/pi433/rf69.c | 26 +++++++++++++------------- drivers/staging/pi433/rf69.h | 26 +++++++++++++------------- drivers/staging/pi433/rf69_enum.h | 16 ++++++++-------- 4 files changed, 50 insertions(+), 54 deletions(-) diff --git a/drivers/staging/pi433/pi433_if.h b/drivers/staging/pi433/pi433_if.h index 84032f3..2929de0 100644 --- a/drivers/staging/pi433/pi433_if.h +++ b/drivers/staging/pi433/pi433_if.h @@ -62,21 +62,20 @@ struct pi433_tx_cfg { __u16 bit_rate; __u32 dev_frequency; enum modulation modulation; - enum modShaping modShaping; + enum mod_shaping modShaping; - enum paRamp pa_ramp; + enum pa_ramp pa_ramp; - enum txStartCondition tx_start_condition; + enum tx_start_condition tx_start_condition; __u16 repetitions; - /* packet format */ - enum optionOnOff enable_preamble; - enum optionOnOff enable_sync; - enum optionOnOff enable_length_byte; - enum optionOnOff enable_address_byte; - enum optionOnOff enable_crc; + enum option_on_off enable_preamble; + enum option_on_off enable_sync; + enum option_on_off enable_length_byte; + enum option_on_off enable_address_byte; + enum option_on_off enable_crc; __u16 preamble_length; __u8 sync_length; @@ -86,7 +85,6 @@ struct pi433_tx_cfg { __u8 address_byte; }; - /** * struct pi433_rx_config - describes the configuration of the radio module for * sending @@ -115,25 +113,24 @@ struct pi433_rx_cfg { enum modulation modulation; __u8 rssi_threshold; - enum thresholdDecrement thresholdDecrement; - enum antennaImpedance antenna_impedance; - enum lnaGain lna_gain; + + enum threshold_decrement thresholdDecrement; + enum antenna_impedance antenna_impedance; + enum lna_gain lna_gain; enum mantisse bw_mantisse; /* normal: 0x50 */ __u8 bw_exponent; /* during AFC: 0x8b */ enum dagc dagc; - - /* packet format */ - enum optionOnOff enable_sync; - enum optionOnOff enable_length_byte; /* should be used in + enum option_on_off enable_sync; + enum option_on_off enable_length_byte; /* should be used in * combination with * sync, only */ - enum addressFiltering enable_address_filtering; /* operational + enum address_filtering enable_address_filtering; /* operational * with sync, only */ - enum optionOnOff enable_crc; /* only operational, + enum option_on_off enable_crc; /* only operational, *if sync on and fixed * length or length * byte is used @@ -148,7 +145,6 @@ struct pi433_rx_cfg { __u8 broadcast_address; }; - #define PI433_IOC_MAGIC 'r' #define PI433_IOC_RD_TX_CFG _IOR(PI433_IOC_MAGIC, PI433_TX_CFG_IOCTL_NR,\ diff --git a/drivers/staging/pi433/rf69.c b/drivers/staging/pi433/rf69.c index f83523e..b7b8c7c 100644 --- a/drivers/staging/pi433/rf69.c +++ b/drivers/staging/pi433/rf69.c @@ -109,7 +109,7 @@ enum modulation rf69_get_modulation(struct spi_device *spi) } } -int rf69_set_modulation_shaping(struct spi_device *spi, enum modShaping modShaping) +int rf69_set_modulation_shaping(struct spi_device *spi, enum mod_shaping modShaping) { #ifdef DEBUG dev_dbg(&spi->dev, "set: mod shaping"); @@ -264,7 +264,7 @@ int rf69_set_frequency(struct spi_device *spi, u32 frequency) return 0; } -int rf69_set_amplifier_0(struct spi_device *spi, enum optionOnOff optionOnOff) +int rf69_set_amplifier_0(struct spi_device *spi, enum option_on_off optionOnOff) { #ifdef DEBUG dev_dbg(&spi->dev, "set: amp #0"); @@ -277,7 +277,7 @@ int rf69_set_amplifier_0(struct spi_device *spi, enum optionOnOff optionOnOff) } } -int rf69_set_amplifier_1(struct spi_device *spi, enum optionOnOff optionOnOff) +int rf69_set_amplifier_1(struct spi_device *spi, enum option_on_off optionOnOff) { #ifdef DEBUG dev_dbg(&spi->dev, "set: amp #1"); @@ -290,7 +290,7 @@ int rf69_set_amplifier_1(struct spi_device *spi, enum optionOnOff optionOnOff) } } -int rf69_set_amplifier_2(struct spi_device *spi, enum optionOnOff optionOnOff) +int rf69_set_amplifier_2(struct spi_device *spi, enum option_on_off optionOnOff) { #ifdef DEBUG dev_dbg(&spi->dev, "set: amp #2"); @@ -319,7 +319,7 @@ int rf69_set_output_power_level(struct spi_device *spi, u8 powerLevel) return WRITE_REG(REG_PALEVEL, (READ_REG(REG_PALEVEL) & ~MASK_PALEVEL_OUTPUT_POWER) | powerLevel); } -int rf69_set_pa_ramp(struct spi_device *spi, enum paRamp paRamp) +int rf69_set_pa_ramp(struct spi_device *spi, enum pa_ramp paRamp) { #ifdef DEBUG dev_dbg(&spi->dev, "set: pa ramp"); @@ -346,7 +346,7 @@ int rf69_set_pa_ramp(struct spi_device *spi, enum paRamp paRamp) } } -int rf69_set_antenna_impedance(struct spi_device *spi, enum antennaImpedance antennaImpedance) +int rf69_set_antenna_impedance(struct spi_device *spi, enum antenna_impedance antennaImpedance) { #ifdef DEBUG dev_dbg(&spi->dev, "set: antenna impedance"); @@ -359,7 +359,7 @@ int rf69_set_antenna_impedance(struct spi_device *spi, enum antennaImpedance ant } } -int rf69_set_lna_gain(struct spi_device *spi, enum lnaGain lnaGain) +int rf69_set_lna_gain(struct spi_device *spi, enum lna_gain lnaGain) { #ifdef DEBUG dev_dbg(&spi->dev, "set: lna gain"); @@ -377,7 +377,7 @@ int rf69_set_lna_gain(struct spi_device *spi, enum lnaGain lnaGain) } } -enum lnaGain rf69_get_lna_gain(struct spi_device *spi) +enum lna_gain rf69_get_lna_gain(struct spi_device *spi) { u8 currentValue; @@ -516,7 +516,7 @@ int rf69_set_ook_threshold_step(struct spi_device *spi, enum thresholdStep thres } } -int rf69_set_ook_threshold_dec(struct spi_device *spi, enum thresholdDecrement thresholdDecrement) +int rf69_set_ook_threshold_dec(struct spi_device *spi, enum threshold_decrement thresholdDecrement) { #ifdef DEBUG dev_dbg(&spi->dev, "set: threshold decrement"); @@ -666,7 +666,7 @@ int rf69_set_preamble_length(struct spi_device *spi, u16 preambleLength) return retval; } -int rf69_set_sync_enable(struct spi_device *spi, enum optionOnOff optionOnOff) +int rf69_set_sync_enable(struct spi_device *spi, enum option_on_off optionOnOff) { #ifdef DEBUG dev_dbg(&spi->dev, "set: sync enable"); @@ -753,7 +753,7 @@ int rf69_set_packet_format(struct spi_device * spi, enum packetFormat packetForm } } -int rf69_set_crc_enable(struct spi_device *spi, enum optionOnOff optionOnOff) +int rf69_set_crc_enable(struct spi_device *spi, enum option_on_off optionOnOff) { #ifdef DEBUG dev_dbg(&spi->dev, "set: crc enable"); @@ -766,7 +766,7 @@ int rf69_set_crc_enable(struct spi_device *spi, enum optionOnOff optionOnOff) } } -int rf69_set_adressFiltering(struct spi_device *spi, enum addressFiltering addressFiltering) +int rf69_set_adressFiltering(struct spi_device *spi, enum address_filtering addressFiltering) { #ifdef DEBUG dev_dbg(&spi->dev, "set: address filtering"); @@ -816,7 +816,7 @@ int rf69_set_broadcast_address(struct spi_device *spi, u8 broadcastAddress) return WRITE_REG(REG_BROADCASTADRS, broadcastAddress); } -int rf69_set_tx_start_condition(struct spi_device *spi, enum txStartCondition txStartCondition) +int rf69_set_tx_start_condition(struct spi_device *spi, enum tx_start_condition txStartCondition) { #ifdef DEBUG dev_dbg(&spi->dev, "set: start condition"); diff --git a/drivers/staging/pi433/rf69.h b/drivers/staging/pi433/rf69.h index b81e076..b548374 100644 --- a/drivers/staging/pi433/rf69.h +++ b/drivers/staging/pi433/rf69.h @@ -29,18 +29,18 @@ int rf69_set_data_mode(struct spi_device *spi, enum dataMode dataMode); int rf69_set_modulation(struct spi_device *spi, enum modulation modulation); enum modulation rf69_get_modulation(struct spi_device *spi); -int rf69_set_modulation_shaping(struct spi_device *spi, enum modShaping modShaping); +int rf69_set_modulation_shaping(struct spi_device *spi, enum mod_shaping modShaping); int rf69_set_bit_rate(struct spi_device *spi, u16 bitRate); int rf69_set_deviation(struct spi_device *spi, u32 deviation); int rf69_set_frequency(struct spi_device *spi, u32 frequency); -int rf69_set_amplifier_0(struct spi_device *spi, enum optionOnOff optionOnOff); -int rf69_set_amplifier_1(struct spi_device *spi, enum optionOnOff optionOnOff); -int rf69_set_amplifier_2(struct spi_device *spi, enum optionOnOff optionOnOff); +int rf69_set_amplifier_0(struct spi_device *spi, enum option_on_off optionOnOff); +int rf69_set_amplifier_1(struct spi_device *spi, enum option_on_off optionOnOff); +int rf69_set_amplifier_2(struct spi_device *spi, enum option_on_off optionOnOff); int rf69_set_output_power_level(struct spi_device *spi, u8 powerLevel); -int rf69_set_pa_ramp(struct spi_device *spi, enum paRamp paRamp); -int rf69_set_antenna_impedance(struct spi_device *spi, enum antennaImpedance antennaImpedance); -int rf69_set_lna_gain(struct spi_device *spi, enum lnaGain lnaGain); -enum lnaGain rf69_get_lna_gain(struct spi_device *spi); +int rf69_set_pa_ramp(struct spi_device *spi, enum pa_ramp paRamp); +int rf69_set_antenna_impedance(struct spi_device *spi, enum antenna_impedance antennaImpedance); +int rf69_set_lna_gain(struct spi_device *spi, enum lna_gain lnaGain); +enum lna_gain rf69_get_lna_gain(struct spi_device *spi); int rf69_set_dc_cut_off_frequency_intern(struct spi_device *spi, u8 reg, enum dccPercent dccPercent); int rf69_set_dc_cut_off_frequency(struct spi_device *spi, enum dccPercent dccPercent); int rf69_set_dc_cut_off_frequency_during_afc(struct spi_device *spi, enum dccPercent dccPercent); @@ -48,7 +48,7 @@ int rf69_set_bandwidth_during_afc(struct spi_device *spi, enum mantisse mantisse, u8 exponent); int rf69_set_ook_threshold_type(struct spi_device *spi, enum thresholdType thresholdType); int rf69_set_ook_threshold_step(struct spi_device *spi, enum thresholdStep thresholdStep); -int rf69_set_ook_threshold_dec(struct spi_device *spi, enum thresholdDecrement thresholdDecrement); +int rf69_set_ook_threshold_dec(struct spi_device *spi, enum threshold_decrement thresholdDecrement); int rf69_set_dio_mapping(struct spi_device *spi, u8 DIONumber, u8 value); bool rf69_get_flag(struct spi_device *spi, enum flag flag); int rf69_reset_flag(struct spi_device *spi, enum flag flag); @@ -56,19 +56,19 @@ int rf69_set_rx_start_timeout(struct spi_device *spi, u8 timeout); int rf69_set_rssi_timeout(struct spi_device *spi, u8 timeout); int rf69_set_preamble_length(struct spi_device *spi, u16 preambleLength); -int rf69_set_sync_enable(struct spi_device *spi, enum optionOnOff optionOnOff); +int rf69_set_sync_enable(struct spi_device *spi, enum option_on_off optionOnOff); int rf69_set_fifo_fill_condition(struct spi_device *spi, enum fifoFillCondition fifoFillCondition); int rf69_set_sync_size(struct spi_device *spi, u8 sync_size); int rf69_set_sync_tolerance(struct spi_device *spi, u8 syncTolerance); int rf69_set_sync_values(struct spi_device *spi, u8 syncValues[8]); int rf69_set_packet_format(struct spi_device * spi, enum packetFormat packetFormat); -int rf69_set_crc_enable(struct spi_device *spi, enum optionOnOff optionOnOff); -int rf69_set_adressFiltering(struct spi_device *spi, enum addressFiltering addressFiltering); +int rf69_set_crc_enable(struct spi_device *spi, enum option_on_off optionOnOff); +int rf69_set_adressFiltering(struct spi_device *spi, enum address_filtering addressFiltering); int rf69_set_payload_length(struct spi_device *spi, u8 payloadLength); u8 rf69_get_payload_length(struct spi_device *spi); int rf69_set_node_address(struct spi_device *spi, u8 nodeAddress); int rf69_set_broadcast_address(struct spi_device *spi, u8 broadcastAddress); -int rf69_set_tx_start_condition(struct spi_device *spi, enum txStartCondition txStartCondition); +int rf69_set_tx_start_condition(struct spi_device *spi, enum tx_start_condition txStartCondition); int rf69_set_fifo_threshold(struct spi_device *spi, u8 threshold); int rf69_set_dagc(struct spi_device *spi, enum dagc dagc); diff --git a/drivers/staging/pi433/rf69_enum.h b/drivers/staging/pi433/rf69_enum.h index fbfb59b..7121200 100644 --- a/drivers/staging/pi433/rf69_enum.h +++ b/drivers/staging/pi433/rf69_enum.h @@ -18,7 +18,7 @@ #ifndef RF69_ENUM_H #define RF69_ENUM_H -enum optionOnOff +enum option_on_off { optionOff, optionOn @@ -46,7 +46,7 @@ enum modulation FSK }; -enum modShaping +enum mod_shaping { shapingOff, shaping1_0, @@ -56,7 +56,7 @@ enum modShaping shaping2BR }; -enum paRamp +enum pa_ramp { ramp3400, ramp2000, @@ -76,13 +76,13 @@ enum paRamp ramp10 }; -enum antennaImpedance +enum antenna_impedance { fiftyOhm, twohundretOhm }; -enum lnaGain +enum lna_gain { automatic, max, @@ -132,7 +132,7 @@ enum thresholdStep step_6_0db }; -enum thresholdDecrement +enum threshold_decrement { dec_every8th, dec_every4th, @@ -177,13 +177,13 @@ enum packetFormat packetLengthVar }; -enum txStartCondition +enum tx_start_condition { fifoLevel, fifoNotEmpty }; -enum addressFiltering +enum address_filtering { filteringOff, nodeAddress, -- 1.9.1 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel