Skip to content

Commit 91b4171

Browse files
pmeerwjic23
authored andcommitted
staging iio: lis3l02dq cleanup
fixes some typos, whitespace, comments Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
1 parent 7c388ec commit 91b4171

3 files changed

Lines changed: 22 additions & 22 deletions

File tree

‎drivers/staging/iio/accel/lis3l02dq.h‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/* Control Register (1 of 2) */
2929
#define LIS3L02DQ_REG_CTRL_1_ADDR 0x20
3030
/* Power ctrl - either bit set corresponds to on*/
31-
#define LIS3L02DQ_REG_CTRL_1_PD_ON 0xC0
31+
#define LIS3L02DQ_REG_CTRL_1_PD_ON 0xC0
3232

3333
/* Decimation Factor */
3434
#define LIS3L02DQ_DEC_MASK 0x30
@@ -73,14 +73,14 @@
7373
/* Interrupt related stuff */
7474
#define LIS3L02DQ_REG_WAKE_UP_CFG_ADDR 0x23
7575

76-
/* Switch from or combination fo conditions to and */
76+
/* Switch from or combination of conditions to and */
7777
#define LIS3L02DQ_REG_WAKE_UP_CFG_BOOLEAN_AND 0x80
7878

7979
/* Latch interrupt request,
8080
* if on ack must be given by reading the ack register */
8181
#define LIS3L02DQ_REG_WAKE_UP_CFG_LATCH_SRC 0x40
8282

83-
/* Z Interrupt on High (above threshold)*/
83+
/* Z Interrupt on High (above threshold) */
8484
#define LIS3L02DQ_REG_WAKE_UP_CFG_INTERRUPT_Z_HIGH 0x20
8585
/* Z Interrupt on Low */
8686
#define LIS3L02DQ_REG_WAKE_UP_CFG_INTERRUPT_Z_LOW 0x10
@@ -117,13 +117,13 @@
117117
#define LIS3L02DQ_REG_STATUS_Y_OVERRUN 0x20
118118
#define LIS3L02DQ_REG_STATUS_X_OVERRUN 0x10
119119
/* XYZ new data available - first is all 3 available? */
120-
#define LIS3L02DQ_REG_STATUS_XYZ_NEW_DATA 0x08
120+
#define LIS3L02DQ_REG_STATUS_XYZ_NEW_DATA 0x08
121121
#define LIS3L02DQ_REG_STATUS_Z_NEW_DATA 0x04
122122
#define LIS3L02DQ_REG_STATUS_Y_NEW_DATA 0x02
123123
#define LIS3L02DQ_REG_STATUS_X_NEW_DATA 0x01
124124

125125
/* The accelerometer readings - low and high bytes.
126-
Form of high byte dependent on justification set in ctrl reg */
126+
* Form of high byte dependent on justification set in ctrl reg */
127127
#define LIS3L02DQ_REG_OUT_X_L_ADDR 0x28
128128
#define LIS3L02DQ_REG_OUT_X_H_ADDR 0x29
129129
#define LIS3L02DQ_REG_OUT_Y_L_ADDR 0x2A
@@ -150,9 +150,9 @@ Form of high byte dependent on justification set in ctrl reg */
150150
* struct lis3l02dq_state - device instance specific data
151151
* @us: actual spi_device
152152
* @trig: data ready trigger registered with iio
153+
* @buf_lock: mutex to protect tx and rx
153154
* @tx: transmit buffer
154155
* @rx: receive buffer
155-
* @buf_lock: mutex to protect tx and rx
156156
**/
157157
struct lis3l02dq_state {
158158
struct spi_device *us;

‎drivers/staging/iio/accel/lis3l02dq_core.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ static int lis3l02dq_initial_setup(struct iio_dev *indio_dev)
392392
dev_err(&st->us->dev, "problem with setup control register 1");
393393
goto err_ret;
394394
}
395-
/* Repeat as sometimes doesn't work first time?*/
395+
/* Repeat as sometimes doesn't work first time? */
396396
ret = lis3l02dq_spi_write_reg_8(indio_dev,
397397
LIS3L02DQ_REG_CTRL_1_ADDR,
398398
val);
@@ -686,7 +686,7 @@ static int __devinit lis3l02dq_probe(struct spi_device *spi)
686686
goto error_ret;
687687
}
688688
st = iio_priv(indio_dev);
689-
/* this is only used tor removal purposes */
689+
/* this is only used for removal purposes */
690690
spi_set_drvdata(spi, indio_dev);
691691

