Skip to content

Commit

Permalink
hwmon: Fix CamelCase checkpatch warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
  • Loading branch information
groeck committed Apr 8, 2013
1 parent 236d903 commit 088ce2a
Show file tree
Hide file tree
Showing 9 changed files with 218 additions and 218 deletions.
42 changes: 21 additions & 21 deletions drivers/hwmon/ads7871.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -79,15 +79,15 @@ 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;
}

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;
}
Expand All @@ -111,28 +111,28 @@ 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
*/
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;
Expand Down Expand Up @@ -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);

Expand Down
56 changes: 28 additions & 28 deletions drivers/hwmon/asc7621.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ static inline int write_byte(struct i2c_client *client, u8 reg, u8 data)
* and retrieval of like parameters.
*/

#define SETUP_SHOW_data_param(d, a) \
#define SETUP_SHOW_DATA_PARAM(d, a) \
struct sensor_device_attribute *sda = to_sensor_dev_attr(a); \
struct asc7621_data *data = asc7621_update_device(d); \
struct asc7621_param *param = to_asc7621_param(sda)

#define SETUP_STORE_data_param(d, a) \
#define SETUP_STORE_DATA_PARAM(d, a) \
struct sensor_device_attribute *sda = to_sensor_dev_attr(a); \
struct i2c_client *client = to_i2c_client(d); \
struct asc7621_data *data = i2c_get_clientdata(client); \
Expand All @@ -177,15 +177,15 @@ static inline int write_byte(struct i2c_client *client, u8 reg, u8 data)
static ssize_t show_u8(struct device *dev, struct device_attribute *attr,
char *buf)
{
SETUP_SHOW_data_param(dev, attr);
SETUP_SHOW_DATA_PARAM(dev, attr);

return sprintf(buf, "%u\n", data->reg[param->msb[0]]);
}

