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/Kconfig5
-rw-r--r--drivers/media/dvb/ttpci/av7110.c15
-rw-r--r--drivers/media/dvb/ttpci/av7110_av.c9
-rw-r--r--drivers/media/dvb/ttpci/av7110_ca.c5
-rw-r--r--drivers/media/dvb/ttpci/av7110_hw.c2
-rw-r--r--drivers/media/dvb/ttpci/av7110_ir.c1
-rw-r--r--drivers/media/dvb/ttpci/av7110_v4l.c6
-rw-r--r--drivers/media/dvb/ttpci/budget-av.c8
-rw-r--r--drivers/media/dvb/ttpci/budget-ci.c88
-rw-r--r--drivers/media/dvb/ttpci/budget-core.c4
-rw-r--r--drivers/media/dvb/ttpci/budget-patch.c4
-rw-r--r--drivers/media/dvb/ttpci/budget.c2
12 files changed, 91 insertions, 58 deletions
diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig
index debea8d1d31c..9d83ced69dd6 100644
--- a/drivers/media/dvb/ttpci/Kconfig
+++ b/drivers/media/dvb/ttpci/Kconfig
@@ -89,16 +89,17 @@ 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
96 select DVB_STB0899 if !DVB_FE_CUSTOMISE 95 select DVB_STB0899 if !DVB_FE_CUSTOMISE
97 select DVB_STB6100 if !DVB_FE_CUSTOMISE 96 select DVB_STB6100 if !DVB_FE_CUSTOMISE
98 select DVB_LNBP21 if !DVB_FE_CUSTOMISE 97 select DVB_LNBP21 if !DVB_FE_CUSTOMISE
98 select DVB_STV0288 if !DVB_FE_CUSTOMISE
99 select DVB_STB6000 if !DVB_FE_CUSTOMISE
99 select DVB_TDA10023 if !DVB_FE_CUSTOMISE 100 select DVB_TDA10023 if !DVB_FE_CUSTOMISE
100 select MEDIA_TUNER_TDA827X if !MEDIA_TUNER_CUSTOMISE 101 select MEDIA_TUNER_TDA827X if !MEDIA_TUNER_CUSTOMISE
101 depends on VIDEO_IR 102 depends on RC_CORE
102 help 103 help
103 Support for simple SAA7146 based DVB cards 104 Support for simple SAA7146 based DVB cards
104 (so called Budget- or Nova-PCI cards) without onboard 105 (so called Budget- or Nova-PCI cards) without onboard
diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c
index a6be529eec5c..3d20719fce1a 100644
--- a/drivers/media/dvb/ttpci/av7110.c
+++ b/drivers/media/dvb/ttpci/av7110.c
@@ -26,7 +26,7 @@
26 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html 26 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
27 * 27 *
28 * 28 *
29 * the project's page is at http://www.linuxtv.org/dvb/ 29 * the project's page is at http://www.linuxtv.org/
30 */ 30 */
31 31
32 32
@@ -730,6 +730,7 @@ static const struct file_operations dvb_osd_fops = {
730 .unlocked_ioctl = dvb_generic_ioctl, 730 .unlocked_ioctl = dvb_generic_ioctl,
731 .open = dvb_generic_open, 731 .open = dvb_generic_open,
732 .release = dvb_generic_release, 732 .release = dvb_generic_release,
733 .llseek = noop_llseek,
733}; 734};
734 735
735static struct dvb_device dvbdev_osd = { 736static struct dvb_device dvbdev_osd = {
@@ -2290,12 +2291,7 @@ static int frontend_init(struct av7110 *av7110)
2290/* Budgetpatch note: 2291/* Budgetpatch note:
2291 * Original hardware design by Roberto Deza: 2292 * Original hardware design by Roberto Deza:
2292 * There is a DVB_Wiki at 2293 * There is a DVB_Wiki at
2293 * http://212.227.36.83/linuxtv/wiki/index.php/Main_Page 2294 * http://www.linuxtv.org/
2294 * where is described this 'DVB TT Budget Patch', on Card Modding:
2295 * http://212.227.36.83/linuxtv/wiki/index.php/DVB_TT_Budget_Patch
2296 * On the short description there is also a link to a external file,
2297 * with more details:
2298 * http://perso.wanadoo.es/jesussolano/Ttf_tsc1.zip
2299 * 2295 *
2300 * New software triggering design by Emard that works on 2296 * New software triggering design by Emard that works on
2301 * original Roberto Deza's hardware: 2297 * original Roberto Deza's hardware:
@@ -2336,7 +2332,7 @@ static int frontend_init(struct av7110 *av7110)
2336 * increment. That's how the 7146 is programmed to do event 2332 * increment. That's how the 7146 is programmed to do event
2337 * counting in this budget-patch.c 2333 * counting in this budget-patch.c
2338 * I *think* HPS setting has something to do with the phase 2334 * I *think* HPS setting has something to do with the phase
2339 * of HS but I cant be 100% sure in that. 2335 * of HS but I can't be 100% sure in that.
2340 * 2336 *
2341 * hardware debug note: a working budget card (including budget patch) 2337 * hardware debug note: a working budget card (including budget patch)
2342 * with vpeirq() interrupt setup in mode "0x90" (every 64K) will 2338 * with vpeirq() interrupt setup in mode "0x90" (every 64K) will
@@ -2476,7 +2472,6 @@ static int __devinit av7110_attach(struct saa7146_dev* dev,
2476 get recognized before the main driver is fully loaded */ 2472 get recognized before the main driver is fully loaded */
2477 saa7146_write(dev, GPIO_CTRL, 0x500000); 2473 saa7146_write(dev, GPIO_CTRL, 0x500000);
2478 2474
2479 av7110->i2c_adap.class = I2C_CLASS_TV_DIGITAL;
2480 strlcpy(av7110->i2c_adap.name, pci_ext->ext_priv, sizeof(av7110->i2c_adap.name)); 2475 strlcpy(av7110->i2c_adap.name, pci_ext->ext_priv, sizeof(av7110->i2c_adap.name));
2481 2476
2482 saa7146_i2c_adapter_prepare(dev, &av7110->i2c_adap, SAA7146_I2C_BUS_BIT_RATE_120); /* 275 kHz */ 2477 saa7146_i2c_adapter_prepare(dev, &av7110->i2c_adap, SAA7146_I2C_BUS_BIT_RATE_120); /* 275 kHz */
@@ -2890,7 +2885,7 @@ MODULE_DEVICE_TABLE(pci, pci_tbl);
2890 2885
2891 2886
2892static struct saa7146_extension av7110_extension_driver = { 2887static struct saa7146_extension av7110_extension_driver = {
2893 .name = "dvb", 2888 .name = "av7110",
2894 .flags = SAA7146_USE_I2C_IRQ, 2889 .flags = SAA7146_USE_I2C_IRQ,
2895 2890
2896 .module = THIS_MODULE, 2891 .module = THIS_MODULE,
diff --git a/drivers/media/dvb/ttpci/av7110_av.c b/drivers/media/dvb/ttpci/av7110_av.c
index 13efba942dac..952b33dbac4f 100644
--- a/drivers/media/dvb/ttpci/av7110_av.c
+++ b/drivers/media/dvb/ttpci/av7110_av.c
@@ -25,7 +25,7 @@
25 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html 25 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
26 * 26 *
27 * 27 *
28 * the project's page is at http://www.linuxtv.org/dvb/ 28 * the project's page is at http://www.linuxtv.org/
29 */ 29 */
30 30
31#include <linux/types.h> 31#include <linux/types.h>
@@ -245,8 +245,11 @@ int av7110_pes_play(void *dest, struct dvb_ringbuffer *buf, int dlen)
245 return -1; 245 return -1;
246 } 246 }
247 while (1) { 247 while (1) {
248 if ((len = dvb_ringbuffer_avail(buf)) < 6) 248 len = dvb_ringbuffer_avail(buf);
249 if (len < 6) {
250 wake_up(&buf->queue);
249 return -1; 251 return -1;
252 }
250 sync = DVB_RINGBUFFER_PEEK(buf, 0) << 24; 253 sync = DVB_RINGBUFFER_PEEK(buf, 0) << 24;
251 sync |= DVB_RINGBUFFER_PEEK(buf, 1) << 16; 254 sync |= DVB_RINGBUFFER_PEEK(buf, 1) << 16;
252 sync |= DVB_RINGBUFFER_PEEK(buf, 2) << 8; 255 sync |= DVB_RINGBUFFER_PEEK(buf, 2) << 8;
@@ -1521,6 +1524,7 @@ static const struct file_operations dvb_video_fops = {
1521 .open = dvb_video_open, 1524 .open = dvb_video_open,
1522 .release = dvb_video_release, 1525 .release = dvb_video_release,
1523 .poll = dvb_video_poll, 1526 .poll = dvb_video_poll,
1527 .llseek = noop_llseek,
1524}; 1528};
1525 1529
1526static struct dvb_device dvbdev_video = { 1530static struct dvb_device dvbdev_video = {
@@ -1539,6 +1543,7 @@ static const struct file_operations dvb_audio_fops = {
1539 .open = dvb_audio_open, 1543 .open = dvb_audio_open,
1540 .release = dvb_audio_release, 1544 .release = dvb_audio_release,
1541 .poll = dvb_audio_poll, 1545 .poll = dvb_audio_poll,
1546 .llseek = noop_llseek,
1542}; 1547};
1543 1548
1544static struct dvb_device dvbdev_audio = { 1549static struct dvb_device dvbdev_audio = {
diff --git a/drivers/media/dvb/ttpci/av7110_ca.c b/drivers/media/dvb/ttpci/av7110_ca.c
index 4eba35a018e3..9fc1dd0ba4c3 100644
--- a/drivers/media/dvb/ttpci/av7110_ca.c
+++ b/drivers/media/dvb/ttpci/av7110_ca.c
@@ -25,7 +25,7 @@
25 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html 25 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
26 * 26 *
27 * 27 *
28 * the project's page is at http://www.linuxtv.org/dvb/ 28 * the project's page is at http://www.linuxtv.org/
29 */ 29 */
30 30
31#include <linux/kernel.h> 31#include <linux/kernel.h>
@@ -277,7 +277,7 @@ static int dvb_ca_ioctl(struct file *file, unsigned int cmd, void *parg)
277 { 277 {
278 ca_slot_info_t *info=(ca_slot_info_t *)parg; 278 ca_slot_info_t *info=(ca_slot_info_t *)parg;
279 279
280 if (info->num > 1) 280 if (info->num < 0 || info->num > 1)
281 return -EINVAL; 281 return -EINVAL;
282 av7110->ci_slot[info->num].num = info->num; 282 av7110->ci_slot[info->num].num = info->num;
283 av7110->ci_slot[info->num].type = FW_CI_LL_SUPPORT(av7110->arm_app) ? 283 av7110->ci_slot[info->num].type = FW_CI_LL_SUPPORT(av7110->arm_app) ?
@@ -353,6 +353,7 @@ static const struct file_operations dvb_ca_fops = {
353 .open = dvb_ca_open, 353 .open = dvb_ca_open,
354 .release = dvb_generic_release, 354 .release = dvb_generic_release,
355 .poll = dvb_ca_poll, 355 .poll = dvb_ca_poll,
356 .llseek = default_llseek,
356}; 357};
357 358
358static struct dvb_device dvbdev_ca = { 359static struct dvb_device dvbdev_ca = {
diff --git a/drivers/media/dvb/ttpci/av7110_hw.c b/drivers/media/dvb/ttpci/av7110_hw.c
index e162691b515d..f1cbfe526989 100644
--- a/drivers/media/dvb/ttpci/av7110_hw.c
+++ b/drivers/media/dvb/ttpci/av7110_hw.c
@@ -22,7 +22,7 @@
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html 23 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
24 * 24 *
25 * the project's page is at http://www.linuxtv.org/dvb/ 25 * the project's page is at http://www.linuxtv.org/
26 */ 26 */
27 27
28/* for debugging ARM communication: */ 28/* for debugging ARM communication: */
diff --git a/drivers/media/dvb/ttpci/av7110_ir.c b/drivers/media/dvb/ttpci/av7110_ir.c
index b070e88d8c6b..908f272fe26c 100644
--- a/drivers/media/dvb/ttpci/av7110_ir.c
+++ b/drivers/media/dvb/ttpci/av7110_ir.c
@@ -312,6 +312,7 @@ static ssize_t av7110_ir_proc_write(struct file *file, const char __user *buffer
312static const struct file_operations av7110_ir_proc_fops = { 312static const struct file_operations av7110_ir_proc_fops = {
313 .owner = THIS_MODULE, 313 .owner = THIS_MODULE,
314 .write = av7110_ir_proc_write, 314 .write = av7110_ir_proc_write,
315 .llseek = noop_llseek,
315}; 316};
316 317
317/* interrupt handler */ 318/* interrupt handler */
diff --git a/drivers/media/dvb/ttpci/av7110_v4l.c b/drivers/media/dvb/ttpci/av7110_v4l.c
index 8986d967d2f4..cdd31cae46c4 100644
--- a/drivers/media/dvb/ttpci/av7110_v4l.c
+++ b/drivers/media/dvb/ttpci/av7110_v4l.c
@@ -22,7 +22,7 @@
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html 23 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
24 * 24 *
25 * the project's page is at http://www.linuxtv.org/dvb/ 25 * the project's page is at http://www.linuxtv.org/
26 */ 26 */
27 27
28#include <linux/kernel.h> 28#include <linux/kernel.h>
@@ -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 983672aa2450..e957d7690bcc 100644
--- a/drivers/media/dvb/ttpci/budget-av.c
+++ b/drivers/media/dvb/ttpci/budget-av.c
@@ -30,7 +30,7 @@
30 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html 30 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
31 * 31 *
32 * 32 *
33 * the project's page is at http://www.linuxtv.org/dvb/ 33 * the project's page is at http://www.linuxtv.org/
34 */ 34 */
35 35
36#include "budget.h" 36#include "budget.h"
@@ -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 13ac9e3ab121..926f299b5225 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -26,16 +26,15 @@
26 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html 26 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
27 * 27 *
28 * 28 *
29 * the project's page is at http://www.linuxtv.org/dvb/ 29 * the project's page is at http://www.linuxtv.org/
30 */ 30 */
31 31
32#include <linux/module.h> 32#include <linux/module.h>
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
@@ -53,6 +52,7 @@
53#include "bsru6.h" 52#include "bsru6.h"
54#include "tda1002x.h" 53#include "tda1002x.h"
55#include "tda827x.h" 54#include "tda827x.h"
55#include "bsbe1-d01a.h"
56 56
57#define MODULE_NAME "budget_ci" 57#define MODULE_NAME "budget_ci"
58 58
@@ -96,13 +96,14 @@ MODULE_PARM_DESC(ir_debug, "enable debugging information for IR decoding");
96DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); 96DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
97 97
98struct budget_ci_ir { 98struct budget_ci_ir {
99 struct input_dev *dev; 99 struct rc_dev *dev;
100 struct tasklet_struct msp430_irq_tasklet; 100 struct tasklet_struct msp430_irq_tasklet;
101 char name[72]; /* 40 + 32 for (struct saa7146_dev).name */ 101 char name[72]; /* 40 + 32 for (struct saa7146_dev).name */
102 char phys[32]; 102 char phys[32];
103 int rc5_device; 103 int rc5_device;
104 u32 ir_key; 104 u32 ir_key;
105 bool have_command; 105 bool have_command;
106 bool full_rc5; /* Outputs a full RC5 code */
106}; 107};
107 108
108struct budget_ci { 109struct budget_ci {
@@ -118,7 +119,7 @@ struct budget_ci {
118static void msp430_ir_interrupt(unsigned long data) 119static void msp430_ir_interrupt(unsigned long data)
119{ 120{
120 struct budget_ci *budget_ci = (struct budget_ci *) data; 121 struct budget_ci *budget_ci = (struct budget_ci *) data;
121 struct input_dev *dev = budget_ci->ir.dev; 122 struct rc_dev *dev = budget_ci->ir.dev;
122 u32 command = ttpci_budget_debiread(&budget_ci->budget, DEBINOSWAP, DEBIADDR_IR, 2, 1, 0) >> 8; 123 u32 command = ttpci_budget_debiread(&budget_ci->budget, DEBINOSWAP, DEBIADDR_IR, 2, 1, 0) >> 8;
123 124
124 /* 125 /*
@@ -155,24 +156,29 @@ static void msp430_ir_interrupt(unsigned long data)
155 return; 156 return;
156 budget_ci->ir.have_command = false; 157 budget_ci->ir.have_command = false;
157 158
158 /* FIXME: We should generate complete scancodes with device info */
159 if (budget_ci->ir.rc5_device != IR_DEVICE_ANY && 159 if (budget_ci->ir.rc5_device != IR_DEVICE_ANY &&
160 budget_ci->ir.rc5_device != (command & 0x1f)) 160 budget_ci->ir.rc5_device != (command & 0x1f))
161 return; 161 return;
162 162
163 ir_keydown(dev, budget_ci->ir.ir_key, (command & 0x20) ? 1 : 0); 163 if (budget_ci->ir.full_rc5) {
164 rc_keydown(dev,
165 budget_ci->ir.rc5_device <<8 | budget_ci->ir.ir_key,
166 (command & 0x20) ? 1 : 0);
167 return;
168 }
169
170 /* FIXME: We should generate complete scancodes for all devices */
171 rc_keydown(dev, budget_ci->ir.ir_key, (command & 0x20) ? 1 : 0);
164} 172}
165 173
166static int msp430_ir_init(struct budget_ci *budget_ci) 174static int msp430_ir_init(struct budget_ci *budget_ci)
167{ 175{
168 struct saa7146_dev *saa = budget_ci->budget.dev; 176 struct saa7146_dev *saa = budget_ci->budget.dev;
169 struct input_dev *input_dev = budget_ci->ir.dev; 177 struct rc_dev *dev;
170 int error; 178 int error;
171 char *ir_codes = NULL;
172 179
173 180 dev = rc_allocate_device();
174 budget_ci->ir.dev = input_dev = input_allocate_device(); 181 if (!dev) {
175 if (!input_dev) {
176 printk(KERN_ERR "budget_ci: IR interface initialisation failed\n"); 182 printk(KERN_ERR "budget_ci: IR interface initialisation failed\n");
177 return -ENOMEM; 183 return -ENOMEM;
178 } 184 }
@@ -182,19 +188,20 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
182 snprintf(budget_ci->ir.phys, sizeof(budget_ci->ir.phys), 188 snprintf(budget_ci->ir.phys, sizeof(budget_ci->ir.phys),
183 "pci-%s/ir0", pci_name(saa->pci)); 189 "pci-%s/ir0", pci_name(saa->pci));
184 190
185 input_dev->name = budget_ci->ir.name; 191 dev->driver_name = MODULE_NAME;
186 192 dev->input_name = budget_ci->ir.name;
187 input_dev->phys = budget_ci->ir.phys; 193 dev->input_phys = budget_ci->ir.phys;
188 input_dev->id.bustype = BUS_PCI; 194 dev->input_id.bustype = BUS_PCI;
189 input_dev->id.version = 1; 195 dev->input_id.version = 1;
196 dev->scanmask = 0xff;
190 if (saa->pci->subsystem_vendor) { 197 if (saa->pci->subsystem_vendor) {
191 input_dev->id.vendor = saa->pci->subsystem_vendor; 198 dev->input_id.vendor = saa->pci->subsystem_vendor;
192 input_dev->id.product = saa->pci->subsystem_device; 199 dev->input_id.product = saa->pci->subsystem_device;
193 } else { 200 } else {
194 input_dev->id.vendor = saa->pci->vendor; 201 dev->input_id.vendor = saa->pci->vendor;
195 input_dev->id.product = saa->pci->device; 202 dev->input_id.product = saa->pci->device;
196 } 203 }
197 input_dev->dev.parent = &saa->pci->dev; 204 dev->dev.parent = &saa->pci->dev;
198 205
199 if (rc5_device < 0) 206 if (rc5_device < 0)
200 budget_ci->ir.rc5_device = IR_DEVICE_ANY; 207 budget_ci->ir.rc5_device = IR_DEVICE_ANY;
@@ -208,7 +215,8 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
208 case 0x1011: 215 case 0x1011:
209 case 0x1012: 216 case 0x1012:
210 /* The hauppauge keymap is a superset of these remotes */ 217 /* The hauppauge keymap is a superset of these remotes */
211 ir_codes = RC_MAP_HAUPPAUGE_NEW; 218 dev->map_name = RC_MAP_HAUPPAUGE;
219 budget_ci->ir.full_rc5 = true;
212 220
213 if (rc5_device < 0) 221 if (rc5_device < 0)
214 budget_ci->ir.rc5_device = 0x1f; 222 budget_ci->ir.rc5_device = 0x1f;
@@ -217,24 +225,24 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
217 case 0x1017: 225 case 0x1017:
218 case 0x1019: 226 case 0x1019:
219 case 0x101a: 227 case 0x101a:
228 case 0x101b:
220 /* for the Technotrend 1500 bundled remote */ 229 /* for the Technotrend 1500 bundled remote */
221 ir_codes = RC_MAP_TT_1500; 230 dev->map_name = RC_MAP_TT_1500;
222 break; 231 break;
223 default: 232 default:
224 /* unknown remote */ 233 /* unknown remote */
225 ir_codes = RC_MAP_BUDGET_CI_OLD; 234 dev->map_name = RC_MAP_BUDGET_CI_OLD;
226 break; 235 break;
227 } 236 }
228 237
229 error = ir_input_register(input_dev, ir_codes, NULL, MODULE_NAME); 238 error = rc_register_device(dev);
230 if (error) { 239 if (error) {
231 printk(KERN_ERR "budget_ci: could not init driver for IR device (code %d)\n", error); 240 printk(KERN_ERR "budget_ci: could not init driver for IR device (code %d)\n", error);
241 rc_free_device(dev);
232 return error; 242 return error;
233 } 243 }
234 244
235 /* note: these must be after input_register_device */ 245 budget_ci->ir.dev = dev;
236 input_dev->rep[REP_DELAY] = 400;
237 input_dev->rep[REP_PERIOD] = 250;
238 246
239 tasklet_init(&budget_ci->ir.msp430_irq_tasklet, msp430_ir_interrupt, 247 tasklet_init(&budget_ci->ir.msp430_irq_tasklet, msp430_ir_interrupt,
240 (unsigned long) budget_ci); 248 (unsigned long) budget_ci);
@@ -248,13 +256,12 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
248static void msp430_ir_deinit(struct budget_ci *budget_ci) 256static void msp430_ir_deinit(struct budget_ci *budget_ci)
249{ 257{
250 struct saa7146_dev *saa = budget_ci->budget.dev; 258 struct saa7146_dev *saa = budget_ci->budget.dev;
251 struct input_dev *dev = budget_ci->ir.dev;
252 259
253 SAA7146_IER_DISABLE(saa, MASK_06); 260 SAA7146_IER_DISABLE(saa, MASK_06);
254 saa7146_setgpio(saa, 3, SAA7146_GPIO_INPUT); 261 saa7146_setgpio(saa, 3, SAA7146_GPIO_INPUT);
255 tasklet_kill(&budget_ci->ir.msp430_irq_tasklet); 262 tasklet_kill(&budget_ci->ir.msp430_irq_tasklet);
256 263
257 ir_input_unregister(dev); 264 rc_unregister_device(budget_ci->ir.dev);
258} 265}
259 266
260static int ciintf_read_attribute_mem(struct dvb_ca_en50221 *ca, int slot, int address) 267static int ciintf_read_attribute_mem(struct dvb_ca_en50221 *ca, int slot, int address)
@@ -1383,6 +1390,23 @@ static void frontend_init(struct budget_ci *budget_ci)
1383 } 1390 }
1384 break; 1391 break;
1385 1392
1393 case 0x101b: /* TT S-1500B (BSBE1-D01A - STV0288/STB6000/LNBP21) */
1394 budget_ci->budget.dvb_frontend = dvb_attach(stv0288_attach, &stv0288_bsbe1_d01a_config, &budget_ci->budget.i2c_adap);
1395 if (budget_ci->budget.dvb_frontend) {
1396 if (dvb_attach(stb6000_attach, budget_ci->budget.dvb_frontend, 0x63, &budget_ci->budget.i2c_adap)) {
1397 if (!dvb_attach(lnbp21_attach, budget_ci->budget.dvb_frontend, &budget_ci->budget.i2c_adap, 0, 0)) {
1398 printk(KERN_ERR "%s: No LNBP21 found!\n", __func__);
1399 dvb_frontend_detach(budget_ci->budget.dvb_frontend);
1400 budget_ci->budget.dvb_frontend = NULL;
1401 }
1402 } else {
1403 printk(KERN_ERR "%s: No STB6000 found!\n", __func__);
1404 dvb_frontend_detach(budget_ci->budget.dvb_frontend);
1405 budget_ci->budget.dvb_frontend = NULL;
1406 }
1407 }
1408 break;
1409
1386 case 0x1019: // TT S2-3200 PCI 1410 case 0x1019: // TT S2-3200 PCI
1387 /* 1411 /*
1388 * NOTE! on some STB0899 versions, the internal PLL takes a longer time 1412 * NOTE! on some STB0899 versions, the internal PLL takes a longer time
@@ -1513,6 +1537,7 @@ MAKE_BUDGET_INFO(ttbtci, "TT-Budget-T-CI PCI", BUDGET_TT);
1513MAKE_BUDGET_INFO(ttbcci, "TT-Budget-C-CI PCI", BUDGET_TT); 1537MAKE_BUDGET_INFO(ttbcci, "TT-Budget-C-CI PCI", BUDGET_TT);
1514MAKE_BUDGET_INFO(ttc1501, "TT-Budget C-1501 PCI", BUDGET_TT); 1538MAKE_BUDGET_INFO(ttc1501, "TT-Budget C-1501 PCI", BUDGET_TT);
1515MAKE_BUDGET_INFO(tt3200, "TT-Budget S2-3200 PCI", BUDGET_TT); 1539MAKE_BUDGET_INFO(tt3200, "TT-Budget S2-3200 PCI", BUDGET_TT);
1540MAKE_BUDGET_INFO(ttbs1500b, "TT-Budget S-1500B PCI", BUDGET_TT);
1516 1541
1517static struct pci_device_id pci_tbl[] = { 1542static struct pci_device_id pci_tbl[] = {
1518 MAKE_EXTENSION_PCI(ttbci, 0x13c2, 0x100c), 1543 MAKE_EXTENSION_PCI(ttbci, 0x13c2, 0x100c),
@@ -1523,6 +1548,7 @@ static struct pci_device_id pci_tbl[] = {
1523 MAKE_EXTENSION_PCI(ttbs2, 0x13c2, 0x1017), 1548 MAKE_EXTENSION_PCI(ttbs2, 0x13c2, 0x1017),
1524 MAKE_EXTENSION_PCI(ttc1501, 0x13c2, 0x101a), 1549 MAKE_EXTENSION_PCI(ttc1501, 0x13c2, 0x101a),
1525 MAKE_EXTENSION_PCI(tt3200, 0x13c2, 0x1019), 1550 MAKE_EXTENSION_PCI(tt3200, 0x13c2, 0x1019),
1551 MAKE_EXTENSION_PCI(ttbs1500b, 0x13c2, 0x101b),
1526 { 1552 {
1527 .vendor = 0, 1553 .vendor = 0,
1528 } 1554 }
diff --git a/drivers/media/dvb/ttpci/budget-core.c b/drivers/media/dvb/ttpci/budget-core.c
index ba18e56d5f11..37666d4edab6 100644
--- a/drivers/media/dvb/ttpci/budget-core.c
+++ b/drivers/media/dvb/ttpci/budget-core.c
@@ -31,7 +31,7 @@
31 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html 31 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
32 * 32 *
33 * 33 *
34 * the project's page is at http://www.linuxtv.org/dvb/ 34 * the project's page is at http://www.linuxtv.org/
35 */ 35 */
36 36
37 37
@@ -495,8 +495,6 @@ int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,
495 if (bi->type != BUDGET_FS_ACTIVY) 495 if (bi->type != BUDGET_FS_ACTIVY)
496 saa7146_write(dev, GPIO_CTRL, 0x500000); /* GPIO 3 = 1 */ 496 saa7146_write(dev, GPIO_CTRL, 0x500000); /* GPIO 3 = 1 */
497 497
498 budget->i2c_adap.class = I2C_CLASS_TV_DIGITAL;
499
500 strlcpy(budget->i2c_adap.name, budget->card->name, sizeof(budget->i2c_adap.name)); 498 strlcpy(budget->i2c_adap.name, budget->card->name, sizeof(budget->i2c_adap.name));
501 499
502 saa7146_i2c_adapter_prepare(dev, &budget->i2c_adap, SAA7146_I2C_BUS_BIT_RATE_120); 500 saa7146_i2c_adapter_prepare(dev, &budget->i2c_adap, SAA7146_I2C_BUS_BIT_RATE_120);
diff --git a/drivers/media/dvb/ttpci/budget-patch.c b/drivers/media/dvb/ttpci/budget-patch.c
index 9c92f9ddd223..3395d1a90516 100644
--- a/drivers/media/dvb/ttpci/budget-patch.c
+++ b/drivers/media/dvb/ttpci/budget-patch.c
@@ -27,7 +27,7 @@
27 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html 27 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
28 * 28 *
29 * 29 *
30 * the project's page is at http://www.linuxtv.org/dvb/ 30 * the project's page is at http://www.linuxtv.org/
31 */ 31 */
32 32
33#include "av7110.h" 33#include "av7110.h"
@@ -539,7 +539,7 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte
539** increment. That's how the 7146 is programmed to do event 539** increment. That's how the 7146 is programmed to do event
540** counting in this budget-patch.c 540** counting in this budget-patch.c
541** I *think* HPS setting has something to do with the phase 541** I *think* HPS setting has something to do with the phase
542** of HS but I cant be 100% sure in that. 542** of HS but I can't be 100% sure in that.
543 543
544** hardware debug note: a working budget card (including budget patch) 544** hardware debug note: a working budget card (including budget patch)
545** with vpeirq() interrupt setup in mode "0x90" (every 64K) will 545** with vpeirq() interrupt setup in mode "0x90" (every 64K) will
diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c
index 874a10a9d493..d238fb9371a7 100644
--- a/drivers/media/dvb/ttpci/budget.c
+++ b/drivers/media/dvb/ttpci/budget.c
@@ -31,7 +31,7 @@
31 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html 31 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
32 * 32 *
33 * 33 *
34 * the project's page is at http://www.linuxtv.org/dvb/ 34 * the project's page is at http://www.linuxtv.org/
35 */ 35 */
36 36
37#include "budget.h" 37#include "budget.h"