Lines Matching refs:counter

8 #include <linux/counter.h>
57 static int i8254_count_read(struct counter_device *const counter, struct counter_count *const count,
60 struct i8254 *const priv = counter_priv(counter);
84 static int i8254_function_read(struct counter_device *const counter,
96 static int i8254_action_read(struct counter_device *const counter,
101 struct i8254 *const priv = counter_priv(counter);
125 static int i8254_count_ceiling_read(struct counter_device *const counter,
128 struct i8254 *const priv = counter_priv(counter);
134 /* Rate Generator decrements 0 by one and the counter "wraps around" */
141 /* Square Wave Mode decrements 0 by two and the counter "wraps around" */
156 static int i8254_count_mode_read(struct counter_device *const counter,
160 const struct i8254 *const priv = counter_priv(counter);
187 static int i8254_count_mode_write(struct counter_device *const counter,
191 struct i8254 *const priv = counter_priv(counter);
221 /* Counter Register is cleared when the counter is programmed */
232 static int i8254_count_floor_read(struct counter_device *const counter,
235 struct i8254 *const priv = counter_priv(counter);
241 /* counter is always reloaded after 1, but 0 is a possible reload value */
245 /* counter is always reloaded after 2 for even preset values */
258 static int i8254_count_preset_read(struct counter_device *const counter,
261 const struct i8254 *const priv = counter_priv(counter);
268 static int i8254_count_preset_write(struct counter_device *const counter,
271 struct i8254 *const priv = counter_priv(counter);
304 /* Initialize each counter to Mode 0 */
406 struct counter_device *counter;
416 counter = devm_counter_alloc(dev, sizeof(*priv));
417 if (!counter)
419 priv = counter_priv(counter);
422 counter->name = dev_name(config->parent);
423 counter->parent = config->parent;
424 counter->ops = &i8254_ops;
425 counter->counts = i8254_counts;
426 counter->num_counts = ARRAY_SIZE(i8254_counts);
427 counter->signals = i8254_signals;
428 counter->num_signals = ARRAY_SIZE(i8254_signals);
436 err = devm_counter_add(dev, counter);
438 return dev_err_probe(dev, err, "Failed to add counter\n");