Skip to content

Commit

Permalink
driver: sensor: adxl372: Formating fixed
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Pejic <[email protected]>
  • Loading branch information
vladislav-pejic committed Sep 30, 2024
1 parent 90878cb commit c6b545a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
7 changes: 4 additions & 3 deletions drivers/sensor/adi/adxl372/adxl372.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ static int adxl372_reset(const struct device *dev)
* @return 0 in case of success, negative error code otherwise.
*/
int adxl372_configure_fifo(const struct device *dev, enum adxl372_fifo_mode mode,
enum adxl372_fifo_format format, uint16_t fifo_samples)
enum adxl372_fifo_format format, uint16_t fifo_samples)
{

Check notice on line 430 in drivers/sensor/adi/adxl372/adxl372.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/sensor/adi/adxl372/adxl372.c:430 - enum adxl372_fifo_format format, uint16_t fifo_samples) + enum adxl372_fifo_format format, uint16_t fifo_samples)
struct adxl372_data *data = dev->data;
uint8_t fifo_config;
Expand Down Expand Up @@ -825,8 +825,9 @@ static int adxl372_init(const struct device *dev)
*/
#define ADXL372_SPI_CFG SPI_WORD_SET(8) | SPI_TRANSFER_MSB

#define ADXL372_RTIO_DEFINE(inst) \
SPI_DT_IODEV_DEFINE(adxl372_iodev_##inst, DT_DRV_INST(inst), ADXL372_SPI_CFG, 0U); \
#define ADXL372_RTIO_DEFINE(inst) \
SPI_DT_IODEV_DEFINE(adxl372_iodev_##inst, DT_DRV_INST(inst), \
ADXL372_SPI_CFG, 0U); \
RTIO_DEFINE(adxl372_rtio_ctx_##inst, 8, 8);

Check notice on line 831 in drivers/sensor/adi/adxl372/adxl372.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/sensor/adi/adxl372/adxl372.c:831 -#define ADXL372_RTIO_DEFINE(inst) \ - SPI_DT_IODEV_DEFINE(adxl372_iodev_##inst, DT_DRV_INST(inst), \ - ADXL372_SPI_CFG, 0U); \ +#define ADXL372_RTIO_DEFINE(inst) \ + SPI_DT_IODEV_DEFINE(adxl372_iodev_##inst, DT_DRV_INST(inst), ADXL372_SPI_CFG, 0U); \

#ifdef CONFIG_ADXL372_TRIGGER
Expand Down
5 changes: 3 additions & 2 deletions drivers/sensor/adi/adxl372/adxl372.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ struct adxl372_fifo_data {
uint64_t timestamp;
} __attribute__((__packed__));

BUILD_ASSERT(sizeof(struct adxl372_fifo_data) % 4 == 0, "adxl372_fifo_data struct should be word aligned");
BUILD_ASSERT(sizeof(struct adxl372_fifo_data) % 4 == 0,
"adxl372_fifo_data struct should be word aligned");

Check notice on line 394 in drivers/sensor/adi/adxl372/adxl372.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/sensor/adi/adxl372/adxl372.h:394 - "adxl372_fifo_data struct should be word aligned"); + "adxl372_fifo_data struct should be word aligned");
int adxl372_spi_init(const struct device *dev);
int adxl372_i2c_init(const struct device *dev);
Expand Down Expand Up @@ -418,7 +419,7 @@ void adxl372_accel_convert(struct sensor_value *val, int16_t sample);

#ifdef CONFIG_ADXL372_STREAM
int adxl372_configure_fifo(const struct device *dev, enum adxl372_fifo_mode mode,
enum adxl372_fifo_format format, uint16_t fifo_samples);
enum adxl372_fifo_format format, uint16_t fifo_samples);
size_t adxl372_get_packet_size(const struct adxl372_dev_config *cfg);

Check notice on line 423 in drivers/sensor/adi/adxl372/adxl372.h

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

drivers/sensor/adi/adxl372/adxl372.h:423 - enum adxl372_fifo_format format, uint16_t fifo_samples); + enum adxl372_fifo_format format, uint16_t fifo_samples);
int adxl372_set_op_mode(const struct device *dev, enum adxl372_op_mode op_mode);
#endif /* CONFIG_ADXL372_STREAM */
Expand Down
2 changes: 1 addition & 1 deletion drivers/sensor/adi/adxl372/adxl372_rtio.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void adxl372_submit(const struct device *dev, struct rtio_iodev_sqe *iodev_sqe)
__ASSERT_NO_MSG(req);

rtio_work_req_submit(req, iodev_sqe, adxl372_submit_fetch);
} else if(IS_ENABLED(CONFIG_ADXL372_STREAM)) {
} else if (IS_ENABLED(CONFIG_ADXL372_STREAM)) {
adxl372_submit_stream(dev, iodev_sqe);
} else {
rtio_iodev_sqe_err(iodev_sqe, -ENOTSUP);
Expand Down
4 changes: 2 additions & 2 deletions drivers/sensor/adi/adxl372/adxl372_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,9 @@ static void adxl372_process_status1_cb(struct rtio *r, const struct rtio_sqe *sq
enum adxl372_fifo_mode current_fifo_mode = cfg->fifo_config.fifo_mode;

adxl372_configure_fifo(dev, ADXL372_FIFO_BYPASSED,
cfg->fifo_config.fifo_format, cfg->fifo_config.fifo_samples);
cfg->fifo_config.fifo_format, cfg->fifo_config.fifo_samples);
adxl372_configure_fifo(dev, current_fifo_mode, cfg->fifo_config.fifo_format,
cfg->fifo_config.fifo_samples);
cfg->fifo_config.fifo_samples);
adxl372_set_op_mode(dev, cfg->op_mode);
}

Expand Down

0 comments on commit c6b545a

Please sign in to comment.