Release 4.7 drivers/iio/dummy/iio_simple_dummy.h
/**
* Copyright (c) 2011 Jonathan Cameron
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
* the Free Software Foundation.
*
* Join together the various functionality of iio_simple_dummy driver
*/
#ifndef _IIO_SIMPLE_DUMMY_H_
#define _IIO_SIMPLE_DUMMY_H_
#include <linux/kernel.h>
struct iio_dummy_accel_calibscale;
struct iio_dummy_regs;
/**
* struct iio_dummy_state - device instance specific state.
* @dac_val: cache for dac value
* @single_ended_adc_val: cache for single ended adc value
* @differential_adc_val: cache for differential adc value
* @accel_val: cache for acceleration value
* @accel_calibbias: cache for acceleration calibbias
* @accel_calibscale: cache for acceleration calibscale
* @lock: lock to ensure state is consistent
* @event_irq: irq number for event line (faked)
* @event_val: cache for event threshold value
* @event_en: cache of whether event is enabled
*/
struct iio_dummy_state {
int dac_val;
int single_ended_adc_val;
int differential_adc_val[2];
int accel_val;
int accel_calibbias;
int activity_running;
int activity_walking;
const struct iio_dummy_accel_calibscale *accel_calibscale;
struct mutex lock;
struct iio_dummy_regs *regs;
int steps_enabled;
int steps;
int height;
#ifdef CONFIG_IIO_SIMPLE_DUMMY_EVENTS
int event_irq;
int event_val;
bool event_en;
s64 event_timestamp;
#endif /* CONFIG_IIO_SIMPLE_DUMMY_EVENTS */
};
#ifdef CONFIG_IIO_SIMPLE_DUMMY_EVENTS
struct iio_dev;
int iio_simple_dummy_read_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir);
int iio_simple_dummy_write_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
int state);
int iio_simple_dummy_read_event_value(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
enum iio_event_info info, int *val,
int *val2);
int iio_simple_dummy_write_event_value(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
enum iio_event_info info, int val,
int val2);
int iio_simple_dummy_events_register(struct iio_dev *indio_dev);
void iio_simple_dummy_events_unregister(struct iio_dev *indio_dev);
#else /* Stubs for when events are disabled at compile time */
static inline int
iio_simple_dummy_events_register(struct iio_dev *indio_dev)
{
return 0;
}Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jonathan cameron | jonathan cameron | 15 | 100.00% | 1 | 100.00% |
| Total | 15 | 100.00% | 1 | 100.00% |
;
static inline void
iio_simple_dummy_events_unregister(struct iio_dev *indio_dev)
{ }Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jonathan cameron | jonathan cameron | 9 | 81.82% | 1 | 50.00% |
vladimirs ambrosovs | vladimirs ambrosovs | 2 | 18.18% | 1 | 50.00% |
| Total | 11 | 100.00% | 2 | 100.00% |
;
#endif /* CONFIG_IIO_SIMPLE_DUMMY_EVENTS*/
/**
* enum iio_simple_dummy_scan_elements - scan index enum
* @DUMMY_INDEX_VOLTAGE_0: the single ended voltage channel
* @DUMMY_INDEX_DIFFVOLTAGE_1M2: first differential channel
* @DUMMY_INDEX_DIFFVOLTAGE_3M4: second differential channel
* @DUMMY_INDEX_ACCELX: acceleration channel
*
* Enum provides convenient numbering for the scan index.
*/
enum iio_simple_dummy_scan_elements {
DUMMY_INDEX_VOLTAGE_0,
DUMMY_INDEX_DIFFVOLTAGE_1M2,
DUMMY_INDEX_DIFFVOLTAGE_3M4,
DUMMY_INDEX_ACCELX,
};
#ifdef CONFIG_IIO_SIMPLE_DUMMY_BUFFER
int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev);
void iio_simple_dummy_unconfigure_buffer(struct iio_dev *indio_dev);
#else
static inline int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev)
{
return 0;
}Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jonathan cameron | jonathan cameron | 15 | 100.00% | 1 | 100.00% |
| Total | 15 | 100.00% | 1 | 100.00% |
;
static inline
void iio_simple_dummy_unconfigure_buffer(struct iio_dev *indio_dev)
{}Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jonathan cameron | jonathan cameron | 11 | 100.00% | 1 | 100.00% |
| Total | 11 | 100.00% | 1 | 100.00% |
;
#endif /* CONFIG_IIO_SIMPLE_DUMMY_BUFFER */
#endif /* _IIO_SIMPLE_DUMMY_H_ */
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
jonathan cameron | jonathan cameron | 222 | 66.67% | 2 | 20.00% |
lars-peter clausen | lars-peter clausen | 67 | 20.12% | 1 | 10.00% |
daniel baluta | daniel baluta | 23 | 6.91% | 2 | 20.00% |
roberta dobrescu | roberta dobrescu | 9 | 2.70% | 1 | 10.00% |
alison schofield | alison schofield | 5 | 1.50% | 1 | 10.00% |
cristina opriceana | cristina opriceana | 3 | 0.90% | 1 | 10.00% |
vladimirs ambrosovs | vladimirs ambrosovs | 3 | 0.90% | 1 | 10.00% |
carlos e. garcia | carlos e. garcia | 1 | 0.30% | 1 | 10.00% |
| Total | 333 | 100.00% | 10 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.