Lines Matching refs:counter

59 static int stm32_count_read(struct counter_device *counter,  in stm32_count_read()  argument
62 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_read()
71 static int stm32_count_write(struct counter_device *counter, in stm32_count_write() argument
74 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_write()
84 static int stm32_count_function_read(struct counter_device *counter, in stm32_count_function_read() argument
88 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_function_read()
111 static int stm32_count_function_write(struct counter_device *counter, in stm32_count_function_write() argument
115 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_function_write()
157 static int stm32_count_direction_read(struct counter_device *counter, in stm32_count_direction_read() argument
161 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_direction_read()
171 static int stm32_count_ceiling_read(struct counter_device *counter, in stm32_count_ceiling_read() argument
174 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_ceiling_read()
184 static int stm32_count_ceiling_write(struct counter_device *counter, in stm32_count_ceiling_write() argument
187 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_ceiling_write()
199 static int stm32_count_enable_read(struct counter_device *counter, in stm32_count_enable_read() argument
202 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_enable_read()
212 static int stm32_count_enable_write(struct counter_device *counter, in stm32_count_enable_write() argument
215 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_enable_write()
238 static int stm32_count_prescaler_read(struct counter_device *counter, in stm32_count_prescaler_read() argument
241 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_prescaler_read()
251 static int stm32_count_prescaler_write(struct counter_device *counter, in stm32_count_prescaler_write() argument
254 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_prescaler_write()
265 static int stm32_count_cap_read(struct counter_device *counter, in stm32_count_cap_read() argument
269 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_cap_read()
292 dev_dbg(counter->parent, "CCR%zu: 0x%08x\n", ch + 1, ccrx); in stm32_count_cap_read()
299 static int stm32_count_nb_ovf_read(struct counter_device *counter, in stm32_count_nb_ovf_read() argument
302 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_nb_ovf_read()
312 static int stm32_count_nb_ovf_write(struct counter_device *counter, in stm32_count_nb_ovf_write() argument
315 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_nb_ovf_write()
347 static int stm32_action_read(struct counter_device *counter, in stm32_action_read() argument
355 err = stm32_count_function_read(counter, count, &function); in stm32_action_read()
411 static int stm32_count_capture_configure(struct counter_device *counter, unsigned int ch, in stm32_count_capture_configure() argument
414 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_capture_configure()
419 dev_err(counter->parent, "invalid ch: %d\n", ch); in stm32_count_capture_configure()
443 dev_dbg(counter->parent, "%s(%s) ch%d 0x%08x 0x%08x\n", __func__, enable ? "ena" : "dis", in stm32_count_capture_configure()
449 static int stm32_count_events_configure(struct counter_device *counter) in stm32_count_events_configure() argument
451 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_events_configure()
456 list_for_each_entry(event_node, &counter->events_list, l) { in stm32_count_events_configure()
465 ret = stm32_count_capture_configure(counter, event_node->channel, true); in stm32_count_events_configure()
482 ret = stm32_count_capture_configure(counter, i, false); in stm32_count_events_configure()
491 static int stm32_count_watch_validate(struct counter_device *counter, in stm32_count_watch_validate() argument
494 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_watch_validate()
503 dev_err(counter->parent, "Invalid channel %d\n", watch->channel); in stm32_count_watch_validate()
524 static int stm32_count_clk_get_freq(struct counter_device *counter, in stm32_count_clk_get_freq() argument
527 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_count_clk_get_freq()
613 struct counter_device *counter = ptr; in stm32_timer_cnt_isr() local
614 struct stm32_timer_cnt *const priv = counter_priv(counter); in stm32_timer_cnt_isr()
632 counter_push_event(counter, COUNTER_EVENT_OVERFLOW_UNDERFLOW, 0); in stm32_timer_cnt_isr()
633 dev_dbg(counter->parent, "COUNTER_EVENT_OVERFLOW_UNDERFLOW\n"); in stm32_timer_cnt_isr()
641 counter_push_event(counter, COUNTER_EVENT_CAPTURE, i); in stm32_timer_cnt_isr()
643 dev_dbg(counter->parent, "COUNTER_EVENT_CAPTURE, %d\n", i); in stm32_timer_cnt_isr()
714 struct counter_device *counter; in stm32_timer_cnt_probe() local
720 counter = devm_counter_alloc(dev, sizeof(*priv)); in stm32_timer_cnt_probe()
721 if (!counter) in stm32_timer_cnt_probe()
724 priv = counter_priv(counter); in stm32_timer_cnt_probe()
737 counter->name = dev_name(dev); in stm32_timer_cnt_probe()
738 counter->parent = dev; in stm32_timer_cnt_probe()
739 counter->ops = &stm32_timer_cnt_ops; in stm32_timer_cnt_probe()
740 counter->counts = &stm32_counts; in stm32_timer_cnt_probe()
741 counter->num_counts = 1; in stm32_timer_cnt_probe()
742 counter->signals = stm32_signals; in stm32_timer_cnt_probe()
743 counter->num_signals = ARRAY_SIZE(stm32_signals); in stm32_timer_cnt_probe()
753 0, dev_name(dev), counter); in stm32_timer_cnt_probe()
769 0, dev_name(dev), counter); in stm32_timer_cnt_probe()
782 ret = devm_counter_add(dev, counter); in stm32_timer_cnt_probe()