From: Jonathan Cameron <jic23@cam.ac.uk>
To: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: arnd@arndb.de, tglx@linutronix.de, Jonathan Cameron <jic23@cam.ac.uk>
Subject: [PATCH 06/21] staging:iio: remove legacy event chrdev for the buffers
Date: Thu, 31 Mar 2011 15:54:00 +0100 [thread overview]
Message-ID: <1301583255-28468-7-git-send-email-jic23@cam.ac.uk> (raw)
In-Reply-To: <1301583255-28468-1-git-send-email-jic23@cam.ac.uk>
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
---
drivers/staging/iio/industrialio-ring.c | 58 +------------------------------
drivers/staging/iio/ring_generic.h | 25 -------------
drivers/staging/iio/ring_sw.c | 5 ---
3 files changed, 1 insertions(+), 87 deletions(-)
diff --git a/drivers/staging/iio/industrialio-ring.c b/drivers/staging/iio/industrialio-ring.c
index 464fec2..b503ea1 100644
--- a/drivers/staging/iio/industrialio-ring.c
+++ b/drivers/staging/iio/industrialio-ring.c
@@ -23,16 +23,6 @@
#include "iio.h"
#include "ring_generic.h"
-int iio_push_ring_event(struct iio_ring_buffer *ring_buf,
- int event_code,
- s64 timestamp)
-{
- return __iio_push_event(&ring_buf->ev_int,
- event_code,
- timestamp);
-}
-EXPORT_SYMBOL(iio_push_ring_event);
-
/**
* iio_ring_open() - chrdev file open for ring buffer access
*
@@ -116,43 +106,6 @@ static const struct file_operations iio_ring_fileops = {
.llseek = noop_llseek,
};
-/**
- * __iio_request_ring_buffer_event_chrdev() - allocate ring event chrdev
- * @buf: ring buffer whose event chrdev we are allocating
- * @id: id of this ring buffer (typically 0)
- * @owner: the module who owns the ring buffer (for ref counting)
- * @dev: device with which the chrdev is associated
- **/
-static inline int
-__iio_request_ring_buffer_event_chrdev(struct iio_ring_buffer *buf,
- int id,
- struct module *owner,
- struct device *dev)
-{
- int ret;
-
- snprintf(buf->ev_int._name, sizeof(buf->ev_int._name),
- "%s:event%d",
- dev_name(&buf->dev),
- id);
- ret = iio_setup_ev_int(&(buf->ev_int),
- buf->ev_int._name,
- owner,
- dev);
- if (ret)
- goto error_ret;
- return 0;
-
-error_ret:
- return ret;
-}
-
-static inline void
-__iio_free_ring_buffer_event_chrdev(struct iio_ring_buffer *buf)
-{
- iio_free_ev_int(&(buf->ev_int));
-}
-
static void iio_ring_access_release(struct device *dev)
{
struct iio_ring_buffer *buf
@@ -227,7 +180,6 @@ void iio_ring_buffer_init(struct iio_ring_buffer *ring,
if (ring->access.mark_param_change)
ring->access.mark_param_change(ring);
ring->indio_dev = dev_info;
- ring->ev_int.private = ring;
ring->access_handler.private = ring;
init_waitqueue_head(&ring->pollq);
}
@@ -399,19 +351,12 @@ int iio_ring_buffer_register_ex(struct iio_ring_buffer *ring, int id,
if (ret)
goto error_ret;
- ret = __iio_request_ring_buffer_event_chrdev(ring,
- 0,
- ring->owner,
- &ring->dev);
- if (ret)
- goto error_remove_device;
-
ret = __iio_request_ring_buffer_access_chrdev(ring,
0,
ring->owner);
if (ret)
- goto error_ret;
+ goto error_remove_device;
if (ring->scan_el_attrs) {
ret = sysfs_create_group(&ring->dev.kobj,
@@ -462,7 +407,6 @@ void iio_ring_buffer_unregister(struct iio_ring_buffer *ring)
{
__iio_ring_attr_cleanup(ring);
__iio_free_ring_buffer_access_chrdev(ring);
- __iio_free_ring_buffer_event_chrdev(ring);
device_del(&ring->dev);
}
EXPORT_SYMBOL(iio_ring_buffer_unregister);
diff --git a/drivers/staging/iio/ring_generic.h b/drivers/staging/iio/ring_generic.h
index 37b5eda..44c7543 100644
--- a/drivers/staging/iio/ring_generic.h
+++ b/drivers/staging/iio/ring_generic.h
@@ -16,29 +16,6 @@
struct iio_ring_buffer;
/**
- * iio_push_ring_event() - ring buffer specific push to event chrdev
- * @ring_buf: ring buffer that is the event source
- * @event_code: event indentification code
- * @timestamp: time of event
- **/
-int iio_push_ring_event(struct iio_ring_buffer *ring_buf,
- int event_code,
- s64 timestamp);
-/**
- * iio_push_or_escallate_ring_event() - escalate or add as appropriate
- * @ring_buf: ring buffer that is the event source
- * @event_code: event indentification code
- * @timestamp: time of event
- *
- * Typical usecase is to escalate a 50% ring full to 75% full if noone has yet
- * read the first event. Clearly the 50% full is no longer of interest in
- * typical use case.
- **/
-int iio_push_or_escallate_ring_event(struct iio_ring_buffer *ring_buf,
- int event_code,
- s64 timestamp);
-
-/**
* struct iio_ring_access_funcs - access functions for ring buffers.
* @mark_in_use: reference counting, typically to prevent module removal
* @unmark_in_use: reduce reference count when no longer using ring buffer
@@ -106,7 +83,6 @@ struct iio_ring_access_funcs {
* @scan_mask: [INTERN] bitmask used in masking scan mode elements
* @scan_timestamp: [INTERN] does the scan mode include a timestamp
* @access_handler: [INTERN] chrdev access handling
- * @ev_int: [INTERN] chrdev interface for the event chrdev
* @access: [DRIVER] ring access functions associated with the
* implementation.
* @preenable: [DRIVER] function to run prior to marking ring enabled
@@ -130,7 +106,6 @@ struct iio_ring_buffer {
u32 scan_mask;
bool scan_timestamp;
struct iio_handler access_handler;
- struct iio_event_interface ev_int;
struct iio_ring_access_funcs access;
int (*preenable)(struct iio_dev *);
int (*postenable)(struct iio_dev *);
diff --git a/drivers/staging/iio/ring_sw.c b/drivers/staging/iio/ring_sw.c
index 53c6774..a429a3d 100644
--- a/drivers/staging/iio/ring_sw.c
+++ b/drivers/staging/iio/ring_sw.c
@@ -69,7 +69,6 @@ static int iio_store_to_sw_ring(struct iio_sw_ring_buffer *ring,
unsigned char *data, s64 timestamp)
{
int ret = 0;
- int code;
unsigned char *temp_ptr, *change_test_ptr;
/* initial store */
@@ -133,10 +132,6 @@ static int iio_store_to_sw_ring(struct iio_sw_ring_buffer *ring,
if (ring->half_p == ring->data + ring->buf.length*ring->buf.bytes_per_datum)
ring->half_p = ring->data;
if (ring->half_p == ring->read_p) {
- code = IIO_EVENT_CODE_RING_50_FULL;
- ret = __iio_push_event(&ring->buf.ev_int,
- code,
- timestamp);
ring->buf.stufftoread = true;
wake_up_interruptible(&ring->buf.pollq);
}
--
1.7.3.4
next prev parent reply other threads:[~2011-03-31 14:57 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-31 14:53 [RFC PATCH 00/21] IIO: Channel registration rework, buffer chardev combining and rewrite of triggers as 'virtual' irq_chips Jonathan Cameron
2011-03-31 14:53 ` [PATCH 01/21] staging:iio: allow channels to be set up using a table of iio_channel_spec structures Jonathan Cameron
2011-03-31 14:53 ` [PATCH 02/21] staging:iio:lis3l02dq - experimental move to new channel_spec approach Jonathan Cameron
2011-03-31 14:53 ` [PATCH 03/21] staging:iio:max1363 - experimental move to channel_spec registration Jonathan Cameron
2011-03-31 14:53 ` [PATCH 04/21] staging:iio: remove ability to escalate events Jonathan Cameron
2011-03-31 14:53 ` [PATCH 05/21] staging:iio: Add polling of events on the ring access chrdev Jonathan Cameron
2011-03-31 14:54 ` Jonathan Cameron [this message]
2011-03-31 14:54 ` [PATCH 07/21] staging:iio: Buffer device flattening Jonathan Cameron
2011-03-31 14:54 ` [PATCH 08/21] staging:iio:lis3l02dq: General cleanup Jonathan Cameron
2011-03-31 14:54 ` [PATCH 09/21] staging:iio: Push interrupt setup down into the drivers for event lines Jonathan Cameron
2011-03-31 14:54 ` [PATCH 10/21] staging:iio: lis3l02dq - separate entirely interrupt handling for thesholds from that for the datardy signal Jonathan Cameron
2011-03-31 14:54 ` [PATCH 11/21] staging:iio: Remove legacy event handling Jonathan Cameron
2011-03-31 14:54 ` [PATCH 12/21] staging:iio:lis3l02dq make threshold interrupt threaded Jonathan Cameron
2011-03-31 14:54 ` [PATCH 13/21] arm: irq: export set flags Jonathan Cameron
2011-03-31 15:48 ` Thomas Gleixner
2011-03-31 14:54 ` [PATCH 14/21] irq: export handle_simple_irq and irq_to_desc to allow for virtual irqs in IIO Jonathan Cameron
2011-03-31 14:54 ` [PATCH 15/21] staging:iio: Add infrastructure for irq_chip based triggers Jonathan Cameron
2011-04-02 18:34 ` Jonathan Cameron
2011-03-31 14:54 ` [PATCH 16/21] stargate2 - add an IIO interrupt pool Jonathan Cameron
2011-03-31 14:54 ` [PATCH 17/21] staging:iio:Documentation generic_buffer.c update to new abi for buffers Jonathan Cameron
2011-03-31 14:54 ` [PATCH 18/21] staging:iio:ring_sw add function needed for threaded irq Jonathan Cameron
2011-03-31 14:54 ` [PATCH 19/21] staging:iio:lis3l02dq move to threaded trigger handling Jonathan Cameron
2011-03-31 14:54 ` [PATCH 20/21] staging:iio:trigger remove legacy pollfunc elements Jonathan Cameron
2011-03-31 14:54 ` [PATCH 21/21] staging:iio: rip out scan_el attributes. Now handled as iio_dev_attrs like everything else Jonathan Cameron
2011-03-31 15:28 ` [RFC PATCH 00/21] IIO: Channel registration rework, buffer chardev combining and rewrite of triggers as 'virtual' irq_chips Arnd Bergmann
2011-04-04 12:02 ` Michael Hennerich
2011-04-04 13:17 ` Jonathan Cameron
2011-04-04 13:26 ` Jonathan Cameron
2011-04-04 14:44 ` Michael Hennerich
2011-04-04 18:09 ` Jonathan Cameron
2011-04-04 14:49 ` Arnd Bergmann
2011-04-04 17:51 ` Jonathan Cameron
2011-04-11 18:38 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1301583255-28468-7-git-send-email-jic23@cam.ac.uk \
--to=jic23@cam.ac.uk \
--cc=arnd@arndb.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®