~ubuntu-branches/ubuntu/trusty/linux-armadaxp/trusty

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Michael Casadevall, Bryan Wu, Dann Frazier, Michael Casadeall
  • Date: 2012-03-10 15:00:54 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120310150054-flugb39zon8vvgwe
Tags: 3.2.0-1600.1
[ Bryan Wu ]
* UBUNTU: import debian/debian.env and debian.armadaxp

[ Dann Frazier ]
* ARM: Armada XP: remove trailing '/' in dirnames in mvRules.mk

[ Michael Casadeall ]
* tools: add some tools for Marvell Armada XP processor
* kernel: timer tick hacking from Marvell
* kernel: Sheeva Errata: add delay on Sheeva when powering down
* net: add Marvell NFP netfilter
* net: socket and skb modifications made by Marvell
* miscdevice: add minor IDs for some Marvell Armada drivers
* fs: introduce memory pool for splice()
* video: EDID detection updates from Marvell Armada XP patchset
* video: backlight: add Marvell Dove LCD backlight driver
* video: display: add THS8200 display driver
* video: framebuffer: add Marvell Dove and Armada XP processor onchip LCD controller driver
* usbtest: add Interrupt transfer testing by Marvell Armada XP code
* usb: ehci: add support for Marvell EHCI controler
* tty/serial: 8250: add support for Marvell Armada XP processor and DeviceTree work
* rtc: add support for Marvell Armada XP onchip RTC controller
* net: pppoe: add Marvell ethernet NFP hook in PPPoE networking driver
* mtd: nand: add support for Marvell Armada XP Nand Flash Controller
* mtd: maps: add Marvell Armada XP specific map driver
* mmc: add support for Marvell Armada XP MMC/SD host controller
* i2c: add support for Marvell Armada XP onchip i2c bus controller
* hwmon: add Kconfig option for Armada XP onchip thermal sensor driver
* dmaengine: add Net DMA support for splice and update Marvell XOR DMA engine driver
* ata: add support for Marvell Armada XP SATA controller and update some quirks
* ARM: add Marvell Armada XP machine to mach-types
* ARM: oprofile: add support for Marvell PJ4B core
* ARM: mm: more ARMv6 switches for Marvell Armada XP
* ARM: remove static declaration to allow compilation
* ARM: alignment access fault trick
* ARM: mm: skip some fault fixing when run on NONE SMP ARMv6 mode during early abort event
* ARM: mm: add Marvell Sheeva CPU Architecture for PJ4B
* ARM: introduce optimized copy operation for Marvell Armada XP
* ARM: SAUCE: hardware breakpoint trick for Marvell Armada XP
* ARM: big endian and little endian tricks for Marvell Armada XP
* ARM: SAUCE: Add Marvell Armada XP build rules to arch/arm/kernel/Makefile
* ARM: vfp: add special handling for Marvell Armada XP
* ARM: add support for Marvell U-Boot
* ARM: add mv_controller_num for ARM PCI drivers
* ARM: add support for local PMUs, general SMP tweaks and cache flushing
* ARM: add Marvell device identifies in glue-proc.h
* ARM: add IPC driver support for Marvell platforms
* ARM: add DMA mapping for Marvell platforms
* ARM: add Sheeva errata and PJ4B code for booting
* ARM: update Kconfig and Makefile to include Marvell Armada XP platforms
* ARM: Armada XP: import LSP from Marvell for Armada XP 3.2 kernel enablement

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 * the project's page is at http://www.linuxtv.org/ 
34
34
 */
35
35
 
 
36
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
37
 
36
38
#include "budget.h"
37
39
#include "stv0299.h"
38
40
#include "stb0899_drv.h"
149
151
        result = ttpci_budget_debiread(&budget_av->budget, DEBICICAM, address & 0xfff, 1, 0, 1);
150
152
        if (result == -ETIMEDOUT) {
151
153
                ciintf_slot_shutdown(ca, slot);
152
 
                printk(KERN_INFO "budget-av: cam ejected 1\n");
 
154
                pr_info("cam ejected 1\n");
153
155
        }
154
156
        return result;
155
157
}
168
170
        result = ttpci_budget_debiwrite(&budget_av->budget, DEBICICAM, address & 0xfff, 1, value, 0, 1);
169
171
        if (result == -ETIMEDOUT) {
170
172
                ciintf_slot_shutdown(ca, slot);
171
 
                printk(KERN_INFO "budget-av: cam ejected 2\n");
 
173
                pr_info("cam ejected 2\n");
172
174
        }
173
175
        return result;
174
176
}
187
189
        result = ttpci_budget_debiread(&budget_av->budget, DEBICICAM, address & 3, 1, 0, 0);
188
190
        if (result == -ETIMEDOUT) {
189
191
                ciintf_slot_shutdown(ca, slot);
190
 
                printk(KERN_INFO "budget-av: cam ejected 3\n");
 
192
                pr_info("cam ejected 3\n");
191
193
                return -ETIMEDOUT;
192
194
        }
193
195
        return result;
