Lines Matching refs:counter
100 static u8 ecap_cnt_capture_get_evmode(struct counter_device *counter) in ecap_cnt_capture_get_evmode() argument
102 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_capture_get_evmode()
105 pm_runtime_get_sync(counter->parent); in ecap_cnt_capture_get_evmode()
107 pm_runtime_put_sync(counter->parent); in ecap_cnt_capture_get_evmode()
112 static void ecap_cnt_capture_set_evmode(struct counter_device *counter, u8 ev_mode) in ecap_cnt_capture_set_evmode() argument
114 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_capture_set_evmode()
116 pm_runtime_get_sync(counter->parent); in ecap_cnt_capture_set_evmode()
118 pm_runtime_put_sync(counter->parent); in ecap_cnt_capture_set_evmode()
121 static void ecap_cnt_capture_enable(struct counter_device *counter) in ecap_cnt_capture_enable() argument
123 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_capture_enable()
125 pm_runtime_get_sync(counter->parent); in ecap_cnt_capture_enable()
136 static void ecap_cnt_capture_disable(struct counter_device *counter) in ecap_cnt_capture_disable() argument
138 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_capture_disable()
146 pm_runtime_put_sync(counter->parent); in ecap_cnt_capture_disable()
149 static u32 ecap_cnt_count_get_val(struct counter_device *counter, unsigned int reg) in ecap_cnt_count_get_val() argument
151 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_count_get_val()
154 pm_runtime_get_sync(counter->parent); in ecap_cnt_count_get_val()
156 pm_runtime_put_sync(counter->parent); in ecap_cnt_count_get_val()
161 static void ecap_cnt_count_set_val(struct counter_device *counter, unsigned int reg, u32 val) in ecap_cnt_count_set_val() argument
163 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_count_set_val()
165 pm_runtime_get_sync(counter->parent); in ecap_cnt_count_set_val()
167 pm_runtime_put_sync(counter->parent); in ecap_cnt_count_set_val()
170 static int ecap_cnt_count_read(struct counter_device *counter, in ecap_cnt_count_read() argument
173 *val = ecap_cnt_count_get_val(counter, ECAP_TSCNT_REG); in ecap_cnt_count_read()
178 static int ecap_cnt_count_write(struct counter_device *counter, in ecap_cnt_count_write() argument
184 ecap_cnt_count_set_val(counter, ECAP_TSCNT_REG, val); in ecap_cnt_count_write()
189 static int ecap_cnt_function_read(struct counter_device *counter, in ecap_cnt_function_read() argument
198 static int ecap_cnt_action_read(struct counter_device *counter, in ecap_cnt_action_read() argument
210 static int ecap_cnt_watch_validate(struct counter_device *counter, in ecap_cnt_watch_validate() argument
225 static int ecap_cnt_clk_get_freq(struct counter_device *counter, in ecap_cnt_clk_get_freq() argument
228 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_clk_get_freq()
235 static int ecap_cnt_pol_read(struct counter_device *counter, in ecap_cnt_pol_read() argument
239 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_pol_read()
242 pm_runtime_get_sync(counter->parent); in ecap_cnt_pol_read()
244 pm_runtime_put_sync(counter->parent); in ecap_cnt_pol_read()
251 static int ecap_cnt_pol_write(struct counter_device *counter, in ecap_cnt_pol_write() argument
255 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_pol_write()
257 pm_runtime_get_sync(counter->parent); in ecap_cnt_pol_write()
262 pm_runtime_put_sync(counter->parent); in ecap_cnt_pol_write()
267 static int ecap_cnt_cap_read(struct counter_device *counter, in ecap_cnt_cap_read() argument
271 *cap = ecap_cnt_count_get_val(counter, ECAP_CAP_REG(idx)); in ecap_cnt_cap_read()
276 static int ecap_cnt_cap_write(struct counter_device *counter, in ecap_cnt_cap_write() argument
283 ecap_cnt_count_set_val(counter, ECAP_CAP_REG(idx), cap); in ecap_cnt_cap_write()
288 static int ecap_cnt_nb_ovf_read(struct counter_device *counter, in ecap_cnt_nb_ovf_read() argument
291 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_nb_ovf_read()
298 static int ecap_cnt_nb_ovf_write(struct counter_device *counter, in ecap_cnt_nb_ovf_write() argument
301 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_nb_ovf_write()
311 static int ecap_cnt_ceiling_read(struct counter_device *counter, in ecap_cnt_ceiling_read() argument
319 static int ecap_cnt_enable_read(struct counter_device *counter, in ecap_cnt_enable_read() argument
322 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_enable_read()
329 static int ecap_cnt_enable_write(struct counter_device *counter, in ecap_cnt_enable_write() argument
332 struct ecap_cnt_dev *ecap_dev = counter_priv(counter); in ecap_cnt_enable_write()
340 ecap_cnt_capture_enable(counter); in ecap_cnt_enable_write()
342 ecap_cnt_capture_disable(counter); in ecap_cnt_enable_write()