Lines Matching refs:counter
15 #include <linux/counter.h>
70 /* Reset hardware counter to CNTIN */
111 * This is enough to disable the counter. No clock has been
117 static int ftm_quaddec_get_prescaler(struct counter_device *counter,
120 struct ftm_quaddec *ftm = counter_priv(counter);
130 static int ftm_quaddec_set_prescaler(struct counter_device *counter,
133 struct ftm_quaddec *ftm = counter_priv(counter);
141 /* Also resets the counter as it is undefined anyway now */
160 static int ftm_quaddec_count_read(struct counter_device *counter,
164 struct ftm_quaddec *const ftm = counter_priv(counter);
174 static int ftm_quaddec_count_write(struct counter_device *counter,
178 struct ftm_quaddec *const ftm = counter_priv(counter);
181 dev_warn(&ftm->pdev->dev, "Can only accept '0' as new counter value\n");
190 static int ftm_quaddec_count_function_read(struct counter_device *counter,
199 static int ftm_quaddec_action_read(struct counter_device *counter,
261 struct counter_device *counter;
268 counter = devm_counter_alloc(&pdev->dev, sizeof(*ftm));
269 if (!counter)
271 ftm = counter_priv(counter);
287 counter->name = dev_name(&pdev->dev);
288 counter->parent = &pdev->dev;
289 counter->ops = &ftm_quaddec_cnt_ops;
290 counter->counts = &ftm_quaddec_counts;
291 counter->num_counts = 1;
292 counter->signals = ftm_quaddec_signals;
293 counter->num_signals = ARRAY_SIZE(ftm_quaddec_signals);
303 ret = devm_counter_add(&pdev->dev, counter);
305 return dev_err_probe(&pdev->dev, ret, "Failed to add counter\n");