@@ -56,7 +56,7 @@ LOG_MODULE_REGISTER(tach_ite_it8xxx2, CONFIG_SENSOR_LOG_LEVEL);
56
56
* NOTE: The PWM output maximum is 324Hz in EC LPM, so if we need fan to work
57
57
* then don't let EC enter LPM.
58
58
*/
59
- #define TACH_FREQ EC_FREQ
59
+ #define TACH_FREQ EC_FREQ
60
60
61
61
struct tach_it8xxx2_config {
62
62
/* Fan x tachometer LSB reading register */
@@ -110,8 +110,7 @@ static bool tach_ch_is_valid(const struct device *dev, int tach_ch)
110
110
return valid ;
111
111
}
112
112
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 )
115
114
{
116
115
const struct tach_it8xxx2_config * const config = dev -> config ;
117
116
volatile uint8_t * reg_fxtlrr = (uint8_t * )config -> reg_fxtlrr ;
@@ -143,8 +142,7 @@ static int tach_it8xxx2_sample_fetch(const struct device *dev,
143
142
return 0 ;
144
143
}
145
144
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 ,
148
146
struct sensor_value * val )
149
147
{
150
148
const struct tach_it8xxx2_config * const config = dev -> config ;
@@ -228,29 +226,24 @@ static DEVICE_API(sensor, tach_it8xxx2_driver_api) = {
228
226
.channel_get = tach_it8xxx2_channel_get ,
229
227
};
230
228
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);
255
248
256
249
DT_INST_FOREACH_STATUS_OKAY (TACH_IT8XXX2_INIT )
0 commit comments