207
209
        result = ttpci_budget_debiwrite(&budget_av->budget, DEBICICAM, address & 3, 1, value, 0, 0);
208
210
        if (result == -ETIMEDOUT) {
209
211
                ciintf_slot_shutdown(ca, slot);
210
 
                printk(KERN_INFO "budget-av: cam ejected 5\n");
 
212
                pr_info("cam ejected 5\n");
211
213
        }
212
214
        return result;
213
215
}
289
291
                if (saa7146_read(saa, PSR) & MASK_06) {
290
292
                        if (budget_av->slot_status == SLOTSTATUS_NONE) {
291
293
                                budget_av->slot_status = SLOTSTATUS_PRESENT;
292
 
                                printk(KERN_INFO "budget-av: cam inserted A\n");
 
294
                                pr_info("cam inserted A\n");
293
295
                        }
294
296
                }
295
297
                saa7146_setgpio(saa, 3, SAA7146_GPIO_OUTLO);
306
308
                result = ttpci_budget_debiread(&budget_av->budget, DEBICICAM, 0, 1, 0, 1);
307
309
                if ((result >= 0) && (budget_av->slot_status == SLOTSTATUS_NONE)) {
308
310
                        budget_av->slot_status = SLOTSTATUS_PRESENT;
309
 
                        printk(KERN_INFO "budget-av: cam inserted B\n");
 
311
                        pr_info("cam inserted B\n");
310
312
                } else if (result < 0) {
311
313
                        if (budget_av->slot_status != SLOTSTATUS_NONE) {
312
314
                                ciintf_slot_shutdown(ca, slot);
313
 
                                printk(KERN_INFO "budget-av: cam ejected 5\n");
 
315
                                pr_info("cam ejected 5\n");
314
316
                                return 0;
315
317
                        }
316
318
                }
365
367
 
366
368
        if ((result = dvb_ca_en50221_init(&budget_av->budget.dvb_adapter,
367
369
                                          &budget_av->ca, 0, 1)) != 0) {
368
 
                printk(KERN_ERR "budget-av: ci initialisation failed.\n");
 
370
                pr_err("ci initialisation failed\n");
369
371
                goto error;
370
372
        }
371
373
 
372
 
        printk(KERN_INFO "budget-av: ci interface initialised.\n");
 
374
        pr_info("ci interface initialised\n");
373
375
        return 0;
374
376
 
375
377
error:
896
898
        { STB0899_DISRX_ST0             , 0x04 },
897
899
        { STB0899_DISRX_ST1             , 0x00 },
898
900
        { STB0899_DISPARITY             , 0x00 },
899
 
        { STB0899_DISFIFO               , 0x00 },
900
901
        { STB0899_DISSTATUS             , 0x20 },
901
902
        { STB0899_DISF22                , 0x8c },
902
903
        { STB0899_DISF22RX              , 0x9a },
1197
1198
#define SUBID_DVBC_KNC1                 0x0020
1198
1199
#define SUBID_DVBC_KNC1_PLUS            0x0021
1199
1200
#define SUBID_DVBC_KNC1_MK3             0x0022
 
1201
#define SUBID_DVBC_KNC1_TDA10024        0x0028
1200
1202
#define SUBID_DVBC_KNC1_PLUS_MK3        0x0023
1201
1203
#define SUBID_DVBC_CINERGY1200          0x1156
1202
1204
#define SUBID_DVBC_CINERGY1200_MK3      0x1176
1316
1318
        case SUBID_DVBC_EASYWATCH_MK3:
1317
1319
        case SUBID_DVBC_CINERGY1200_MK3:
1318
1320
        case SUBID_DVBC_KNC1_MK3:
 
1321
        case SUBID_DVBC_KNC1_TDA10024:
1319
1322
        case SUBID_DVBC_KNC1_PLUS_MK3:
1320
1323
                budget_av->reinitialise_demod = 1;
1321
1324
                budget_av->budget.dev->i2c_bitrate = SAA7146_I2C_BUS_BIT_RATE_240;
1343
1346
        }
1344
1347
 
