hwmon: Fix CamelCase checkpatch warnings
Subsystems (4)
Guenter Roeck
maintainerPATCH 3/9 hwmon: Fix CamelCase checkpatch warnings
Signed-off-by Guenter Roeck <[email protected]>
--- drivers/hwmon/ads7871.c | 42 ++--- drivers/hwmon/asc7621.c | 56 +++---- drivers/hwmon/da9052-hwmon.c | 14 +- drivers/hwmon/da9055-hwmon.c | 4 +- drivers/hwmon/it87.c | 24 +-- drivers/hwmon/lm93.c | 38 ++--- drivers/hwmon/ntc_thermistor.c | 216 +++++++++++++------------- drivers/hwmon/via686a.c | 38 ++--- include/linux/platform_data/ntc_thermistor.h | 4 +- 9 files changed, 218 insertions(+), 218 deletions(-)
drivers/hwmon/ads7871.c +21 -21
@@ -40,25 +40,25 @@* the instruction byte */ /*Instruction Bit masks*/ -#define INST_MODE_bm (1<<7) -#define INST_READ_bm (1<<6) -#define INST_16BIT_bm (1<<5) +#define INST_MODE_BM (1 << 7) +#define INST_READ_BM (1 << 6) +#define INST_16BIT_BM (1 << 5)/*From figure 18 in the datasheet*/ /*bit masks for Rev/Oscillator Control Register*/ -#define MUX_CNV_bv 7 -#define MUX_CNV_bm (1<<MUX_CNV_bv) -#define MUX_M3_bm (1<<3)/*M3 selects single ended*/ -#define MUX_G_bv 4/*allows for reg = (gain << MUX_G_bv) | ...*/ +#define MUX_CNV_BV 7 +#define MUX_CNV_BM (1 << MUX_CNV_BV) +#define MUX_M3_BM (1 << 3)/*M3 selects single ended*/ +#define MUX_G_BV 4/*allows for reg = (gain << MUX_G_BV) | ...*/ /*From figure 18 in the datasheet*/ /*bit masks for Rev/Oscillator Control Register*/ -#define OSC_OSCR_bm (1<<5) -#define OSC_OSCE_bm (1<<4) -#define OSC_REFE_bm (1<<3) -#define OSC_BUFE_bm (1<<2) -#define OSC_R2V_bm (1<<1) -#define OSC_RBG_bm (1<<0) +#define OSC_OSCR_BM (1 << 5) +#define OSC_OSCE_BM (1 << 4) +#define OSC_REFE_BM (1 << 3) +#define OSC_BUFE_BM (1 << 2) +#define OSC_R2V_BM (1 << 1) +#define OSC_RBG_BM (1 << 0)#include <linux/module.h> #include <linux/init.h>
@@ -79,7 +79,7 @@ struct ads7871_data {static int ads7871_read_reg8 (struct spi_device *spi,int reg) {int ret; - reg = reg | INST_READ_bm; + reg = reg |INST_READ_BM ; ret =spi_w8r8 (spi, reg);return ret; }
@@ -87,7 +87,7 @@ static int ads7871_read_reg8(struct spi_device *spi, int reg)static int ads7871_read_reg16 (struct spi_device *spi,int reg) {int ret; - reg = reg | INST_READ_bm | INST_16BIT_bm; + reg = reg |INST_READ_BM |INST_16BIT_BM ; ret =spi_w8r16 (spi, reg);return ret; }
@@ -111,13 +111,13 @@ static ssize_t show_voltage(struct device *dev,* TODO: add support for conversions * other than single ended with a gain of 1 */ -/*MUX_M3_bm forces single ended*/ +/*MUX_M3_BM forces single ended*/ /*This is also where the gain of the PGA would be set*/ ads7871_write_reg8 (spi,REG_GAIN_MUX , - (MUX_CNV_bm | MUX_M3_bm | channel)); + (MUX_CNV_BM |MUX_M3_BM | channel)); ret =ads7871_read_reg8 (spi,REG_GAIN_MUX ); - mux_cnv = ((ret & MUX_CNV_bm)>>MUX_CNV_bv); + mux_cnv = ((ret &MUX_CNV_BM ) >>MUX_CNV_BV );/* * on 400MHz arm9 platform the conversion * is already done when we do this test
@@ -125,14 +125,14 @@ static ssize_t show_voltage(struct device *dev,while ((i <2 ) && mux_cnv) { i++; ret =ads7871_read_reg8 (spi,REG_GAIN_MUX ); - mux_cnv = ((ret & MUX_CNV_bm)>>MUX_CNV_bv); + mux_cnv = ((ret &MUX_CNV_BM ) >>MUX_CNV_BV );msleep_interruptible (1 ); }if (mux_cnv =0 ) { val =ads7871_read_reg16 (spi,REG_LS_BYTE );/*result in volts*10000 = (val/8192)*2.5*10000*/ - val = ((val>>2 ) *25000 ) /8192 ; + val = ((val >>2 ) *25000 ) /8192 ;return sprintf (buf,"%d\n" , val); }else {return -1 ;
@@ -189,7 +189,7 @@ static int ads7871_probe(struct spi_device *spi)ads7871_write_reg8 (spi,REG_SER_CONTROL ,0 );ads7871_write_reg8 (spi,REG_AD_CONTROL ,0 ); - val = (OSC_OSCR_bm | OSC_OSCE_bm | OSC_REFE_bm | OSC_BUFE_bm); + val = (OSC_OSCR_BM |OSC_OSCE_BM |OSC_REFE_BM |OSC_BUFE_BM );ads7871_write_reg8 (spi,REG_OSC_CONTROL , val); ret =ads7871_read_reg8 (spi,REG_OSC_CONTROL );
drivers/hwmon/asc7621.c +28 -28
219 lines not on this page · raw message
drivers/hwmon/da9052-hwmon.c +7 -7
@@ -43,19 +43,19 @@ static const char * const input_names[] = { };/* Conversion function for VDDOUT and VBAT */ -static inline int volt_reg_to_mV (int value) +static inline int volt_reg_to_mv (int value) {return DIV_ROUND_CLOSEST (value *1000 ,512 ) +2500 ; }/* Conversion function for ADC channels 4, 5 and 6 */ -static inline int input_reg_to_mV (int value) +static inline int input_reg_to_mv (int value) {return DIV_ROUND_CLOSEST (value *2500 ,1023 ); }/* Conversion function for VBBAT */ -static inline int vbbat_reg_to_mV (int value) +static inline int vbbat_reg_to_mv (int value) {return DIV_ROUND_CLOSEST (value *2500 ,512 ); }
@@ -96,7 +96,7 @@ static ssize_t da9052_read_vddout(struct device *dev, goto hwmon_err;mutex_unlock (&hwmon->hwmon_lock); -return sprintf (buf,"%d\n" ,volt_reg_to_mV (vdd)); +return sprintf (buf,"%d\n" ,volt_reg_to_mv (vdd)); hwmon_err_release:da9052_disable_vddout_channel (hwmon->da9052);
@@ -137,7 +137,7 @@ static ssize_t da9052_read_vbat(struct device *dev,if (ret <0 )return ret; -return sprintf (buf,"%d\n" ,volt_reg_to_mV (ret)); +return sprintf (buf,"%d\n" ,volt_reg_to_mv (ret)); } static ssize_t da9052_read_misc_channel(struct device *dev,
@@ -152,7 +152,7 @@ static ssize_t da9052_read_misc_channel(struct device *dev,if (ret <0 )return ret; -return sprintf (buf,"%d\n" ,input_reg_to_mV (ret)); +return sprintf (buf,"%d\n" ,input_reg_to_mv (ret)); } static ssize_t da9052_read_tjunc(struct device *dev,
@@ -187,7 +187,7 @@ static ssize_t da9052_read_vbbat(struct device *dev,if (ret <0 )return ret; -return sprintf (buf,"%d\n" ,vbbat_reg_to_mV (ret)); +return sprintf (buf,"%d\n" ,vbbat_reg_to_mv (ret)); } static ssize_t da9052_hwmon_show_name(struct device *dev,
drivers/hwmon/da9055-hwmon.c +2 -2
@@ -119,7 +119,7 @@ static irqreturn_t da9055_auxadc_irq(int irq, void *irq_data) }/* Conversion function for VSYS and ADCINx */ -static inline int volt_reg_to_mV (int value,int channel) +static inline int volt_reg_to_mv (int value,int channel) {if (channel =DA9055_ADC_VSYS )return DIV_ROUND_CLOSEST (value *1000 ,DA9055_VSYS_DIV ) +2500 ;
@@ -168,7 +168,7 @@ static ssize_t da9055_read_auto_ch(struct device *dev,mutex_unlock (&hwmon->hwmon_lock); -return sprintf (buf,"%d\n" ,volt_reg_to_mV (adc, channel)); +return sprintf (buf,"%d\n" ,volt_reg_to_mv (adc, channel)); hwmon_err_release:da9055_disable_auto_mode (hwmon->da9055, channel);
drivers/hwmon/it87.c +12 -12
@@ -1778,7 +1778,7 @@ static int __init it87_find(unsigned short *address,superio_select (5 ); sio_data->beep_pin =superio_inb (IT87_SIO_BEEP_PIN_REG ) &0x3f ; }else if (sio_data->type = it8783) { -int reg25, reg27, reg2A, reg2C, regEF; +int reg25, reg27, reg2a, reg2c, regef; sio_data->skip_vid =1 ;/* No VID */
@@ -1786,15 +1786,15 @@ static int __init it87_find(unsigned short *address, reg25 =superio_inb (IT87_SIO_GPIO1_REG ); reg27 =superio_inb (IT87_SIO_GPIO3_REG ); - reg2A =superio_inb (IT87_SIO_PINX1_REG ); - reg2C =superio_inb (IT87_SIO_PINX2_REG ); - regEF =superio_inb (IT87_SIO_SPI_REG ); + reg2a =superio_inb (IT87_SIO_PINX1_REG ); + reg2c =superio_inb (IT87_SIO_PINX2_REG ); + regef =superio_inb (IT87_SIO_SPI_REG );/* Check if fan3 is there or not */ -if ((reg27 & (1 <<0 )) || !(reg2C & (1 <<2 ))) +if ((reg27 & (1 <<0 )) || !(reg2c & (1 <<2 ))) sio_data->skip_fan |= (1 <<2 );if ((reg25 & (1 <<4 )) - || (!(reg2A & (1 <<1 )) && (regEF & (1 <<0 )))) + || (!(reg2a & (1 <<1 )) && (regef & (1 <<0 )))) sio_data->skip_pwm |= (1 <<2 );/* Check if fan2 is there or not */
@@ -1804,7 +1804,7 @@ static int __init it87_find(unsigned short *address, sio_data->skip_pwm |= (1 <<1 );/* VIN5 */ -if ((reg27 & (1 <<0 )) || (reg2C & (1 <<2 ))) +if ((reg27 & (1 <<0 )) || (reg2c & (1 <<2 ))) sio_data->skip_in |= (1 <<5 );/* No VIN5 */ /* VIN6 */
@@ -1829,18 +1829,18 @@ static int __init it87_find(unsigned short *address,* not the case, and ask the user to report if the * resulting voltage is sane. */ -if (!(reg2C & (1 <<1 ))) { - reg2C |= (1 <<1 ); -superio_outb (IT87_SIO_PINX2_REG , reg2C); +if (!(reg2c & (1 <<1 ))) { + reg2c |= (1 <<1 ); +superio_outb (IT87_SIO_PINX2_REG , reg2c);pr_notice ("Routing internal VCCH5V to in7.\n" ); }pr_notice ("in7 routed to internal voltage divider, with external pin disabled.\n" );pr_notice ("Please report if it displays a reasonable voltage.\n" ); } -if (reg2C & (1 <<0 )) +if (reg2c & (1 <<0 )) sio_data->internal |= (1 <<0 ); -if (reg2C & (1 <<1 )) +if (reg2c & (1 <<1 )) sio_data->internal |= (1 <<1 ); sio_data->beep_pin =superio_inb (IT87_SIO_BEEP_PIN_REG ) &0x3f ;
drivers/hwmon/lm93.c +19 -19
@@ -354,12 +354,12 @@ static const unsigned long lm93_vin_val_max[16] = {static unsigned LM93_IN_FROM_REG (int nr,u8 reg) { -const long uV_max = lm93_vin_val_max[nr] *1000 ; -const long uV_min = lm93_vin_val_min[nr] *1000 ; +const long uv_max = lm93_vin_val_max[nr] *1000 ; +const long uv_min = lm93_vin_val_min[nr] *1000 ; -const long slope = (uV_max - uV_min) / +const long slope = (uv_max - uv_min) / (lm93_vin_reg_max[nr] - lm93_vin_reg_min[nr]); -const long intercept = uV_min - slope * lm93_vin_reg_min[nr]; +const long intercept = uv_min - slope * lm93_vin_reg_min[nr];return (slope * reg + intercept +500 ) /1000 ; }
@@ -371,20 +371,20 @@ static unsigned LM93_IN_FROM_REG(int nr, u8 reg)static u8 LM93_IN_TO_REG (int nr,unsigned val) {/* range limit */ -const long mV =clamp_val (val, +const long mv =clamp_val (val, lm93_vin_val_min[nr], lm93_vin_val_max[nr]);/* try not to lose too much precision here */ -const long uV = mV *1000 ; -const long uV_max = lm93_vin_val_max[nr] *1000 ; -const long uV_min = lm93_vin_val_min[nr] *1000 ; +const long uv = mv *1000 ; +const long uv_max = lm93_vin_val_max[nr] *1000 ; +const long uv_min = lm93_vin_val_min[nr] *1000 ;/* convert */ -const long slope = (uV_max - uV_min) / +const long slope = (uv_max - uv_min) / (lm93_vin_reg_max[nr] - lm93_vin_reg_min[nr]); -const long intercept = uV_min - slope * lm93_vin_reg_min[nr]; +const long intercept = uv_min - slope * lm93_vin_reg_min[nr]; -u8 result = ((uV - intercept + (slope/2 )) / slope); +u8 result = ((uv - intercept + (slope/2 )) / slope); result =clamp_val (result, lm93_vin_reg_min[nr], lm93_vin_reg_max[nr]);return result;
@@ -393,10 +393,10 @@ static u8 LM93_IN_TO_REG(int nr, unsigned val)/* vid in mV, upper = 0 indicates low limit, otherwise upper limit */ static unsigned LM93_IN_REL_FROM_REG (u8 reg,int upper,int vid) { -const long uV_offset = upper ? (((reg >>4 &0x0f ) +1 ) *12500 ) : +const long uv_offset = upper ? (((reg >>4 &0x0f ) +1 ) *12500 ) : (((reg >>0 &0x0f ) +1 ) *-25000 ); -const long uV_vid = vid *1000 ; -return (uV_vid + uV_offset +5000 ) /10000 ; +const long uv_vid = vid *1000 ; +return (uv_vid + uv_offset +5000 ) /10000 ; }#define LM93_IN_MIN_FROM_REG (reg, vid) LM93_IN_REL_FROM_REG((reg), 0, (vid))
@@ -409,13 +409,13 @@ static unsigned LM93_IN_REL_FROM_REG(u8 reg, int upper, int vid)*/ static u8 LM93_IN_REL_TO_REG (unsigned val,int upper,int vid) { -long uV_offset = vid *1000 - val *10000 ; +long uv_offset = vid *1000 - val *10000 ;if (upper) { - uV_offset =clamp_val (uV_offset,12500 ,200000 ); -return (u8)((uV_offset /12500 -1 ) <<4 ); + uv_offset =clamp_val (uv_offset,12500 ,200000 ); +return (u8)((uv_offset /12500 -1 ) <<4 ); }else { - uV_offset =clamp_val (uV_offset,-400000 ,-25000 ); -return (u8)((uV_offset /-25000 -1 ) <<0 ); + uv_offset =clamp_val (uv_offset,-400000 ,-25000 ); +return (u8)((uv_offset /-25000 -1 ) <<0 ); } }
drivers/hwmon/ntc_thermistor.c +108 -108
315 lines not on this page · raw message
drivers/hwmon/via686a.c +19 -19
@@ -125,7 +125,7 @@ static const u8 VIA686A_REG_TEMP_HYST[] = { 0x3a, 0x3e, 0x1e };* (These conversions were contributed by Jonathan Teh Soon Yew * <[email protected]>) */ -static inline u8 IN_TO_REG (long val,int inNum) +static inline u8 IN_TO_REG (long val,int in_num) {/* * To avoid floating point, we multiply constants by 10 (100 for +12V).
@@ -134,29 +134,29 @@ static inline u8 IN_TO_REG(long val, int inNum)* by an additional 10000 (100000 for +12V): 1000 for val and 10 (100) * for the constants. */ -if (inNum <=1 ) +if (in_num <=1 )return (u8 )clamp_val ((val *21024 -1205000 ) /250000 ,0 ,255 ); -else if (inNum =2 ) +else if (in_num =2 )return (u8 )clamp_val ((val *15737 -1205000 ) /250000 ,0 ,255 ); -else if (inNum =3 ) +else if (in_num =3 )return (u8 )clamp_val ((val *10108 -1205000 ) /250000 ,0 ,255 );else return (u8 )clamp_val ((val *41714 -12050000 ) /2500000 ,0 ,255 ); } -static inline long IN_FROM_REG (u8 val,int inNum) +static inline long IN_FROM_REG (u8 val,int in_num) {/* * To avoid floating point, we multiply constants by 10 (100 for +12V). * We also multiply them by 1000 because we want 0.001V/bit for the * output value. Rounding is done. */ -if (inNum <=1 ) +if (in_num <=1 )return (long ) ((250000 * val +1330000 +21024 /2 ) /21024 ); -else if (inNum =2 ) +else if (in_num =2 )return (long ) ((250000 * val +1330000 +15737 /2 ) /15737 ); -else if (inNum =3 ) +else if (in_num =3 )return (long ) ((250000 * val +1330000 +10108 /2 ) /10108 );else return (long ) ((2500000 * val +13300000 +41714 /2 ) /41714 );
@@ -210,10 +210,10 @@ static inline u8 FAN_TO_REG(long rpm, int div)* VIA register values 0-255. I *10 before rounding, so we get tenth-degree * precision. (I could have done all 1024 values for our 10-bit readings, * but the function is very linear in the useful range (0-80 deg C), so -* we'll just use linear interpolation for 10-bit readings.) So, tempLUT +* we'll just use linear interpolation for 10-bit readings.) So, temp_lut * is the temp at via register values 0-255: */ -static const s16 tempLUT[] = { +static const s16 temp_lut[] = {-709 ,-688 ,-667 ,-646 ,-627 ,-607 ,-589 ,-570 ,-553 ,-536 ,-519 ,-503 ,-487 ,-471 ,-456 ,-442 ,-428 ,-414 ,-400 ,-387 ,-375 ,-362 ,-350 ,-339 ,-327 ,-316 ,-305 ,-295 ,-285 ,-275 ,-265 ,
@@ -261,7 +261,7 @@ static const s16 tempLUT[] = {* - 2.525453e-04*val^3 + 1.424593e-02*val^2 + 2.148941e+00*val +7.275808e+01) * Note that n1: */ -static const u8 viaLUT[] = { +static const u8 via_lut[] = {12 ,12 ,13 ,14 ,14 ,15 ,16 ,16 ,17 ,18 ,18 ,19 ,20 ,20 ,21 ,22 ,23 ,23 ,24 ,25 ,26 ,27 ,28 ,29 ,30 ,31 ,32 ,33 ,35 ,36 ,37 ,39 ,40 ,41 ,43 ,45 ,46 ,48 ,49 ,51 ,53 ,55 ,57 ,59 ,60 ,62 ,64 ,66 ,
@@ -284,26 +284,26 @@ static const u8 viaLUT[] = {*/ static inline u8 TEMP_TO_REG (long val) { -return viaLUT[val <=-50000 ?0 : val >=110000 ?160 : +return via_lut[val <=-50000 ?0 : val >=110000 ?160 : (val <0 ? val -500 : val +500 ) /1000 +50 ]; }/* for 8-bit temperature hyst and over registers */ -#define TEMP_FROM_REG (val) ((long)tempLUT[val] * 100) +#define TEMP_FROM_REG (val) ((long)temp_lut[val] * 100)/* for 10-bit temperature readings */ static inline long TEMP_FROM_REG10 (u16 val) { -u16 eightBits = val >>2 ; -u16 twoBits = val &3 ; +u16 eight_bits = val >>2 ; +u16 two_bits = val &3 ;/* no interpolation for these */ -if (twoBits =0 || eightBits =255 ) -return TEMP_FROM_REG (eightBits); +if (two_bits =0 || eight_bits =255 ) +return TEMP_FROM_REG (eight_bits);/* do some linear interpolation */ -return (tempLUT[eightBits] * (4 - twoBits) + - tempLUT[eightBits +1 ] * twoBits) *25 ; +return (temp_lut[eight_bits] * (4 - two_bits) + + temp_lut[eight_bits +1 ] * two_bits) *25 ; }#define DIV_FROM_REG (val) (1 << (val))
include/linux/platform_data/ntc_thermistor.h +2 -2
@@ -45,8 +45,8 @@ struct ntc_thermistor_platform_data {* chan: iio_channel pointer to communicate with the ADC which the * thermistor is using for conversion of the analog values. */ -int (*read_uV)(struct ntc_thermistor_platform_data *); -unsigned int pullup_uV; +int (*read_uv)(struct ntc_thermistor_platform_data *); +unsigned int pullup_uv;unsigned int pullup_ohm;unsigned int pulldown_ohm;
Signature · 7 lines
1.7.9.7 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors