summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttpci/budget-patch.c
diff options
context:
space:
mode:
authorJohannes Stezenbach <devnull@localhost>2005-03-02 21:42:00 +0000
committerJohannes Stezenbach <devnull@localhost>2005-03-02 21:42:00 +0000
commit22369c7b769f439e3b351ecc9cd396a40b452db1 (patch)
treed7c330a08914350746300715a74c8fa6dc1fcebf /linux/drivers/media/dvb/ttpci/budget-patch.c
parentca7fda81614047eda9a192f937edf43dbbb11e88 (diff)
downloadmediapointer-dvb-s2-22369c7b769f439e3b351ecc9cd396a40b452db1.tar.gz
mediapointer-dvb-s2-22369c7b769f439e3b351ecc9cd396a40b452db1.tar.bz2
whitespace cleanup (remove ws at eol, sync with changes in mainline kernel)
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/budget-patch.c')
-rw-r--r--linux/drivers/media/dvb/ttpci/budget-patch.c89
1 files changed, 44 insertions, 45 deletions
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");
-