Lines Matching refs:counter

6 #include <linux/counter.h>
29 struct counter_device *counter = dev_id;
30 struct interrupt_cnt_priv *priv = counter_priv(counter);
34 counter_push_event(counter, COUNTER_EVENT_CHANGE_OF_STATE, 0);
39 static int interrupt_cnt_enable_read(struct counter_device *counter,
42 struct interrupt_cnt_priv *priv = counter_priv(counter);
49 static int interrupt_cnt_enable_write(struct counter_device *counter,
52 struct interrupt_cnt_priv *priv = counter_priv(counter);
77 static int interrupt_cnt_action_read(struct counter_device *counter,
87 static int interrupt_cnt_read(struct counter_device *counter,
90 struct interrupt_cnt_priv *priv = counter_priv(counter);
97 static int interrupt_cnt_write(struct counter_device *counter,
100 struct interrupt_cnt_priv *priv = counter_priv(counter);
102 if (val != (typeof(priv->count.counter))val)
114 static int interrupt_cnt_function_read(struct counter_device *counter,
123 static int interrupt_cnt_signal_read(struct counter_device *counter,
127 struct interrupt_cnt_priv *priv = counter_priv(counter);
142 static int interrupt_cnt_watch_validate(struct counter_device *counter,
164 struct counter_device *counter;
168 counter = devm_counter_alloc(dev, sizeof(*priv));
169 if (!counter)
171 priv = counter_priv(counter);
202 counter->signals = &priv->signals;
203 counter->num_signals = 1;
217 counter->name = dev_name(dev);
218 counter->parent = dev;
219 counter->ops = &interrupt_cnt_ops;
220 counter->counts = &priv->cnts;
221 counter->num_counts = 1;
226 dev_name(dev), counter);
230 ret = devm_counter_add(dev, counter);
232 return dev_err_probe(dev, ret, "Failed to add counter\n");
238 { .compatible = "interrupt-counter", },
252 MODULE_ALIAS("platform:interrupt-counter");
254 MODULE_DESCRIPTION("Interrupt counter driver");