sensor: lps22hh: clang-format cleanup

Style-only reformatting, no functional change.

Signed-off-by: Van Petrosyan <van.petrosyan@sensirion.com>
This commit is contained in:
Van Petrosyan 2025-06-04 17:36:00 +02:00 committed by Anas Nashif
commit 04057e15ec

View file

@ -29,8 +29,7 @@ static inline int lps22hh_set_odr_raw(const struct device *dev, uint8_t odr)
return lps22hh_data_rate_set(ctx, odr);
}
static int lps22hh_sample_fetch(const struct device *dev,
enum sensor_channel chan)
static int lps22hh_sample_fetch(const struct device *dev, enum sensor_channel chan)
{
struct lps22hh_data *data = dev->data;
const struct lps22hh_config *const cfg = dev->config;
@ -38,9 +37,8 @@ static int lps22hh_sample_fetch(const struct device *dev,
uint32_t raw_press;
int16_t raw_temp;
__ASSERT_NO_MSG(chan == SENSOR_CHAN_ALL
|| chan == SENSOR_CHAN_PRESS
|| chan == SENSOR_CHAN_AMBIENT_TEMP);
__ASSERT_NO_MSG(chan == SENSOR_CHAN_ALL || chan == SENSOR_CHAN_PRESS ||
chan == SENSOR_CHAN_AMBIENT_TEMP);
switch (chan) {
case SENSOR_CHAN_PRESS:
@ -81,8 +79,7 @@ static int lps22hh_sample_fetch(const struct device *dev,
return 0;
}
static inline void lps22hh_press_convert(struct sensor_value *val,
int32_t raw_val)
static inline void lps22hh_press_convert(struct sensor_value *val, int32_t raw_val)
{
int32_t press_tmp = raw_val >> 8; /* raw value is left aligned (24 msb) */
@ -97,16 +94,14 @@ static inline void lps22hh_press_convert(struct sensor_value *val,
val->val2 = (press_tmp % 40960) * 3125 / 128;
}
static inline void lps22hh_temp_convert(struct sensor_value *val,
int16_t raw_val)
static inline void lps22hh_temp_convert(struct sensor_value *val, int16_t raw_val)
{
/* Temperature sensitivity is 100 LSB/deg C */
val->val1 = raw_val / 100;
val->val2 = ((int32_t)raw_val % 100) * 10000;
}
static int lps22hh_channel_get(const struct device *dev,
enum sensor_channel chan,
static int lps22hh_channel_get(const struct device *dev, enum sensor_channel chan,
struct sensor_value *val)
{
struct lps22hh_data *data = dev->data;
@ -147,10 +142,8 @@ static int lps22hh_odr_set(const struct device *dev, uint16_t freq)
return 0;
}
static int lps22hh_attr_set(const struct device *dev,
enum sensor_channel chan,
enum sensor_attribute attr,
const struct sensor_value *val)
static int lps22hh_attr_set(const struct device *dev, enum sensor_channel chan,
enum sensor_attribute attr, const struct sensor_value *val)
{
if (chan != SENSOR_CHAN_ALL) {
LOG_WRN("attr_set() not supported on this channel.");
@ -311,8 +304,7 @@ static int lps22hh_init(const struct device *dev)
*/
#ifdef CONFIG_LPS22HH_TRIGGER
#define LPS22HH_CFG_IRQ(inst) \
.gpio_int = GPIO_DT_SPEC_INST_GET(inst, drdy_gpios),
#define LPS22HH_CFG_IRQ(inst) .gpio_int = GPIO_DT_SPEC_INST_GET(inst, drdy_gpios),
#else
#define LPS22HH_CFG_IRQ(inst)
#endif /* CONFIG_LPS22HH_TRIGGER */
@ -322,10 +314,7 @@ static int lps22hh_init(const struct device *dev)
COND_CODE_1(DT_INST_NODE_HAS_PROP(inst, drdy_gpios), \
(LPS22HH_CFG_IRQ(inst)), ())
#define LPS22HH_SPI_OPERATION (SPI_WORD_SET(8) | \
SPI_OP_MODE_MASTER | \
SPI_MODE_CPOL | \
SPI_MODE_CPHA) \
#define LPS22HH_SPI_OPERATION (SPI_WORD_SET(8) | SPI_OP_MODE_MASTER | SPI_MODE_CPOL | SPI_MODE_CPHA)
#define LPS22HH_CONFIG_SPI(inst) \
{ \
@ -385,8 +374,8 @@ static int lps22hh_init(const struct device *dev)
(LPS22HH_CONFIG_I3C_OR_I2C(inst)), \
(LPS22HH_CONFIG_I2C(inst))))); \
PM_DEVICE_DT_INST_DEFINE(inst, lps22hh_pm_action); \
SENSOR_DEVICE_DT_INST_DEFINE(inst, lps22hh_init, PM_DEVICE_DT_INST_GET(inst), &lps22hh_data_##inst, \
&lps22hh_config_##inst, POST_KERNEL, \
SENSOR_DEVICE_DT_INST_DEFINE(inst, lps22hh_init, PM_DEVICE_DT_INST_GET(inst), \
&lps22hh_data_##inst, &lps22hh_config_##inst, POST_KERNEL, \
CONFIG_SENSOR_INIT_PRIORITY, &lps22hh_driver_api);
DT_INST_FOREACH_STATUS_OKAY(LPS22HH_DEFINE)