diff options
Diffstat (limited to 'linux/drivers/media/dvb/ttpci')
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110.h | 1 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/av7110_hw.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/budget-patch.c | 89 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/budget.c | 41 | ||||
-rw-r--r-- | linux/drivers/media/dvb/ttpci/ttpci-eeprom.c | 1 |
5 files changed, 66 insertions, 70 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.h b/linux/drivers/media/dvb/ttpci/av7110.h index 46aab89eb..09bc74ce2 100644 --- a/linux/drivers/media/dvb/ttpci/av7110.h +++ b/linux/drivers/media/dvb/ttpci/av7110.h @@ -281,4 +281,3 @@ extern int av7110_init_v4l(struct av7110 *av7110); extern int av7110_exit_v4l(struct av7110 *av7110); #endif /* _AV7110_H_ */ - diff --git a/linux/drivers/media/dvb/ttpci/av7110_hw.c b/linux/drivers/media/dvb/ttpci/av7110_hw.c index 8c0a1611f..b90a61248 100644 --- a/linux/drivers/media/dvb/ttpci/av7110_hw.c +++ b/linux/drivers/media/dvb/ttpci/av7110_hw.c @@ -95,7 +95,7 @@ u32 av7110_debiread(struct av7110 *av7110, u32 config, int addr, int count) printk("%s: wait_for_debi_done #2 failed\n", __FUNCTION__); return 0; } - + result = saa7146_read(dev, DEBI_AD); result &= (0xffffffffUL >> ((4 - count) * 8)); return result; @@ -314,7 +314,7 @@ int av7110_wait_msgstate(struct av7110 *av7110, u16 flags) msleep(50); return 0; } - + /* new firmware */ start = jiffies; for (;;) { diff --git a/linux/drivers/media/dvb/ttpci/budget-patch.c b/linux/drivers/media/dvb/ttpci/budget-patch.c index 866f149cc..dc45a3ded 100644 --- a/linux/drivers/media/dvb/ttpci/budget-patch.c +++ b/linux/drivers/media/dvb/ttpci/budget-patch.c @@ -13,19 +13,19 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Or, point your browser to http://www.gnu.org/copyleft/gpl.html - * + * * * the project's page is at http://www.linuxtv.org/dvb/ */ @@ -55,7 +55,7 @@ static struct pci_device_id pci_tbl[] = { /* those lines are for budget-patch to be tried ** on a true budget card and observe the ** behaviour of VSYNC generated by rps1. -** this code was shamelessly copy/pasted from budget.c +** this code was shamelessly copy/pasted from budget.c */ static void gpio_Set22K (struct budget *budget, int state) { @@ -123,7 +123,7 @@ static int SendDiSEqCMsg (struct budget *budget, int len, u8 *msg, unsigned long return 0; } -/* shamelessly copy/pasted from budget.c +/* shamelessly copy/pasted from budget.c */ static int budget_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) { @@ -173,12 +173,12 @@ static int budget_av7110_send_fw_cmd(struct budget_patch *budget, u16* buf, int { ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND + 2*i, 2, (u32) buf[i], 0,0); msleep(5); - } + } if (length) ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND + 2, 2, (u32) buf[1], 0,0); else ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND + 2, 2, 0, 0,0); - msleep(5); + msleep(5); ttpci_budget_debiwrite(budget, DEBINOSWAP, COMMAND, 2, (u32) buf[0], 0,0); msleep(5); return 0; @@ -187,7 +187,7 @@ static int budget_av7110_send_fw_cmd(struct budget_patch *budget, u16* buf, int static void av7110_set22k(struct budget_patch *budget, int state) { u16 buf[2] = {( COMTYPE_AUDIODAC << 8) | (state ? ON22K : OFF22K), 0}; - + dprintk(2, "budget: %p\n", budget); budget_av7110_send_fw_cmd(budget, buf, 2); } @@ -210,7 +210,7 @@ static int av7110_send_diseqc_msg(struct budget_patch *budget, int len, u8 *msg, buf[3]=burst ? 0x01 : 0x00; else buf[3]=0xffff; - + for (i=0; i<len; i++) buf[i+4]=msg[i]; @@ -412,11 +412,11 @@ static struct tda8083_config grundig_29504_451_config = { }; static void frontend_init(struct budget_patch* budget) -{ +{ switch(budget->dev->pci->subsystem_device) { case 0x0000: // Hauppauge/TT WinTV DVB-S rev1.X case 0x1013: // SATELCO Multimedia PCI - + // try the ALPS BSRV2 first of all budget->dvb_frontend = ves1x93_attach(&alps_bsrv2_config, &budget->i2c_adap); if (budget->dvb_frontend) { @@ -498,7 +498,7 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte saa7146_write(dev, CLIP_FORMAT_CTRL, 0); // r78 // Set HPS prescaler for port B input saa7146_write(dev, HPS_CTRL, (1<<30) | (0<<29) | (1<<28) | (0<<12) ); - saa7146_write(dev, MC2, + saa7146_write(dev, MC2, 0 * (MASK_08 | MASK_24) | // BRS control 0 * (MASK_09 | MASK_25) | // a 0 * (MASK_10 | MASK_26) | // b @@ -512,15 +512,15 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte // RPS1 timeout disable saa7146_write(dev, RPS_TOV1, 0); - // code for autodetection + // code for autodetection // will wait for VBI_B event (vertical blank at port B) // and will reset GPIO3 after VBI_B is detected. // (GPIO3 should be raised high by CPU to - // test if GPIO3 will generate vertical blank signal + // test if GPIO3 will generate vertical blank signal // in budget patch GPIO3 is connected to VSYNC_B count = 0; #if 0 - WRITE_RPS1(cpu_to_le32(CMD_UPLOAD | + WRITE_RPS1(cpu_to_le32(CMD_UPLOAD | MASK_10 | MASK_09 | MASK_08 | MASK_06 | MASK_05 | MASK_04 | MASK_03 | MASK_02 )); #endif WRITE_RPS1(cpu_to_le32(CMD_PAUSE | EVT_VBI_B)); @@ -557,7 +557,7 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTHI); mdelay(150); - + if( (saa7146_read(dev, GPIO_CTRL) & 0x10000000) == 0) detected = 1; @@ -570,51 +570,51 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte if(detected == 0) printk("budget-patch not detected or saa7146 in non-default state.\n" "try enabling ressetting of 7146 with MASK_31 in MC1 register\n"); - + else printk("BUDGET-PATCH DETECTED.\n"); /* OLD (Original design by Roberto Deza): -** This code will setup the SAA7146_RPS1 to generate a square -** wave on GPIO3, changing when a field (TS_HEIGHT/2 "lines" of -** TS_WIDTH packets) has been acquired on SAA7146_D1B video port; -** then, this GPIO3 output which is connected to the D1B_VSYNC -** input, will trigger the acquisition of the alternate field +** This code will setup the SAA7146_RPS1 to generate a square +** wave on GPIO3, changing when a field (TS_HEIGHT/2 "lines" of +** TS_WIDTH packets) has been acquired on SAA7146_D1B video port; +** then, this GPIO3 output which is connected to the D1B_VSYNC +** input, will trigger the acquisition of the alternate field ** and so on. -** Currently, the TT_budget / WinTV_Nova cards have two ICs -** (74HCT4040, LVC74) for the generation of this VSYNC signal, +** Currently, the TT_budget / WinTV_Nova cards have two ICs +** (74HCT4040, LVC74) for the generation of this VSYNC signal, ** which seems that can be done perfectly without this :-)). -*/ +*/ /* 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 ** HS is an internal event of 7146, accessible with RPS -** and temporarily raised high every n lines +** 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 ** ends, HS is lowered. -** To transmit data over DMA, 7146 needs changing state at -** port B VSYNC pin. Any changing of port B VSYNC will +** To transmit data over DMA, 7146 needs changing state at +** port B VSYNC pin. Any changing of port B VSYNC will ** cause some DMA data transfer, with more or less packets loss. -** It depends on the phase and frequency of VSYNC and +** It depends on the phase and frequency of VSYNC and ** the way of 7146 is instructed to trigger on port B (defined ** in DD1_INIT register, 3rd nibble from the right valid ** numbers are 0-7, see datasheet) ** -** The correct triggering can minimize packet loss, +** The correct triggering can minimize packet loss, ** dvbtraffic should give this stable bandwidths: ** 22k transponder = 33814 kbit/s ** 27.5k transponder = 38045 kbit/s -** by experiment it is found that the best results -** (stable bandwidths and almost no packet loss) -** are obtained using DD1_INIT triggering number 2 -** (Va at rising edge of VS Fa = HS x VS-failing forced toggle) +** by experiment it is found that the best results +** (stable bandwidths and almost no packet loss) +** are obtained using DD1_INIT triggering number 2 +** (Va at rising edge of VS Fa = HS x VS-failing forced toggle) ** and a VSYNC phase that occurs in the middle of DMA transfer ** (about byte 188*512=96256 in the DMA window). ** @@ -625,20 +625,20 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte ** increment. That's how the 7146 is programmed to do event ** counting in this budget-patch.c ** I *think* HPS setting has something to do with the phase -** of HS but I cant be 100% sure in that. +** of HS but I cant be 100% sure in that. ** 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 -** watch cat /proc/interrupts +** watch cat /proc/interrupts ** ** If this frequency is 3x lower (and data received in the DMA ** buffer don't start with 0x47, but in the middle of packets, ** whose lengths appear to be like 188 292 188 104 etc. -** this means VSYNC line is not connected in the hardware. +** 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 +** The same behaviour of missing VSYNC can be duplicated on budget ** cards, by seting DD1_INIT trigger mode 7 in 3rd nibble. */ @@ -681,14 +681,14 @@ static int budget_patch_attach (struct saa7146_dev* dev, struct saa7146_pci_exte // low 16 bits are set to TS_WIDTH bytes (TS_WIDTH=2*188 //,then RPS_THRESH1 // should be set to trigger every TS_HEIGHT (512) lines. - // + // saa7146_write(dev, RPS_THRESH1, (TS_HEIGHT*1) | MASK_12 ); - + // saa7146_write(dev, RPS_THRESH0, ((TS_HEIGHT/2)<<16) |MASK_28| (TS_HEIGHT/2) |MASK_12 ); // Enable RPS1 (rFC p33) saa7146_write(dev, MC1, (MASK_13 | MASK_29)); - + if (!(budget = kmalloc (sizeof(struct budget_patch), GFP_KERNEL))) return -ENOMEM; @@ -722,20 +722,20 @@ static int budget_patch_detach (struct saa7146_dev* dev) return err; } -static int __init budget_patch_init(void) +static int __init budget_patch_init(void) { return saa7146_register_extension(&budget_extension); } static void __exit budget_patch_exit(void) { - saa7146_unregister_extension(&budget_extension); + saa7146_unregister_extension(&budget_extension); } static struct saa7146_extension budget_extension = { .name = "budget_patch dvb\0", .flags = 0, - + .module = THIS_MODULE, .pci_tbl = pci_tbl, .attach = budget_patch_attach, @@ -752,4 +752,3 @@ MODULE_LICENSE("GPL"); MODULE_AUTHOR("Emard, Roberto Deza, Holger Waechtler, Michael Hunold, others"); MODULE_DESCRIPTION("Driver for full TS modified DVB-S SAA7146+AV7110 " "based so-called Budget Patch cards"); - diff --git a/linux/drivers/media/dvb/ttpci/budget.c b/linux/drivers/media/dvb/ttpci/budget.c index c2a8b8cb9..5e6a10f4a 100644 --- a/linux/drivers/media/dvb/ttpci/budget.c +++ b/linux/drivers/media/dvb/ttpci/budget.c @@ -1,35 +1,35 @@ /* - * budget.c: driver for the SAA7146 based Budget DVB cards + * budget.c: driver for the SAA7146 based Budget DVB cards * - * Compiled from various sources by Michael Hunold <michael@mihu.de> + * Compiled from various sources by Michael Hunold <michael@mihu.de> * * Copyright (C) 2002 Ralph Metzler <rjkm@metzlerbros.de> * - * Copyright (C) 1999-2002 Ralph Metzler + * Copyright (C) 1999-2002 Ralph Metzler * & Marcus Metzler for convergence integrated media GmbH * * 26feb2004 Support for FS Activy Card (Grundig tuner) by * Michael Dreher <michael@5dot1.de>, * Oliver Endriss <o.endriss@gmx.de> and * Andreas 'randy' Weinberger - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - * + * * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Or, point your browser to http://www.gnu.org/copyleft/gpl.html - * + * * * the project's page is at http://www.linuxtv.org/dvb/ */ @@ -204,7 +204,7 @@ static int alps_bsrv2_pll_set(struct dvb_frontend* fe, struct dvb_frontend_param return 0; } -static struct ves1x93_config alps_bsrv2_config = +static struct ves1x93_config alps_bsrv2_config = { .demod_address = 0x08, .xin = 90100000UL, @@ -358,7 +358,7 @@ static int grundig_29504_401_pll_set(struct dvb_frontend* fe, struct dvb_fronten if (params->frequency < 175000000) band_select = 0x0e; else if (params->frequency < 470000000) band_select = 0x05; else band_select = 0x03; - + data[0] = (div >> 8) & 0x7f; data[1] = div & 0xff; data[2] = ((div >> 10) & 0x60) | cfg; @@ -409,7 +409,7 @@ static u8 read_pwm(struct budget* budget) } static void frontend_init(struct budget *budget) -{ +{ switch(budget->dev->pci->subsystem_device) { case 0x1003: // Hauppauge/TT Nova budget (stv0299/ALPS BSRU6(tsa5059) OR ves1893/ALPS BSRV2(sp5659)) case 0x1013: @@ -432,24 +432,24 @@ static void frontend_init(struct budget *budget) } break; - case 0x1004: // Hauppauge/TT DVB-C budget (ves1820/ALPS TDBE2(sp5659)) + case 0x1004: // Hauppauge/TT DVB-C budget (ves1820/ALPS TDBE2(sp5659)) budget->dvb_frontend = ves1820_attach(&alps_tdbe2_config, &budget->i2c_adap, read_pwm(budget)); if (budget->dvb_frontend) break; break; - case 0x1005: // Hauppauge/TT Nova-T budget (L64781/Grundig 29504-401(tsa5060)) + case 0x1005: // Hauppauge/TT Nova-T budget (L64781/Grundig 29504-401(tsa5060)) budget->dvb_frontend = l64781_attach(&grundig_29504_401_config, &budget->i2c_adap); if (budget->dvb_frontend) break; break; case 0x4f60: // Fujitsu Siemens Activy Budget-S PCI rev AL (stv0299/ALPS BSRU6(tsa5059)) - budget->dvb_frontend = stv0299_attach(&alps_bsru6_config, &budget->i2c_adap); + budget->dvb_frontend = stv0299_attach(&alps_bsru6_config, &budget->i2c_adap); if (budget->dvb_frontend) { budget->dvb_frontend->ops->set_voltage = siemens_budget_set_voltage; break; - } + } break; case 0x4f61: // Fujitsu Siemens Activy Budget-S PCI rev GR (tda8083/Grundig 29504-451(tsa5522)) @@ -514,7 +514,7 @@ static int budget_detach (struct saa7146_dev* dev) kfree (budget); dev->ext_priv = NULL; - + return err; } @@ -543,8 +543,8 @@ MODULE_DEVICE_TABLE(pci, pci_tbl); static struct saa7146_extension budget_extension = { .name = "budget dvb\0", - .flags = 0, - + .flags = 0, + .module = THIS_MODULE, .pci_tbl = pci_tbl, .attach = budget_attach, @@ -552,16 +552,16 @@ static struct saa7146_extension budget_extension = { .irq_mask = MASK_10, .irq_func = ttpci_budget_irq10_handler, -}; +}; -static int __init budget_init(void) +static int __init budget_init(void) { return saa7146_register_extension(&budget_extension); } static void __exit budget_exit(void) { - saa7146_unregister_extension(&budget_extension); + saa7146_unregister_extension(&budget_extension); } module_init(budget_init); @@ -571,4 +571,3 @@ MODULE_LICENSE("GPL"); MODULE_AUTHOR("Ralph Metzler, Marcus Metzler, Michael Hunold, others"); MODULE_DESCRIPTION("driver for the SAA7146 based so-called " "budget PCI DVB cards by Siemens, Technotrend, Hauppauge"); - diff --git a/linux/drivers/media/dvb/ttpci/ttpci-eeprom.c b/linux/drivers/media/dvb/ttpci/ttpci-eeprom.c index 602071868..e9a8457b0 100644 --- a/linux/drivers/media/dvb/ttpci/ttpci-eeprom.c +++ b/linux/drivers/media/dvb/ttpci/ttpci-eeprom.c @@ -144,4 +144,3 @@ MODULE_LICENSE("GPL"); MODULE_AUTHOR("Ralph Metzler, Marcus Metzler, others"); MODULE_DESCRIPTION("Decode dvb_net MAC address from EEPROM of PCI DVB cards " "made by Siemens, Technotrend, Hauppauge"); - |