From: Johannes Stezenbach <js@linuxtv.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: [DVB patch 46/48] ttusb_dec: cleanup
Date: Tue, 22 Mar 2005 02:24:19 +0100 [thread overview]
Message-ID: <20050322013500.610850000@abc> (raw)
In-Reply-To: 20050322013427.919515000@abc
[-- Attachment #1: dvb-ttusb-dec-cleanup.patch --]
[-- Type: text/plain, Size: 3593 bytes --]
Cleanup patch from Peter Beutner:
o unregister the input device on disconnect
and move cleanup stuff of the RC to own function
o keymap should be static not const
o set up keymap correctly and completly for input device
plus a more cosmetic one:
o usb endpoints are only 4bit numbers[0...15], the 8th bit
only specifies the direction and is set by the snd/rcvxxxpipe() macro
Signed-off-by: Johannes Stezenbach <js@linuxtv.org>
ttusb_dec.c | 49 +++++++++++++++++++++++++++++--------------------
1 files changed, 29 insertions(+), 20 deletions(-)
Index: linux-2.6.12-rc1-mm1/drivers/media/dvb/ttusb-dec/ttusb_dec.c
===================================================================
--- linux-2.6.12-rc1-mm1.orig/drivers/media/dvb/ttusb-dec/ttusb_dec.c 2005-03-22 00:18:46.000000000 +0100
+++ linux-2.6.12-rc1-mm1/drivers/media/dvb/ttusb-dec/ttusb_dec.c 2005-03-22 00:29:05.000000000 +0100
@@ -58,10 +58,10 @@ MODULE_PARM_DESC(enable_rc, "Turn on/off
#define DRIVER_NAME "TechnoTrend/Hauppauge DEC USB"
#define COMMAND_PIPE 0x03
-#define RESULT_PIPE 0x84
-#define IN_PIPE 0x88
+#define RESULT_PIPE 0x04
+#define IN_PIPE 0x08
#define OUT_PIPE 0x07
-#define IRQ_PIPE 0x8A
+#define IRQ_PIPE 0x0A
#define COMMAND_PACKET_SIZE 0x3c
#define ARM_PACKET_SIZE 0x1000
@@ -170,7 +170,7 @@ struct filter_info {
struct list_head filter_info_list;
};
-const uint16_t rc_keys[] = {
+static u16 rc_keys[] = {
KEY_POWER,
KEY_MUTE,
KEY_1,
@@ -1191,8 +1191,9 @@ static void ttusb_init_rc( struct ttusb_
dec->rc_input_dev.name = "ttusb_dec remote control";
dec->rc_input_dev.evbit[0] = BIT(EV_KEY);
- dec->rc_input_dev.keycodesize = sizeof(unsigned char);
- dec->rc_input_dev.keycodemax = KEY_MAX;
+ dec->rc_input_dev.keycodesize = sizeof(u16);
+ dec->rc_input_dev.keycodemax = 0x1a;
+ dec->rc_input_dev.keycode = rc_keys;
for (i = 0; i < sizeof(rc_keys)/sizeof(rc_keys[0]); i++)
set_bit(rc_keys[i], dec->rc_input_dev.keybit);
@@ -1498,6 +1499,26 @@ static void ttusb_dec_exit_dvb(struct tt
dvb_unregister_adapter(dec->adapter);
}
+static void ttusb_dec_exit_rc(struct ttusb_dec *dec)
+{
+
+ dprintk("%s\n", __FUNCTION__);
+ /* we have to check whether the irq URB is already submitted.
+ * As the irq is submitted after the interface is changed,
+ * this is the best method i figured out.
+ * Any others?*/
+ if(dec->interface == TTUSB_DEC_INTERFACE_IN)
+ usb_kill_urb(dec->irq_urb);
+
+ usb_free_urb(dec->irq_urb);
+
+ usb_buffer_free(dec->udev,IRQ_PACKET_SIZE,
+ dec->irq_buffer, dec->irq_dma_handle);
+
+ input_unregister_device(&dec->rc_input_dev);
+}
+
+
static void ttusb_dec_exit_usb(struct ttusb_dec *dec)
{
int i;
@@ -1510,20 +1531,6 @@ static void ttusb_dec_exit_usb(struct tt
usb_kill_urb(dec->iso_urb[i]);
ttusb_dec_free_iso_urbs(dec);
-
- if(enable_rc) {
- /* we have to check whether the irq URB is already submitted.
- * As the irq is submitted after the interface is changed,
- * this is the best method i figured out.
- * Any other possibilities?*/
- if(dec->interface == TTUSB_DEC_INTERFACE_IN)
- usb_kill_urb(dec->irq_urb);
-
- usb_free_urb(dec->irq_urb);
-
- usb_buffer_free(dec->udev,IRQ_PACKET_SIZE,
- dec->irq_buffer, dec->irq_dma_handle);
- }
}
static void ttusb_dec_exit_tasklet(struct ttusb_dec *dec)
@@ -1663,6 +1670,8 @@ static void ttusb_dec_disconnect(struct
if (dec->active) {
ttusb_dec_exit_tasklet(dec);
ttusb_dec_exit_filters(dec);
+ if(enable_rc)
+ ttusb_dec_exit_rc(dec);
ttusb_dec_exit_usb(dec);
ttusb_dec_exit_dvb(dec);
}
--
next prev parent reply other threads:[~2005-03-22 2:16 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-22 1:23 [DVB patch 00/48] DVB updates for 2.6.12-rc1-mm1 Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 01/48] clarify firmware upload messages Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 02/48] dibcom: frontend fixes Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 03/48] dibusb: misc. fixes Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 04/48] skystar2: remove duplicate pci_release_region() Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 05/48] mt352: Pinnacle 300i comments Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 06/48] support Activy Budget card Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 07/48] skystar2: update email address Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 08/48] ves1x93: invert_pwm fix Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 09/48] dibusb readme update Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 10/48] dibusb: support Hauppauge WinTV NOVA-T USB2 Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 11/48] nxt2002: QAM64/256 support Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 12/48] get_dvb_firmware: new unshield version Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 13/48] dib3000: corrected device naming Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 14/48] dibusb: debug changes Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 15/48] dibusb: increased the number of urbs for usb1.1 devices Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 16/48] ttusb_dec: use alternative interface to save bandwidth Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 17/48] l64781: email address fix Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 18/48] skystar2: fix MAC address reading Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 19/48] support KWorld/ADSTech Instant DVB-T USB2.0 Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 20/48] cleanups, make stuff static Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 21/48] refactor sw pid filter to drop redundant code Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 22/48] nxt2002: fix max frequency Johannes Stezenbach
2005-03-22 2:43 ` Gene Heskett
2005-03-22 1:23 ` [DVB patch 23/48] ttusb-budget: s/usb_unlink_urb/usb_kill_urb/ Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 24/48] av7110: fix Oops when av7110_ir_init() failed Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 25/48] saa7146: static initialization Johannes Stezenbach
2005-03-22 1:23 ` [DVB patch 26/48] av7110: error handling during attach Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 27/48] corrected links to firmware files Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 28/48] support pcHDTV HD2000 Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 29/48] dibusb: support nova-t usb ir Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 30/48] OREN or51211, or51132_qam and or51132_vsb firmware download info Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 31/48] ttusb_dec: IR support Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 32/48] dibusb: pll fix Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 33/48] tda10021: fix continuity errors Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 34/48] saa7146: remove duplicate setgpio Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 35/48] fix CAMs on Typhoon DVB-S Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 36/48] frontends: kfree() cleanup Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 37/48] clear up confusion between ids and adapters Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 38/48] dibusb: remove useless ifdef Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 39/48] support for Technotrend PCI DVB-T Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 40/48] dibusb: HanfTek UMT-010 fixes Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 41/48] vfree() checking cleanups Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 42/48] convert from pci_module_init to pci_register_driver Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 43/48] dibusb: support dtt200u (Yakumo/Typhoon/Hama) USB2.0 device Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 44/48] sparse warnings on one-bit bitfields Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 45/48] support Nova-S rev 2.2 Johannes Stezenbach
2005-03-22 1:24 ` Johannes Stezenbach [this message]
2005-03-22 1:24 ` [DVB patch 47/48] gcc 2.95 compile fixes Johannes Stezenbach
2005-03-22 1:24 ` [DVB patch 48/48] mt352: cleanups Johannes Stezenbach
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=20050322013500.610850000@abc \
--to=js@linuxtv.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.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