aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/ttpci
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/ttpci')
-rw-r--r--drivers/media/dvb/ttpci/Kconfig3
-rw-r--r--drivers/media/dvb/ttpci/av7110_v4l.c4
-rw-r--r--drivers/media/dvb/ttpci/budget-av.c6
-rw-r--r--drivers/media/dvb/ttpci/budget-ci.c54
4 files changed, 34 insertions, 33 deletions
diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig
index debea8d1d31c..44afab2fdc2d 100644
--- a/drivers/media/dvb/ttpci/Kconfig
+++ b/drivers/media/dvb/ttpci/Kconfig
@@ -89,7 +89,6 @@ config DVB_BUDGET
89config DVB_BUDGET_CI 89config DVB_BUDGET_CI
90 tristate "Budget cards with onboard CI connector" 90 tristate "Budget cards with onboard CI connector"
91 depends on DVB_BUDGET_CORE && I2C 91 depends on DVB_BUDGET_CORE && I2C
92 depends on INPUT # due to IR
93 select DVB_STV0297 if !DVB_FE_CUSTOMISE 92 select DVB_STV0297 if !DVB_FE_CUSTOMISE
94 select DVB_STV0299 if !DVB_FE_CUSTOMISE 93 select DVB_STV0299 if !DVB_FE_CUSTOMISE
95 select DVB_TDA1004X if !DVB_FE_CUSTOMISE 94 select DVB_TDA1004X if !DVB_FE_CUSTOMISE
@@ -98,7 +97,7 @@ config DVB_BUDGET_CI
98 select DVB_LNBP21 if !DVB_FE_CUSTOMISE 97 select DVB_LNBP21 if !DVB_FE_CUSTOMISE
99 select DVB_TDA10023 if !DVB_FE_CUSTOMISE 98 select DVB_TDA10023 if !DVB_FE_CUSTOMISE
100 select MEDIA_TUNER_TDA827X if !MEDIA_TUNER_CUSTOMISE 99 select MEDIA_TUNER_TDA827X if !MEDIA_TUNER_CUSTOMISE
101 depends on VIDEO_IR 100 depends on RC_CORE
102 help 101 help
103 Support for simple SAA7146 based DVB cards 102 Support for simple SAA7146 based DVB cards
104 (so called Budget- or Nova-PCI cards) without onboard 103 (so called Budget- or Nova-PCI cards) without onboard
diff --git a/drivers/media/dvb/ttpci/av7110_v4l.c b/drivers/media/dvb/ttpci/av7110_v4l.c
index ac20c5bbfa43..cdd31cae46c4 100644
--- a/drivers/media/dvb/ttpci/av7110_v4l.c
+++ b/drivers/media/dvb/ttpci/av7110_v4l.c
@@ -100,6 +100,7 @@ static struct v4l2_input inputs[4] = {
100 .tuner = 0, /* ignored */ 100 .tuner = 0, /* ignored */
101 .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 101 .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M,
102 .status = 0, 102 .status = 0,
103 .capabilities = V4L2_IN_CAP_STD,
103 }, { 104 }, {
104 .index = 1, 105 .index = 1,
105 .name = "Television", 106 .name = "Television",
@@ -108,6 +109,7 @@ static struct v4l2_input inputs[4] = {
108 .tuner = 0, 109 .tuner = 0,
109 .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 110 .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M,
110 .status = 0, 111 .status = 0,
112 .capabilities = V4L2_IN_CAP_STD,
111 }, { 113 }, {
112 .index = 2, 114 .index = 2,
113 .name = "Video", 115 .name = "Video",
@@ -116,6 +118,7 @@ static struct v4l2_input inputs[4] = {
116 .tuner = 0, 118 .tuner = 0,
117 .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 119 .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M,
118 .status = 0, 120 .status = 0,
121 .capabilities = V4L2_IN_CAP_STD,
119 }, { 122 }, {
120 .index = 3, 123 .index = 3,
121 .name = "Y/C", 124 .name = "Y/C",
@@ -124,6 +127,7 @@ static struct v4l2_input inputs[4] = {
124 .tuner = 0, 127 .tuner = 0,
125 .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 128 .std = V4L2_STD_PAL_BG|V4L2_STD_NTSC_M,
126 .status = 0, 129 .status = 0,
130 .capabilities = V4L2_IN_CAP_STD,
127 } 131 }
128}; 132};
129 133
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c
index 97afc01f60d0..e957d7690bcc 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -1406,8 +1406,10 @@ static int budget_av_detach(struct saa7146_dev *dev)
1406 1406
1407#define KNC1_INPUTS 2 1407#define KNC1_INPUTS 2
1408static struct v4l2_input knc1_inputs[KNC1_INPUTS] = { 1408static struct v4l2_input knc1_inputs[KNC1_INPUTS] = {
1409 {0, "Composite", V4L2_INPUT_TYPE_TUNER, 1, 0, V4L2_STD_PAL_BG | V4L2_STD_NTSC_M, 0}, 1409 { 0, "Composite", V4L2_INPUT_TYPE_TUNER, 1, 0,
1410 {1, "S-Video", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG | V4L2_STD_NTSC_M, 0}, 1410 V4L2_STD_PAL_BG | V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD },
1411 { 1, "S-Video", V4L2_INPUT_TYPE_CAMERA, 2, 0,
1412 V4L2_STD_PAL_BG | V4L2_STD_NTSC_M, 0, V4L2_IN_CAP_STD },
1411}; 1413};
1412 1414
1413static int vidioc_enum_input(struct file *file, void *fh, struct v4l2_input *i) 1415static int vidioc_enum_input(struct file *file, void *fh, struct v4l2_input *i)
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c
index a9c2c326df4b..b82756db5bd1 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -33,9 +33,8 @@
33#include <linux/errno.h> 33#include <linux/errno.h>
34#include <linux/slab.h> 34#include <linux/slab.h>
35#include <linux/interrupt.h> 35#include <linux/interrupt.h>
36#include <linux/input.h>
37#include <linux/spinlock.h> 36#include <linux/spinlock.h>
38#include <media/ir-core.h> 37#include <media/rc-core.h>
39 38
40#include "budget.h" 39#include "budget.h"
41 40
@@ -96,7 +95,7 @@ MODULE_PARM_DESC(ir_debug, "enable debugging information for IR decoding");
96DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); 95DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
97 96
98struct budget_ci_ir { 97struct budget_ci_ir {
99 struct input_dev *dev; 98 struct rc_dev *dev;
100 struct tasklet_struct msp430_irq_tasklet; 99 struct tasklet_struct msp430_irq_tasklet;
101 char name[72]; /* 40 + 32 for (struct saa7146_dev).name */ 100 char name[72]; /* 40 + 32 for (struct saa7146_dev).name */
102 char phys[32]; 101 char phys[32];
@@ -118,7 +117,7 @@ struct budget_ci {
118static void msp430_ir_interrupt(unsigned long data) 117static void msp430_ir_interrupt(unsigned long data)
119{ 118{
120 struct budget_ci *budget_ci = (struct budget_ci *) data; 119 struct budget_ci *budget_ci = (struct budget_ci *) data;
121 struct input_dev *dev = budget_ci->ir.dev; 120 struct rc_dev *dev = budget_ci->ir.dev;
122 u32 command = ttpci_budget_debiread(&budget_ci->budget, DEBINOSWAP, DEBIADDR_IR, 2, 1, 0) >> 8; 121 u32 command = ttpci_budget_debiread(&budget_ci->budget, DEBINOSWAP, DEBIADDR_IR, 2, 1, 0) >> 8;
123 122
124 /* 123 /*
@@ -160,19 +159,17 @@ static void msp430_ir_interrupt(unsigned long data)
160 budget_ci->ir.rc5_device != (command & 0x1f)) 159 budget_ci->ir.rc5_device != (command & 0x1f))
161 return; 160 return;
162 161
163 ir_keydown(dev, budget_ci->ir.ir_key, (command & 0x20) ? 1 : 0); 162 rc_keydown(dev, budget_ci->ir.ir_key, (command & 0x20) ? 1 : 0);
164} 163}
165 164
166static int msp430_ir_init(struct budget_ci *budget_ci) 165static int msp430_ir_init(struct budget_ci *budget_ci)
167{ 166{
168 struct saa7146_dev *saa = budget_ci->budget.dev; 167 struct saa7146_dev *saa = budget_ci->budget.dev;
169 struct input_dev *input_dev = budget_ci->ir.dev; 168 struct rc_dev *dev;
170 int error; 169 int error;
171 char *ir_codes = NULL;
172 170
173 171 dev = rc_allocate_device();
174 budget_ci->ir.dev = input_dev = input_allocate_device(); 172 if (!dev) {
175 if (!input_dev) {
176 printk(KERN_ERR "budget_ci: IR interface initialisation failed\n"); 173 printk(KERN_ERR "budget_ci: IR interface initialisation failed\n");
177 return -ENOMEM; 174 return -ENOMEM;
178 } 175 }
@@ -182,19 +179,20 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
182 snprintf(budget_ci->ir.phys, sizeof(budget_ci->ir.phys), 179 snprintf(budget_ci->ir.phys, sizeof(budget_ci->ir.phys),
183 "pci-%s/ir0", pci_name(saa->pci)); 180 "pci-%s/ir0", pci_name(saa->pci));
184 181
185 input_dev->name = budget_ci->ir.name; 182 dev->driver_name = MODULE_NAME;
186 183 dev->input_name = budget_ci->ir.name;
187 input_dev->phys = budget_ci->ir.phys; 184 dev->input_phys = budget_ci->ir.phys;
188 input_dev->id.bustype = BUS_PCI; 185 dev->input_id.bustype = BUS_PCI;
189 input_dev->id.version = 1; 186 dev->input_id.version = 1;
187 dev->scanmask = 0xff;
190 if (saa->pci->subsystem_vendor) { 188 if (saa->pci->subsystem_vendor) {
191 input_dev->id.vendor = saa->pci->subsystem_vendor; 189 dev->input_id.vendor = saa->pci->subsystem_vendor;
192 input_dev->id.product = saa->pci->subsystem_device; 190 dev->input_id.product = saa->pci->subsystem_device;
193 } else { 191 } else {
194 input_dev->id.vendor = saa->pci->vendor; 192 dev->input_id.vendor = saa->pci->vendor;
195 input_dev->id.product = saa->pci->device; 193 dev->input_id.product = saa->pci->device;
196 } 194 }
197 input_dev->dev.parent = &saa->pci->dev; 195 dev->dev.parent = &saa->pci->dev;
198 196
199 if (rc5_device < 0) 197 if (rc5_device < 0)
200 budget_ci->ir.rc5_device = IR_DEVICE_ANY; 198 budget_ci->ir.rc5_device = IR_DEVICE_ANY;
@@ -208,7 +206,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
208 case 0x1011: 206 case 0x1011:
209 case 0x1012: 207 case 0x1012:
210 /* The hauppauge keymap is a superset of these remotes */ 208 /* The hauppauge keymap is a superset of these remotes */
211 ir_codes = RC_MAP_HAUPPAUGE_NEW; 209 dev->map_name = RC_MAP_HAUPPAUGE_NEW;
212 210
213 if (rc5_device < 0) 211 if (rc5_device < 0)
214 budget_ci->ir.rc5_device = 0x1f; 212 budget_ci->ir.rc5_device = 0x1f;
@@ -218,23 +216,22 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
218 case 0x1019: 216 case 0x1019:
219 case 0x101a: 217 case 0x101a:
220 /* for the Technotrend 1500 bundled remote */ 218 /* for the Technotrend 1500 bundled remote */
221 ir_codes = RC_MAP_TT_1500; 219 dev->map_name = RC_MAP_TT_1500;
222 break; 220 break;
223 default: 221 default:
224 /* unknown remote */ 222 /* unknown remote */
225 ir_codes = RC_MAP_BUDGET_CI_OLD; 223 dev->map_name = RC_MAP_BUDGET_CI_OLD;
226 break; 224 break;
227 } 225 }
228 226
229 error = ir_input_register(input_dev, ir_codes, NULL, MODULE_NAME); 227 error = rc_register_device(dev);
230 if (error) { 228 if (error) {
231 printk(KERN_ERR "budget_ci: could not init driver for IR device (code %d)\n", error); 229 printk(KERN_ERR "budget_ci: could not init driver for IR device (code %d)\n", error);
230 rc_free_device(dev);
232 return error; 231 return error;
233 } 232 }
234 233
235 /* note: these must be after input_register_device */ 234 budget_ci->ir.dev = dev;
236 input_dev->rep[REP_DELAY] = 400;
237 input_dev->rep[REP_PERIOD] = 250;
238 235
239 tasklet_init(&budget_ci->ir.msp430_irq_tasklet, msp430_ir_interrupt, 236 tasklet_init(&budget_ci->ir.msp430_irq_tasklet, msp430_ir_interrupt,
240 (unsigned long) budget_ci); 237 (unsigned long) budget_ci);
@@ -248,13 +245,12 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
248static void msp430_ir_deinit(struct budget_ci *budget_ci) 245static void msp430_ir_deinit(struct budget_ci *budget_ci)
249{ 246{
250 struct saa7146_dev *saa = budget_ci->budget.dev; 247 struct saa7146_dev *saa = budget_ci->budget.dev;
251 struct input_dev *dev = budget_ci->ir.dev;
252 248
253 SAA7146_IER_DISABLE(saa, MASK_06); 249 SAA7146_IER_DISABLE(saa, MASK_06);
254 saa7146_setgpio(saa, 3, SAA7146_GPIO_INPUT); 250 saa7146_setgpio(saa, 3, SAA7146_GPIO_INPUT);
255 tasklet_kill(&budget_ci->ir.msp430_irq_tasklet); 251 tasklet_kill(&budget_ci->ir.msp430_irq_tasklet);
256 252
257 ir_input_unregister(dev); 253 rc_unregister_device(budget_ci->ir.dev);
258} 254}
259 255
260static int ciintf_read_attribute_mem(struct dvb_ca_en50221 *ca, int slot, int address) 256static int ciintf_read_attribute_mem(struct dvb_ca_en50221 *ca, int slot, int address)