public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: "David Härdeman" <david@hardeman.nu>
To: linux-media@vger.kernel.org
Cc: jarod@wilsonet.com, mchehab@infradead.org
Subject: [PATCH 08/10] bttv: merge ir decoding timers
Date: Sat, 20 Nov 2010 00:43:17 +0100	[thread overview]
Message-ID: <20101119234317.3511.48553.stgit@localhost.localdomain> (raw)
In-Reply-To: <20101119233959.3511.91287.stgit@localhost.localdomain>

Similarly to saa7134, bttv_ir has two timers, only one of which is used
at a time and which serve the same purpose. Merge them.

Signed-off-by: David Härdeman <david@hardeman.nu>
---
 drivers/media/video/bt8xx/bttv-input.c |    8 +++-----
 drivers/media/video/bt8xx/bttvp.h      |    3 +--
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/media/video/bt8xx/bttv-input.c b/drivers/media/video/bt8xx/bttv-input.c
index c8bf423..8013d91 100644
--- a/drivers/media/video/bt8xx/bttv-input.c
+++ b/drivers/media/video/bt8xx/bttv-input.c
@@ -283,8 +283,7 @@ static int bttv_rc5_irq(struct bttv *btv)
 		ir->base_time = tv;
 		ir->last_bit = 0;
 
-		mod_timer(&ir->timer_end,
-			  current_jiffies + msecs_to_jiffies(30));
+		mod_timer(&ir->timer, current_jiffies + msecs_to_jiffies(30));
 	}
 
 	/* toggle GPIO pin 4 to reset the irq */
@@ -303,8 +302,7 @@ static void bttv_ir_start(struct bttv *btv, struct bttv_ir *ir)
 		add_timer(&ir->timer);
 	} else if (ir->rc5_gpio) {
 		/* set timer_end for code completion */
-		setup_timer(&ir->timer_end, bttv_rc5_timer_end,
-			    (unsigned long)ir);
+		setup_timer(&ir->timer, bttv_rc5_timer_end, (unsigned long)ir);
 		ir->shift_by = 1;
 		ir->start = 3;
 		ir->addr = 0x0;
@@ -322,7 +320,7 @@ static void bttv_ir_stop(struct bttv *btv)
 	if (btv->remote->rc5_gpio) {
 		u32 gpio;
 
-		del_timer_sync(&btv->remote->timer_end);
+		del_timer_sync(&btv->remote->timer);
 		flush_scheduled_work();
 
 		gpio = bttv_gpio_read(&btv->c);
diff --git a/drivers/media/video/bt8xx/bttvp.h b/drivers/media/video/bt8xx/bttvp.h
index 3d5b2bc..0712320 100644
--- a/drivers/media/video/bt8xx/bttvp.h
+++ b/drivers/media/video/bt8xx/bttvp.h
@@ -122,6 +122,7 @@ struct bttv_format {
 
 struct bttv_ir {
 	struct rc_dev           *dev;
+	struct timer_list       timer;
 
 	char                    name[32];
 	char                    phys[32];
@@ -136,11 +137,9 @@ struct bttv_ir {
 	int                     start; // What should RC5_START() be
 	int                     addr; // What RC5_ADDR() should be.
 	int                     rc5_remote_gap;
-	struct timer_list       timer;
 
 	/* RC5 gpio */
 	u32                     rc5_gpio;
-	struct timer_list       timer_end;  /* timer_end for code completion */
 	u32                     last_bit;   /* last raw bit seen */
 	u32                     code;       /* raw code under construction */
 	struct timeval          base_time;  /* time of last seen code */


  parent reply	other threads:[~2010-11-19 23:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-19 23:42 [PATCH 00/10] rc-core: various cleanups David Härdeman
2010-11-19 23:42 ` [PATCH 01/10] saa7134: remove unused module parameter David Härdeman
2010-11-19 23:42 ` [PATCH 02/10] saa7134: use full keycode for BeholdTV David Härdeman
2010-11-19 23:42 ` [PATCH 03/10] saa7134: some minor cleanups David Härdeman
2010-11-19 23:42 ` [PATCH 04/10] saa7134: merge saa7134_card_ir->timer and saa7134_card_ir->timer_end David Härdeman
2010-11-19 23:43 ` [PATCH 05/10] saa7134: protect the ir user count David Härdeman
2010-11-19 23:43 ` [PATCH 06/10] saa7134: make module parameters boolean David Härdeman
2010-11-20  6:10   ` hermann pitton
2010-11-19 23:43 ` [PATCH 07/10] bttv: rename struct card_ir to bttv_ir David Härdeman
2010-11-19 23:43 ` David Härdeman [this message]
2010-11-19 23:43 ` [PATCH 09/10] mceusb: int to bool conversion David Härdeman
2010-11-19 23:43 ` [PATCH 10/10] rc-core: fix some leftovers from the renaming patches David Härdeman

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=20101119234317.3511.48553.stgit@localhost.localdomain \
    --to=david@hardeman.nu \
    --cc=jarod@wilsonet.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    /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