Lines Matching refs:counter

10 #include <linux/counter.h>
86 * @pm_ctx.time_cntr: timestamp counter value
100 static u8 ecap_cnt_capture_get_evmode(struct counter_device *counter)
102 struct ecap_cnt_dev *ecap_dev = counter_priv(counter);
105 pm_runtime_get_sync(counter->parent);
107 pm_runtime_put_sync(counter->parent);
112 static void ecap_cnt_capture_set_evmode(struct counter_device *counter, u8 ev_mode)
114 struct ecap_cnt_dev *ecap_dev = counter_priv(counter);
116 pm_runtime_get_sync(counter->parent);
118 pm_runtime_put_sync(counter->parent);
121 static void ecap_cnt_capture_enable(struct counter_device *counter)
123 struct ecap_cnt_dev *ecap_dev = counter_priv(counter);
125 pm_runtime_get_sync(counter->parent);
131 /* Run counter */
136 static void ecap_cnt_capture_disable(struct counter_device *counter)
138 struct ecap_cnt_dev *ecap_dev = counter_priv(counter);
140 /* Stop counter */
146 pm_runtime_put_sync(counter->parent);
149 static u32 ecap_cnt_count_get_val(struct counter_device *counter, unsigned int reg)
151 struct ecap_cnt_dev *ecap_dev = counter_priv(counter);
154 pm_runtime_get_sync(counter->parent);
156 pm_runtime_put_sync(counter->parent);
161 static void ecap_cnt_count_set_val(struct counter_device *counter, unsigned int reg, u32 val)
163 struct ecap_cnt_dev *ecap_dev = counter_priv(counter);
165 pm_runtime_get_sync(counter->parent);
167 pm_runtime_put_sync(counter->parent);
170 static int ecap_cnt_count_read(struct counter_device *counter,
173 *val = ecap_cnt_count_get_val(counter, ECAP_TSCNT_REG);
178 static int ecap_cnt_count_write(struct counter_device *counter,
184 ecap_cnt_count_set_val(counter, ECAP_TSCNT_REG, val);
189 static int ecap_cnt_function_read(struct counter_device *counter,
198 static int ecap_cnt_action_read(struct counter_device *counter,
210 static int ecap_cnt_watch_validate(struct counter_device *counter,
225 static int ecap_cnt_clk_get_freq(struct counter_device *counter,
228 struct ecap_cnt_dev *ecap_dev = counter_priv(counter);
235 static int ecap_cnt_pol_read(struct counter_device *counter,
239 struct ecap_cnt_dev *ecap_dev = counter_priv(counter);
242 pm_runtime_get_sync(counter->parent);
244 pm_runtime_put_sync(counter->parent);
251 static int ecap_cnt_pol_write(struct counter_device *counter,
255 struct ecap_cnt_dev *ecap_dev = counter_priv(counter);
257 pm_runtime_get_sync(counter->parent);
262 pm_runtime_put_sync(counter->parent);
267 static int ecap_cnt_cap_read(struct counter_device *counter,
271 *cap = ecap_cnt_count_get_val(counter, ECAP_CAP_REG(idx));
276 static int ecap_cnt_cap_write(struct counter_device *counter,
283 ecap_cnt_count_set_val(counter, ECAP_CAP_REG(idx), cap);
288 static int ecap_cnt_nb_ovf_read(struct counter_device *counter,
291 struct ecap_cnt_dev *ecap_dev = counter_priv(counter);
298 static int ecap_cnt_nb_ovf_write(struct counter_device *counter,
301 struct ecap_cnt_dev *ecap_dev = counter_priv(counter);
311 static int ecap_cnt_ceiling_read(struct counter_device *counter,
319 static int ecap_cnt_enable_read(struct counter_device *counter,
322 struct ecap_cnt_dev *ecap_dev = counter_priv(counter);
329 static int ecap_cnt_enable_write(struct counter_device *counter,
332 struct ecap_cnt_dev *ecap_dev = counter_priv(counter);
340 ecap_cnt_capture_enable(counter);
342 ecap_cnt_capture_disable(counter);
454 /* Check counter overflow */
535 return dev_err_probe(dev, ret, "failed to add counter\n");
554 /* If eCAP is running, stop capture then save timestamp counter */
560 * - timebase counter is stopped
582 /* If eCAP was running, restore timestamp counter then run capture */