Commit 5262d8fd authored by Peter Meerwald's avatar Peter Meerwald Committed by Jonathan Cameron

staging:iio:accel:sca3000: Fix format of comments

Signed-off-by: default avatarPeter Meerwald <pmeerw@pmeerw.net>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent e6869759
...@@ -32,7 +32,8 @@ enum sca3000_variant { ...@@ -32,7 +32,8 @@ enum sca3000_variant {
e05, e05,
}; };
/* Note where option modes are not defined, the chip simply does not /*
* Note where option modes are not defined, the chip simply does not
* support any. * support any.
* Other chips in the sca3000 series use i2c and are not included here. * Other chips in the sca3000 series use i2c and are not included here.
* *
...@@ -191,7 +192,6 @@ static int sca3000_write_ctrl_reg(struct sca3000_state *st, ...@@ -191,7 +192,6 @@ static int sca3000_write_ctrl_reg(struct sca3000_state *st,
return ret; return ret;
} }
/* Crucial that lock is called before calling this */
/** /**
* sca3000_read_ctrl_reg() read from lock protected control register. * sca3000_read_ctrl_reg() read from lock protected control register.
* *
...@@ -402,7 +402,8 @@ sca3000_store_measurement_mode(struct device *dev, ...@@ -402,7 +402,8 @@ sca3000_store_measurement_mode(struct device *dev,
} }
/* Not even vaguely standard attributes so defined here rather than /*
* Not even vaguely standard attributes so defined here rather than
* in the relevant IIO core headers * in the relevant IIO core headers
*/ */
static IIO_DEVICE_ATTR(measurement_mode_available, S_IRUGO, static IIO_DEVICE_ATTR(measurement_mode_available, S_IRUGO,
...@@ -662,7 +663,8 @@ static ssize_t sca3000_set_frequency(struct device *dev, ...@@ -662,7 +663,8 @@ static ssize_t sca3000_set_frequency(struct device *dev,
return ret ? ret : len; return ret ? ret : len;
} }
/* Should only really be registered if ring buffer support is compiled in. /*
* Should only really be registered if ring buffer support is compiled in.
* Does no harm however and doing it right would add a fair bit of complexity * Does no harm however and doing it right would add a fair bit of complexity
*/ */
static IIO_DEV_ATTR_SAMP_FREQ_AVAIL(sca3000_read_av_freq); static IIO_DEV_ATTR_SAMP_FREQ_AVAIL(sca3000_read_av_freq);
...@@ -675,10 +677,10 @@ static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO, ...@@ -675,10 +677,10 @@ static IIO_DEV_ATTR_SAMP_FREQ(S_IWUSR | S_IRUGO,
/** /**
* sca3000_read_temp() sysfs interface to get the temperature when available * sca3000_read_temp() sysfs interface to get the temperature when available
* *
* The alignment of data in here is downright odd. See data sheet. * The alignment of data in here is downright odd. See data sheet.
* Converting this into a meaningful value is left to inline functions in * Converting this into a meaningful value is left to inline functions in
* userspace part of header. * userspace part of header.
**/ **/
static ssize_t sca3000_read_temp(struct device *dev, static ssize_t sca3000_read_temp(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
char *buf) char *buf)
...@@ -802,12 +804,12 @@ static const struct attribute_group sca3000_attribute_group_with_temp = { ...@@ -802,12 +804,12 @@ static const struct attribute_group sca3000_attribute_group_with_temp = {
.attrs = sca3000_attributes_with_temp, .attrs = sca3000_attributes_with_temp,
}; };
/* RING RELATED interrupt handler */
/* depending on event, push to the ring buffer event chrdev or the event one */
/** /**
* sca3000_event_handler() - handling ring and non ring events * sca3000_event_handler() - handling ring and non ring events
* *
* Ring related interrupt handler. Depending on event, push to
* the ring buffer event chrdev or the event one.
*
* This function is complicated by the fact that the devices can signify ring * This function is complicated by the fact that the devices can signify ring
* and non ring events via the same interrupt line and they can only * and non ring events via the same interrupt line and they can only
* be distinguished via a read of the relevant status register. * be distinguished via a read of the relevant status register.
...@@ -819,7 +821,8 @@ static irqreturn_t sca3000_event_handler(int irq, void *private) ...@@ -819,7 +821,8 @@ static irqreturn_t sca3000_event_handler(int irq, void *private)
int ret, val; int ret, val;
s64 last_timestamp = iio_get_time_ns(); s64 last_timestamp = iio_get_time_ns();
/* Could lead if badly timed to an extra read of status reg, /*
* Could lead if badly timed to an extra read of status reg,
* but ensures no interrupt is missed. * but ensures no interrupt is missed.
*/ */
mutex_lock(&st->lock); mutex_lock(&st->lock);
...@@ -934,7 +937,6 @@ static ssize_t sca3000_query_free_fall_mode(struct device *dev, ...@@ -934,7 +937,6 @@ static ssize_t sca3000_query_free_fall_mode(struct device *dev,
* the device falls more than 25cm. This has not been tested due * the device falls more than 25cm. This has not been tested due
* to fragile wiring. * to fragile wiring.
**/ **/
static ssize_t sca3000_set_free_fall_mode(struct device *dev, static ssize_t sca3000_set_free_fall_mode(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, const char *buf,
...@@ -956,7 +958,7 @@ static ssize_t sca3000_set_free_fall_mode(struct device *dev, ...@@ -956,7 +958,7 @@ static ssize_t sca3000_set_free_fall_mode(struct device *dev,
if (ret) if (ret)
goto error_ret; goto error_ret;
/*if off and should be on*/ /* if off and should be on */
if (val && !(st->rx[0] & protect_mask)) if (val && !(st->rx[0] & protect_mask))
ret = sca3000_write_reg(st, SCA3000_REG_ADDR_MODE, ret = sca3000_write_reg(st, SCA3000_REG_ADDR_MODE,
(st->rx[0] | SCA3000_FREE_FALL_DETECT)); (st->rx[0] | SCA3000_FREE_FALL_DETECT));
...@@ -991,13 +993,15 @@ static int sca3000_write_event_config(struct iio_dev *indio_dev, ...@@ -991,13 +993,15 @@ static int sca3000_write_event_config(struct iio_dev *indio_dev,
int num = chan->channel2; int num = chan->channel2;
mutex_lock(&st->lock); mutex_lock(&st->lock);
/* First read the motion detector config to find out if /*
* this axis is on*/ * First read the motion detector config to find out if
* this axis is on
*/
ret = sca3000_read_ctrl_reg(st, SCA3000_REG_CTRL_SEL_MD_CTRL); ret = sca3000_read_ctrl_reg(st, SCA3000_REG_CTRL_SEL_MD_CTRL);
if (ret < 0) if (ret < 0)
goto exit_point; goto exit_point;
ctrlval = ret; ctrlval = ret;
/* Off and should be on */ /* if off and should be on */
if (state && !(ctrlval & sca3000_addresses[num][2])) { if (state && !(ctrlval & sca3000_addresses[num][2])) {
ret = sca3000_write_ctrl_reg(st, ret = sca3000_write_ctrl_reg(st,
SCA3000_REG_CTRL_SEL_MD_CTRL, SCA3000_REG_CTRL_SEL_MD_CTRL,
...@@ -1020,7 +1024,7 @@ static int sca3000_write_event_config(struct iio_dev *indio_dev, ...@@ -1020,7 +1024,7 @@ static int sca3000_write_event_config(struct iio_dev *indio_dev,
ret = sca3000_read_data_short(st, SCA3000_REG_ADDR_MODE, 1); ret = sca3000_read_data_short(st, SCA3000_REG_ADDR_MODE, 1);
if (ret) if (ret)
goto exit_point; goto exit_point;
/*if off and should be on*/ /* if off and should be on */
if ((st->mo_det_use_count) if ((st->mo_det_use_count)
&& ((st->rx[0] & protect_mask) != SCA3000_MEAS_MODE_MOT_DET)) && ((st->rx[0] & protect_mask) != SCA3000_MEAS_MODE_MOT_DET))
ret = sca3000_write_reg(st, SCA3000_REG_ADDR_MODE, ret = sca3000_write_reg(st, SCA3000_REG_ADDR_MODE,
...@@ -1106,9 +1110,11 @@ static int sca3000_clean_setup(struct sca3000_state *st) ...@@ -1106,9 +1110,11 @@ static int sca3000_clean_setup(struct sca3000_state *st)
| SCA3000_INT_MASK_ACTIVE_LOW); | SCA3000_INT_MASK_ACTIVE_LOW);
if (ret) if (ret)
goto error_ret; goto error_ret;
/* Select normal measurement mode, free fall off, ring off */ /*
/* Ring in 12 bit mode - it is fine to overwrite reserved bits 3,5 * Select normal measurement mode, free fall off, ring off
* as that occurs in one of the example on the datasheet */ * Ring in 12 bit mode - it is fine to overwrite reserved bits 3,5
* as that occurs in one of the example on the datasheet
*/
ret = sca3000_read_data_short(st, SCA3000_REG_ADDR_MODE, 1); ret = sca3000_read_data_short(st, SCA3000_REG_ADDR_MODE, 1);
if (ret) if (ret)
goto error_ret; goto error_ret;
...@@ -1235,7 +1241,7 @@ static int sca3000_remove(struct spi_device *spi) ...@@ -1235,7 +1241,7 @@ static int sca3000_remove(struct spi_device *spi)
struct iio_dev *indio_dev = spi_get_drvdata(spi); struct iio_dev *indio_dev = spi_get_drvdata(spi);
struct sca3000_state *st = iio_priv(indio_dev); struct sca3000_state *st = iio_priv(indio_dev);
/* Must ensure no interrupts can be generated after this!*/ /* Must ensure no interrupts can be generated after this! */
sca3000_stop_all_interrupts(st); sca3000_stop_all_interrupts(st);
if (spi->irq) if (spi->irq)
free_irq(spi->irq, indio_dev); free_irq(spi->irq, indio_dev);
......
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