Skip to content

Commit dcbd0d1

Browse files
RuibinChangkartben
authored andcommitted
drivers/sensor/ite/tach_ite_it8xxx2: run clang format
Run clang format. Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
1 parent cbe1932 commit dcbd0d1

File tree

1 file changed

+22
-29
lines changed

1 file changed

+22
-29
lines changed

drivers/sensor/ite/ite_tach_it8xxx2/tach_ite_it8xxx2.c

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ LOG_MODULE_REGISTER(tach_ite_it8xxx2, CONFIG_SENSOR_LOG_LEVEL);
5656
* NOTE: The PWM output maximum is 324Hz in EC LPM, so if we need fan to work
5757
* then don't let EC enter LPM.
5858
*/
59-
#define TACH_FREQ EC_FREQ
59+
#define TACH_FREQ EC_FREQ
6060

6161
struct tach_it8xxx2_config {
6262
/* Fan x tachometer LSB reading register */
@@ -110,8 +110,7 @@ static bool tach_ch_is_valid(const struct device *dev, int tach_ch)
110110
return valid;
111111
}
112112

113-
static int tach_it8xxx2_sample_fetch(const struct device *dev,
114-
enum sensor_channel chan)
113+
static int tach_it8xxx2_sample_fetch(const struct device *dev, enum sensor_channel chan)
115114
{
116115
const struct tach_it8xxx2_config *const config = dev->config;
117116
volatile uint8_t *reg_fxtlrr = (uint8_t *)config->reg_fxtlrr;
@@ -143,8 +142,7 @@ static int tach_it8xxx2_sample_fetch(const struct device *dev,
143142
return 0;
144143
}
145144

146-
static int tach_it8xxx2_channel_get(const struct device *dev,
147-
enum sensor_channel chan,
145+
static int tach_it8xxx2_channel_get(const struct device *dev, enum sensor_channel chan,
148146
struct sensor_value *val)
149147
{
150148
const struct tach_it8xxx2_config *const config = dev->config;
@@ -228,29 +226,24 @@ static DEVICE_API(sensor, tach_it8xxx2_driver_api) = {
228226
.channel_get = tach_it8xxx2_channel_get,
229227
};
230228

231-
#define TACH_IT8XXX2_INIT(inst) \
232-
PINCTRL_DT_INST_DEFINE(inst); \
233-
\
234-
static const struct tach_it8xxx2_config tach_it8xxx2_cfg_##inst = { \
235-
.reg_fxtlrr = DT_INST_REG_ADDR_BY_IDX(inst, 0), \
236-
.reg_fxtmrr = DT_INST_REG_ADDR_BY_IDX(inst, 1), \
237-
.reg_tswctlr = DT_INST_REG_ADDR_BY_IDX(inst, 2), \
238-
.dvs_bit = DT_INST_PROP(inst, dvs_bit), \
239-
.chsel_bit = DT_INST_PROP(inst, chsel_bit), \
240-
.pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \
241-
.channel = DT_INST_PROP(inst, channel), \
242-
.pulses_per_round = DT_INST_PROP(inst, pulses_per_round), \
243-
}; \
244-
\
245-
static struct tach_it8xxx2_data tach_it8xxx2_data_##inst; \
246-
\
247-
SENSOR_DEVICE_DT_INST_DEFINE(inst, \
248-
tach_it8xxx2_init, \
249-
NULL, \
250-
&tach_it8xxx2_data_##inst, \
251-
&tach_it8xxx2_cfg_##inst, \
252-
POST_KERNEL, \
253-
CONFIG_SENSOR_INIT_PRIORITY, \
254-
&tach_it8xxx2_driver_api);
229+
#define TACH_IT8XXX2_INIT(inst) \
230+
PINCTRL_DT_INST_DEFINE(inst); \
231+
\
232+
static const struct tach_it8xxx2_config tach_it8xxx2_cfg_##inst = { \
233+
.reg_fxtlrr = DT_INST_REG_ADDR_BY_IDX(inst, 0), \
234+
.reg_fxtmrr = DT_INST_REG_ADDR_BY_IDX(inst, 1), \
235+
.reg_tswctlr = DT_INST_REG_ADDR_BY_IDX(inst, 2), \
236+
.dvs_bit = DT_INST_PROP(inst, dvs_bit), \
237+
.chsel_bit = DT_INST_PROP(inst, chsel_bit), \
238+
.pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(inst), \
239+
.channel = DT_INST_PROP(inst, channel), \
240+
.pulses_per_round = DT_INST_PROP(inst, pulses_per_round), \
241+
}; \
242+
\
243+
static struct tach_it8xxx2_data tach_it8xxx2_data_##inst; \
244+
\
245+
SENSOR_DEVICE_DT_INST_DEFINE(inst, tach_it8xxx2_init, NULL, &tach_it8xxx2_data_##inst, \
246+
&tach_it8xxx2_cfg_##inst, POST_KERNEL, \
247+
CONFIG_SENSOR_INIT_PRIORITY, &tach_it8xxx2_driver_api);
255248

256249
DT_INST_FOREACH_STATUS_OKAY(TACH_IT8XXX2_INIT)

0 commit comments

Comments
 (0)