~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/media/dvb/ttpci/budget-ci.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
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/ 
 
29
 * the project's page is at http://www.linuxtv.org/
30
30
 */
31
31
 
32
32
#include <linux/module.h>
52
52
#include "bsru6.h"
53
53
#include "tda1002x.h"
54
54
#include "tda827x.h"
 
55
#include "bsbe1-d01a.h"
55
56
 
56
57
#define MODULE_NAME "budget_ci"
57
58
 
102
103
        int rc5_device;
103
104
        u32 ir_key;
104
105
        bool have_command;
 
106
        bool full_rc5;          /* Outputs a full RC5 code */
105
107
};
106
108
 
107
109
struct budget_ci {
154
156
                return;
155
157
        budget_ci->ir.have_command = false;
156
158
 
157
 
        /* FIXME: We should generate complete scancodes with device info */
158
159
        if (budget_ci->ir.rc5_device != IR_DEVICE_ANY &&
159
160
            budget_ci->ir.rc5_device != (command & 0x1f))
160
161
                return;
161
162
 
 
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 */
162
171
        rc_keydown(dev, budget_ci->ir.ir_key, (command & 0x20) ? 1 : 0);
163
172
}
164
173
 
206
215
        case 0x1011:
207
216
        case 0x1012:
208
217
                /* The hauppauge keymap is a superset of these remotes */
209
 
                dev->map_name = RC_MAP_HAUPPAUGE_NEW;
 
218
                dev->map_name = RC_MAP_HAUPPAUGE;
 
219
                budget_ci->ir.full_rc5 = true;
210
220
 
211
221
                if (rc5_device < 0)
212
222
                        budget_ci->ir.rc5_device = 0x1f;
215
225
        case 0x1017:
216
226
        case 0x1019:
217
227
        case 0x101a:
 
228
        case 0x101b:
218
229
                /* for the Technotrend 1500 bundled remote */
219
230
                dev->map_name = RC_MAP_TT_1500;
220
231
                break;
1379
1390
                }
1380
1391
                break;
1381
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
 
1382
1410
        case 0x1019:            // TT S2-3200 PCI
1383
1411
                /*
1384
1412
                 * NOTE! on some STB0899 versions, the internal PLL takes a longer time
1509
1537
MAKE_BUDGET_INFO(ttbcci, "TT-Budget-C-CI PCI", BUDGET_TT);
1510
1538
MAKE_BUDGET_INFO(ttc1501, "TT-Budget C-1501 PCI", BUDGET_TT);
1511
1539
MAKE_BUDGET_INFO(tt3200, "TT-Budget S2-3200 PCI", BUDGET_TT);
 
1540
MAKE_BUDGET_INFO(ttbs1500b, "TT-Budget S-1500B PCI", BUDGET_TT);
1512
1541
 
1513
1542
static struct pci_device_id pci_tbl[] = {
1514
1543
        MAKE_EXTENSION_PCI(ttbci, 0x13c2, 0x100c),
1519
1548
        MAKE_EXTENSION_PCI(ttbs2, 0x13c2, 0x1017),
1520
1549
        MAKE_EXTENSION_PCI(ttc1501, 0x13c2, 0x101a),
1521
1550
        MAKE_EXTENSION_PCI(tt3200, 0x13c2, 0x1019),
 
1551
        MAKE_EXTENSION_PCI(ttbs1500b, 0x13c2, 0x101b),
1522
1552
        {
1523
1553
         .vendor = 0,
1524
1554
         }