Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 268142
b: refs/heads/master
c: 7ae8cf6
h: refs/heads/master
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Sep 6, 2011
1 parent b9b1230 commit b36deb1
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 34 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a710cc77db9785993cddecc966a662cb772b3ad9
refs/heads/master: 7ae8cf6275589a9ebb733eb5bdd093859ba1be36
32 changes: 0 additions & 32 deletions trunk/drivers/staging/iio/chrdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#ifndef _IIO_CHRDEV_H_
#define _IIO_CHRDEV_H_
struct iio_dev;

/**
* struct iio_handler - Structure used to specify file operations
Expand Down Expand Up @@ -41,35 +40,4 @@ struct iio_event_data {
s64 timestamp;
};

/**
* struct iio_detected_event_list - list element for events that have occurred
* @list: linked list header
* @ev: the event itself
*/
struct iio_detected_event_list {
struct list_head list;
struct iio_event_data ev;
};

/**
* struct iio_event_interface - chrdev interface for an event line
* @dev: device assocated with event interface
* @handler: fileoperations and related control for the chrdev
* @wait: wait queue to allow blocking reads of events
* @event_list_lock: mutex to protect the list of detected events
* @det_events: list of detected events
* @max_events: maximum number of events before new ones are dropped
* @current_events: number of events in detected list
*/
struct iio_event_interface {
struct device dev;
struct iio_handler handler;
wait_queue_head_t wait;
struct mutex event_list_lock;
struct list_head det_events;
int max_events;
int current_events;
struct list_head dev_attr_list;
};

#endif
2 changes: 1 addition & 1 deletion trunk/drivers/staging/iio/iio.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <linux/cdev.h>
#include <linux/irq.h>
#include "sysfs.h"
#include "chrdev.h"

/* IIO TODO LIST */
/*
Expand Down Expand Up @@ -178,6 +177,7 @@ static inline s64 iio_get_time_ns(void)
#define IIO_VAL_INT_PLUS_NANO 3

struct iio_trigger; /* forward declaration */
struct iio_dev;

/**
* struct iio_info - constant information about device
Expand Down
32 changes: 32 additions & 0 deletions trunk/drivers/staging/iio/industrialio-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "iio.h"
#include "iio_core.h"
#include "iio_core_trigger.h"
#include "chrdev.h"

#define IIO_ID_PREFIX "device"
#define IIO_ID_FORMAT IIO_ID_PREFIX "%d"
Expand Down Expand Up @@ -117,6 +118,37 @@ static void iio_free_ida_val(struct ida *this_ida, int id)
spin_unlock(&iio_ida_lock);
}

/**
* struct iio_detected_event_list - list element for events that have occurred
* @list: linked list header
* @ev: the event itself
*/
struct iio_detected_event_list {
struct list_head list;
struct iio_event_data ev;
};

/**
* struct iio_event_interface - chrdev interface for an event line
* @dev: device assocated with event interface
* @handler: fileoperations and related control for the chrdev
* @wait: wait queue to allow blocking reads of events
* @event_list_lock: mutex to protect the list of detected events
* @det_events: list of detected events
* @max_events: maximum number of events before new ones are dropped
* @current_events: number of events in detected list
*/
struct iio_event_interface {
struct device dev;
struct iio_handler handler;
wait_queue_head_t wait;
struct mutex event_list_lock;
struct list_head det_events;
int max_events;
int current_events;
struct list_head dev_attr_list;
};

int iio_push_event(struct iio_dev *dev_info,
int ev_line,
int ev_code,
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/staging/iio/ring_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef _IIO_RING_GENERIC_H_
#define _IIO_RING_GENERIC_H_
#include "iio.h"
#include "chrdev.h"

#ifdef CONFIG_IIO_RING_BUFFER

Expand Down

0 comments on commit b36deb1

Please sign in to comment.