aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/cinergyT2/cinergyT2.c108
-rw-r--r--drivers/media/dvb/dvb-core/dvb_ca_en50221.c1
-rw-r--r--drivers/media/dvb/dvb-core/dvbdev.c2
-rw-r--r--drivers/media/dvb/dvb-usb/dtt200u.c4
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-remote.c50
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb.h3
-rw-r--r--drivers/media/dvb/dvb-usb/vp7045.c2
-rw-r--r--drivers/media/dvb/frontends/bcm3510.c3
-rw-r--r--drivers/media/dvb/frontends/dib3000mb.c2
-rw-r--r--drivers/media/dvb/frontends/dib3000mc.c2
-rw-r--r--drivers/media/dvb/frontends/dvb_dummy_fe.c2
-rw-r--r--drivers/media/dvb/frontends/lgdt330x.c2
-rw-r--r--drivers/media/dvb/frontends/mt312.c2
-rw-r--r--drivers/media/dvb/frontends/mt352.c2
-rw-r--r--drivers/media/dvb/frontends/nxt2002.c2
-rw-r--r--drivers/media/dvb/frontends/or51132.c2
-rw-r--r--drivers/media/dvb/frontends/or51211.c2
-rw-r--r--drivers/media/dvb/frontends/s5h1420.c2
-rw-r--r--drivers/media/dvb/frontends/sp8870.c2
-rw-r--r--drivers/media/dvb/frontends/sp887x.c2
-rw-r--r--drivers/media/dvb/frontends/stv0297.c2
-rw-r--r--drivers/media/dvb/frontends/stv0299.c1
-rw-r--r--drivers/media/dvb/frontends/tda1004x.c4
-rw-r--r--drivers/media/dvb/frontends/tda8083.c1
-rw-r--r--drivers/media/dvb/ttpci/av7110_ir.c37
-rw-r--r--drivers/media/dvb/ttpci/budget-ci.c24
-rw-r--r--drivers/media/dvb/ttusb-dec/ttusb_dec.c51
27 files changed, 206 insertions, 111 deletions
diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c b/drivers/media/dvb/cinergyT2/cinergyT2.c
index 6db0929ef53d..a1607e7d6d6b 100644
--- a/drivers/media/dvb/cinergyT2/cinergyT2.c
+++ b/drivers/media/dvb/cinergyT2/cinergyT2.c
@@ -137,7 +137,8 @@ struct cinergyt2 {
137 struct urb *stream_urb [STREAM_URB_COUNT]; 137 struct urb *stream_urb [STREAM_URB_COUNT];
138 138
139#ifdef ENABLE_RC 139#ifdef ENABLE_RC
140 struct input_dev rc_input_dev; 140 struct input_dev *rc_input_dev;
141 char phys[64];
141 struct work_struct rc_query_work; 142 struct work_struct rc_query_work;
142 int rc_input_event; 143 int rc_input_event;
143 u32 rc_last_code; 144 u32 rc_last_code;
@@ -683,6 +684,7 @@ static struct dvb_device cinergyt2_fe_template = {
683}; 684};
684 685
685#ifdef ENABLE_RC 686#ifdef ENABLE_RC
687
686static void cinergyt2_query_rc (void *data) 688static void cinergyt2_query_rc (void *data)
687{ 689{
688 struct cinergyt2 *cinergyt2 = data; 690 struct cinergyt2 *cinergyt2 = data;
@@ -703,7 +705,7 @@ static void cinergyt2_query_rc (void *data)
703 /* stop key repeat */ 705 /* stop key repeat */
704 if (cinergyt2->rc_input_event != KEY_MAX) { 706 if (cinergyt2->rc_input_event != KEY_MAX) {
705 dprintk(1, "rc_input_event=%d Up\n", cinergyt2->rc_input_event); 707 dprintk(1, "rc_input_event=%d Up\n", cinergyt2->rc_input_event);
706 input_report_key(&cinergyt2->rc_input_dev, 708 input_report_key(cinergyt2->rc_input_dev,
707 cinergyt2->rc_input_event, 0); 709 cinergyt2->rc_input_event, 0);
708 cinergyt2->rc_input_event = KEY_MAX; 710 cinergyt2->rc_input_event = KEY_MAX;
709 } 711 }
@@ -722,7 +724,7 @@ static void cinergyt2_query_rc (void *data)
722 /* keyrepeat bit -> just repeat last rc_input_event */ 724 /* keyrepeat bit -> just repeat last rc_input_event */
723 } else { 725 } else {
724 cinergyt2->rc_input_event = KEY_MAX; 726 cinergyt2->rc_input_event = KEY_MAX;
725 for (i = 0; i < sizeof(rc_keys) / sizeof(rc_keys[0]); i += 3) { 727 for (i = 0; i < ARRAY_SIZE(rc_keys); i += 3) {
726 if (rc_keys[i + 0] == rc_events[n].type && 728 if (rc_keys[i + 0] == rc_events[n].type &&
727 rc_keys[i + 1] == le32_to_cpu(rc_events[n].value)) { 729 rc_keys[i + 1] == le32_to_cpu(rc_events[n].value)) {
728 cinergyt2->rc_input_event = rc_keys[i + 2]; 730 cinergyt2->rc_input_event = rc_keys[i + 2];
@@ -736,11 +738,11 @@ static void cinergyt2_query_rc (void *data)
736 cinergyt2->rc_last_code != ~0) { 738 cinergyt2->rc_last_code != ~0) {
737 /* emit a key-up so the double event is recognized */ 739 /* emit a key-up so the double event is recognized */
738 dprintk(1, "rc_input_event=%d UP\n", cinergyt2->rc_input_event); 740 dprintk(1, "rc_input_event=%d UP\n", cinergyt2->rc_input_event);
739 input_report_key(&cinergyt2->rc_input_dev, 741 input_report_key(cinergyt2->rc_input_dev,
740 cinergyt2->rc_input_event, 0); 742 cinergyt2->rc_input_event, 0);
741 } 743 }
742 dprintk(1, "rc_input_event=%d\n", cinergyt2->rc_input_event); 744 dprintk(1, "rc_input_event=%d\n", cinergyt2->rc_input_event);
743 input_report_key(&cinergyt2->rc_input_dev, 745 input_report_key(cinergyt2->rc_input_dev,
744 cinergyt2->rc_input_event, 1); 746 cinergyt2->rc_input_event, 1);
745 cinergyt2->rc_last_code = rc_events[n].value; 747 cinergyt2->rc_last_code = rc_events[n].value;
746 } 748 }
@@ -752,7 +754,59 @@ out:
752 754
753 up(&cinergyt2->sem); 755 up(&cinergyt2->sem);
754} 756}
755#endif 757
758static int cinergyt2_register_rc(struct cinergyt2 *cinergyt2)
759{
760 struct input_dev *input_dev;
761 int i;
762
763 cinergyt2->rc_input_dev = input_dev = input_allocate_device();
764 if (!input_dev)
765 return -ENOMEM;
766
767 usb_make_path(cinergyt2->udev, cinergyt2->phys, sizeof(cinergyt2->phys));
768 strlcat(cinergyt2->phys, "/input0", sizeof(cinergyt2->phys));
769 cinergyt2->rc_input_event = KEY_MAX;
770 cinergyt2->rc_last_code = ~0;
771 INIT_WORK(&cinergyt2->rc_query_work, cinergyt2_query_rc, cinergyt2);
772
773 input_dev->name = DRIVER_NAME " remote control";
774 input_dev->phys = cinergyt2->phys;
775 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
776 for (i = 0; ARRAY_SIZE(rc_keys); i += 3)
777 set_bit(rc_keys[i + 2], input_dev->keybit);
778 input_dev->keycodesize = 0;
779 input_dev->keycodemax = 0;
780
781 input_register_device(cinergyt2->rc_input_dev);
782 schedule_delayed_work(&cinergyt2->rc_query_work, HZ/2);
783}
784
785static void cinergyt2_unregister_rc(struct cinergyt2 *cinergyt2)
786{
787 cancel_delayed_work(&cinergyt2->rc_query_work);
788 flush_scheduled_work();
789 input_unregister_device(cinergyt2->rc_input_dev);
790}
791
792static inline void cinergyt2_suspend_rc(struct cinergyt2 *cinergyt2)
793{
794 cancel_delayed_work(&cinergyt2->rc_query_work);
795}
796
797static inline void cinergyt2_resume_rc(struct cinergyt2 *cinergyt2)
798{
799 schedule_delayed_work(&cinergyt2->rc_query_work, HZ/2);
800}
801
802#else
803
804static inline int cinergyt2_register_rc(struct cinergyt2 *cinergyt2) { return 0; }
805static inline void cinergyt2_unregister_rc(struct cinergyt2 *cinergyt2) { }
806static inline void cinergyt2_suspend_rc(struct cinergyt2 *cinergyt2) { }
807static inline void cinergyt2_resume_rc(struct cinergyt2 *cinergyt2) { }
808
809#endif /* ENABLE_RC */
756 810
757static void cinergyt2_query (void *data) 811static void cinergyt2_query (void *data)
758{ 812{
@@ -789,9 +843,6 @@ static int cinergyt2_probe (struct usb_interface *intf,
789{ 843{
790 struct cinergyt2 *cinergyt2; 844 struct cinergyt2 *cinergyt2;
791 int err; 845 int err;
792#ifdef ENABLE_RC
793 int i;
794#endif
795 846
796 if (!(cinergyt2 = kmalloc (sizeof(struct cinergyt2), GFP_KERNEL))) { 847 if (!(cinergyt2 = kmalloc (sizeof(struct cinergyt2), GFP_KERNEL))) {
797 dprintk(1, "out of memory?!?\n"); 848 dprintk(1, "out of memory?!?\n");
@@ -846,30 +897,17 @@ static int cinergyt2_probe (struct usb_interface *intf,
846 &cinergyt2_fe_template, cinergyt2, 897 &cinergyt2_fe_template, cinergyt2,
847 DVB_DEVICE_FRONTEND); 898 DVB_DEVICE_FRONTEND);
848 899
849#ifdef ENABLE_RC 900 err = cinergyt2_register_rc(cinergyt2);
850 cinergyt2->rc_input_dev.evbit[0] = BIT(EV_KEY) | BIT(EV_REP); 901 if (err)
851 cinergyt2->rc_input_dev.keycodesize = 0; 902 goto bailout;
852 cinergyt2->rc_input_dev.keycodemax = 0;
853 cinergyt2->rc_input_dev.name = DRIVER_NAME " remote control";
854
855 for (i = 0; i < sizeof(rc_keys) / sizeof(rc_keys[0]); i += 3)
856 set_bit(rc_keys[i + 2], cinergyt2->rc_input_dev.keybit);
857
858 input_register_device(&cinergyt2->rc_input_dev);
859
860 cinergyt2->rc_input_event = KEY_MAX;
861 cinergyt2->rc_last_code = ~0;
862 903
863 INIT_WORK(&cinergyt2->rc_query_work, cinergyt2_query_rc, cinergyt2);
864 schedule_delayed_work(&cinergyt2->rc_query_work, HZ/2);
865#endif
866 return 0; 904 return 0;
867 905
868bailout: 906bailout:
869 dvb_dmxdev_release(&cinergyt2->dmxdev); 907 dvb_dmxdev_release(&cinergyt2->dmxdev);
870 dvb_dmx_release(&cinergyt2->demux); 908 dvb_dmx_release(&cinergyt2->demux);
871 dvb_unregister_adapter (&cinergyt2->adapter); 909 dvb_unregister_adapter(&cinergyt2->adapter);
872 cinergyt2_free_stream_urbs (cinergyt2); 910 cinergyt2_free_stream_urbs(cinergyt2);
873 kfree(cinergyt2); 911 kfree(cinergyt2);
874 return -ENOMEM; 912 return -ENOMEM;
875} 913}
@@ -881,11 +919,7 @@ static void cinergyt2_disconnect (struct usb_interface *intf)
881 if (down_interruptible(&cinergyt2->sem)) 919 if (down_interruptible(&cinergyt2->sem))
882 return; 920 return;
883 921
884#ifdef ENABLE_RC 922 cinergyt2_unregister_rc(cinergyt2);
885 cancel_delayed_work(&cinergyt2->rc_query_work);
886 flush_scheduled_work();
887 input_unregister_device(&cinergyt2->rc_input_dev);
888#endif
889 923
890 cinergyt2->demux.dmx.close(&cinergyt2->demux.dmx); 924 cinergyt2->demux.dmx.close(&cinergyt2->demux.dmx);
891 dvb_net_release(&cinergyt2->dvbnet); 925 dvb_net_release(&cinergyt2->dvbnet);
@@ -908,9 +942,8 @@ static int cinergyt2_suspend (struct usb_interface *intf, pm_message_t state)
908 942
909 if (state.event > PM_EVENT_ON) { 943 if (state.event > PM_EVENT_ON) {
910 struct cinergyt2 *cinergyt2 = usb_get_intfdata (intf); 944 struct cinergyt2 *cinergyt2 = usb_get_intfdata (intf);
911#ifdef ENABLE_RC 945
912 cancel_delayed_work(&cinergyt2->rc_query_work); 946 cinergyt2_suspend_rc(cinergyt2);
913#endif
914 cancel_delayed_work(&cinergyt2->query_work); 947 cancel_delayed_work(&cinergyt2->query_work);
915 if (cinergyt2->streaming) 948 if (cinergyt2->streaming)
916 cinergyt2_stop_stream_xfer(cinergyt2); 949 cinergyt2_stop_stream_xfer(cinergyt2);
@@ -938,9 +971,8 @@ static int cinergyt2_resume (struct usb_interface *intf)
938 schedule_delayed_work(&cinergyt2->query_work, HZ/2); 971 schedule_delayed_work(&cinergyt2->query_work, HZ/2);
939 } 972 }
940 973
941#ifdef ENABLE_RC 974 cinergyt2_resume_rc(cinergyt2);
942 schedule_delayed_work(&cinergyt2->rc_query_work, HZ/2); 975
943#endif
944 up(&cinergyt2->sem); 976 up(&cinergyt2->sem);
945 return 0; 977 return 0;
946} 978}
diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
index 88757e2634e5..2aa767f9bd7d 100644
--- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
+++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
@@ -36,6 +36,7 @@
36#include <linux/vmalloc.h> 36#include <linux/vmalloc.h>
37#include <linux/delay.h> 37#include <linux/delay.h>
38#include <linux/rwsem.h> 38#include <linux/rwsem.h>
39#include <linux/sched.h>
39 40
40#include "dvb_ca_en50221.h" 41#include "dvb_ca_en50221.h"
41#include "dvb_ringbuffer.h" 42#include "dvb_ringbuffer.h"
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c
index 4b7adca3e286..477b4fa56430 100644
--- a/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/drivers/media/dvb/dvb-core/dvbdev.c
@@ -235,7 +235,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev,
235 S_IFCHR | S_IRUSR | S_IWUSR, 235 S_IFCHR | S_IRUSR | S_IWUSR,
236 "dvb/adapter%d/%s%d", adap->num, dnames[type], id); 236 "dvb/adapter%d/%s%d", adap->num, dnames[type], id);
237 237
238 class_device_create(dvb_class, MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), 238 class_device_create(dvb_class, NULL, MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)),
239 NULL, "dvb%d.%s%d", adap->num, dnames[type], id); 239 NULL, "dvb%d.%s%d", adap->num, dnames[type], id);
240 240
241 dprintk("DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n", 241 dprintk("DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n",
diff --git a/drivers/media/dvb/dvb-usb/dtt200u.c b/drivers/media/dvb/dvb-usb/dtt200u.c
index 5aa12ebab34f..b595476332cd 100644
--- a/drivers/media/dvb/dvb-usb/dtt200u.c
+++ b/drivers/media/dvb/dvb-usb/dtt200u.c
@@ -151,7 +151,7 @@ static struct dvb_usb_properties dtt200u_properties = {
151 .cold_ids = { &dtt200u_usb_table[0], NULL }, 151 .cold_ids = { &dtt200u_usb_table[0], NULL },
152 .warm_ids = { &dtt200u_usb_table[1], NULL }, 152 .warm_ids = { &dtt200u_usb_table[1], NULL },
153 }, 153 },
154 { 0 }, 154 { NULL },
155 } 155 }
156}; 156};
157 157
@@ -192,7 +192,7 @@ static struct dvb_usb_properties wt220u_properties = {
192 .cold_ids = { &dtt200u_usb_table[2], NULL }, 192 .cold_ids = { &dtt200u_usb_table[2], NULL },
193 .warm_ids = { &dtt200u_usb_table[3], NULL }, 193 .warm_ids = { &dtt200u_usb_table[3], NULL },
194 }, 194 },
195 { 0 }, 195 { NULL },
196 } 196 }
197}; 197};
198 198
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
index fc7800f1743e..e5c6d9835e06 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-remote.c
@@ -39,9 +39,9 @@ static void dvb_usb_read_remote_control(void *data)
39 d->last_event = event; 39 d->last_event = event;
40 case REMOTE_KEY_REPEAT: 40 case REMOTE_KEY_REPEAT:
41 deb_rc("key repeated\n"); 41 deb_rc("key repeated\n");
42 input_event(&d->rc_input_dev, EV_KEY, d->last_event, 1); 42 input_event(d->rc_input_dev, EV_KEY, event, 1);
43 input_event(&d->rc_input_dev, EV_KEY, d->last_event, 0); 43 input_event(d->rc_input_dev, EV_KEY, d->last_event, 0);
44 input_sync(&d->rc_input_dev); 44 input_sync(d->rc_input_dev);
45 break; 45 break;
46 default: 46 default:
47 break; 47 break;
@@ -53,8 +53,8 @@ static void dvb_usb_read_remote_control(void *data)
53 deb_rc("NO KEY PRESSED\n"); 53 deb_rc("NO KEY PRESSED\n");
54 if (d->last_state != REMOTE_NO_KEY_PRESSED) { 54 if (d->last_state != REMOTE_NO_KEY_PRESSED) {
55 deb_rc("releasing event %d\n",d->last_event); 55 deb_rc("releasing event %d\n",d->last_event);
56 input_event(&d->rc_input_dev, EV_KEY, d->last_event, 0); 56 input_event(d->rc_input_dev, EV_KEY, d->last_event, 0);
57 input_sync(&d->rc_input_dev); 57 input_sync(d->rc_input_dev);
58 } 58 }
59 d->last_state = REMOTE_NO_KEY_PRESSED; 59 d->last_state = REMOTE_NO_KEY_PRESSED;
60 d->last_event = 0; 60 d->last_event = 0;
@@ -63,8 +63,8 @@ static void dvb_usb_read_remote_control(void *data)
63 deb_rc("KEY PRESSED\n"); 63 deb_rc("KEY PRESSED\n");
64 deb_rc("pressing event %d\n",event); 64 deb_rc("pressing event %d\n",event);
65 65
66 input_event(&d->rc_input_dev, EV_KEY, event, 1); 66 input_event(d->rc_input_dev, EV_KEY, event, 1);
67 input_sync(&d->rc_input_dev); 67 input_sync(d->rc_input_dev);
68 68
69 d->last_event = event; 69 d->last_event = event;
70 d->last_state = REMOTE_KEY_PRESSED; 70 d->last_state = REMOTE_KEY_PRESSED;
@@ -73,8 +73,8 @@ static void dvb_usb_read_remote_control(void *data)
73 deb_rc("KEY_REPEAT\n"); 73 deb_rc("KEY_REPEAT\n");
74 if (d->last_state != REMOTE_NO_KEY_PRESSED) { 74 if (d->last_state != REMOTE_NO_KEY_PRESSED) {
75 deb_rc("repeating event %d\n",d->last_event); 75 deb_rc("repeating event %d\n",d->last_event);
76 input_event(&d->rc_input_dev, EV_KEY, d->last_event, 2); 76 input_event(d->rc_input_dev, EV_KEY, d->last_event, 2);
77 input_sync(&d->rc_input_dev); 77 input_sync(d->rc_input_dev);
78 d->last_state = REMOTE_KEY_REPEAT; 78 d->last_state = REMOTE_KEY_REPEAT;
79 } 79 }
80 default: 80 default:
@@ -89,24 +89,30 @@ schedule:
89int dvb_usb_remote_init(struct dvb_usb_device *d) 89int dvb_usb_remote_init(struct dvb_usb_device *d)
90{ 90{
91 int i; 91 int i;
92
92 if (d->props.rc_key_map == NULL || 93 if (d->props.rc_key_map == NULL ||
93 d->props.rc_query == NULL || 94 d->props.rc_query == NULL ||
94 dvb_usb_disable_rc_polling) 95 dvb_usb_disable_rc_polling)
95 return 0; 96 return 0;
96 97
97 /* Initialise the remote-control structures.*/ 98 usb_make_path(d->udev, d->rc_phys, sizeof(d->rc_phys));
98 init_input_dev(&d->rc_input_dev); 99 strlcpy(d->rc_phys, "/ir0", sizeof(d->rc_phys));
100
101 d->rc_input_dev = input_allocate_device();
102 if (!d->rc_input_dev)
103 return -ENOMEM;
99 104
100 d->rc_input_dev.evbit[0] = BIT(EV_KEY); 105 d->rc_input_dev->evbit[0] = BIT(EV_KEY);
101 d->rc_input_dev.keycodesize = sizeof(unsigned char); 106 d->rc_input_dev->keycodesize = sizeof(unsigned char);
102 d->rc_input_dev.keycodemax = KEY_MAX; 107 d->rc_input_dev->keycodemax = KEY_MAX;
103 d->rc_input_dev.name = "IR-receiver inside an USB DVB receiver"; 108 d->rc_input_dev->name = "IR-receiver inside an USB DVB receiver";
109 d->rc_input_dev->phys = d->rc_phys;
104 110
105 /* set the bits for the keys */ 111 /* set the bits for the keys */
106 deb_rc("key map size: %d\n",d->props.rc_key_map_size); 112 deb_rc("key map size: %d\n", d->props.rc_key_map_size);
107 for (i = 0; i < d->props.rc_key_map_size; i++) { 113 for (i = 0; i < d->props.rc_key_map_size; i++) {
108 deb_rc("setting bit for event %d item %d\n",d->props.rc_key_map[i].event, i); 114 deb_rc("setting bit for event %d item %d\n",d->props.rc_key_map[i].event, i);
109 set_bit(d->props.rc_key_map[i].event, d->rc_input_dev.keybit); 115 set_bit(d->props.rc_key_map[i].event, d->rc_input_dev->keybit);
110 } 116 }
111 117
112 /* Start the remote-control polling. */ 118 /* Start the remote-control polling. */
@@ -114,14 +120,14 @@ int dvb_usb_remote_init(struct dvb_usb_device *d)
114 d->props.rc_interval = 100; /* default */ 120 d->props.rc_interval = 100; /* default */
115 121
116 /* setting these two values to non-zero, we have to manage key repeats */ 122 /* setting these two values to non-zero, we have to manage key repeats */
117 d->rc_input_dev.rep[REP_PERIOD] = d->props.rc_interval; 123 d->rc_input_dev->rep[REP_PERIOD] = d->props.rc_interval;
118 d->rc_input_dev.rep[REP_DELAY] = d->props.rc_interval + 150; 124 d->rc_input_dev->rep[REP_DELAY] = d->props.rc_interval + 150;
119 125
120 input_register_device(&d->rc_input_dev); 126 input_register_device(d->rc_input_dev);
121 127
122 INIT_WORK(&d->rc_query_work, dvb_usb_read_remote_control, d); 128 INIT_WORK(&d->rc_query_work, dvb_usb_read_remote_control, d);
123 129
124 info("schedule remote query interval to %d msecs.",d->props.rc_interval); 130 info("schedule remote query interval to %d msecs.", d->props.rc_interval);
125 schedule_delayed_work(&d->rc_query_work,msecs_to_jiffies(d->props.rc_interval)); 131 schedule_delayed_work(&d->rc_query_work,msecs_to_jiffies(d->props.rc_interval));
126 132
127 d->state |= DVB_USB_STATE_REMOTE; 133 d->state |= DVB_USB_STATE_REMOTE;
@@ -134,7 +140,7 @@ int dvb_usb_remote_exit(struct dvb_usb_device *d)
134 if (d->state & DVB_USB_STATE_REMOTE) { 140 if (d->state & DVB_USB_STATE_REMOTE) {
135 cancel_delayed_work(&d->rc_query_work); 141 cancel_delayed_work(&d->rc_query_work);
136 flush_scheduled_work(); 142 flush_scheduled_work();
137 input_unregister_device(&d->rc_input_dev); 143 input_unregister_device(d->rc_input_dev);
138 } 144 }
139 d->state &= ~DVB_USB_STATE_REMOTE; 145 d->state &= ~DVB_USB_STATE_REMOTE;
140 return 0; 146 return 0;
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h
index 0e4f1035b0dd..b4a1a98006c7 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb.h
+++ b/drivers/media/dvb/dvb-usb/dvb-usb.h
@@ -300,7 +300,8 @@ struct dvb_usb_device {
300 int (*fe_init) (struct dvb_frontend *); 300 int (*fe_init) (struct dvb_frontend *);
301 301
302 /* remote control */ 302 /* remote control */
303 struct input_dev rc_input_dev; 303 struct input_dev *rc_input_dev;
304 char rc_phys[64];
304 struct work_struct rc_query_work; 305 struct work_struct rc_query_work;
305 u32 last_event; 306 u32 last_event;
306 int last_state; 307 int last_state;
diff --git a/drivers/media/dvb/dvb-usb/vp7045.c b/drivers/media/dvb/dvb-usb/vp7045.c
index 0f57abeb6d6b..75765e3a569c 100644
--- a/drivers/media/dvb/dvb-usb/vp7045.c
+++ b/drivers/media/dvb/dvb-usb/vp7045.c
@@ -247,7 +247,7 @@ static struct dvb_usb_properties vp7045_properties = {
247 .cold_ids = { &vp7045_usb_table[2], NULL }, 247 .cold_ids = { &vp7045_usb_table[2], NULL },
248 .warm_ids = { &vp7045_usb_table[3], NULL }, 248 .warm_ids = { &vp7045_usb_table[3], NULL },
249 }, 249 },
250 { 0 }, 250 { NULL },
251 } 251 }
252}; 252};
253 253
diff --git a/drivers/media/dvb/frontends/bcm3510.c b/drivers/media/dvb/frontends/bcm3510.c
index f5fdc5c3e605..f6d4ee78bdd4 100644
--- a/drivers/media/dvb/frontends/bcm3510.c
+++ b/drivers/media/dvb/frontends/bcm3510.c
@@ -36,6 +36,9 @@
36#include <linux/moduleparam.h> 36#include <linux/moduleparam.h>
37#include <linux/device.h> 37#include <linux/device.h>
38#include <linux/firmware.h> 38#include <linux/firmware.h>
39#include <linux/jiffies.h>
40#include <linux/string.h>
41#include <linux/slab.h>
39 42
40#include "dvb_frontend.h" 43#include "dvb_frontend.h"
41#include "bcm3510.h" 44#include "bcm3510.h"
diff --git a/drivers/media/dvb/frontends/dib3000mb.c b/drivers/media/dvb/frontends/dib3000mb.c
index 21433e1831e7..6b0553608610 100644
--- a/drivers/media/dvb/frontends/dib3000mb.c
+++ b/drivers/media/dvb/frontends/dib3000mb.c
@@ -27,6 +27,8 @@
27#include <linux/moduleparam.h> 27#include <linux/moduleparam.h>
28#include <linux/init.h> 28#include <linux/init.h>
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/string.h>
31#include <linux/slab.h>
30 32
31#include "dib3000-common.h" 33#include "dib3000-common.h"
32#include "dib3000mb_priv.h" 34#include "dib3000mb_priv.h"
diff --git a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c
index 441de665fec3..c024fad17337 100644
--- a/drivers/media/dvb/frontends/dib3000mc.c
+++ b/drivers/media/dvb/frontends/dib3000mc.c
@@ -26,6 +26,8 @@
26#include <linux/moduleparam.h> 26#include <linux/moduleparam.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/delay.h> 28#include <linux/delay.h>
29#include <linux/string.h>
30#include <linux/slab.h>
29 31
30#include "dib3000-common.h" 32#include "dib3000-common.h"
31#include "dib3000mc_priv.h" 33#include "dib3000mc_priv.h"
diff --git a/drivers/media/dvb/frontends/dvb_dummy_fe.c b/drivers/media/dvb/frontends/dvb_dummy_fe.c
index cff93b9d8ab2..794be520d590 100644
--- a/drivers/media/dvb/frontends/dvb_dummy_fe.c
+++ b/drivers/media/dvb/frontends/dvb_dummy_fe.c
@@ -22,6 +22,8 @@
22#include <linux/module.h> 22#include <linux/module.h>
23#include <linux/moduleparam.h> 23#include <linux/moduleparam.h>
24#include <linux/init.h> 24#include <linux/init.h>
25#include <linux/string.h>
26#include <linux/slab.h>
25 27
26#include "dvb_frontend.h" 28#include "dvb_frontend.h"
27#include "dvb_dummy_fe.h" 29#include "dvb_dummy_fe.h"
diff --git a/drivers/media/dvb/frontends/lgdt330x.c b/drivers/media/dvb/frontends/lgdt330x.c
index 7142b9c51dd2..8dde72bd1046 100644
--- a/drivers/media/dvb/frontends/lgdt330x.c
+++ b/drivers/media/dvb/frontends/lgdt330x.c
@@ -37,6 +37,8 @@
37#include <linux/moduleparam.h> 37#include <linux/moduleparam.h>
38#include <linux/init.h> 38#include <linux/init.h>
39#include <linux/delay.h> 39#include <linux/delay.h>
40#include <linux/string.h>
41#include <linux/slab.h>
40#include <asm/byteorder.h> 42#include <asm/byteorder.h>
41 43
42#include "dvb_frontend.h" 44#include "dvb_frontend.h"
diff --git a/drivers/media/dvb/frontends/mt312.c b/drivers/media/dvb/frontends/mt312.c
index e455aecd76b2..e38454901dd1 100644
--- a/drivers/media/dvb/frontends/mt312.c
+++ b/drivers/media/dvb/frontends/mt312.c
@@ -29,6 +29,8 @@
29#include <linux/kernel.h> 29#include <linux/kernel.h>
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/moduleparam.h> 31#include <linux/moduleparam.h>
32#include <linux/string.h>
33#include <linux/slab.h>
32 34
33#include "dvb_frontend.h" 35#include "dvb_frontend.h"
34#include "mt312_priv.h" 36#include "mt312_priv.h"
diff --git a/drivers/media/dvb/frontends/mt352.c b/drivers/media/dvb/frontends/mt352.c
index cc1bc0edd65e..f0c610f2c2df 100644
--- a/drivers/media/dvb/frontends/mt352.c
+++ b/drivers/media/dvb/frontends/mt352.c
@@ -35,6 +35,8 @@
35#include <linux/moduleparam.h> 35#include <linux/moduleparam.h>
36#include <linux/init.h> 36#include <linux/init.h>
37#include <linux/delay.h> 37#include <linux/delay.h>
38#include <linux/string.h>
39#include <linux/slab.h>
38 40
39#include "dvb_frontend.h" 41#include "dvb_frontend.h"
40#include "mt352_priv.h" 42#include "mt352_priv.h"
diff --git a/drivers/media/dvb/frontends/nxt2002.c b/drivers/media/dvb/frontends/nxt2002.c
index 35a1d60f1927..30786b1911bd 100644
--- a/drivers/media/dvb/frontends/nxt2002.c
+++ b/drivers/media/dvb/frontends/nxt2002.c
@@ -32,6 +32,8 @@
32#include <linux/moduleparam.h> 32#include <linux/moduleparam.h>
33#include <linux/device.h> 33#include <linux/device.h>
34#include <linux/firmware.h> 34#include <linux/firmware.h>
35#include <linux/string.h>
36#include <linux/slab.h>
35 37
36#include "dvb_frontend.h" 38#include "dvb_frontend.h"
37#include "nxt2002.h" 39#include "nxt2002.h"
diff --git a/drivers/media/dvb/frontends/or51132.c b/drivers/media/dvb/frontends/or51132.c
index b6d0eecc59eb..817b044c7fd1 100644
--- a/drivers/media/dvb/frontends/or51132.c
+++ b/drivers/media/dvb/frontends/or51132.c
@@ -36,6 +36,8 @@
36#include <linux/moduleparam.h> 36#include <linux/moduleparam.h>
37#include <linux/init.h> 37#include <linux/init.h>
38#include <linux/delay.h> 38#include <linux/delay.h>
39#include <linux/string.h>
40#include <linux/slab.h>
39#include <asm/byteorder.h> 41#include <asm/byteorder.h>
40 42
41#include "dvb_frontend.h" 43#include "dvb_frontend.h"
diff --git a/drivers/media/dvb/frontends/or51211.c b/drivers/media/dvb/frontends/or51211.c
index ad56a9958404..8a9db23dd1b7 100644
--- a/drivers/media/dvb/frontends/or51211.c
+++ b/drivers/media/dvb/frontends/or51211.c
@@ -34,6 +34,8 @@
34#include <linux/moduleparam.h> 34#include <linux/moduleparam.h>
35#include <linux/device.h> 35#include <linux/device.h>
36#include <linux/firmware.h> 36#include <linux/firmware.h>
37#include <linux/string.h>
38#include <linux/slab.h>
37#include <asm/byteorder.h> 39#include <asm/byteorder.h>
38 40
39#include "dvb_frontend.h" 41#include "dvb_frontend.h"
diff --git a/drivers/media/dvb/frontends/s5h1420.c b/drivers/media/dvb/frontends/s5h1420.c
index c7fe27fd530c..f265418e3261 100644
--- a/drivers/media/dvb/frontends/s5h1420.c
+++ b/drivers/media/dvb/frontends/s5h1420.c
@@ -26,6 +26,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26#include <linux/string.h> 26#include <linux/string.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/delay.h> 28#include <linux/delay.h>
29#include <linux/jiffies.h>
30#include <asm/div64.h>
29 31
30#include "dvb_frontend.h" 32#include "dvb_frontend.h"
31#include "s5h1420.h" 33#include "s5h1420.h"
diff --git a/drivers/media/dvb/frontends/sp8870.c b/drivers/media/dvb/frontends/sp8870.c
index 764a95a2e212..1c6b2e9264bc 100644
--- a/drivers/media/dvb/frontends/sp8870.c
+++ b/drivers/media/dvb/frontends/sp8870.c
@@ -32,6 +32,8 @@
32#include <linux/device.h> 32#include <linux/device.h>
33#include <linux/firmware.h> 33#include <linux/firmware.h>
34#include <linux/delay.h> 34#include <linux/delay.h>
35#include <linux/string.h>
36#include <linux/slab.h>
35 37
36#include "dvb_frontend.h" 38#include "dvb_frontend.h"
37#include "sp8870.h" 39#include "sp8870.h"
diff --git a/drivers/media/dvb/frontends/sp887x.c b/drivers/media/dvb/frontends/sp887x.c
index d868a6927a16..73384e75625e 100644
--- a/drivers/media/dvb/frontends/sp887x.c
+++ b/drivers/media/dvb/frontends/sp887x.c
@@ -14,6 +14,8 @@
14#include <linux/moduleparam.h> 14#include <linux/moduleparam.h>
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/firmware.h> 16#include <linux/firmware.h>
17#include <linux/string.h>
18#include <linux/slab.h>
17 19
18#include "dvb_frontend.h" 20#include "dvb_frontend.h"
19#include "sp887x.h" 21#include "sp887x.h"
diff --git a/drivers/media/dvb/frontends/stv0297.c b/drivers/media/dvb/frontends/stv0297.c
index 8d09afd7545d..6122ba754bc5 100644
--- a/drivers/media/dvb/frontends/stv0297.c
+++ b/drivers/media/dvb/frontends/stv0297.c
@@ -24,6 +24,8 @@
24#include <linux/module.h> 24#include <linux/module.h>
25#include <linux/string.h> 25#include <linux/string.h>
26#include <linux/delay.h> 26#include <linux/delay.h>
27#include <linux/jiffies.h>
28#include <linux/slab.h>
27 29
28#include "dvb_frontend.h" 30#include "dvb_frontend.h"
29#include "stv0297.h" 31#include "stv0297.h"
diff --git a/drivers/media/dvb/frontends/stv0299.c b/drivers/media/dvb/frontends/stv0299.c
index 2d62931f20b5..889d9257215d 100644
--- a/drivers/media/dvb/frontends/stv0299.c
+++ b/drivers/media/dvb/frontends/stv0299.c
@@ -48,6 +48,7 @@
48#include <linux/moduleparam.h> 48#include <linux/moduleparam.h>
49#include <linux/string.h> 49#include <linux/string.h>
50#include <linux/slab.h> 50#include <linux/slab.h>
51#include <linux/jiffies.h>
51#include <asm/div64.h> 52#include <asm/div64.h>
52 53
53#include "dvb_frontend.h" 54#include "dvb_frontend.h"
diff --git a/drivers/media/dvb/frontends/tda1004x.c b/drivers/media/dvb/frontends/tda1004x.c
index 74cea9f8d721..3529c618f828 100644
--- a/drivers/media/dvb/frontends/tda1004x.c
+++ b/drivers/media/dvb/frontends/tda1004x.c
@@ -32,6 +32,10 @@
32#include <linux/module.h> 32#include <linux/module.h>
33#include <linux/moduleparam.h> 33#include <linux/moduleparam.h>
34#include <linux/device.h> 34#include <linux/device.h>
35#include <linux/jiffies.h>
36#include <linux/string.h>
37#include <linux/slab.h>
38
35#include "dvb_frontend.h" 39#include "dvb_frontend.h"
36#include "tda1004x.h" 40#include "tda1004x.h"
37 41
diff --git a/drivers/media/dvb/frontends/tda8083.c b/drivers/media/dvb/frontends/tda8083.c
index 168e013d23bd..c05cf1861051 100644
--- a/drivers/media/dvb/frontends/tda8083.c
+++ b/drivers/media/dvb/frontends/tda8083.c
@@ -30,6 +30,7 @@
30#include <linux/moduleparam.h> 30#include <linux/moduleparam.h>
31#include <linux/string.h> 31#include <linux/string.h>
32#include <linux/slab.h> 32#include <linux/slab.h>
33#include <linux/jiffies.h>
33#include "dvb_frontend.h" 34#include "dvb_frontend.h"
34#include "tda8083.h" 35#include "tda8083.h"
35 36
diff --git a/drivers/media/dvb/ttpci/av7110_ir.c b/drivers/media/dvb/ttpci/av7110_ir.c
index 357a3728ec68..f5e59fc924af 100644
--- a/drivers/media/dvb/ttpci/av7110_ir.c
+++ b/drivers/media/dvb/ttpci/av7110_ir.c
@@ -15,7 +15,7 @@
15 15
16static int av_cnt; 16static int av_cnt;
17static struct av7110 *av_list[4]; 17static struct av7110 *av_list[4];
18static struct input_dev input_dev; 18static struct input_dev *input_dev;
19 19
20static u16 key_map [256] = { 20static u16 key_map [256] = {
21 KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, 21 KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7,
@@ -43,10 +43,10 @@ static u16 key_map [256] = {
43 43
44static void av7110_emit_keyup(unsigned long data) 44static void av7110_emit_keyup(unsigned long data)
45{ 45{
46 if (!data || !test_bit(data, input_dev.key)) 46 if (!data || !test_bit(data, input_dev->key))
47 return; 47 return;
48 48
49 input_event(&input_dev, EV_KEY, data, !!0); 49 input_event(input_dev, EV_KEY, data, !!0);
50} 50}
51 51
52 52
@@ -112,13 +112,13 @@ static void av7110_emit_key(unsigned long parm)
112 if (timer_pending(&keyup_timer)) { 112 if (timer_pending(&keyup_timer)) {
113 del_timer(&keyup_timer); 113 del_timer(&keyup_timer);
114 if (keyup_timer.data != keycode || new_toggle != old_toggle) { 114 if (keyup_timer.data != keycode || new_toggle != old_toggle) {
115 input_event(&input_dev, EV_KEY, keyup_timer.data, !!0); 115 input_event(input_dev, EV_KEY, keyup_timer.data, !!0);
116 input_event(&input_dev, EV_KEY, keycode, !0); 116 input_event(input_dev, EV_KEY, keycode, !0);
117 } else 117 } else
118 input_event(&input_dev, EV_KEY, keycode, 2); 118 input_event(input_dev, EV_KEY, keycode, 2);
119 119
120 } else 120 } else
121 input_event(&input_dev, EV_KEY, keycode, !0); 121 input_event(input_dev, EV_KEY, keycode, !0);
122 122
123 keyup_timer.expires = jiffies + UP_TIMEOUT; 123 keyup_timer.expires = jiffies + UP_TIMEOUT;
124 keyup_timer.data = keycode; 124 keyup_timer.data = keycode;
@@ -132,13 +132,13 @@ static void input_register_keys(void)
132{ 132{
133 int i; 133 int i;
134 134
135 memset(input_dev.keybit, 0, sizeof(input_dev.keybit)); 135 memset(input_dev->keybit, 0, sizeof(input_dev->keybit));
136 136
137 for (i = 0; i < sizeof(key_map) / sizeof(key_map[0]); i++) { 137 for (i = 0; i < ARRAY_SIZE(key_map); i++) {
138 if (key_map[i] > KEY_MAX) 138 if (key_map[i] > KEY_MAX)
139 key_map[i] = 0; 139 key_map[i] = 0;
140 else if (key_map[i] > KEY_RESERVED) 140 else if (key_map[i] > KEY_RESERVED)
141 set_bit(key_map[i], input_dev.keybit); 141 set_bit(key_map[i], input_dev->keybit);
142 } 142 }
143} 143}
144 144
@@ -216,12 +216,17 @@ int __init av7110_ir_init(struct av7110 *av7110)
216 init_timer(&keyup_timer); 216 init_timer(&keyup_timer);
217 keyup_timer.data = 0; 217 keyup_timer.data = 0;
218 218
219 input_dev.name = "DVB on-card IR receiver"; 219 input_dev = input_allocate_device();
220 set_bit(EV_KEY, input_dev.evbit); 220 if (!input_dev)
221 set_bit(EV_REP, input_dev.evbit); 221 return -ENOMEM;
222
223 input_dev->name = "DVB on-card IR receiver";
224
225 set_bit(EV_KEY, input_dev->evbit);
226 set_bit(EV_REP, input_dev->evbit);
222 input_register_keys(); 227 input_register_keys();
223 input_register_device(&input_dev); 228 input_register_device(input_dev);
224 input_dev.timer.function = input_repeat_key; 229 input_dev->timer.function = input_repeat_key;
225 230
226 e = create_proc_entry("av7110_ir", S_IFREG | S_IRUGO | S_IWUSR, NULL); 231 e = create_proc_entry("av7110_ir", S_IFREG | S_IRUGO | S_IWUSR, NULL);
227 if (e) { 232 if (e) {
@@ -256,7 +261,7 @@ void __exit av7110_ir_exit(struct av7110 *av7110)
256 if (av_cnt == 1) { 261 if (av_cnt == 1) {
257 del_timer_sync(&keyup_timer); 262 del_timer_sync(&keyup_timer);
258 remove_proc_entry("av7110_ir", NULL); 263 remove_proc_entry("av7110_ir", NULL);
259 input_unregister_device(&input_dev); 264 input_unregister_device(input_dev);
260 } 265 }
261 266
262 av_cnt--; 267 av_cnt--;
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c
index 2980db3ef22f..51c30ba68140 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -64,7 +64,7 @@
64 64
65struct budget_ci { 65struct budget_ci {
66 struct budget budget; 66 struct budget budget;
67 struct input_dev input_dev; 67 struct input_dev *input_dev;
68 struct tasklet_struct msp430_irq_tasklet; 68 struct tasklet_struct msp430_irq_tasklet;
69 struct tasklet_struct ciintf_irq_tasklet; 69 struct tasklet_struct ciintf_irq_tasklet;
70 int slot_status; 70 int slot_status;
@@ -145,7 +145,7 @@ static void msp430_ir_debounce(unsigned long data)
145static void msp430_ir_interrupt(unsigned long data) 145static void msp430_ir_interrupt(unsigned long data)
146{ 146{
147 struct budget_ci *budget_ci = (struct budget_ci *) data; 147 struct budget_ci *budget_ci = (struct budget_ci *) data;
148 struct input_dev *dev = &budget_ci->input_dev; 148 struct input_dev *dev = budget_ci->input_dev;
149 unsigned int code = 149 unsigned int code =
150 ttpci_budget_debiread(&budget_ci->budget, DEBINOSWAP, DEBIADDR_IR, 2, 1, 0) >> 8; 150 ttpci_budget_debiread(&budget_ci->budget, DEBINOSWAP, DEBIADDR_IR, 2, 1, 0) >> 8;
151 151
@@ -181,25 +181,27 @@ static void msp430_ir_interrupt(unsigned long data)
181static int msp430_ir_init(struct budget_ci *budget_ci) 181static int msp430_ir_init(struct budget_ci *budget_ci)
182{ 182{
183 struct saa7146_dev *saa = budget_ci->budget.dev; 183 struct saa7146_dev *saa = budget_ci->budget.dev;
184 struct input_dev *input_dev;
184 int i; 185 int i;
185 186
186 memset(&budget_ci->input_dev, 0, sizeof(struct input_dev)); 187 budget_ci->input_dev = input_dev = input_allocate_device();
188 if (!input_dev)
189 return -ENOMEM;
187 190
188 sprintf(budget_ci->ir_dev_name, "Budget-CI dvb ir receiver %s", saa->name); 191 sprintf(budget_ci->ir_dev_name, "Budget-CI dvb ir receiver %s", saa->name);
189 budget_ci->input_dev.name = budget_ci->ir_dev_name;
190 192
191 set_bit(EV_KEY, budget_ci->input_dev.evbit); 193 input_dev->name = budget_ci->ir_dev_name;
192 194
193 for (i = 0; i < sizeof(key_map) / sizeof(*key_map); i++) 195 set_bit(EV_KEY, input_dev->evbit);
196 for (i = 0; i < ARRAY_SIZE(key_map); i++)
194 if (key_map[i]) 197 if (key_map[i])
195 set_bit(key_map[i], budget_ci->input_dev.keybit); 198 set_bit(key_map[i], input_dev->keybit);
196 199
197 input_register_device(&budget_ci->input_dev); 200 input_register_device(budget_ci->input_dev);
198 201
199 budget_ci->input_dev.timer.function = msp430_ir_debounce; 202 input_dev->timer.function = msp430_ir_debounce;
200 203
201 saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_06); 204 saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_06);
202
203 saa7146_setgpio(saa, 3, SAA7146_GPIO_IRQHI); 205 saa7146_setgpio(saa, 3, SAA7146_GPIO_IRQHI);
204 206
205 return 0; 207 return 0;
@@ -208,7 +210,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
208static void msp430_ir_deinit(struct budget_ci *budget_ci) 210static void msp430_ir_deinit(struct budget_ci *budget_ci)
209{ 211{
210 struct saa7146_dev *saa = budget_ci->budget.dev; 212 struct saa7146_dev *saa = budget_ci->budget.dev;
211 struct input_dev *dev = &budget_ci->input_dev; 213 struct input_dev *dev = budget_ci->input_dev;
212 214
213 saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_06); 215 saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_06);
214 saa7146_setgpio(saa, 3, SAA7146_GPIO_INPUT); 216 saa7146_setgpio(saa, 3, SAA7146_GPIO_INPUT);
diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index 3d08fc83a754..832d179f26fa 100644
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -152,7 +152,8 @@ struct ttusb_dec {
152 struct list_head filter_info_list; 152 struct list_head filter_info_list;
153 spinlock_t filter_info_list_lock; 153 spinlock_t filter_info_list_lock;
154 154
155 struct input_dev rc_input_dev; 155 struct input_dev *rc_input_dev;
156 char rc_phys[64];
156 157
157 int active; /* Loaded successfully */ 158 int active; /* Loaded successfully */
158}; 159};
@@ -235,9 +236,9 @@ static void ttusb_dec_handle_irq( struct urb *urb, struct pt_regs *regs)
235 * this should/could be added later ... 236 * this should/could be added later ...
236 * for now lets report each signal as a key down and up*/ 237 * for now lets report each signal as a key down and up*/
237 dprintk("%s:rc signal:%d\n", __FUNCTION__, buffer[4]); 238 dprintk("%s:rc signal:%d\n", __FUNCTION__, buffer[4]);
238 input_report_key(&dec->rc_input_dev,rc_keys[buffer[4]-1],1); 239 input_report_key(dec->rc_input_dev, rc_keys[buffer[4] - 1], 1);
239 input_report_key(&dec->rc_input_dev,rc_keys[buffer[4]-1],0); 240 input_report_key(dec->rc_input_dev, rc_keys[buffer[4] - 1], 0);
240 input_sync(&dec->rc_input_dev); 241 input_sync(dec->rc_input_dev);
241 } 242 }
242 243
243exit: retval = usb_submit_urb(urb, GFP_ATOMIC); 244exit: retval = usb_submit_urb(urb, GFP_ATOMIC);
@@ -1181,29 +1182,38 @@ static void ttusb_dec_init_tasklet(struct ttusb_dec *dec)
1181 (unsigned long)dec); 1182 (unsigned long)dec);
1182} 1183}
1183 1184
1184static void ttusb_init_rc( struct ttusb_dec *dec) 1185static int ttusb_init_rc(struct ttusb_dec *dec)
1185{ 1186{
1187 struct input_dev *input_dev;
1186 u8 b[] = { 0x00, 0x01 }; 1188 u8 b[] = { 0x00, 0x01 };
1187 int i; 1189 int i;
1188 1190
1189 init_input_dev(&dec->rc_input_dev); 1191 usb_make_path(dec->udev, dec->rc_phys, sizeof(dec->rc_phys));
1192 strlcpy(dec->rc_phys, "/input0", sizeof(dec->rc_phys));
1190 1193
1191 dec->rc_input_dev.name = "ttusb_dec remote control"; 1194 dec->rc_input_dev = input_dev = input_allocate_device();
1192 dec->rc_input_dev.evbit[0] = BIT(EV_KEY); 1195 if (!input_dev)
1193 dec->rc_input_dev.keycodesize = sizeof(u16); 1196 return -ENOMEM;
1194 dec->rc_input_dev.keycodemax = 0x1a; 1197
1195 dec->rc_input_dev.keycode = rc_keys; 1198 input_dev->name = "ttusb_dec remote control";
1199 input_dev->phys = dec->rc_phys;
1200 input_dev->evbit[0] = BIT(EV_KEY);
1201 input_dev->keycodesize = sizeof(u16);
1202 input_dev->keycodemax = 0x1a;
1203 input_dev->keycode = rc_keys;
1196 1204
1197 for (i = 0; i < sizeof(rc_keys)/sizeof(rc_keys[0]); i++) 1205 for (i = 0; i < ARRAY_SIZE(rc_keys); i++)
1198 set_bit(rc_keys[i], dec->rc_input_dev.keybit); 1206 set_bit(rc_keys[i], input_dev->keybit);
1199 1207
1200 input_register_device(&dec->rc_input_dev); 1208 input_register_device(input_dev);
1201 1209
1202 if(usb_submit_urb(dec->irq_urb,GFP_KERNEL)) { 1210 if (usb_submit_urb(dec->irq_urb, GFP_KERNEL))
1203 printk("%s: usb_submit_urb failed\n",__FUNCTION__); 1211 printk("%s: usb_submit_urb failed\n",__FUNCTION__);
1204 } 1212
1205 /* enable irq pipe */ 1213 /* enable irq pipe */
1206 ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL); 1214 ttusb_dec_send_command(dec,0xb0,sizeof(b),b,NULL,NULL);
1215
1216 return 0;
1207} 1217}
1208 1218
1209static void ttusb_dec_init_v_pes(struct ttusb_dec *dec) 1219static void ttusb_dec_init_v_pes(struct ttusb_dec *dec)
@@ -1513,7 +1523,7 @@ static void ttusb_dec_exit_rc(struct ttusb_dec *dec)
1513 * As the irq is submitted after the interface is changed, 1523 * As the irq is submitted after the interface is changed,
1514 * this is the best method i figured out. 1524 * this is the best method i figured out.
1515 * Any others?*/ 1525 * Any others?*/
1516 if(dec->interface == TTUSB_DEC_INTERFACE_IN) 1526 if (dec->interface == TTUSB_DEC_INTERFACE_IN)
1517 usb_kill_urb(dec->irq_urb); 1527 usb_kill_urb(dec->irq_urb);
1518 1528
1519 usb_free_urb(dec->irq_urb); 1529 usb_free_urb(dec->irq_urb);
@@ -1521,7 +1531,10 @@ static void ttusb_dec_exit_rc(struct ttusb_dec *dec)
1521 usb_buffer_free(dec->udev,IRQ_PACKET_SIZE, 1531 usb_buffer_free(dec->udev,IRQ_PACKET_SIZE,
1522 dec->irq_buffer, dec->irq_dma_handle); 1532 dec->irq_buffer, dec->irq_dma_handle);
1523 1533
1524 input_unregister_device(&dec->rc_input_dev); 1534 if (dec->rc_input_dev) {
1535 input_unregister_device(dec->rc_input_dev);
1536 dec->rc_input_dev = NULL;
1537 }
1525} 1538}
1526 1539
1527 1540
@@ -1659,7 +1672,7 @@ static int ttusb_dec_probe(struct usb_interface *intf,
1659 1672
1660 ttusb_dec_set_interface(dec, TTUSB_DEC_INTERFACE_IN); 1673 ttusb_dec_set_interface(dec, TTUSB_DEC_INTERFACE_IN);
1661 1674
1662 if(enable_rc) 1675 if (enable_rc)
1663 ttusb_init_rc(dec); 1676 ttusb_init_rc(dec);
1664 1677
1665 return 0; 1678 return 0;