692692
st->us = spi;

‎drivers/staging/iio/accel/lis3l02dq_ring.c‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "lis3l02dq.h"
1515

1616
/**
17-
* combine_8_to_16() utility function to munge to u8s into u16
17+
* combine_8_to_16() utility function to munge two u8s into u16
1818
**/
1919
static inline u16 combine_8_to_16(u8 lower, u8 upper)
2020
{
@@ -49,7 +49,7 @@ static const u8 read_all_tx_array[] = {
4949

5050
/**
5151
* lis3l02dq_read_all() Reads all channels currently selected
52-
* @st: device specific state
52+
* @indio_dev: IIO device state
5353
* @rx_array: (dma capable) receive array, must be at least
5454
* 4*number of channels
5555
**/
@@ -170,22 +170,22 @@ __lis3l02dq_write_data_ready_config(struct iio_dev *indio_dev, bool state)
170170
bool currentlyset;
171171
struct lis3l02dq_state *st = iio_priv(indio_dev);
172172

173-
/* Get the current event mask register */
173+
/* Get the current event mask register */
174174
ret = lis3l02dq_spi_read_reg_8(indio_dev,
175175
LIS3L02DQ_REG_CTRL_2_ADDR,
176176
&valold);
177177
if (ret)
178178
goto error_ret;
179-
/* Find out if data ready is already on */
179+
/* Find out if data ready is already on */
180180
currentlyset
181181
= valold & LIS3L02DQ_REG_CTRL_2_ENABLE_DATA_READY_GENERATION;
182182

183-
/* Disable requested */
183+
/* Disable requested */
184184
if (!state && currentlyset) {
185-
/* disable the data ready signal */
185+
/* Disable the data ready signal */
186186
valold &= ~LIS3L02DQ_REG_CTRL_2_ENABLE_DATA_READY_GENERATION;
187187

188-
/* The double write is to overcome a hardware bug?*/
188+
/* The double write is to overcome a hardware bug? */
189189
ret = lis3l02dq_spi_write_reg_8(indio_dev,
190190
LIS3L02DQ_REG_CTRL_2_ADDR,
191191
valold);
@@ -197,10 +197,10 @@ __lis3l02dq_write_data_ready_config(struct iio_dev *indio_dev, bool state)
197197
if (ret)
198198
goto error_ret;
199199
st->trigger_on = false;
200-
/* Enable requested */
200+
/* Enable requested */
201201
} else if (state && !currentlyset) {
202-
/* if not set, enable requested */
203-
/* first disable all events */
202+
/* If not set, enable requested
203+
* first disable all events */
204204
ret = lis3l02dq_disable_all_events(indio_dev);
205205
if (ret < 0)
206206
goto error_ret;
@@ -239,7 +239,7 @@ static int lis3l02dq_data_rdy_trigger_set_state(struct iio_trigger *trig,
239239
if (state == false) {
240240
/*
241241
* A possible quirk with the handler is currently worked around
242-
* by ensuring outstanding read events are cleared.
242+
* by ensuring outstanding read events are cleared.
243243
*/
244244
ret = lis3l02dq_read_all(indio_dev, NULL);
245245
}
@@ -250,7 +250,7 @@ static int lis3l02dq_data_rdy_trigger_set_state(struct iio_trigger *trig,
250250
}
251251

252252
/**
253-
* lis3l02dq_trig_try_reen() try renabling irq for data rdy trigger
253+
* lis3l02dq_trig_try_reen() try reenabling irq for data rdy trigger
254254
* @trig: the datardy trigger
255255
*/
256256
static int lis3l02dq_trig_try_reen(struct iio_trigger *trig)
@@ -259,8 +259,8 @@ static int lis3l02dq_trig_try_reen(struct iio_trigger *trig)
259259
struct lis3l02dq_state *st = iio_priv(indio_dev);
260260
int i;
261261

262-
/* If gpio still high (or high again) */
263-
/* In theory possible we will need to do this several times */
262+
/* If gpio still high (or high again)
263+
* In theory possible we will need to do this several times */
264264
for (i = 0; i < 5; i++)
265265
if (gpio_get_value(irq_to_gpio(st->us->irq)))
266266
lis3l02dq_read_all(indio_dev, NULL);

0 commit comments

Comments
 (0)