1345
1348
        if (fe == NULL) {
1346
 
                printk(KERN_ERR "budget-av: A frontend driver was not found "
1347
 
                                "for device [%04x:%04x] subsystem [%04x:%04x]\n",
 
1349
                pr_err("A frontend driver was not found for device [%04x:%04x] subsystem [%04x:%04x]\n",
1348
1350
                       saa->pci->vendor,
1349
1351
                       saa->pci->device,
1350
1352
                       saa->pci->subsystem_vendor,
1356
1358
 
1357
1359
        if (dvb_register_frontend(&budget_av->budget.dvb_adapter,
1358
1360
                                  budget_av->budget.dvb_frontend)) {
1359
 
                printk(KERN_ERR "budget-av: Frontend registration failed!\n");
 
1361
                pr_err("Frontend registration failed!\n");
1360
1362
                dvb_frontend_detach(budget_av->budget.dvb_frontend);
1361
1363
                budget_av->budget.dvb_frontend = NULL;
1362
1364
        }
1414
1416
 
1415
1417
static int vidioc_enum_input(struct file *file, void *fh, struct v4l2_input *i)
1416
1418
{
1417
 
        dprintk(1, "VIDIOC_ENUMINPUT %d.\n", i->index);
 
1419
        dprintk(1, "VIDIOC_ENUMINPUT %d\n", i->index);
1418
1420
        if (i->index >= KNC1_INPUTS)
1419
1421
                return -EINVAL;
1420
1422
        memcpy(i, &knc1_inputs[i->index], sizeof(struct v4l2_input));
1428
1430
 
1429
1431
        *i = budget_av->cur_input;
1430
1432
 
1431
 
        dprintk(1, "VIDIOC_G_INPUT %d.\n", *i);
 
1433
        dprintk(1, "VIDIOC_G_INPUT %d\n", *i);
1432
1434
        return 0;
1433
1435
}
1434
1436
 
1437
1439
        struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev;
1438
1440
        struct budget_av *budget_av = (struct budget_av *)dev->ext_priv;
1439
1441
 
1440
 
        dprintk(1, "VIDIOC_S_INPUT %d.\n", input);
 
1442
        dprintk(1, "VIDIOC_S_INPUT %d\n", input);
1441
1443
        return saa7113_setinput(budget_av, input);
1442
1444
}
1443
1445
 
1476
1478
 
1477
1479
                if (0 != saa7146_vv_init(dev, &vv_data)) {
1478
1480
                        /* fixme: proper cleanup here */
1479
 
                        ERR(("cannot init vv subsystem.\n"));
 
1481
                        ERR("cannot init vv subsystem\n");
1480
1482
                        return err;
1481
1483
                }
1482
1484
                vv_data.ops.vidioc_enum_input = vidioc_enum_input;
1485
1487
 
1486
1488
                if ((err = saa7146_register_device(&budget_av->vd, dev, "knc1", VFL_TYPE_GRABBER))) {
1487
1489
                        /* fixme: proper cleanup here */
1488
 
                        ERR(("cannot register capture v4l2 device.\n"));
 
1490
                        ERR("cannot register capture v4l2 device\n");
1489
1491
                        saa7146_vv_release(dev);
1490
1492
                        return err;
1491
1493
                }
1502
1504
 
1503
1505
        mac = budget_av->budget.dvb_adapter.proposed_mac;
1504
1506
        if (i2c_readregs(&budget_av->budget.i2c_adap, 0xa0, 0x30, mac, 6)) {
1505
 
                printk(KERN_ERR "KNC1-%d: Could not read MAC from KNC1 card\n",
 
1507
                pr_err("KNC1-%d: Could not read MAC from KNC1 card\n",
1506
1508
                       budget_av->budget.dvb_adapter.num);
1507
1509
                memset(mac, 0, 6);
1508
1510
        } else {
1509
 
                printk(KERN_INFO "KNC1-%d: MAC addr = %.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
1510
 
                       budget_av->budget.dvb_adapter.num,
1511
 
                       mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
 
1511
                pr_info("KNC1-%d: MAC addr = %pM\n",
 
1512
                        budget_av->budget.dvb_adapter.num, mac);
1512
1513
        }
1513
1514
 
1514
1515
        budget_av->budget.dvb_adapter.priv = budget_av;
1558
1559
MAKE_BUDGET_INFO(knc1spx4, "KNC1 DVB-S Plus X4", BUDGET_KNC1SP);
1559
1560
MAKE_BUDGET_INFO(knc1cp, "KNC1 DVB-C Plus", BUDGET_KNC1CP);
1560
1561
MAKE_BUDGET_INFO(knc1cmk3, "KNC1 DVB-C MK3", BUDGET_KNC1C_MK3);
 
1562
MAKE_BUDGET_INFO(knc1ctda10024, "KNC1 DVB-C TDA10024", BUDGET_KNC1C_TDA10024);
1561
1563
MAKE_BUDGET_INFO(knc1cpmk3, "KNC1 DVB-C Plus MK3", BUDGET_KNC1CP_MK3);
1562
1564
MAKE_BUDGET_INFO(knc1tp, "KNC1 DVB-T Plus", BUDGET_KNC1TP);
1563
1565
MAKE_BUDGET_INFO(cin1200s, "TerraTec Cinergy 1200 DVB-S", BUDGET_CIN1200S);
1587
1589
        MAKE_EXTENSION_PCI(knc1c, 0x1894, 0x0020),
1588
1590
        MAKE_EXTENSION_PCI(knc1cp, 0x1894, 0x0021),
1589
1591
        MAKE_EXTENSION_PCI(knc1cmk3, 0x1894, 0x0022),
 
1592
        MAKE_EXTENSION_PCI(knc1ctda10024, 0x1894, 0x0028),
1590
1593
        MAKE_EXTENSION_PCI(knc1cpmk3, 0x1894, 0x0023),
1591
1594
        MAKE_EXTENSION_PCI(knc1t, 0x1894, 0x0030),
1592
1595
        MAKE_EXTENSION_PCI(knc1tp, 0x1894, 0x0031),