diff options
Diffstat (limited to 'drivers/media/dvb/dm1105')
| -rw-r--r-- | drivers/media/dvb/dm1105/Kconfig | 20 | ||||
| -rw-r--r-- | drivers/media/dvb/dm1105/Makefile | 3 | ||||
| -rw-r--r-- | drivers/media/dvb/dm1105/dm1105.c | 1245 |
3 files changed, 1268 insertions, 0 deletions
diff --git a/drivers/media/dvb/dm1105/Kconfig b/drivers/media/dvb/dm1105/Kconfig new file mode 100644 index 00000000000..f3de0a4d63f --- /dev/null +++ b/drivers/media/dvb/dm1105/Kconfig | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | config DVB_DM1105 | ||
| 2 | tristate "SDMC DM1105 based PCI cards" | ||
| 3 | depends on DVB_CORE && PCI && I2C | ||
| 4 | select DVB_PLL if !DVB_FE_CUSTOMISE | ||
| 5 | select DVB_STV0299 if !DVB_FE_CUSTOMISE | ||
| 6 | select DVB_STV0288 if !DVB_FE_CUSTOMISE | ||
| 7 | select DVB_STB6000 if !DVB_FE_CUSTOMISE | ||
| 8 | select DVB_CX24116 if !DVB_FE_CUSTOMISE | ||
| 9 | select DVB_SI21XX if !DVB_FE_CUSTOMISE | ||
| 10 | select DVB_DS3000 if !DVB_FE_CUSTOMISE | ||
| 11 | depends on RC_CORE | ||
| 12 | help | ||
| 13 | Support for cards based on the SDMC DM1105 PCI chip like | ||
| 14 | DvbWorld 2002 | ||
| 15 | |||
| 16 | Since these cards have no MPEG decoder onboard, they transmit | ||
| 17 | only compressed MPEG data over the PCI bus, so you need | ||
| 18 | an external software decoder to watch TV on your computer. | ||
| 19 | |||
| 20 | Say Y or M if you own such a device and want to use it. | ||
diff --git a/drivers/media/dvb/dm1105/Makefile b/drivers/media/dvb/dm1105/Makefile new file mode 100644 index 00000000000..8ac28b0546a --- /dev/null +++ b/drivers/media/dvb/dm1105/Makefile | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | obj-$(CONFIG_DVB_DM1105) += dm1105.o | ||
| 2 | |||
| 3 | EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends | ||
diff --git a/drivers/media/dvb/dm1105/dm1105.c b/drivers/media/dvb/dm1105/dm1105.c new file mode 100644 index 00000000000..55e6533f15e --- /dev/null +++ b/drivers/media/dvb/dm1105/dm1105.c | |||
| @@ -0,0 +1,1245 @@ | |||
| 1 | /* | ||
| 2 | * dm1105.c - driver for DVB cards based on SDMC DM1105 PCI chip | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008 Igor M. Liplianin <liplianin@me.by> | ||
| 5 | * | ||
| 6 | * This program is free software; you can redistribute it and/or modify | ||
| 7 | * it under the terms of the GNU General Public License as published by | ||
| 8 | * the Free Software Foundation; either version 2 of the License, or | ||
| 9 | * (at your option) any later version. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope that it will be useful, | ||
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | * GNU General Public License for more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License | ||
| 17 | * along with this program; if not, write to the Free Software | ||
| 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
| 19 | * | ||
| 20 | */ | ||
| 21 | |||
| 22 | #include <linux/i2c.h> | ||
| 23 | #include <linux/i2c-algo-bit.h> | ||
| 24 | #include <linux/init.h> | ||
| 25 | #include <linux/interrupt.h> | ||
| 26 | #include <linux/kernel.h> | ||
| 27 | #include <linux/module.h> | ||
| 28 | #include <linux/proc_fs.h> | ||
| 29 | #include <linux/pci.h> | ||
| 30 | #include <linux/dma-mapping.h> | ||
| 31 | #include <linux/slab.h> | ||
| 32 | #include <media/rc-core.h> | ||
| 33 | |||
| 34 | #include "demux.h" | ||
| 35 | #include "dmxdev.h" | ||
| 36 | #include "dvb_demux.h" | ||
| 37 | #include "dvb_frontend.h" | ||
| 38 | #include "dvb_net.h" | ||
| 39 | #include "dvbdev.h" | ||
| 40 | #include "dvb-pll.h" | ||
| 41 | |||
| 42 | #include "stv0299.h" | ||
| 43 | #include "stv0288.h" | ||
| 44 | #include "stb6000.h" | ||
| 45 | #include "si21xx.h" | ||
| 46 | #include "cx24116.h" | ||
| 47 | #include "z0194a.h" | ||
| 48 | #include "ds3000.h" | ||
| 49 | |||
| 50 | #define MODULE_NAME "dm1105" | ||
| 51 | |||
| 52 | #define UNSET (-1U) | ||
| 53 | |||
| 54 | #define DM1105_BOARD_NOAUTO UNSET | ||
| 55 | #define DM1105_BOARD_UNKNOWN 0 | ||
| 56 | #define DM1105_BOARD_DVBWORLD_2002 1 | ||
| 57 | #define DM1105_BOARD_DVBWORLD_2004 2 | ||
| 58 | #define DM1105_BOARD_AXESS_DM05 3 | ||
| 59 | #define DM1105_BOARD_UNBRANDED_I2C_ON_GPIO 4 | ||
| 60 | |||
| 61 | /* ----------------------------------------------- */ | ||
| 62 | /* | ||
| 63 | * PCI ID's | ||
| 64 | */ | ||
| 65 | #ifndef PCI_VENDOR_ID_TRIGEM | ||
| 66 | #define PCI_VENDOR_ID_TRIGEM 0x109f | ||
| 67 | #endif | ||
| 68 | #ifndef PCI_VENDOR_ID_AXESS | ||
| 69 | #define PCI_VENDOR_ID_AXESS 0x195d | ||
| 70 | #endif | ||
| 71 | #ifndef PCI_DEVICE_ID_DM1105 | ||
| 72 | #define PCI_DEVICE_ID_DM1105 0x036f | ||
| 73 | #endif | ||
| 74 | #ifndef PCI_DEVICE_ID_DW2002 | ||
| 75 | #define PCI_DEVICE_ID_DW2002 0x2002 | ||
| 76 | #endif | ||
| 77 | #ifndef PCI_DEVICE_ID_DW2004 | ||
| 78 | #define PCI_DEVICE_ID_DW2004 0x2004 | ||
| 79 | #endif | ||
| 80 | #ifndef PCI_DEVICE_ID_DM05 | ||
| 81 | #define PCI_DEVICE_ID_DM05 0x1105 | ||
| 82 | #endif | ||
| 83 | /* ----------------------------------------------- */ | ||
| 84 | /* sdmc dm1105 registers */ | ||
| 85 | |||
| 86 | /* TS Control */ | ||
| 87 | #define DM1105_TSCTR 0x00 | ||
| 88 | #define DM1105_DTALENTH 0x04 | ||
| 89 | |||
| 90 | /* GPIO Interface */ | ||
| 91 | #define DM1105_GPIOVAL 0x08 | ||
| 92 | #define DM1105_GPIOCTR 0x0c | ||
| 93 | |||
| 94 | /* PID serial number */ | ||
| 95 | #define DM1105_PIDN 0x10 | ||
| 96 | |||
| 97 | /* Odd-even secret key select */ | ||
| 98 | #define DM1105_CWSEL 0x14 | ||
| 99 | |||
| 100 | /* Host Command Interface */ | ||
| 101 | #define DM1105_HOST_CTR 0x18 | ||
| 102 | #define DM1105_HOST_AD 0x1c | ||
| 103 | |||
| 104 | /* PCI Interface */ | ||
| 105 | #define DM1105_CR 0x30 | ||
| 106 | #define DM1105_RST 0x34 | ||
| 107 | #define DM1105_STADR 0x38 | ||
| 108 | #define DM1105_RLEN 0x3c | ||
| 109 | #define DM1105_WRP 0x40 | ||
| 110 | #define DM1105_INTCNT 0x44 | ||
| 111 | #define DM1105_INTMAK 0x48 | ||
| 112 | #define DM1105_INTSTS 0x4c | ||
| 113 | |||
| 114 | /* CW Value */ | ||
| 115 | #define DM1105_ODD 0x50 | ||
| 116 | #define DM1105_EVEN 0x58 | ||
| 117 | |||
| 118 | /* PID Value */ | ||
| 119 | #define DM1105_PID 0x60 | ||
| 120 | |||
| 121 | /* IR Control */ | ||
| 122 | #define DM1105_IRCTR 0x64 | ||
| 123 | #define DM1105_IRMODE 0x68 | ||
| 124 | #define DM1105_SYSTEMCODE 0x6c | ||
| 125 | #define DM1105_IRCODE 0x70 | ||
| 126 | |||
| 127 | /* Unknown Values */ | ||
| 128 | #define DM1105_ENCRYPT 0x74 | ||
| 129 | #define DM1105_VER 0x7c | ||
| 130 | |||
| 131 | /* I2C Interface */ | ||
| 132 | #define DM1105_I2CCTR 0x80 | ||
| 133 | #define DM1105_I2CSTS 0x81 | ||
| 134 | #define DM1105_I2CDAT 0x82 | ||
| 135 | #define DM1105_I2C_RA 0x83 | ||
| 136 | /* ----------------------------------------------- */ | ||
| 137 | /* Interrupt Mask Bits */ | ||
| 138 | |||
| 139 | #define INTMAK_TSIRQM 0x01 | ||
| 140 | #define INTMAK_HIRQM 0x04 | ||
| 141 | #define INTMAK_IRM 0x08 | ||
| 142 | #define INTMAK_ALLMASK (INTMAK_TSIRQM | \ | ||
| 143 | INTMAK_HIRQM | \ | ||
| 144 | INTMAK_IRM) | ||
| 145 | #define INTMAK_NONEMASK 0x00 | ||
| 146 | |||
| 147 | /* Interrupt Status Bits */ | ||
| 148 | #define INTSTS_TSIRQ 0x01 | ||
| 149 | #define INTSTS_HIRQ 0x04 | ||
| 150 | #define INTSTS_IR 0x08 | ||
| 151 | |||
| 152 | /* IR Control Bits */ | ||
| 153 | #define DM1105_IR_EN 0x01 | ||
| 154 | #define DM1105_SYS_CHK 0x02 | ||
| 155 | #define DM1105_REP_FLG 0x08 | ||
| 156 | |||
| 157 | /* EEPROM addr */ | ||
| 158 | #define IIC_24C01_addr 0xa0 | ||
| 159 | /* Max board count */ | ||
| 160 | #define DM1105_MAX 0x04 | ||
| 161 | |||
| 162 | #define DRIVER_NAME "dm1105" | ||
| 163 | #define DM1105_I2C_GPIO_NAME "dm1105-gpio" | ||
| 164 | |||
| 165 | #define DM1105_DMA_PACKETS 47 | ||
| 166 | #define DM1105_DMA_PACKET_LENGTH (128*4) | ||
| 167 | #define DM1105_DMA_BYTES (128 * 4 * DM1105_DMA_PACKETS) | ||
| 168 | |||
| 169 | /* */ | ||
| 170 | #define GPIO08 (1 << 8) | ||
| 171 | #define GPIO13 (1 << 13) | ||
| 172 | #define GPIO14 (1 << 14) | ||
| 173 | #define GPIO15 (1 << 15) | ||
| 174 | #define GPIO16 (1 << 16) | ||
| 175 | #define GPIO17 (1 << 17) | ||
| 176 | #define GPIO_ALL 0x03ffff | ||
| 177 | |||
| 178 | /* GPIO's for LNB power control */ | ||
| 179 | #define DM1105_LNB_MASK (GPIO_ALL & ~(GPIO14 | GPIO13)) | ||
| 180 | #define DM1105_LNB_OFF GPIO17 | ||
| 181 | #define DM1105_LNB_13V (GPIO16 | GPIO08) | ||
| 182 | #define DM1105_LNB_18V GPIO08 | ||
| 183 | |||
| 184 | /* GPIO's for LNB power control for Axess DM05 */ | ||
