aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/b2c2
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/b2c2')
-rw-r--r--drivers/media/dvb/b2c2/Kconfig45
-rw-r--r--drivers/media/dvb/b2c2/Makefile16
-rw-r--r--drivers/media/dvb/b2c2/flexcop-common.h185
-rw-r--r--drivers/media/dvb/b2c2/flexcop-dma.c172
-rw-r--r--drivers/media/dvb/b2c2/flexcop-eeprom.c147
-rw-r--r--drivers/media/dvb/b2c2/flexcop-fe-tuner.c678
-rw-r--r--drivers/media/dvb/b2c2/flexcop-hw-filter.c232
-rw-r--r--drivers/media/dvb/b2c2/flexcop-i2c.c288
-rw-r--r--drivers/media/dvb/b2c2/flexcop-misc.c86
-rw-r--r--drivers/media/dvb/b2c2/flexcop-pci.c450
-rw-r--r--drivers/media/dvb/b2c2/flexcop-reg.h166
-rw-r--r--drivers/media/dvb/b2c2/flexcop-sram.c363
-rw-r--r--drivers/media/dvb/b2c2/flexcop-usb.c608
-rw-r--r--drivers/media/dvb/b2c2/flexcop-usb.h111
-rw-r--r--drivers/media/dvb/b2c2/flexcop.c311
-rw-r--r--drivers/media/dvb/b2c2/flexcop.h29
-rw-r--r--drivers/media/dvb/b2c2/flexcop_ibi_value_be.h455
-rw-r--r--drivers/media/dvb/b2c2/flexcop_ibi_value_le.h455
18 files changed, 4797 insertions, 0 deletions
diff --git a/drivers/media/dvb/b2c2/Kconfig b/drivers/media/dvb/b2c2/Kconfig
new file mode 100644
index 00000000000..9e578140074
--- /dev/null
+++ b/drivers/media/dvb/b2c2/Kconfig
@@ -0,0 +1,45 @@
1config DVB_B2C2_FLEXCOP
2 tristate "Technisat/B2C2 FlexCopII(b) and FlexCopIII adapters"
3 depends on DVB_CORE && I2C
4 select DVB_PLL if !DVB_FE_CUSTOMISE
5 select DVB_STV0299 if !DVB_FE_CUSTOMISE
6 select DVB_MT352 if !DVB_FE_CUSTOMISE
7 select DVB_MT312 if !DVB_FE_CUSTOMISE
8 select DVB_NXT200X if !DVB_FE_CUSTOMISE
9 select DVB_STV0297 if !DVB_FE_CUSTOMISE
10 select DVB_BCM3510 if !DVB_FE_CUSTOMISE
11 select DVB_LGDT330X if !DVB_FE_CUSTOMISE
12 select DVB_S5H1420 if !DVB_FE_CUSTOMISE
13 select DVB_TUNER_ITD1000 if !DVB_FE_CUSTOMISE
14 select DVB_ISL6421 if !DVB_FE_CUSTOMISE
15 select DVB_CX24123 if !DVB_FE_CUSTOMISE
16 select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMISE
17 select DVB_TUNER_CX24113 if !DVB_FE_CUSTOMISE
18 help
19 Support for the digital TV receiver chip made by B2C2 Inc. included in
20 Technisats PCI cards and USB boxes.
21
22 Say Y if you own such a device and want to use it.
23
24config DVB_B2C2_FLEXCOP_PCI
25 tristate "Technisat/B2C2 Air/Sky/Cable2PC PCI"
26 depends on DVB_B2C2_FLEXCOP && PCI && I2C
27 help
28 Support for the Air/Sky/CableStar2 PCI card (DVB/ATSC) by Technisat/B2C2.
29
30 Say Y if you own such a device and want to use it.
31
32config DVB_B2C2_FLEXCOP_USB
33 tristate "Technisat/B2C2 Air/Sky/Cable2PC USB"
34 depends on DVB_B2C2_FLEXCOP && USB && I2C
35 help
36 Support for the Air/Sky/Cable2PC USB1.1 box (DVB/ATSC) by Technisat/B2C2,
37
38 Say Y if you own such a device and want to use it.
39
40config DVB_B2C2_FLEXCOP_DEBUG
41 bool "Enable debug for the B2C2 FlexCop drivers"
42 depends on DVB_B2C2_FLEXCOP
43 help
44 Say Y if you want to enable the module option to control debug messages
45 of all B2C2 FlexCop drivers.
diff --git a/drivers/media/dvb/b2c2/Makefile b/drivers/media/dvb/b2c2/Makefile
new file mode 100644
index 00000000000..b97cf7208a1
--- /dev/null
+++ b/drivers/media/dvb/b2c2/Makefile
@@ -0,0 +1,16 @@
1b2c2-flexcop-objs = flexcop.o flexcop-fe-tuner.o flexcop-i2c.o \
2 flexcop-sram.o flexcop-eeprom.o flexcop-misc.o flexcop-hw-filter.o
3obj-$(CONFIG_DVB_B2C2_FLEXCOP) += b2c2-flexcop.o
4
5ifneq ($(CONFIG_DVB_B2C2_FLEXCOP_PCI),)
6b2c2-flexcop-objs += flexcop-dma.o
7endif
8
9b2c2-flexcop-pci-objs = flexcop-pci.o
10obj-$(CONFIG_DVB_B2C2_FLEXCOP_PCI) += b2c2-flexcop-pci.o
11
12b2c2-flexcop-usb-objs = flexcop-usb.o
13obj-$(CONFIG_DVB_B2C2_FLEXCOP_USB) += b2c2-flexcop-usb.o
14
15EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
16EXTRA_CFLAGS += -Idrivers/media/common/tuners/
diff --git a/drivers/media/dvb/b2c2/flexcop-common.h b/drivers/media/dvb/b2c2/flexcop-common.h
new file mode 100644
index 00000000000..437912e4982
--- /dev/null
+++ b/drivers/media/dvb/b2c2/flexcop-common.h
@@ -0,0 +1,185 @@
1/*
2 * Linux driver for digital TV devices equipped with B2C2 FlexcopII(b)/III
3 * flexcop-common.h - common header file for device-specific source files
4 * see flexcop.c for copyright information
5 */
6#ifndef __FLEXCOP_COMMON_H__
7#define __FLEXCOP_COMMON_H__
8
9#include <linux/interrupt.h>
10#include <linux/pci.h>
11#include <linux/mutex.h>
12
13#include "flexcop-reg.h"
14
15#include "dmxdev.h"
16#include "dvb_demux.h"
17#include "dvb_filter.h"
18#include "dvb_net.h"
19#include "dvb_frontend.h"
20
21#define FC_MAX_FEED 256
22
23#ifndef FC_LOG_PREFIX
24#warning please define a log prefix for your file, using a default one
25#define FC_LOG_PREFIX "b2c2-undef"
26#endif
27
28/* Steal from usb.h */
29#undef err
30#define err(format, arg...) \
31 printk(KERN_ERR FC_LOG_PREFIX ": " format "\n" , ## arg)
32#undef info
33#define info(format, arg...) \
34 printk(KERN_INFO FC_LOG_PREFIX ": " format "\n" , ## arg)
35#undef warn
36#define warn(format, arg...) \
37 printk(KERN_WARNING FC_LOG_PREFIX ": " format "\n" , ## arg)
38
39struct flexcop_dma {
40 struct pci_dev *pdev;
41
42 u8 *cpu_addr0;
43 dma_addr_t dma_addr0;
44 u8 *cpu_addr1;
45 dma_addr_t dma_addr1;
46 u32 size; /* size of each address in bytes */
47};
48
49struct flexcop_i2c_adapter {
50 struct flexcop_device *fc;
51 struct i2c_adapter i2c_adap;
52
53 u8 no_base_addr;
54 flexcop_i2c_port_t port;
55};
56
57/* Control structure for data definitions that are common to
58 * the B2C2-based PCI and USB devices.
59 */
60struct flexcop_device {
61 /* general */
62 struct device *dev; /* for firmware_class */
63
64#define FC_STATE_DVB_INIT 0x01
65#define FC_STATE_I2C_INIT 0x02
66#define FC_STATE_FE_INIT 0x04
67 int init_state;
68
69 /* device information */
70 int has_32_hw_pid_filter;
71 flexcop_revision_t rev;
72 flexcop_device_type_t dev_type;
73 flexcop_bus_t bus_type;
74
75 /* dvb stuff */
76 struct dvb_adapter dvb_adapter;
77 struct dvb_frontend *fe;
78 struct dvb_net dvbnet;
79 struct dvb_demux demux;
80 struct dmxdev dmxdev;
81 struct dmx_frontend hw_frontend;
82 struct dmx_frontend mem_frontend;
83 int (*fe_sleep) (struct dvb_frontend *);
84
85 struct flexcop_i2c_adapter fc_i2c_adap[3];
86 struct mutex i2c_mutex;
87 struct module *owner;
88
89 /* options and status */
90 int extra_feedcount;
91 int feedcount;
92 int pid_filtering;
93 int fullts_streaming_state;
94
95 /* bus specific callbacks */
96 flexcop_ibi_value(*read_ibi_reg) (struct flexcop_device *,
97 flexcop_ibi_register);
98 int (*write_ibi_reg) (struct flexcop_device *,
99 flexcop_ibi_register, flexcop_ibi_value);
100 int (*i2c_request) (struct flexcop_i2c_adapter *,
101 flexcop_access_op_t, u8 chipaddr, u8 addr, u8 *buf, u16 len);
102 int (*stream_control) (struct flexcop_device *, int);
103 int (*get_mac_addr) (struct flexcop_device *fc, int extended);
104 void *bus_specific;
105};
106
107/* exported prototypes */
108
109/* from flexcop.c */
110void flexcop_pass_dmx_data(struct flexcop_device *fc, u8 *buf, u32 len);
111void flexcop_pass_dmx_packets(struct flexcop_device *fc, u8 *buf, u32 no);
112
113struct flexcop_device *flexcop_device_kmalloc(size_t bus_specific_len);
114void flexcop_device_kfree(struct flexcop_device *);
115
116int flexcop_device_initialize(struct flexcop_device *);
117void flexcop_device_exit(struct flexcop_device *fc);
118void flexcop_reset_block_300(struct flexcop_device *fc);
119
120/* from flexcop-dma.c */
121int flexcop_dma_allocate(struct pci_dev *pdev,
122 struct flexcop_dma *dma, u32 size);
123void flexcop_dma_free(struct flexcop_dma *dma);