All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarod Wilson <jarod@redhat.com>
To: linux-media@vger.kernel.org
Cc: mchehab@redhat.com
Subject: [PATCH] new_build/v2.6.32: build lirc_dev, ir-lirc-codec, mceusb, imon
Date: Wed, 27 Oct 2010 15:50:04 -0400	[thread overview]
Message-ID: <20101027195004.GE13824@redhat.com> (raw)

With some minor kfifo-related changes, lirc_dev ir-lirc-codec can be built
on a 2.6.32-based kernel (Red Hat Enterprise Linux 6). The mceusb and imon
drivers build fine without any changes, modulo a warning about pr_fmt
being redefined in the imon driver.

Signed-off-by: Jarod Wilson <jarod@redhat.com>

---
 backports/v2.6.32/kfifo.patch |  105 +++++++++++++++++++++++++++++++++++++++++
 v4l/versions.txt              |    4 --
 2 files changed, 105 insertions(+), 4 deletions(-)

diff --git a/backports/v2.6.32/kfifo.patch b/backports/v2.6.32/kfifo.patch
index a612f1b..df97d07 100644
--- a/backports/v2.6.32/kfifo.patch
+++ b/backports/v2.6.32/kfifo.patch
@@ -426,3 +426,108 @@ diff -r 5254948f88c4 drivers/media/video/meye.h
  	spinlock_t doneq_lock;		/* lock protecting the queue */
  	wait_queue_head_t proc_list;	/* wait queue */
  	struct video_device *vdev;	/* video device parameters */
+diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h
+index 54780a5..87b2ca6 100644
+--- a/include/media/lirc_dev.h
++++ b/include/media/lirc_dev.h
+@@ -28,19 +28,15 @@ struct lirc_buffer {
+ 	unsigned int size; /* in chunks */
+ 	/* Using chunks instead of bytes pretends to simplify boundary checking
+ 	 * And should allow for some performance fine tunning later */
+-	struct kfifo fifo;
++	struct kfifo *fifo;
+ 	u8 fifo_initialized;
+ };
+ 
+ static inline void lirc_buffer_clear(struct lirc_buffer *buf)
+ {
+-	unsigned long flags;
+-
+-	if (buf->fifo_initialized) {
+-		spin_lock_irqsave(&buf->fifo_lock, flags);
+-		kfifo_reset(&buf->fifo);
+-		spin_unlock_irqrestore(&buf->fifo_lock, flags);
+-	} else
++	if (buf->fifo)
++		kfifo_reset(buf->fifo);
++	else
+ 		WARN(1, "calling %s on an uninitialized lirc_buffer\n",
+ 		     __func__);
+ }
+@@ -49,25 +45,23 @@ static inline int lirc_buffer_init(struct lirc_buffer *buf,
+ 				    unsigned int chunk_size,
+ 				    unsigned int size)
+ {
+-	int ret;
+-
+ 	init_waitqueue_head(&buf->wait_poll);
+ 	spin_lock_init(&buf->fifo_lock);
+ 	buf->chunk_size = chunk_size;
+ 	buf->size = size;
+-	ret = kfifo_alloc(&buf->fifo, size * chunk_size, GFP_KERNEL);
+-	if (ret == 0)
+-		buf->fifo_initialized = 1;
++	buf->fifo = kfifo_alloc(size * chunk_size, GFP_KERNEL,
++				&buf->fifo_lock);
++	if (!buf->fifo)
++		return -ENOMEM;
+ 
+-	return ret;
++	return 0;
+ }
+ 
+ static inline void lirc_buffer_free(struct lirc_buffer *buf)
+ {
+-	if (buf->fifo_initialized) {
+-		kfifo_free(&buf->fifo);
+-		buf->fifo_initialized = 0;
+-	} else
++	if (buf->fifo)
++		kfifo_free(buf->fifo);
++	else
+ 		WARN(1, "calling %s on an uninitialized lirc_buffer\n",
+ 		     __func__);
+ }
+@@ -75,11 +69,8 @@ static inline void lirc_buffer_free(struct lirc_buffer *buf)
+ static inline int lirc_buffer_len(struct lirc_buffer *buf)
+ {
+ 	int len;
+-	unsigned long flags;
+ 
+-	spin_lock_irqsave(&buf->fifo_lock, flags);
+-	len = kfifo_len(&buf->fifo);
+-	spin_unlock_irqrestore(&buf->fifo_lock, flags);
++	len = kfifo_len(buf->fifo);
+ 
+ 	return len;
+ }
+@@ -102,24 +93,19 @@ static inline int lirc_buffer_available(struct lirc_buffer *buf)
+ static inline unsigned int lirc_buffer_read(struct lirc_buffer *buf,
+ 					    unsigned char *dest)
+ {
+-	unsigned int ret = 0;
+-
+ 	if (lirc_buffer_len(buf) >= buf->chunk_size)
+-		ret = kfifo_out_locked(&buf->fifo, dest, buf->chunk_size,
+-				       &buf->fifo_lock);
+-	return ret;
++		kfifo_get(buf->fifo, dest, buf->chunk_size);
++
++	return 0;
+ 
+ }
+ 
+ static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf,
+ 					     unsigned char *orig)
+ {
+-	unsigned int ret;
+-
+-	ret = kfifo_in_locked(&buf->fifo, orig, buf->chunk_size,
+-			      &buf->fifo_lock);
++	kfifo_put(buf->fifo, orig, buf->chunk_size);
+ 
+-	return ret;
++	return 0;
+ }
+ 
+ struct lirc_driver {
diff --git a/v4l/versions.txt b/v4l/versions.txt
index 46db158..6465418 100644
--- a/v4l/versions.txt
+++ b/v4l/versions.txt
@@ -6,10 +6,6 @@
 VIDEO_VIA_CAMERA
 
 [2.6.36]
-LIRC
-IR_LIRC_CODEC
-IR_IMON
-IR_MCEUSB
 
 [2.6.34]
 MACH_DAVINCI_DM6467_EVM

-- 
Jarod Wilson
jarod@redhat.com


                 reply	other threads:[~2010-10-27 19:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20101027195004.GE13824@redhat.com \
    --to=jarod@redhat.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.