Commit ca52c88c authored by Eva Rachel Retuya's avatar Eva Rachel Retuya Committed by Greg Kroah-Hartman

staging: iio: light: indent to match open parenthesis

Indent the parameters to match open parenthesis as suggested by checkpatch.
Signed-off-by: default avatarEva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 911568be
...@@ -183,7 +183,7 @@ static int isl29018_read_sensor_input(struct isl29018_chip *chip, int mode) ...@@ -183,7 +183,7 @@ static int isl29018_read_sensor_input(struct isl29018_chip *chip, int mode)
/* Set mode */ /* Set mode */
status = regmap_write(chip->regmap, ISL29018_REG_ADD_COMMAND1, status = regmap_write(chip->regmap, ISL29018_REG_ADD_COMMAND1,
mode << COMMMAND1_OPMODE_SHIFT); mode << COMMMAND1_OPMODE_SHIFT);
if (status) { if (status) {
dev_err(chip->dev, dev_err(chip->dev,
"Error in setting operating mode err %d\n", status); "Error in setting operating mode err %d\n", status);
...@@ -241,7 +241,7 @@ static int isl29018_read_ir(struct isl29018_chip *chip, int *ir) ...@@ -241,7 +241,7 @@ static int isl29018_read_ir(struct isl29018_chip *chip, int *ir)
} }
static int isl29018_read_proximity_ir(struct isl29018_chip *chip, int scheme, static int isl29018_read_proximity_ir(struct isl29018_chip *chip, int scheme,
int *near_ir) int *near_ir)
{ {
int status; int status;
int prox_data = -1; int prox_data = -1;
...@@ -249,15 +249,15 @@ static int isl29018_read_proximity_ir(struct isl29018_chip *chip, int scheme, ...@@ -249,15 +249,15 @@ static int isl29018_read_proximity_ir(struct isl29018_chip *chip, int scheme,
/* Do proximity sensing with required scheme */ /* Do proximity sensing with required scheme */
status = regmap_update_bits(chip->regmap, ISL29018_REG_ADD_COMMANDII, status = regmap_update_bits(chip->regmap, ISL29018_REG_ADD_COMMANDII,
COMMANDII_SCHEME_MASK, COMMANDII_SCHEME_MASK,
scheme << COMMANDII_SCHEME_SHIFT); scheme << COMMANDII_SCHEME_SHIFT);
if (status) { if (status) {
dev_err(chip->dev, "Error in setting operating mode\n"); dev_err(chip->dev, "Error in setting operating mode\n");
return status; return status;
} }
prox_data = isl29018_read_sensor_input(chip, prox_data = isl29018_read_sensor_input(chip,
COMMMAND1_OPMODE_PROX_ONCE); COMMMAND1_OPMODE_PROX_ONCE);
if (prox_data < 0) if (prox_data < 0)
return prox_data; return prox_data;
...@@ -280,7 +280,7 @@ static int isl29018_read_proximity_ir(struct isl29018_chip *chip, int scheme, ...@@ -280,7 +280,7 @@ static int isl29018_read_proximity_ir(struct isl29018_chip *chip, int scheme,
} }
static ssize_t show_scale_available(struct device *dev, static ssize_t show_scale_available(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct isl29018_chip *chip = iio_priv(indio_dev); struct isl29018_chip *chip = iio_priv(indio_dev);
...@@ -297,7 +297,7 @@ static ssize_t show_scale_available(struct device *dev, ...@@ -297,7 +297,7 @@ static ssize_t show_scale_available(struct device *dev,
} }
static ssize_t show_int_time_available(struct device *dev, static ssize_t show_int_time_available(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct isl29018_chip *chip = iio_priv(indio_dev); struct isl29018_chip *chip = iio_priv(indio_dev);
...@@ -314,7 +314,8 @@ static ssize_t show_int_time_available(struct device *dev, ...@@ -314,7 +314,8 @@ static ssize_t show_int_time_available(struct device *dev,
/* proximity scheme */ /* proximity scheme */
static ssize_t show_prox_infrared_suppression(struct device *dev, static ssize_t show_prox_infrared_suppression(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr,
char *buf)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct isl29018_chip *chip = iio_priv(indio_dev); struct isl29018_chip *chip = iio_priv(indio_dev);
...@@ -325,7 +326,8 @@ static ssize_t show_prox_infrared_suppression(struct device *dev, ...@@ -325,7 +326,8 @@ static ssize_t show_prox_infrared_suppression(struct device *dev,
} }
static ssize_t store_prox_infrared_suppression(struct device *dev, static ssize_t store_prox_infrared_suppression(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count) struct device_attribute *attr,
const char *buf, size_t count)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct isl29018_chip *chip = iio_priv(indio_dev); struct isl29018_chip *chip = iio_priv(indio_dev);
...@@ -413,7 +415,8 @@ static int isl29018_read_raw(struct iio_dev *indio_dev, ...@@ -413,7 +415,8 @@ static int isl29018_read_raw(struct iio_dev *indio_dev,
break; break;
case IIO_PROXIMITY: case IIO_PROXIMITY:
ret = isl29018_read_proximity_ir(chip, ret = isl29018_read_proximity_ir(chip,
chip->prox_scheme, val); chip->prox_scheme,
val);
break; break;
default: default:
break; break;
...@@ -705,7 +708,7 @@ static const char *isl29018_match_acpi_device(struct device *dev, int *data) ...@@ -705,7 +708,7 @@ static const char *isl29018_match_acpi_device(struct device *dev, int *data)
} }
static int isl29018_probe(struct i2c_client *client, static int isl29018_probe(struct i2c_client *client,
const struct i2c_device_id *id) const struct i2c_device_id *id)
{ {
struct isl29018_chip *chip; struct isl29018_chip *chip;
struct iio_dev *indio_dev; struct iio_dev *indio_dev;
......
...@@ -81,7 +81,7 @@ struct isl29028_chip { ...@@ -81,7 +81,7 @@ struct isl29028_chip {
}; };
static int isl29028_set_proxim_sampling(struct isl29028_chip *chip, static int isl29028_set_proxim_sampling(struct isl29028_chip *chip,
unsigned int sampling) unsigned int sampling)
{ {
static unsigned int prox_period[] = {800, 400, 200, 100, 75, 50, 12, 0}; static unsigned int prox_period[] = {800, 400, 200, 100, 75, 50, 12, 0};
int sel; int sel;
...@@ -103,7 +103,7 @@ static int isl29028_enable_proximity(struct isl29028_chip *chip, bool enable) ...@@ -103,7 +103,7 @@ static int isl29028_enable_proximity(struct isl29028_chip *chip, bool enable)
if (enable) if (enable)
val = CONFIGURE_PROX_EN; val = CONFIGURE_PROX_EN;
ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE,
CONFIGURE_PROX_EN_MASK, val); CONFIGURE_PROX_EN_MASK, val);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -122,24 +122,27 @@ static int isl29028_set_als_scale(struct isl29028_chip *chip, int lux_scale) ...@@ -122,24 +122,27 @@ static int isl29028_set_als_scale(struct isl29028_chip *chip, int lux_scale)
} }
static int isl29028_set_als_ir_mode(struct isl29028_chip *chip, static int isl29028_set_als_ir_mode(struct isl29028_chip *chip,
enum als_ir_mode mode) enum als_ir_mode mode)
{ {
int ret = 0; int ret = 0;
switch (mode) { switch (mode) {
case MODE_ALS: case MODE_ALS:
ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE,
CONFIGURE_ALS_IR_MODE_MASK, CONFIGURE_ALS_IR_MODE_ALS); CONFIGURE_ALS_IR_MODE_MASK,
CONFIGURE_ALS_IR_MODE_ALS);
if (ret < 0) if (ret < 0)
return ret; return ret;
ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE,
CONFIGURE_ALS_RANGE_MASK, CONFIGURE_ALS_RANGE_HIGH_LUX); CONFIGURE_ALS_RANGE_MASK,
CONFIGURE_ALS_RANGE_HIGH_LUX);
break; break;
case MODE_IR: case MODE_IR:
ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE,
CONFIGURE_ALS_IR_MODE_MASK, CONFIGURE_ALS_IR_MODE_IR); CONFIGURE_ALS_IR_MODE_MASK,
CONFIGURE_ALS_IR_MODE_IR);
break; break;
case MODE_NONE: case MODE_NONE:
...@@ -152,7 +155,7 @@ static int isl29028_set_als_ir_mode(struct isl29028_chip *chip, ...@@ -152,7 +155,7 @@ static int isl29028_set_als_ir_mode(struct isl29028_chip *chip,
/* Enable the ALS/IR */ /* Enable the ALS/IR */
ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE, ret = regmap_update_bits(chip->regmap, ISL29028_REG_CONFIGURE,
CONFIGURE_ALS_EN_MASK, CONFIGURE_ALS_EN); CONFIGURE_ALS_EN_MASK, CONFIGURE_ALS_EN);
if (ret < 0) if (ret < 0)
return ret; return ret;
...@@ -193,7 +196,7 @@ static int isl29028_read_proxim(struct isl29028_chip *chip, int *prox) ...@@ -193,7 +196,7 @@ static int isl29028_read_proxim(struct isl29028_chip *chip, int *prox)
ret = regmap_read(chip->regmap, ISL29028_REG_PROX_DATA, &data); ret = regmap_read(chip->regmap, ISL29028_REG_PROX_DATA, &data);
if (ret < 0) { if (ret < 0) {
dev_err(chip->dev, "Error in reading register %d, error %d\n", dev_err(chip->dev, "Error in reading register %d, error %d\n",
ISL29028_REG_PROX_DATA, ret); ISL29028_REG_PROX_DATA, ret);
return ret; return ret;
} }
*prox = data; *prox = data;
...@@ -264,7 +267,8 @@ static int isl29028_ir_get(struct isl29028_chip *chip, int *ir_data) ...@@ -264,7 +267,8 @@ static int isl29028_ir_get(struct isl29028_chip *chip, int *ir_data)
/* Channel IO */ /* Channel IO */
static int isl29028_write_raw(struct iio_dev *indio_dev, static int isl29028_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int val, int val2, long mask) struct iio_chan_spec const *chan,
int val, int val2, long mask)
{ {
struct isl29028_chip *chip = iio_priv(indio_dev); struct isl29028_chip *chip = iio_priv(indio_dev);
int ret = -EINVAL; int ret = -EINVAL;
...@@ -323,7 +327,8 @@ static int isl29028_write_raw(struct iio_dev *indio_dev, ...@@ -323,7 +327,8 @@ static int isl29028_write_raw(struct iio_dev *indio_dev,
} }
static int isl29028_read_raw(struct iio_dev *indio_dev, static int isl29028_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int *val, int *val2, long mask) struct iio_chan_spec const *chan,
int *val, int *val2, long mask)
{ {
struct isl29028_chip *chip = iio_priv(indio_dev); struct isl29028_chip *chip = iio_priv(indio_dev);
int ret = -EINVAL; int ret = -EINVAL;
...@@ -476,7 +481,7 @@ static const struct regmap_config isl29028_regmap_config = { ...@@ -476,7 +481,7 @@ static const struct regmap_config isl29028_regmap_config = {
}; };
static int isl29028_probe(struct i2c_client *client, static int isl29028_probe(struct i2c_client *client,
const struct i2c_device_id *id) const struct i2c_device_id *id)
{ {
struct isl29028_chip *chip; struct isl29028_chip *chip;
struct iio_dev *indio_dev; struct iio_dev *indio_dev;
......
...@@ -482,7 +482,7 @@ static int taos_chip_off(struct iio_dev *indio_dev) ...@@ -482,7 +482,7 @@ static int taos_chip_off(struct iio_dev *indio_dev)
/* Sysfs Interface Functions */ /* Sysfs Interface Functions */
static ssize_t taos_power_state_show(struct device *dev, static ssize_t taos_power_state_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct tsl2583_chip *chip = iio_priv(indio_dev); struct tsl2583_chip *chip = iio_priv(indio_dev);
...@@ -491,7 +491,8 @@ static ssize_t taos_power_state_show(struct device *dev, ...@@ -491,7 +491,8 @@ static ssize_t taos_power_state_show(struct device *dev,
} }
static ssize_t taos_power_state_store(struct device *dev, static ssize_t taos_power_state_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t len) struct device_attribute *attr,
const char *buf, size_t len)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
int value; int value;
...@@ -508,7 +509,7 @@ static ssize_t taos_power_state_store(struct device *dev, ...@@ -508,7 +509,7 @@ static ssize_t taos_power_state_store(struct device *dev,
} }
static ssize_t taos_gain_show(struct device *dev, static ssize_t taos_gain_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct tsl2583_chip *chip = iio_priv(indio_dev); struct tsl2583_chip *chip = iio_priv(indio_dev);
...@@ -533,7 +534,8 @@ static ssize_t taos_gain_show(struct device *dev, ...@@ -533,7 +534,8 @@ static ssize_t taos_gain_show(struct device *dev,
} }
static ssize_t taos_gain_store(struct device *dev, static ssize_t taos_gain_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t len) struct device_attribute *attr,
const char *buf, size_t len)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct tsl2583_chip *chip = iio_priv(indio_dev); struct tsl2583_chip *chip = iio_priv(indio_dev);
...@@ -564,13 +566,14 @@ static ssize_t taos_gain_store(struct device *dev, ...@@ -564,13 +566,14 @@ static ssize_t taos_gain_store(struct device *dev,
} }
static ssize_t taos_gain_available_show(struct device *dev, static ssize_t taos_gain_available_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr,
char *buf)
{ {
return sprintf(buf, "%s\n", "1 8 16 111"); return sprintf(buf, "%s\n", "1 8 16 111");
} }
static ssize_t taos_als_time_show(struct device *dev, static ssize_t taos_als_time_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct tsl2583_chip *chip = iio_priv(indio_dev); struct tsl2583_chip *chip = iio_priv(indio_dev);
...@@ -579,7 +582,8 @@ static ssize_t taos_als_time_show(struct device *dev, ...@@ -579,7 +582,8 @@ static ssize_t taos_als_time_show(struct device *dev,
} }
static ssize_t taos_als_time_store(struct device *dev, static ssize_t taos_als_time_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t len) struct device_attribute *attr,
const char *buf, size_t len)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct tsl2583_chip *chip = iio_priv(indio_dev); struct tsl2583_chip *chip = iio_priv(indio_dev);
...@@ -600,14 +604,15 @@ static ssize_t taos_als_time_store(struct device *dev, ...@@ -600,14 +604,15 @@ static ssize_t taos_als_time_store(struct device *dev,
} }
static ssize_t taos_als_time_available_show(struct device *dev, static ssize_t taos_als_time_available_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr,
char *buf)
{ {
return sprintf(buf, "%s\n", return sprintf(buf, "%s\n",
"50 100 150 200 250 300 350 400 450 500 550 600 650"); "50 100 150 200 250 300 350 400 450 500 550 600 650");
} }
static ssize_t taos_als_trim_show(struct device *dev, static ssize_t taos_als_trim_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct tsl2583_chip *chip = iio_priv(indio_dev); struct tsl2583_chip *chip = iio_priv(indio_dev);
...@@ -616,7 +621,8 @@ static ssize_t taos_als_trim_show(struct device *dev, ...@@ -616,7 +621,8 @@ static ssize_t taos_als_trim_show(struct device *dev,
} }
static ssize_t taos_als_trim_store(struct device *dev, static ssize_t taos_als_trim_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t len) struct device_attribute *attr,
const char *buf, size_t len)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct tsl2583_chip *chip = iio_priv(indio_dev); struct tsl2583_chip *chip = iio_priv(indio_dev);
...@@ -632,7 +638,8 @@ static ssize_t taos_als_trim_store(struct device *dev, ...@@ -632,7 +638,8 @@ static ssize_t taos_als_trim_store(struct device *dev,
} }
static ssize_t taos_als_cal_target_show(struct device *dev, static ssize_t taos_als_cal_target_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr,
char *buf)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct tsl2583_chip *chip = iio_priv(indio_dev); struct tsl2583_chip *chip = iio_priv(indio_dev);
...@@ -641,7 +648,8 @@ static ssize_t taos_als_cal_target_show(struct device *dev, ...@@ -641,7 +648,8 @@ static ssize_t taos_als_cal_target_show(struct device *dev,
} }
static ssize_t taos_als_cal_target_store(struct device *dev, static ssize_t taos_als_cal_target_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t len) struct device_attribute *attr,
const char *buf, size_t len)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct tsl2583_chip *chip = iio_priv(indio_dev); struct tsl2583_chip *chip = iio_priv(indio_dev);
...@@ -657,7 +665,7 @@ static ssize_t taos_als_cal_target_store(struct device *dev, ...@@ -657,7 +665,7 @@ static ssize_t taos_als_cal_target_store(struct device *dev,
} }
static ssize_t taos_lux_show(struct device *dev, struct device_attribute *attr, static ssize_t taos_lux_show(struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {
int ret; int ret;
...@@ -669,7 +677,8 @@ static ssize_t taos_lux_show(struct device *dev, struct device_attribute *attr, ...@@ -669,7 +677,8 @@ static ssize_t taos_lux_show(struct device *dev, struct device_attribute *attr,
} }
static ssize_t taos_do_calibrate(struct device *dev, static ssize_t taos_do_calibrate(struct device *dev,
struct device_attribute *attr, const char *buf, size_t len) struct device_attribute *attr,
const char *buf, size_t len)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
int value; int value;
...@@ -684,7 +693,7 @@ static ssize_t taos_do_calibrate(struct device *dev, ...@@ -684,7 +693,7 @@ static ssize_t taos_do_calibrate(struct device *dev,
} }
static ssize_t taos_luxtable_show(struct device *dev, static ssize_t taos_luxtable_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
int i; int i;
int offset = 0; int offset = 0;
...@@ -707,7 +716,8 @@ static ssize_t taos_luxtable_show(struct device *dev, ...@@ -707,7 +716,8 @@ static ssize_t taos_luxtable_show(struct device *dev,
} }
static ssize_t taos_luxtable_store(struct device *dev, static ssize_t taos_luxtable_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t len) struct device_attribute *attr,
const char *buf, size_t len)
{ {
struct iio_dev *indio_dev = dev_to_iio_dev(dev); struct iio_dev *indio_dev = dev_to_iio_dev(dev);
struct tsl2583_chip *chip = iio_priv(indio_dev); struct tsl2583_chip *chip = iio_priv(indio_dev);
...@@ -809,7 +819,7 @@ static int taos_probe(struct i2c_client *clientp, ...@@ -809,7 +819,7 @@ static int taos_probe(struct i2c_client *clientp,
struct iio_dev *indio_dev; struct iio_dev *indio_dev;
if (!i2c_check_functionality(clientp->adapter, if (!i2c_check_functionality(clientp->adapter,
I2C_FUNC_SMBUS_BYTE_DATA)) { I2C_FUNC_SMBUS_BYTE_DATA)) {
dev_err(&clientp->dev, "taos_probe() - i2c smbus byte data func unsupported\n"); dev_err(&clientp->dev, "taos_probe() - i2c smbus byte data func unsupported\n");
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
...@@ -846,7 +856,7 @@ static int taos_probe(struct i2c_client *clientp, ...@@ -846,7 +856,7 @@ static int taos_probe(struct i2c_client *clientp,
if (!taos_tsl258x_device(buf)) { if (!taos_tsl258x_device(buf)) {
dev_info(&clientp->dev, dev_info(&clientp->dev,
"i2c device found but does not match expected id in taos_probe()\n"); "i2c device found but does not match expected id in taos_probe()\n");
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment