From ecba77f246011344f0b8f46eb25ae01ab4ae282d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20H=E4rdeman?= Date: Fri, 27 Oct 2006 20:56:51 -0300 Subject: V4L/DVB (4785): Budget-ci: Change DEBIADDR_IR to a safer default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The IR chip has no address decoding, so the IR data is always present in the high byte when doing a read from the saa7146 chip. This means that the DEBI address used is irrelevant to the IR decoding logic. DEBI addresses 0x1XXX are mapped to the registers on the CI module itself, but only the lowest two bits are actually used (see EN50221, section A.2.2.1), meaning that 0x1234 is equivalent to 0x1000 which maps to register 0 (the data register). A read from the data register is supposed to be preceded by a read from the size register, so some CI modules will be confused (the AlphaCrypt CAM will hang completely). The attached patch changes the address used when reading the IR data to use 0x4000 instead. This is the CI version address, which is a safer default, works with the AlphaCrypt CAM and matches the behaviour of the Windows driver (AFAIK). Signed-off-by: David Härdeman Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-ci.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 2a2e9b40061..ac0cecb14dc 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -46,7 +46,14 @@ #include "bsbe1.h" #include "bsru6.h" -#define DEBIADDR_IR 0x1234 +/* + * Regarding DEBIADDR_IR: + * Some CI modules hang if random addresses are read. + * Using address 0x4000 for the IR read means that we + * use the same address as for CI version, which should + * be a safe default. + */ +#define DEBIADDR_IR 0x4000 #define DEBIADDR_CICONTROL 0x0000 #define DEBIADDR_CIVERSION 0x4000 #define DEBIADDR_IO 0x1000 -- cgit v1.2.3 From 9e741b74afc975da51ec60c5a8147b2ebcf7e33a Mon Sep 17 00:00:00 2001 From: Raymond Mantchala Date: Mon, 30 Oct 2006 23:20:50 -0300 Subject: V4L/DVB (4787): Budget-ci: Inversion setting fixed for Technotrend 1500 T Technotrend 1500 T card have "inverted inversion". This patch fixes that. Many thanks to Martin Zwickel from Technotrend for his confirmation and correction proposal. Signed-off-by: Raymond Mantchala Signed-off-by: Perceval Anichini Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-ci.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index ac0cecb14dc..cd5ec489af1 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -1035,6 +1035,7 @@ static void frontend_init(struct budget_ci *budget_ci) case 0x1012: // TT DVB-T CI budget (tda10046/Philips tdm1316l(tda6651tt)) budget_ci->tuner_pll_address = 0x60; + philips_tdm1316l_config.invert = 1; budget_ci->budget.dvb_frontend = dvb_attach(tda10046_attach, &philips_tdm1316l_config, &budget_ci->budget.i2c_adap); if (budget_ci->budget.dvb_frontend) { -- cgit v1.2.3 From c4e46b9567669eb5e1182d4b12c2d889ce27da64 Mon Sep 17 00:00:00 2001 From: Andrew de Quincey Date: Thu, 16 Nov 2006 18:31:04 -0300 Subject: V4L/DVB (4831): Fix tuning on older budget DVBS cards. Fixes to DISEQC on these cards inadvertently broke normal tone/voltage signalling. This restores the necessary function. Signed-off-by: Andrew de Quincey Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c index e58f0391e9d..e28617bd564 100644 --- a/drivers/media/dvb/ttpci/budget.c +++ b/drivers/media/dvb/ttpci/budget.c @@ -382,6 +382,7 @@ static void frontend_init(struct budget *budget) if (budget->dvb_frontend) { budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; budget->dvb_frontend->tuner_priv = &budget->i2c_adap; + budget->dvb_frontend->ops.set_tone = budget_set_tone; break; } break; -- cgit v1.2.3 From bc495b66d048d64a9b8aeb49ca8405f4687ca123 Mon Sep 17 00:00:00 2001 From: Oliver Endriss Date: Sun, 19 Nov 2006 02:15:37 -0300 Subject: V4L/DVB (4840): Budget: diseqc_method module parameter for cards with subsystem-id 13c2:1003 New module parameter diseqc_method for cards with subsystem-id 13c2:1003. - 0: unreliable method, can be used by all board revisions (default) - 1: reliable method, works for newer board layouts only The parameter has no effect for cards with other subsystem-ids. Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c index e28617bd564..56f1c80defc 100644 --- a/drivers/media/dvb/ttpci/budget.c +++ b/drivers/media/dvb/ttpci/budget.c @@ -46,6 +46,10 @@ #include "lnbp21.h" #include "bsru6.h" +static int diseqc_method; +module_param(diseqc_method, int, 0444); +MODULE_PARM_DESC(diseqc_method, "Select DiSEqC method for subsystem id 13c2:1003, 0: default, 1: more reliable (for newer revisions only)"); + static void Set22K (struct budget *budget, int state) { struct saa7146_dev *dev=budget->dev; @@ -382,7 +386,11 @@ static void frontend_init(struct budget *budget) if (budget->dvb_frontend) { budget->dvb_frontend->ops.tuner_ops.set_params = alps_bsru6_tuner_set_params; budget->dvb_frontend->tuner_priv = &budget->i2c_adap; - budget->dvb_frontend->ops.set_tone = budget_set_tone; + if (budget->dev->pci->subsystem_device == 0x1003 && diseqc_method == 0) { + budget->dvb_frontend->ops.diseqc_send_master_cmd = budget_diseqc_send_master_cmd; + budget->dvb_frontend->ops.diseqc_send_burst = budget_diseqc_send_burst; + budget->dvb_frontend->ops.set_tone = budget_set_tone; + } break; } break; -- cgit v1.2.3 From 0779bf2d2ecc4d9b1e9437ae659f50e6776a7666 Mon Sep 17 00:00:00 2001 From: Matt LaPlante Date: Thu, 30 Nov 2006 05:24:39 +0100 Subject: Fix misc .c/.h comment typos Fix various .c/.h typos in comments (no code changes). Signed-off-by: Matt LaPlante Signed-off-by: Adrian Bunk --- drivers/media/dvb/ttpci/budget-patch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-patch.c b/drivers/media/dvb/ttpci/budget-patch.c index fc1267b8c89..9a155396d6a 100644 --- a/drivers/media/dvb/ttpci/budget-patch.c +++ b/drivers/media/dvb/ttpci/budget-patch.c @@ -500,14 +500,14 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte /* New design (By Emard) ** this rps1 code will copy internal HS event to GPIO3 pin. -** GPIO3 is in budget-patch hardware connectd to port B VSYNC +** GPIO3 is in budget-patch hardware connected to port B VSYNC ** HS is an internal event of 7146, accessible with RPS ** and temporarily raised high every n lines ** (n in defined in the RPS_THRESH1 counter threshold) ** I think HS is raised high on the beginning of the n-th line ** and remains high until this n-th line that triggered -** it is completely received. When the receiption of n-th line +** it is completely received. When the reception of n-th line ** ends, HS is lowered. ** To transmit data over DMA, 7146 needs changing state at @@ -541,7 +541,7 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte ** hardware debug note: a working budget card (including budget patch) ** with vpeirq() interrupt setup in mode "0x90" (every 64K) will ** generate 3 interrupts per 25-Hz DMA frame of 2*188*512 bytes -** and that means 3*25=75 Hz of interrupt freqency, as seen by +** and that means 3*25=75 Hz of interrupt frequency, as seen by ** watch cat /proc/interrupts ** ** If this frequency is 3x lower (and data received in the DMA @@ -550,7 +550,7 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte ** this means VSYNC line is not connected in the hardware. ** (check soldering pcb and pins) ** The same behaviour of missing VSYNC can be duplicated on budget -** cards, by seting DD1_INIT trigger mode 7 in 3rd nibble. +** cards, by setting DD1_INIT trigger mode 7 in 3rd nibble. */ // Setup RPS1 "program" (p35) -- cgit v1.2.3 From c01d1e486a0fc489a495ea304616484bcbcf0018 Mon Sep 17 00:00:00 2001 From: Thomas Hamm Date: Fri, 17 Nov 2006 07:12:58 -0300 Subject: V4L/DVB (4833): Patch for SATELCO EasyWatch PCI (DVB-C) Add support for Satelco EasyWatch PCI DVBC cards Signed-off-by: Thomas Hamm Signed-off-by: Andrew de Quincey Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-av.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c index 2235ff8b8a1..c7312420c37 100644 --- a/drivers/media/dvb/ttpci/budget-av.c +++ b/drivers/media/dvb/ttpci/budget-av.c @@ -914,6 +914,7 @@ static u8 read_pwm(struct budget_av *budget_av) #define SUBID_DVBS_TV_STAR_CI 0x0016 #define SUBID_DVBS_EASYWATCH_1 0x001a #define SUBID_DVBS_EASYWATCH 0x001e +#define SUBID_DVBC_EASYWATCH 0x002a #define SUBID_DVBC_KNC1 0x0020 #define SUBID_DVBC_KNC1_PLUS 0x0021 #define SUBID_DVBC_CINERGY1200 0x1156 @@ -952,6 +953,7 @@ static void frontend_init(struct budget_av *budget_av) case SUBID_DVBS_KNC1_PLUS: case SUBID_DVBC_KNC1_PLUS: case SUBID_DVBT_KNC1_PLUS: + case SUBID_DVBC_EASYWATCH: saa7146_setgpio(saa, 3, SAA7146_GPIO_OUTHI); break; } @@ -1006,6 +1008,7 @@ static void frontend_init(struct budget_av *budget_av) case SUBID_DVBC_KNC1: case SUBID_DVBC_KNC1_PLUS: case SUBID_DVBC_CINERGY1200: + case SUBID_DVBC_EASYWATCH: budget_av->reinitialise_demod = 1; fe = dvb_attach(tda10021_attach, &philips_cu1216_config, &budget_av->budget.i2c_adap, @@ -1242,6 +1245,7 @@ MAKE_BUDGET_INFO(knc1t, "KNC1 DVB-T", BUDGET_KNC1T); MAKE_BUDGET_INFO(kncxs, "KNC TV STAR DVB-S", BUDGET_TVSTAR); MAKE_BUDGET_INFO(satewpls, "Satelco EasyWatch DVB-S light", BUDGET_TVSTAR); MAKE_BUDGET_INFO(satewpls1, "Satelco EasyWatch DVB-S light", BUDGET_KNC1S); +MAKE_BUDGET_INFO(satewplc, "Satelco EasyWatch DVB-C", BUDGET_KNC1CP); MAKE_BUDGET_INFO(knc1sp, "KNC1 DVB-S Plus", BUDGET_KNC1SP); MAKE_BUDGET_INFO(knc1cp, "KNC1 DVB-C Plus", BUDGET_KNC1CP); MAKE_BUDGET_INFO(knc1tp, "KNC1 DVB-T Plus", BUDGET_KNC1TP); @@ -1260,6 +1264,7 @@ static struct pci_device_id pci_tbl[] = { MAKE_EXTENSION_PCI(kncxs, 0x1894, 0x0016), MAKE_EXTENSION_PCI(satewpls, 0x1894, 0x001e), MAKE_EXTENSION_PCI(satewpls1, 0x1894, 0x001a), + MAKE_EXTENSION_PCI(satewplc, 0x1894, 0x002a), MAKE_EXTENSION_PCI(knc1c, 0x1894, 0x0020), MAKE_EXTENSION_PCI(knc1cp, 0x1894, 0x0021), MAKE_EXTENSION_PCI(knc1t, 0x1894, 0x0030), -- cgit v1.2.3 From b07b4783fb30dee8c542fc76ed8993108d46d6aa Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Mon, 20 Nov 2006 10:23:04 -0300 Subject: V4L/DVB (4854): Handle errors from input_register_device() Also sprinkled some input_sync() throughout the code. Acked-by: Ricardo Cerqueira Acked-by: Oliver Endriss Acked-by: Andrew de Quincey Signed-off-by: Dmitry Torokhov Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/av7110_ir.c | 25 +++++++++++++++------- drivers/media/dvb/ttpci/budget-ci.c | 42 ++++++++++++++++++++++--------------- 2 files changed, 42 insertions(+), 25 deletions(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/av7110_ir.c b/drivers/media/dvb/ttpci/av7110_ir.c index d54bbcdde2c..e4544ea2b89 100644 --- a/drivers/media/dvb/ttpci/av7110_ir.c +++ b/drivers/media/dvb/ttpci/av7110_ir.c @@ -48,7 +48,8 @@ static void av7110_emit_keyup(unsigned long data) if (!data || !test_bit(data, input_dev->key)) return; - input_event(input_dev, EV_KEY, data, !!0); + input_report_key(input_dev, data, 0); + input_sync(input_dev); } @@ -115,14 +116,17 @@ static void av7110_emit_key(unsigned long parm) del_timer(&keyup_timer); if (keyup_timer.data != keycode || new_toggle != old_toggle) { delay_timer_finished = 0; - input_event(input_dev, EV_KEY, keyup_timer.data, !!0); - input_event(input_dev, EV_KEY, keycode, !0); - } else - if (delay_timer_finished) - input_event(input_dev, EV_KEY, keycode, 2); + input_event(input_dev, EV_KEY, keyup_timer.data, 0); + input_event(input_dev, EV_KEY, keycode, 1); + input_sync(input_dev); + } else if (delay_timer_finished) { + input_event(input_dev, EV_KEY, keycode, 2); + input_sync(input_dev); + } } else { delay_timer_finished = 0; - input_event(input_dev, EV_KEY, keycode, !0); + input_event(input_dev, EV_KEY, keycode, 1); + input_sync(input_dev); } keyup_timer.expires = jiffies + UP_TIMEOUT; @@ -211,6 +215,7 @@ static void ir_handler(struct av7110 *av7110, u32 ircom) int __devinit av7110_ir_init(struct av7110 *av7110) { static struct proc_dir_entry *e; + int err; if (av_cnt >= sizeof av_list/sizeof av_list[0]) return -ENOSPC; @@ -231,7 +236,11 @@ int __devinit av7110_ir_init(struct av7110 *av7110) set_bit(EV_KEY, input_dev->evbit); set_bit(EV_REP, input_dev->evbit); input_register_keys(); - input_register_device(input_dev); + err = input_register_device(input_dev); + if (err) { + input_free_device(input_dev); + return err; + } input_dev->timer.function = input_repeat_key; e = create_proc_entry("av7110_ir", S_IFREG | S_IRUGO | S_IWUSR, NULL); diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index cd5ec489af1..25d0dfc1f58 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -143,14 +143,14 @@ static void msp430_ir_debounce(unsigned long data) struct input_dev *dev = (struct input_dev *) data; if (dev->rep[0] == 0 || dev->rep[0] == ~0) { - input_event(dev, EV_KEY, key_map[dev->repeat_key], !!0); - return; + input_event(dev, EV_KEY, key_map[dev->repeat_key], 0); + } else { + dev->rep[0] = 0; + dev->timer.expires = jiffies + HZ * 350 / 1000; + add_timer(&dev->timer); + input_event(dev, EV_KEY, key_map[dev->repeat_key], 2); /* REPEAT */ } - - dev->rep[0] = 0; - dev->timer.expires = jiffies + HZ * 350 / 1000; - add_timer(&dev->timer); - input_event(dev, EV_KEY, key_map[dev->repeat_key], 2); /* REPEAT */ + input_sync(dev); } static void msp430_ir_interrupt(unsigned long data) @@ -169,7 +169,7 @@ static void msp430_ir_interrupt(unsigned long data) return; } del_timer(&dev->timer); - input_event(dev, EV_KEY, key_map[dev->repeat_key], !!0); + input_event(dev, EV_KEY, key_map[dev->repeat_key], 0); } if (!key_map[code]) { @@ -177,15 +177,14 @@ static void msp430_ir_interrupt(unsigned long data) return; } + input_event(dev, EV_KEY, key_map[code], 1); + input_sync(dev); + /* initialize debounce and repeat */ dev->repeat_key = code; /* Zenith remote _always_ sends 2 sequences */ dev->rep[0] = ~0; - /* 350 milliseconds */ - dev->timer.expires = jiffies + HZ * 350 / 1000; - /* MAKE */ - input_event(dev, EV_KEY, key_map[code], !0); - add_timer(&dev->timer); + mod_timer(&dev->timer, jiffies + msecs_to_jiffies(350)); } } @@ -194,8 +193,9 @@ static int msp430_ir_init(struct budget_ci *budget_ci) struct saa7146_dev *saa = budget_ci->budget.dev; struct input_dev *input_dev; int i; + int err; - budget_ci->input_dev = input_dev = input_allocate_device(); + input_dev = input_allocate_device(); if (!input_dev) return -ENOMEM; @@ -208,10 +208,16 @@ static int msp430_ir_init(struct budget_ci *budget_ci) if (key_map[i]) set_bit(key_map[i], input_dev->keybit); - input_register_device(budget_ci->input_dev); + err = input_register_device(input_dev); + if (err) { + input_free_device(input_dev); + return err; + } input_dev->timer.function = msp430_ir_debounce; + budget_ci->input_dev = input_dev; + saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_06); saa7146_setgpio(saa, 3, SAA7146_GPIO_IRQHI); @@ -226,8 +232,10 @@ static void msp430_ir_deinit(struct budget_ci *budget_ci) saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_06); saa7146_setgpio(saa, 3, SAA7146_GPIO_INPUT); - if (del_timer(&dev->timer)) - input_event(dev, EV_KEY, key_map[dev->repeat_key], !!0); + if (del_timer(&dev->timer)) { + input_event(dev, EV_KEY, key_map[dev->repeat_key], 0); + input_sync(dev); + } input_unregister_device(dev); } -- cgit v1.2.3 From 61cebe9db7992c2c6ccb91f179f56008e74c2de1 Mon Sep 17 00:00:00 2001 From: Andrew de Quincey Date: Sun, 19 Nov 2006 14:10:59 -0300 Subject: V4L/DVB (4855): Support KNC1 DVBC cards with alternative tda10021 i2c address For some reason, some of these cards have the tda10021 configured to a different address. This adds support for such cards Signed-off-by: Andrew de Quincey Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-av.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c index c7312420c37..461e8d75b63 100644 --- a/drivers/media/dvb/ttpci/budget-av.c +++ b/drivers/media/dvb/ttpci/budget-av.c @@ -655,6 +655,10 @@ static struct tda10021_config philips_cu1216_config = { .demod_address = 0x0c, }; +static struct tda10021_config philips_cu1216_config_altaddress = { + .demod_address = 0x0d, +}; + @@ -1013,6 +1017,10 @@ static void frontend_init(struct budget_av *budget_av) fe = dvb_attach(tda10021_attach, &philips_cu1216_config, &budget_av->budget.i2c_adap, read_pwm(budget_av)); + if (fe == NULL) + fe = dvb_attach(tda10021_attach, &philips_cu1216_config_altaddress, + &budget_av->budget.i2c_adap, + read_pwm(budget_av)); if (fe) { budget_av->tda10021_poclkp = 1; budget_av->tda10021_set_frontend = fe->ops.set_frontend; -- cgit v1.2.3 From 47ae9ae895a5228e7a3ca47b1c9ab00a3f641923 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Mon, 20 Nov 2006 16:38:42 -0300 Subject: V4L/DVB (4867): Whitespace cleanup - adhere to 80-column limit - replace some spaces with tabs Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-av.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c index 461e8d75b63..8bdc90a70c2 100644 --- a/drivers/media/dvb/ttpci/budget-av.c +++ b/drivers/media/dvb/ttpci/budget-av.c @@ -835,7 +835,7 @@ static int philips_sd1878_tda8261_tuner_set_params(struct dvb_frontend *fe, return -EINVAL; rc=dvb_pll_configure(&dvb_pll_philips_sd1878_tda8261, buf, - params->frequency, 0); + params->frequency, 0); if(rc < 0) return rc; if (fe->ops.i2c_gate_ctrl) -- cgit v1.2.3 From dd2f398ccb73530a99582e972aa57e3ed2fd73c6 Mon Sep 17 00:00:00 2001 From: David Hardeman Date: Sat, 2 Dec 2006 21:16:05 -0200 Subject: V4L/DVB (4875): budget-ci IR: groundwork for following patches This patch lays down some groundwork for later budget-ci patches. The bulk of this consists of moving a few members into a new struct and renaming a few of them. It also allocates extra space for the device name (the "name" field in /proc/bus/input/devices and in the relevant sysfs dir) to avoid truncation and uses snprintf rather than sprintf in case the extra space shouldn't be enough. Taken from Darren Salt's dvb-ir patchset Signed-off-by: Darren Salt Signed-off-by: David Hardeman Signed-off-by: Andrew de Quincey Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-ci.c | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 25d0dfc1f58..2893e752745 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -72,15 +72,19 @@ #define SLOTSTATUS_READY 8 #define SLOTSTATUS_OCCUPIED (SLOTSTATUS_PRESENT|SLOTSTATUS_RESET|SLOTSTATUS_READY) +struct budget_ci_ir { + struct input_dev *dev; + struct tasklet_struct msp430_irq_tasklet; + char name[72]; /* 40 + 32 for (struct saa7146_dev).name */ +}; + struct budget_ci { struct budget budget; - struct input_dev *input_dev; - struct tasklet_struct msp430_irq_tasklet; struct tasklet_struct ciintf_irq_tasklet; int slot_status; int ci_irq; struct dvb_ca_en50221 ca; - char ir_dev_name[50]; + struct budget_ci_ir ir; u8 tuner_pll_address; /* used for philips_tdm1316l configs */ }; @@ -156,7 +160,7 @@ static void msp430_ir_debounce(unsigned long data) static void msp430_ir_interrupt(unsigned long data) { struct budget_ci *budget_ci = (struct budget_ci *) data; - struct input_dev *dev = budget_ci->input_dev; + struct input_dev *dev = budget_ci->ir.dev; unsigned int code = ttpci_budget_debiread(&budget_ci->budget, DEBINOSWAP, DEBIADDR_IR, 2, 1, 0) >> 8; @@ -191,17 +195,17 @@ static void msp430_ir_interrupt(unsigned long data) static int msp430_ir_init(struct budget_ci *budget_ci) { struct saa7146_dev *saa = budget_ci->budget.dev; - struct input_dev *input_dev; + struct input_dev *input_dev = budget_ci->ir.dev; int i; int err; - input_dev = input_allocate_device(); + budget_ci->ir.dev = input_dev = input_allocate_device(); if (!input_dev) return -ENOMEM; - sprintf(budget_ci->ir_dev_name, "Budget-CI dvb ir receiver %s", saa->name); - - input_dev->name = budget_ci->ir_dev_name; + snprintf(budget_ci->ir.name, sizeof(budget_ci->ir.name), + "Budget-CI dvb ir receiver %s", saa->name); + input_dev->name = budget_ci->ir.name; set_bit(EV_KEY, input_dev->evbit); for (i = 0; i < ARRAY_SIZE(key_map); i++) @@ -214,9 +218,9 @@ static int msp430_ir_init(struct budget_ci *budget_ci) return err; } - input_dev->timer.function = msp430_ir_debounce; + input_register_device(budget_ci->ir.dev); - budget_ci->input_dev = input_dev; + input_dev->timer.function = msp430_ir_debounce; saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_06); saa7146_setgpio(saa, 3, SAA7146_GPIO_IRQHI); @@ -227,7 +231,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci) static void msp430_ir_deinit(struct budget_ci *budget_ci) { struct saa7146_dev *saa = budget_ci->budget.dev; - struct input_dev *dev = budget_ci->input_dev; + struct input_dev *dev = budget_ci->ir.dev; saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_06); saa7146_setgpio(saa, 3, SAA7146_GPIO_INPUT); @@ -548,7 +552,7 @@ static void budget_ci_irq(struct saa7146_dev *dev, u32 * isr) dprintk(8, "dev: %p, budget_ci: %p\n", dev, budget_ci); if (*isr & MASK_06) - tasklet_schedule(&budget_ci->msp430_irq_tasklet); + tasklet_schedule(&budget_ci->ir.msp430_irq_tasklet); if (*isr & MASK_10) ttpci_budget_irq10_handler(dev, isr); @@ -1105,7 +1109,7 @@ static int budget_ci_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio return err; } - tasklet_init(&budget_ci->msp430_irq_tasklet, msp430_ir_interrupt, + tasklet_init(&budget_ci->ir.msp430_irq_tasklet, msp430_ir_interrupt, (unsigned long) budget_ci); msp430_ir_init(budget_ci); @@ -1134,7 +1138,7 @@ static int budget_ci_detach(struct saa7146_dev *dev) } err = ttpci_budget_deinit(&budget_ci->budget); - tasklet_kill(&budget_ci->msp430_irq_tasklet); + tasklet_kill(&budget_ci->ir.msp430_irq_tasklet); msp430_ir_deinit(budget_ci); -- cgit v1.2.3 From 5cc8ae000233e8dad667edcdbb921668c317b627 Mon Sep 17 00:00:00 2001 From: David Hardeman Date: Sat, 2 Dec 2006 21:16:05 -0200 Subject: V4L/DVB (4876): budget-ci IR: support EVIOCGPHYS This patch adds a 'phys' string, of the same form as used by various other DVB cards' IR drivers, for access by any program which uses the EVIOCPHYS ioctl or may read /sys/class/input/*/phys (e.g. udev) to identify input device nodes. Taken from Darren Salt's dvb-ir patchset. Signed-off-by: Darren Salt Signed-off-by: David Hardeman Signed-off-by: Andrew de Quincey Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-ci.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 2893e752745..0809fb90c26 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -76,6 +76,7 @@ struct budget_ci_ir { struct input_dev *dev; struct tasklet_struct msp430_irq_tasklet; char name[72]; /* 40 + 32 for (struct saa7146_dev).name */ + char phys[32]; }; struct budget_ci { @@ -205,8 +206,27 @@ static int msp430_ir_init(struct budget_ci *budget_ci) snprintf(budget_ci->ir.name, sizeof(budget_ci->ir.name), "Budget-CI dvb ir receiver %s", saa->name); + snprintf(budget_ci->ir.phys, sizeof(budget_ci->ir.phys), + "pci-%s/ir0", pci_name(saa->pci)); + input_dev->name = budget_ci->ir.name; + input_dev->phys = budget_ci->ir.phys; + input_dev->id.bustype = BUS_PCI; + input_dev->id.version = 1; + if (saa->pci->subsystem_vendor) { + input_dev->id.vendor = saa->pci->subsystem_vendor; + input_dev->id.product = saa->pci->subsystem_device; + } else { + input_dev->id.vendor = saa->pci->vendor; + input_dev->id.product = saa->pci->device; + } +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) + input_dev->cdev.dev = &saa->pci->dev; +# else + input_dev->dev = &saa->pci->dev; +# endif + set_bit(EV_KEY, input_dev->evbit); for (i = 0; i < ARRAY_SIZE(key_map); i++) if (key_map[i]) -- cgit v1.2.3 From 8cc532ef5bf1230ed6345aebe5bd11ea8567ba52 Mon Sep 17 00:00:00 2001 From: David Hardeman Date: Sat, 2 Dec 2006 21:16:05 -0200 Subject: V4L/DVB (4877): budget-ci IR: improve error checking in init and deinit functions Improve the error checking in the IR init and deinit functions. Based on Darren Salt's dvb-ir patchset. Signed-off-by: David Hardeman Signed-off-by: Andrew de Quincey Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-ci.c | 60 +++++++++++++++++++++++-------------- 1 file changed, 37 insertions(+), 23 deletions(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 0809fb90c26..b2869ab8b7b 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -198,11 +198,13 @@ static int msp430_ir_init(struct budget_ci *budget_ci) struct saa7146_dev *saa = budget_ci->budget.dev; struct input_dev *input_dev = budget_ci->ir.dev; int i; - int err; + int error; budget_ci->ir.dev = input_dev = input_allocate_device(); - if (!input_dev) - return -ENOMEM; + if (!input_dev) { + error = -ENOMEM; + goto out1; + } snprintf(budget_ci->ir.name, sizeof(budget_ci->ir.name), "Budget-CI dvb ir receiver %s", saa->name); @@ -232,20 +234,26 @@ static int msp430_ir_init(struct budget_ci *budget_ci) if (key_map[i]) set_bit(key_map[i], input_dev->keybit); - err = input_register_device(input_dev); - if (err) { - input_free_device(input_dev); - return err; + error = input_register_device(input_dev); + if (error) { + printk(KERN_ERR "budget_ci: could not init driver for IR device (code %d)\n", error); + goto out2; } - input_register_device(budget_ci->ir.dev); - input_dev->timer.function = msp430_ir_debounce; + tasklet_init(&budget_ci->ir.msp430_irq_tasklet, msp430_ir_interrupt, + (unsigned long) budget_ci); + saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_06); saa7146_setgpio(saa, 3, SAA7146_GPIO_IRQHI); return 0; + +out2: + input_free_device(input_dev); +out1: + return error; } static void msp430_ir_deinit(struct budget_ci *budget_ci) @@ -255,6 +263,7 @@ static void msp430_ir_deinit(struct budget_ci *budget_ci) saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_06); saa7146_setgpio(saa, 3, SAA7146_GPIO_INPUT); + tasklet_kill(&budget_ci->ir.msp430_irq_tasklet); if (del_timer(&dev->timer)) { input_event(dev, EV_KEY, key_map[dev->repeat_key], 0); @@ -1115,8 +1124,11 @@ static int budget_ci_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio struct budget_ci *budget_ci; int err; - if (!(budget_ci = kmalloc(sizeof(struct budget_ci), GFP_KERNEL))) - return -ENOMEM; + budget_ci = kmalloc(sizeof(struct budget_ci), GFP_KERNEL); + if (!budget_ci) { + err = -ENOMEM; + goto out1; + } dprintk(2, "budget_ci: %p\n", budget_ci); @@ -1124,15 +1136,13 @@ static int budget_ci_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio dev->ext_priv = budget_ci; - if ((err = ttpci_budget_init(&budget_ci->budget, dev, info, THIS_MODULE))) { - kfree(budget_ci); - return err; - } + err = ttpci_budget_init(&budget_ci->budget, dev, info, THIS_MODULE); + if (err) + goto out2; - tasklet_init(&budget_ci->ir.msp430_irq_tasklet, msp430_ir_interrupt, - (unsigned long) budget_ci); - - msp430_ir_init(budget_ci); + err = msp430_ir_init(budget_ci); + if (err) + goto out3; ciintf_init(budget_ci); @@ -1142,6 +1152,13 @@ static int budget_ci_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio ttpci_budget_init_hooks(&budget_ci->budget); return 0; + +out3: + ttpci_budget_deinit(&budget_ci->budget); +out2: + kfree(budget_ci); +out1: + return err; } static int budget_ci_detach(struct saa7146_dev *dev) @@ -1152,16 +1169,13 @@ static int budget_ci_detach(struct saa7146_dev *dev) if (budget_ci->budget.ci_present) ciintf_deinit(budget_ci); + msp430_ir_deinit(budget_ci); if (budget_ci->budget.dvb_frontend) { dvb_unregister_frontend(budget_ci->budget.dvb_frontend); dvb_frontend_detach(budget_ci->budget.dvb_frontend); } err = ttpci_budget_deinit(&budget_ci->budget); - tasklet_kill(&budget_ci->ir.msp430_irq_tasklet); - - msp430_ir_deinit(budget_ci); - // disable frontend and CI interface saa7146_setgpio(saa, 2, SAA7146_GPIO_INPUT); -- cgit v1.2.3 From ee579bc9332ef8a67e20f512e7bc91e3efb92225 Mon Sep 17 00:00:00 2001 From: David Hardeman Date: Sat, 2 Dec 2006 21:16:05 -0200 Subject: V4L/DVB (4878): budget-ci IR: be more verbose in case of init failure Trivial change to help the user understand what went wrong. Taken from Darren Salt's dvb-ir patchset. Signed-off-by: Darren Salt Signed-off-by: David Hardeman Signed-off-by: Andrew de Quincey Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-ci.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index b2869ab8b7b..c34b5d3bdde 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -202,6 +202,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci) budget_ci->ir.dev = input_dev = input_allocate_device(); if (!input_dev) { + printk(KERN_ERR "budget_ci: IR interface initialisation failed\n"); error = -ENOMEM; goto out1; } @@ -1124,7 +1125,7 @@ static int budget_ci_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio struct budget_ci *budget_ci; int err; - budget_ci = kmalloc(sizeof(struct budget_ci), GFP_KERNEL); + budget_ci = kzalloc(sizeof(struct budget_ci), GFP_KERNEL); if (!budget_ci) { err = -ENOMEM; goto out1; @@ -1132,8 +1133,6 @@ static int budget_ci_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio dprintk(2, "budget_ci: %p\n", budget_ci); - budget_ci->budget.ci_present = 0; - dev->ext_priv = budget_ci; err = ttpci_budget_init(&budget_ci->budget, dev, info, THIS_MODULE); -- cgit v1.2.3 From 2520fffd8b7a312e77009414d3201c9751d6448c Mon Sep 17 00:00:00 2001 From: David Hardeman Date: Sat, 2 Dec 2006 21:16:05 -0200 Subject: V4L/DVB (4879): budget-ci IR: integrate with ir-common This converts the budget-ci driver so that it uses ir-common for some of its IR processing. In particular, the keymap for the Nova-T (sub 13c2:1011) is switched to the Hauppauge grey/black keymap, of which the keys on the supplied R808 remote control form a subset. The old budget-ci keymap is moved to ir-keymaps.c and is used for other remotes. The debounce logic for buggy remotes (i.e. Zenith) is made conditional the new debounce parameter and defaults to off (so that repeat keypresses aren't ignored for all working remotes). Some parts are based on Darren Salt's dvb-ir patchset. Signed-off-by: David Hardeman Signed-off-by: Andrew de Quincey Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/Kconfig | 1 + drivers/media/dvb/ttpci/budget-ci.c | 138 ++++++++++++++++++++---------------- 2 files changed, 78 insertions(+), 61 deletions(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig index 95531a62499..eec7ccf41f8 100644 --- a/drivers/media/dvb/ttpci/Kconfig +++ b/drivers/media/dvb/ttpci/Kconfig @@ -92,6 +92,7 @@ config DVB_BUDGET_CI select DVB_STV0299 if !DVB_FE_CUSTOMISE select DVB_TDA1004X if !DVB_FE_CUSTOMISE select DVB_LNBP21 if !DVB_FE_CUSTOMISE + select VIDEO_IR help Support for simple SAA7146 based DVB cards (so called Budget- or Nova-PCI cards) without onboard diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index c34b5d3bdde..d1b5402cd6f 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -37,6 +37,7 @@ #include #include #include +#include #include "dvb_ca_en50221.h" #include "stv0299.h" @@ -72,11 +73,24 @@ #define SLOTSTATUS_READY 8 #define SLOTSTATUS_OCCUPIED (SLOTSTATUS_PRESENT|SLOTSTATUS_RESET|SLOTSTATUS_READY) +/* Milliseconds during which key presses are regarded as key repeat and during + * which the debounce logic is active + */ +#define IR_REPEAT_TIMEOUT 350 + +/* Some remotes sends multiple sequences per keypress (e.g. Zenith sends two), + * this setting allows the superflous sequences to be ignored + */ +static int debounce = 0; +module_param(debounce, int, 0644); +MODULE_PARM_DESC(debounce, "ignore repeated IR sequences (default: 0 = ignore no sequences)"); + struct budget_ci_ir { struct input_dev *dev; struct tasklet_struct msp430_irq_tasklet; char name[72]; /* 40 + 32 for (struct saa7146_dev).name */ char phys[32]; + struct ir_input_state state; }; struct budget_ci { @@ -89,59 +103,44 @@ struct budget_ci { u8 tuner_pll_address; /* used for philips_tdm1316l configs */ }; -/* from reading the following remotes: - Zenith Universal 7 / TV Mode 807 / VCR Mode 837 - Hauppauge (from NOVA-CI-s box product) - i've taken a "middle of the road" approach and note the differences -*/ -static u16 key_map[64] = { - /* 0x0X */ - KEY_0, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, - KEY_9, - KEY_ENTER, - KEY_RED, - KEY_POWER, /* RADIO on Hauppauge */ - KEY_MUTE, - 0, - KEY_A, /* TV on Hauppauge */ - /* 0x1X */ - KEY_VOLUMEUP, KEY_VOLUMEDOWN, - 0, 0, - KEY_B, - 0, 0, 0, 0, 0, 0, 0, - KEY_UP, KEY_DOWN, - KEY_OPTION, /* RESERVED on Hauppauge */ - KEY_BREAK, - /* 0x2X */ - KEY_CHANNELUP, KEY_CHANNELDOWN, - KEY_PREVIOUS, /* Prev. Ch on Zenith, SOURCE on Hauppauge */ - 0, KEY_RESTART, KEY_OK, - KEY_CYCLEWINDOWS, /* MINIMIZE on Hauppauge */ - 0, - KEY_ENTER, /* VCR mode on Zenith */ - KEY_PAUSE, - 0, - KEY_RIGHT, KEY_LEFT, - 0, - KEY_MENU, /* FULL SCREEN on Hauppauge */ - 0, - /* 0x3X */ - KEY_SLOW, - KEY_PREVIOUS, /* VCR mode on Zenith */ - KEY_REWIND, - 0, - KEY_FASTFORWARD, - KEY_PLAY, KEY_STOP, - KEY_RECORD, - KEY_TUNER, /* TV/VCR on Zenith */ - 0, - KEY_C, - 0, - KEY_EXIT, - KEY_POWER2, - KEY_TUNER, /* VCR mode on Zenith */ - 0, -}; +static void msp430_ir_keyup(unsigned long data) +{ + struct budget_ci_ir *ir = (struct budget_ci_ir *) data; + ir_input_nokey(ir->dev, &ir->state); +} + +static void msp430_ir_interrupt(unsigned long data) +{ + struct budget_ci *budget_ci = (struct budget_ci *) data; + struct input_dev *dev = budget_ci->ir.dev; + static int bounces = 0; + u32 ir_key; + u32 command = ttpci_budget_debiread(&budget_ci->budget, DEBINOSWAP, DEBIADDR_IR, 2, 1, 0) >> 8; + + if (command & 0x40) { + ir_key = command & 0x3f; + + if (ir_key != dev->repeat_key && del_timer(&dev->timer)) + /* We were still waiting for a keyup event but this is a new key */ + ir_input_nokey(dev, &budget_ci->ir.state); + + if (ir_key == dev->repeat_key && bounces > 0 && timer_pending(&dev->timer)) { + /* Ignore repeated key sequences if requested */ + bounces--; + return; + } + + if (!timer_pending(&dev->timer)) + /* New keypress */ + bounces = debounce; + + /* Prepare a keyup event sometime in the future */ + mod_timer(&dev->timer, jiffies + msecs_to_jiffies(IR_REPEAT_TIMEOUT)); + + /* Generate a new or repeated keypress */ + ir_input_keydown(dev, &budget_ci->ir.state, ir_key, command); + } +} static void msp430_ir_debounce(unsigned long data) { @@ -197,7 +196,6 @@ static int msp430_ir_init(struct budget_ci *budget_ci) { struct saa7146_dev *saa = budget_ci->budget.dev; struct input_dev *input_dev = budget_ci->ir.dev; - int i; int error; budget_ci->ir.dev = input_dev = input_allocate_device(); @@ -230,10 +228,30 @@ static int msp430_ir_init(struct budget_ci *budget_ci) input_dev->dev = &saa->pci->dev; # endif - set_bit(EV_KEY, input_dev->evbit); - for (i = 0; i < ARRAY_SIZE(key_map); i++) - if (key_map[i]) - set_bit(key_map[i], input_dev->keybit); + /* Select keymap */ + switch (budget_ci->budget.dev->pci->subsystem_device) { + case 0x100c: + case 0x100f: + case 0x1010: + case 0x1011: + case 0x1012: + case 0x1017: + /* The hauppauge keymap is a superset of these remotes */ + ir_input_init(input_dev, &budget_ci->ir.state, + IR_TYPE_RC5, ir_codes_hauppauge_new); + break; + default: + /* unknown remote */ + ir_input_init(input_dev, &budget_ci->ir.state, + IR_TYPE_RC5, ir_codes_budget_ci_old); + break; + } + + /* initialise the key-up timeout handler */ + input_dev->timer.function = msp430_ir_keyup; + input_dev->timer.data = (unsigned long) &budget_ci->ir; + input_dev->rep[REP_DELAY] = 1; + input_dev->rep[REP_PERIOD] = 1; error = input_register_device(input_dev); if (error) { @@ -241,8 +259,6 @@ static int msp430_ir_init(struct budget_ci *budget_ci) goto out2; } - input_dev->timer.function = msp430_ir_debounce; - tasklet_init(&budget_ci->ir.msp430_irq_tasklet, msp430_ir_interrupt, (unsigned long) budget_ci); @@ -267,7 +283,7 @@ static void msp430_ir_deinit(struct budget_ci *budget_ci) tasklet_kill(&budget_ci->ir.msp430_irq_tasklet); if (del_timer(&dev->timer)) { - input_event(dev, EV_KEY, key_map[dev->repeat_key], 0); + ir_input_nokey(dev, &budget_ci->ir.state); input_sync(dev); } -- cgit v1.2.3 From 64741b70cf2030ffe017e5ed731620b4a4570f77 Mon Sep 17 00:00:00 2001 From: David Hardeman Date: Sat, 2 Dec 2006 21:16:05 -0200 Subject: V4L/DVB (4880): budget-ci IR: decode rc5 device byte Decode the RC5 device byte as well as the command byte. Introduce a parameter to set the device events to listen for. Default to try to auto-detect the proper device code, otherwise, listen to any device as the old code did. Based on Darren Salt's dvb-ir patchset. Signed-off-by: Darren Salt Signed-off-by: David Hardeman Signed-off-by: Andrew de Quincey Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-ci.c | 76 ++++++++++++++++++++++++++++--------- 1 file changed, 59 insertions(+), 17 deletions(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index d1b5402cd6f..76d3b6694bc 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -78,6 +78,9 @@ */ #define IR_REPEAT_TIMEOUT 350 +/* RC5 device wildcard */ +#define IR_DEVICE_ANY 255 + /* Some remotes sends multiple sequences per keypress (e.g. Zenith sends two), * this setting allows the superflous sequences to be ignored */ @@ -85,12 +88,17 @@ static int debounce = 0; module_param(debounce, int, 0644); MODULE_PARM_DESC(debounce, "ignore repeated IR sequences (default: 0 = ignore no sequences)"); +static int rc5_device = -1; +module_param(rc5_device, int, 0644); +MODULE_PARM_DESC(rc5_device, "only IR commands to given RC5 device (device = 0 - 31, any device = 255, default: autodetect)"); + struct budget_ci_ir { struct input_dev *dev; struct tasklet_struct msp430_irq_tasklet; char name[72]; /* 40 + 32 for (struct saa7146_dev).name */ char phys[32]; struct ir_input_state state; + int rc5_device; }; struct budget_ci { @@ -114,32 +122,56 @@ static void msp430_ir_interrupt(unsigned long data) struct budget_ci *budget_ci = (struct budget_ci *) data; struct input_dev *dev = budget_ci->ir.dev; static int bounces = 0; - u32 ir_key; + int device; + int toggle; + static int prev_toggle = -1; + static u32 ir_key; u32 command = ttpci_budget_debiread(&budget_ci->budget, DEBINOSWAP, DEBIADDR_IR, 2, 1, 0) >> 8; + /* + * The msp430 chip can generate two different bytes, command and device + * + * type1: X1CCCCCC, C = command bits (0 - 63) + * type2: X0TDDDDD, D = device bits (0 - 31), T = RC5 toggle bit + * + * More than one command byte may be generated before the device byte + * Only when we have both, a correct keypress is generated + */ + + /* Is this a RC5 command byte? */ if (command & 0x40) { ir_key = command & 0x3f; + return; + } - if (ir_key != dev->repeat_key && del_timer(&dev->timer)) - /* We were still waiting for a keyup event but this is a new key */ - ir_input_nokey(dev, &budget_ci->ir.state); + /* It's a RC5 device byte */ + device = command & 0x1f; + toggle = command & 0x20; - if (ir_key == dev->repeat_key && bounces > 0 && timer_pending(&dev->timer)) { - /* Ignore repeated key sequences if requested */ - bounces--; - return; - } + if (budget_ci->ir.rc5_device != IR_DEVICE_ANY && budget_ci->ir.rc5_device != device) + return; - if (!timer_pending(&dev->timer)) - /* New keypress */ - bounces = debounce; + /* Are we still waiting for a keyup event while this is a new key? */ + if ((ir_key != dev->repeat_key || toggle != prev_toggle) && del_timer(&dev->timer)) + ir_input_nokey(dev, &budget_ci->ir.state); - /* Prepare a keyup event sometime in the future */ - mod_timer(&dev->timer, jiffies + msecs_to_jiffies(IR_REPEAT_TIMEOUT)); + prev_toggle = toggle; - /* Generate a new or repeated keypress */ - ir_input_keydown(dev, &budget_ci->ir.state, ir_key, command); + /* Ignore repeated key sequences if requested */ + if (ir_key == dev->repeat_key && bounces > 0 && timer_pending(&dev->timer)) { + bounces--; + return; } + + /* New keypress? */ + if (!timer_pending(&dev->timer)) + bounces = debounce; + + /* Prepare a keyup event sometime in the future */ + mod_timer(&dev->timer, jiffies + msecs_to_jiffies(IR_REPEAT_TIMEOUT)); + + /* Generate a new or repeated keypress */ + ir_input_keydown(dev, &budget_ci->ir.state, ir_key, ((device << 8) | command)); } static void msp430_ir_debounce(unsigned long data) @@ -228,7 +260,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci) input_dev->dev = &saa->pci->dev; # endif - /* Select keymap */ + /* Select keymap and address */ switch (budget_ci->budget.dev->pci->subsystem_device) { case 0x100c: case 0x100f: @@ -239,11 +271,21 @@ static int msp430_ir_init(struct budget_ci *budget_ci) /* The hauppauge keymap is a superset of these remotes */ ir_input_init(input_dev, &budget_ci->ir.state, IR_TYPE_RC5, ir_codes_hauppauge_new); + + if (rc5_device < 0) + budget_ci->ir.rc5_device = 0x1f; + else + budget_ci->ir.rc5_device = rc5_device; break; default: /* unknown remote */ ir_input_init(input_dev, &budget_ci->ir.state, IR_TYPE_RC5, ir_codes_budget_ci_old); + + if (rc5_device < 0) + budget_ci->ir.rc5_device = IR_DEVICE_ANY; + else + budget_ci->ir.rc5_device = rc5_device; break; } -- cgit v1.2.3 From b5471a27b48801507c5bd0eadd83730230515016 Mon Sep 17 00:00:00 2001 From: David Hardeman Date: Sat, 2 Dec 2006 21:16:05 -0200 Subject: V4L/DVB (4881): budget-ci IR: add IR debugging information This adds a ir_debug parameter which is useful in tracking down IR decoding problems. Based on Darren Salt's dvb-ir patchset. Signed-off-by: Darren Salt Signed-off-by: David Hardeman Signed-off-by: Andrew de Quincey Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-ci.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 76d3b6694bc..2a3707c8794 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -92,6 +92,10 @@ static int rc5_device = -1; module_param(rc5_device, int, 0644); MODULE_PARM_DESC(rc5_device, "only IR commands to given RC5 device (device = 0 - 31, any device = 255, default: autodetect)"); +static int ir_debug = 0; +module_param(ir_debug, int, 0644); +MODULE_PARM_DESC(ir_debug, "enable debugging information for IR decoding"); + struct budget_ci_ir { struct input_dev *dev; struct tasklet_struct msp430_irq_tasklet; @@ -140,11 +144,15 @@ static void msp430_ir_interrupt(unsigned long data) /* Is this a RC5 command byte? */ if (command & 0x40) { + if (ir_debug) + printk("budget_ci: received command byte 0x%02x\n", command); ir_key = command & 0x3f; return; } /* It's a RC5 device byte */ + if (ir_debug) + printk("budget_ci: received device byte 0x%02x\n", command); device = command & 0x1f; toggle = command & 0x20; -- cgit v1.2.3 From 59236d46dab429646b023026ac92d9e8c732c18a Mon Sep 17 00:00:00 2001 From: David Hardeman Date: Sat, 2 Dec 2006 21:16:06 -0200 Subject: V4L/DVB (4882): budget-ci IR: make debounce logic conditional Change the debounce logic so that it is not used at all unless the debounce parameter has been set. This makes for a much "snappier" remote for most users as there is no timeout to wait for (the debounce logic has a 350ms timer for the next repeat, but with the RC5 protocol, one event per ~110ms is possible) Signed-off-by: David Hardeman Signed-off-by: Andrew de Quincey Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-ci.c | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 2a3707c8794..83a1c5f44a0 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -159,27 +159,32 @@ static void msp430_ir_interrupt(unsigned long data) if (budget_ci->ir.rc5_device != IR_DEVICE_ANY && budget_ci->ir.rc5_device != device) return; - /* Are we still waiting for a keyup event while this is a new key? */ - if ((ir_key != dev->repeat_key || toggle != prev_toggle) && del_timer(&dev->timer)) - ir_input_nokey(dev, &budget_ci->ir.state); - - prev_toggle = toggle; - /* Ignore repeated key sequences if requested */ - if (ir_key == dev->repeat_key && bounces > 0 && timer_pending(&dev->timer)) { + if (toggle == prev_toggle && ir_key == dev->repeat_key && + bounces > 0 && timer_pending(&dev->timer)) { + if (ir_debug) + printk("budget_ci: debounce logic ignored IR command\n"); bounces--; return; } + prev_toggle = toggle; - /* New keypress? */ - if (!timer_pending(&dev->timer)) - bounces = debounce; + /* Are we still waiting for a keyup event? */ + if (del_timer(&dev->timer)) + ir_input_nokey(dev, &budget_ci->ir.state); - /* Prepare a keyup event sometime in the future */ - mod_timer(&dev->timer, jiffies + msecs_to_jiffies(IR_REPEAT_TIMEOUT)); + /* Generate keypress */ + if (ir_debug) + printk("budget_ci: generating keypress 0x%02x\n", ir_key); + ir_input_keydown(dev, &budget_ci->ir.state, ir_key, (ir_key & (command << 8))); - /* Generate a new or repeated keypress */ - ir_input_keydown(dev, &budget_ci->ir.state, ir_key, ((device << 8) | command)); + /* Do we want to delay the keyup event? */ + if (debounce) { + bounces = debounce; + mod_timer(&dev->timer, jiffies + msecs_to_jiffies(IR_REPEAT_TIMEOUT)); + } else { + ir_input_nokey(dev, &budget_ci->ir.state); + } } static void msp430_ir_debounce(unsigned long data) @@ -297,11 +302,9 @@ static int msp430_ir_init(struct budget_ci *budget_ci) break; } - /* initialise the key-up timeout handler */ + /* initialise the key-up debounce timeout handler */ input_dev->timer.function = msp430_ir_keyup; input_dev->timer.data = (unsigned long) &budget_ci->ir; - input_dev->rep[REP_DELAY] = 1; - input_dev->rep[REP_PERIOD] = 1; error = input_register_device(input_dev); if (error) { -- cgit v1.2.3 From 9abec6189aa8b6659222544bf893158fc96e8822 Mon Sep 17 00:00:00 2001 From: Thomas Kaiser Date: Wed, 22 Nov 2006 18:15:19 -0300 Subject: V4L/DVB (4883): Fix TD1316 tuner for DVBC If your device is using the philips tda1316 tuner, i think there is a problem in setting the correct Band. 162 MHz and above should be band 2 (Mid-Band). But in dvbc_philips_tdm1316l_tuner_set_params band 1 is set for frequencies below 200 MHz. Signed-off-by: Thomas Kaiser Signed-off-by: Andrew de Quincey Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-ci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 83a1c5f44a0..a68f5bf0125 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -946,7 +946,7 @@ static int dvbc_philips_tdm1316l_tuner_set_params(struct dvb_frontend *fe, struc band = 1; } else if (tuner_frequency < 200000000) { cp = 6; - band = 1; + band = 2; } else if (tuner_frequency < 290000000) { cp = 3; band = 2; -- cgit v1.2.3 From e457579079642924da621e92cb39d8fb90a4d5a7 Mon Sep 17 00:00:00 2001 From: Andrew de Quincey Date: Fri, 24 Nov 2006 12:58:42 -0300 Subject: V4L/DVB (4884): Remove stray IR code left from patchset This caused compilation to fail - completely replaced by new style functions, so can be removed. Signed-off-by: Andrew de Quincey Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-ci.c | 50 ------------------------------------- 1 file changed, 50 deletions(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index a68f5bf0125..8f71124099b 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -187,56 +187,6 @@ static void msp430_ir_interrupt(unsigned long data) } } -static void msp430_ir_debounce(unsigned long data) -{ - struct input_dev *dev = (struct input_dev *) data; - - if (dev->rep[0] == 0 || dev->rep[0] == ~0) { - input_event(dev, EV_KEY, key_map[dev->repeat_key], 0); - } else { - dev->rep[0] = 0; - dev->timer.expires = jiffies + HZ * 350 / 1000; - add_timer(&dev->timer); - input_event(dev, EV_KEY, key_map[dev->repeat_key], 2); /* REPEAT */ - } - input_sync(dev); -} - -static void msp430_ir_interrupt(unsigned long data) -{ - struct budget_ci *budget_ci = (struct budget_ci *) data; - struct input_dev *dev = budget_ci->ir.dev; - unsigned int code = - ttpci_budget_debiread(&budget_ci->budget, DEBINOSWAP, DEBIADDR_IR, 2, 1, 0) >> 8; - - if (code & 0x40) { - code &= 0x3f; - - if (timer_pending(&dev->timer)) { - if (code == dev->repeat_key) { - ++dev->rep[0]; - return; - } - del_timer(&dev->timer); - input_event(dev, EV_KEY, key_map[dev->repeat_key], 0); - } - - if (!key_map[code]) { - printk("DVB (%s): no key for %02x!\n", __FUNCTION__, code); - return; - } - - input_event(dev, EV_KEY, key_map[code], 1); - input_sync(dev); - - /* initialize debounce and repeat */ - dev->repeat_key = code; - /* Zenith remote _always_ sends 2 sequences */ - dev->rep[0] = ~0; - mod_timer(&dev->timer, jiffies + msecs_to_jiffies(350)); - } -} - static int msp430_ir_init(struct budget_ci *budget_ci) { struct saa7146_dev *saa = budget_ci->budget.dev; -- cgit v1.2.3 From 036171e75ef866b4fd8650c5b890359482ba2a4c Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 28 Nov 2006 05:09:22 -0300 Subject: V4L/DVB: Dvb-budget ci fix drivers/media/dvb/ttpci/budget-ci.c:220:6: warning: "LINUX_VERSION_CODE" is not defined drivers/media/dvb/ttpci/budget-ci.c:220:28: warning: "KERNEL_VERSION" is not defined drivers/media/dvb/ttpci/budget-ci.c:220:42: error: missing binary operator before token "(" Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-ci.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 8f71124099b..f793a2741e2 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -217,11 +217,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci) input_dev->id.vendor = saa->pci->vendor; input_dev->id.product = saa->pci->device; } -# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) input_dev->cdev.dev = &saa->pci->dev; -# else - input_dev->dev = &saa->pci->dev; -# endif /* Select keymap and address */ switch (budget_ci->budget.dev->pci->subsystem_device) { -- cgit v1.2.3 From 00c4cc67512ada1d195b8bf3ef1db1d6b3951605 Mon Sep 17 00:00:00 2001 From: Oliver Endriss Date: Wed, 1 Nov 2006 13:09:51 -0300 Subject: V4L/DVB (4916): Av7110,budget,budget-ci,budget-av: Use interrupt mode for I2C transfers Use interrupt mode for I2C transfers. Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/av7110.c | 2 +- drivers/media/dvb/ttpci/budget-av.c | 2 +- drivers/media/dvb/ttpci/budget-ci.c | 2 +- drivers/media/dvb/ttpci/budget.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c index bba23bcd1b1..366c1371ee9 100644 --- a/drivers/media/dvb/ttpci/av7110.c +++ b/drivers/media/dvb/ttpci/av7110.c @@ -2828,7 +2828,7 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); static struct saa7146_extension av7110_extension = { .name = "dvb", - .flags = SAA7146_I2C_SHORT_DELAY, + .flags = SAA7146_USE_I2C_IRQ, .module = THIS_MODULE, .pci_tbl = &pci_tbl[0], diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c index 8bdc90a70c2..9478d5957b9 100644 --- a/drivers/media/dvb/ttpci/budget-av.c +++ b/drivers/media/dvb/ttpci/budget-av.c @@ -1290,7 +1290,7 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); static struct saa7146_extension budget_extension = { .name = "budget_av", - .flags = SAA7146_I2C_SHORT_DELAY, + .flags = SAA7146_USE_I2C_IRQ, .pci_tbl = pci_tbl, diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index f793a2741e2..0a11b551440 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -1222,7 +1222,7 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); static struct saa7146_extension budget_extension = { .name = "budget_ci dvb", - .flags = SAA7146_I2C_SHORT_DELAY, + .flags = SAA7146_USE_I2C_IRQ, .module = THIS_MODULE, .pci_tbl = &pci_tbl[0], diff --git a/drivers/media/dvb/ttpci/budget.c b/drivers/media/dvb/ttpci/budget.c index 56f1c80defc..9268a82bada 100644 --- a/drivers/media/dvb/ttpci/budget.c +++ b/drivers/media/dvb/ttpci/budget.c @@ -555,7 +555,7 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); static struct saa7146_extension budget_extension = { .name = "budget dvb", - .flags = SAA7146_I2C_SHORT_DELAY, + .flags = SAA7146_USE_I2C_IRQ, .module = THIS_MODULE, .pci_tbl = pci_tbl, -- cgit v1.2.3 From 740cf9e15e5b2274841ee9e6d6d717e37b3f31cf Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Fri, 3 Nov 2006 15:34:18 -0300 Subject: V4L/DVB (4918): Budget-av: Add delay for frontend power-on Added a delay to give the frontend a little bit time for power-on. Signed-off-by: Hartmut Birr Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-av.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c index 9478d5957b9..4d1954072bb 100644 --- a/drivers/media/dvb/ttpci/budget-av.c +++ b/drivers/media/dvb/ttpci/budget-av.c @@ -952,6 +952,9 @@ static void frontend_init(struct budget_av *budget_av) /* Enable / PowerON Frontend */ saa7146_setgpio(saa, 0, SAA7146_GPIO_OUTLO); + /* Wait for PowerON */ + msleep(100); + /* additional setup necessary for the PLUS cards */ switch (saa->pci->subsystem_device) { case SUBID_DVBS_KNC1_PLUS: -- cgit v1.2.3 From 97a2cf05c409f0f73346d3d258b643c782879c77 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Sun, 3 Dec 2006 10:49:47 -0300 Subject: V4L/DVB (4919): Budget-ci: Use SAA7146_IER_ENABLE/DISABLE to enable or disable a hardware interrupt Use SAA7146_IER_ENABLE/DISABLE to enable or disable a hardware interrupt. Signed-off-by: Hartmut Birr Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-ci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 0a11b551440..0dc52918ce6 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -261,7 +261,7 @@ static int msp430_ir_init(struct budget_ci *budget_ci) tasklet_init(&budget_ci->ir.msp430_irq_tasklet, msp430_ir_interrupt, (unsigned long) budget_ci); - saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_06); + SAA7146_IER_ENABLE(saa, MASK_06); saa7146_setgpio(saa, 3, SAA7146_GPIO_IRQHI); return 0; @@ -277,7 +277,7 @@ static void msp430_ir_deinit(struct budget_ci *budget_ci) struct saa7146_dev *saa = budget_ci->budget.dev; struct input_dev *dev = budget_ci->ir.dev; - saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_06); + SAA7146_IER_DISABLE(saa, MASK_06); saa7146_setgpio(saa, 3, SAA7146_GPIO_INPUT); tasklet_kill(&budget_ci->ir.msp430_irq_tasklet); @@ -537,7 +537,7 @@ static int ciintf_init(struct budget_ci *budget_ci) } else { saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI); } - saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_03); + SAA7146_IER_ENABLE(saa, MASK_03); } // enable interface @@ -569,7 +569,7 @@ static void ciintf_deinit(struct budget_ci *budget_ci) // disable CI interrupts if (budget_ci->ci_irq) { - saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_03); + SAA7146_IER_DISABLE(saa, MASK_03); saa7146_setgpio(saa, 0, SAA7146_GPIO_INPUT); tasklet_kill(&budget_ci->ciintf_irq_tasklet); } -- cgit v1.2.3 From 2a893dea0f186efc2eb4bcdaee145b20c87d239d Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Sun, 3 Dec 2006 21:08:08 -0300 Subject: V4L/DVB (4921): Budget-av, budget-ci: Fix MC1 register programming Remove bogus read during MC1 programming. A '1' bit could never be cleared using the old code. Use MASK_xx macros. Signed-off-by: Hartmut Birr Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/budget-av.c | 6 +++--- drivers/media/dvb/ttpci/budget-ci.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/media/dvb/ttpci') diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c index 4d1954072bb..89ab4b59155 100644 --- a/drivers/media/dvb/ttpci/budget-av.c +++ b/drivers/media/dvb/ttpci/budget-av.c @@ -360,7 +360,7 @@ static int ciintf_init(struct budget_av *budget_av) saa7146_setgpio(saa, 3, SAA7146_GPIO_OUTLO); /* Enable DEBI pins */ - saa7146_write(saa, MC1, saa7146_read(saa, MC1) | (0x800 << 16) | 0x800); + saa7146_write(saa, MC1, MASK_27 | MASK_11); /* register CI interface */ budget_av->ca.owner = THIS_MODULE; @@ -386,7 +386,7 @@ static int ciintf_init(struct budget_av *budget_av) return 0; error: - saa7146_write(saa, MC1, saa7146_read(saa, MC1) | (0x800 << 16)); + saa7146_write(saa, MC1, MASK_27); return result; } @@ -403,7 +403,7 @@ static void ciintf_deinit(struct budget_av *budget_av) dvb_ca_en50221_release(&budget_av->ca); /* disable DEBI pins */ - saa7146_write(saa, MC1, saa7146_read(saa, MC1) | (0x800 << 16)); + saa7146_write(saa, MC1, MASK_27); } diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 0dc52918ce6..f2066b47bae 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c @@ -485,7 +485,7 @@ static int ciintf_init(struct budget_ci *budget_ci) memset(&budget_ci->ca, 0, sizeof(struct dvb_ca_en50221)); // enable DEBI pins - saa7146_write(saa, MC1, saa7146_read(saa, MC1) | (0x800 << 16) | 0x800); + saa7146_write(saa, MC1, MASK_27 | MASK_11); // test if it is there ci_version = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CIVERSION, 1, 1, 0); @@ -559,7 +559,7 @@ static int ciintf_init(struct budget_ci *budget_ci) return 0; error: - saa7146_write(saa, MC1, saa7146_read(saa, MC1) | (0x800 << 16)); + saa7146_write(saa, MC1, MASK_27); return result; } @@ -587,7 +587,7 @@ static void ciintf_deinit(struct budget_ci *budget_ci) dvb_ca_en50221_release(&budget_ci->ca); // disable DEBI pins - saa7146_write(saa, MC1, saa7146_read(saa, MC1) | (0x800 << 16)); + saa7146_write(saa, MC1, MASK_27); } static void budget_ci_irq(struct saa7146_dev *dev, u32 * isr) -- cgit v1.2.3