static ssize_t store_u8(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
SETUP_STORE_data_param(dev, attr);
SETUP_STORE_DATA_PARAM(dev, attr);
long reqval;

if (kstrtol(buf, 10, &reqval))
Expand All @@ -206,7 +206,7 @@ static ssize_t store_u8(struct device *dev, struct device_attribute *attr,
static ssize_t show_bitmask(struct device *dev,
struct device_attribute *attr, char *buf)
{
SETUP_SHOW_data_param(dev, attr);
SETUP_SHOW_DATA_PARAM(dev, attr);

return sprintf(buf, "%u\n",
(data->reg[param->msb[0]] >> param->
Expand All @@ -217,7 +217,7 @@ static ssize_t store_bitmask(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
SETUP_STORE_data_param(dev, attr);
SETUP_STORE_DATA_PARAM(dev, attr);
long reqval;
u8 currval;

Expand Down Expand Up @@ -246,7 +246,7 @@ static ssize_t store_bitmask(struct device *dev,
static ssize_t show_fan16(struct device *dev,
struct device_attribute *attr, char *buf)
{
SETUP_SHOW_data_param(dev, attr);
SETUP_SHOW_DATA_PARAM(dev, attr);
u16 regval;

mutex_lock(&data->update_lock);
Expand All @@ -262,7 +262,7 @@ static ssize_t store_fan16(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{
SETUP_STORE_data_param(dev, attr);
SETUP_STORE_DATA_PARAM(dev, attr);
long reqval;

if (kstrtol(buf, 10, &reqval))
Expand Down Expand Up @@ -307,7 +307,7 @@ static int asc7621_in_scaling[] = {
static ssize_t show_in10(struct device *dev, struct device_attribute *attr,
char *buf)
{
SETUP_SHOW_data_param(dev, attr);
SETUP_SHOW_DATA_PARAM(dev, attr);
u16 regval;
u8 nr = sda->index;

Expand All @@ -325,7 +325,7 @@ static ssize_t show_in10(struct device *dev, struct device_attribute *attr,
static ssize_t show_in8(struct device *dev, struct device_attribute *attr,
char *buf)
{
SETUP_SHOW_data_param(dev, attr);
SETUP_SHOW_DATA_PARAM(dev, attr);
u8 nr = sda->index;

return sprintf(buf, "%u\n",
Expand All @@ -336,7 +336,7 @@ static ssize_t show_in8(struct device *dev, struct device_attribute *attr,
static ssize_t store_in8(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{
SETUP_STORE_data_param(dev, attr);
SETUP_STORE_DATA_PARAM(dev, attr);
long reqval;
u8 nr = sda->index;

Expand All @@ -360,7 +360,7 @@ static ssize_t store_in8(struct device *dev, struct device_attribute *attr,
static ssize_t show_temp8(struct device *dev,
struct device_attribute *attr, char *buf)
{
SETUP_SHOW_data_param(dev, attr);
SETUP_SHOW_DATA_PARAM(dev, attr);

return sprintf(buf, "%d\n", ((s8) data->reg[param->msb[0]]) * 1000);
}
Expand All @@ -369,7 +369,7 @@ static ssize_t store_temp8(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{
SETUP_STORE_data_param(dev, attr);
SETUP_STORE_DATA_PARAM(dev, attr);
long reqval;
s8 temp;

Expand Down Expand Up @@ -397,7 +397,7 @@ static ssize_t store_temp8(struct device *dev,
static ssize_t show_temp10(struct device *dev,
struct device_attribute *attr, char *buf)
{
SETUP_SHOW_data_param(dev, attr);
SETUP_SHOW_DATA_PARAM(dev, attr);
u8 msb, lsb;
int temp;

Expand All @@ -414,7 +414,7 @@ static ssize_t show_temp10(struct device *dev,
static ssize_t show_temp62(struct device *dev,
struct device_attribute *attr, char *buf)
{
SETUP_SHOW_data_param(dev, attr);
SETUP_SHOW_DATA_PARAM(dev, attr);
u8 regval = data->reg[param->msb[0]];
int temp = ((s8) (regval & 0xfc) * 1000) + ((regval & 0x03) * 250);

Expand All @@ -425,7 +425,7 @@ static ssize_t store_temp62(struct device *dev,
struct device_attribute *attr, const char *buf,
size_t count)
{
SETUP_STORE_data_param(dev, attr);
SETUP_STORE_DATA_PARAM(dev, attr);
long reqval, i, f;
s8 temp;

Expand Down Expand Up @@ -459,7 +459,7 @@ static u32 asc7621_range_map[] = {
static ssize_t show_ap2_temp(struct device *dev,
struct device_attribute *attr, char *buf)
{
SETUP_SHOW_data_param(dev, attr);
SETUP_SHOW_DATA_PARAM(dev, attr);
long auto_point1;
u8 regval;
int temp;
Expand All @@ -479,7 +479,7 @@ static ssize_t store_ap2_temp(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
SETUP_STORE_data_param(dev, attr);
SETUP_STORE_DATA_PARAM(dev, attr);
long reqval, auto_point1;
int i;
u8 currval, newval = 0;
Expand Down Expand Up @@ -510,7 +510,7 @@ static ssize_t store_ap2_temp(struct device *dev,
static ssize_t show_pwm_ac(struct device *dev,
struct device_attribute *attr, char *buf)
{
SETUP_SHOW_data_param(dev, attr);
SETUP_SHOW_DATA_PARAM(dev, attr);
u8 config, altbit, regval;
u8 map[] = {
0x01, 0x02, 0x04, 0x1f, 0x00, 0x06, 0x07, 0x10,
Expand All @@ -530,7 +530,7 @@ static ssize_t store_pwm_ac(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
SETUP_STORE_data_param(dev, attr);
SETUP_STORE_DATA_PARAM(dev, attr);
unsigned long reqval;
u8 currval, config, altbit, newval;
u16 map[] = {
Expand Down Expand Up @@ -569,7 +569,7 @@ static ssize_t store_pwm_ac(struct device *dev,
static ssize_t show_pwm_enable(struct device *dev,
struct device_attribute *attr, char *buf)
{
SETUP_SHOW_data_param(dev, attr);
SETUP_SHOW_DATA_PARAM(dev, attr);
u8 config, altbit, minoff, val, newval;

mutex_lock(&data->update_lock);
Expand Down Expand Up @@ -599,7 +599,7 @@ static ssize_t store_pwm_enable(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
SETUP_STORE_data_param(dev, attr);
SETUP_STORE_DATA_PARAM(dev, attr);
long reqval;
u8 currval, config, altbit, newval, minoff = 255;

Expand Down Expand Up @@ -659,7 +659,7 @@ static u32 asc7621_pwm_freq_map[] = {
static ssize_t show_pwm_freq(struct device *dev,
struct device_attribute *attr, char *buf)
{
SETUP_SHOW_data_param(dev, attr);
SETUP_SHOW_DATA_PARAM(dev, attr);
u8 regval =
(data->reg[param->msb[0]] >> param->shift[0]) & param->mask[0];

Expand All @@ -672,7 +672,7 @@ static ssize_t store_pwm_freq(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
SETUP_STORE_data_param(dev, attr);
SETUP_STORE_DATA_PARAM(dev, attr);
unsigned long reqval;
u8 currval, newval = 255;
int i;
Expand Down Expand Up @@ -707,7 +707,7 @@ static u32 asc7621_pwm_auto_spinup_map[] = {
static ssize_t show_pwm_ast(struct device *dev,
struct device_attribute *attr, char *buf)
{
SETUP_SHOW_data_param(dev, attr);
SETUP_SHOW_DATA_PARAM(dev, attr);
u8 regval =
(data->reg[param->msb[0]] >> param->shift[0]) & param->mask[0];

Expand All @@ -721,7 +721,7 @@ static ssize_t store_pwm_ast(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
SETUP_STORE_data_param(dev, attr);
SETUP_STORE_DATA_PARAM(dev, attr);
long reqval;
u8 currval, newval = 255;
u32 i;
Expand Down Expand Up @@ -756,7 +756,7 @@ static u32 asc7621_temp_smoothing_time_map[] = {
static ssize_t show_temp_st(struct device *dev,
struct device_attribute *attr, char *buf)
{
SETUP_SHOW_data_param(dev, attr);
SETUP_SHOW_DATA_PARAM(dev, attr);
u8 regval =
(data->reg[param->msb[0]] >> param->shift[0]) & param->mask[0];
regval = clamp_val(regval, 0, 7);
Expand All @@ -768,7 +768,7 @@ static ssize_t store_temp_st(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
SETUP_STORE_data_param(dev, attr);
SETUP_STORE_DATA_PARAM(dev, attr);
long reqval;
u8 currval, newval = 255;
u32 i;
Expand Down
Loading

0 comments on commit 088ce2a

Please sign in to comment.