summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb
diff options
context:
space:
mode:
authorMichael Hunold <devnull@localhost>2003-07-16 07:46:35 +0000
committerMichael Hunold <devnull@localhost>2003-07-16 07:46:35 +0000
commitf05699315d318ed9dc34e4ea3e94c351a4832ab7 (patch)
tree713d31d4cb9134468a9d7fba3277d300e1f906a8 /linux/drivers/media/dvb
parent7f3701fc616562f067ad81bf592c30ec93eebc9d (diff)
downloadmediapointer-dvb-s2-f05699315d318ed9dc34e4ea3e94c351a4832ab7.tar.gz
mediapointer-dvb-s2-f05699315d318ed9dc34e4ea3e94c351a4832ab7.tar.bz2
- change comments
Diffstat (limited to 'linux/drivers/media/dvb')
-rw-r--r--linux/drivers/media/dvb/b2c2/skystar2.c228
1 files changed, 93 insertions, 135 deletions
diff --git a/linux/drivers/media/dvb/b2c2/skystar2.c b/linux/drivers/media/dvb/b2c2/skystar2.c
index 64de94590..8d59309a3 100644
--- a/linux/drivers/media/dvb/b2c2/skystar2.c
+++ b/linux/drivers/media/dvb/b2c2/skystar2.c
@@ -36,7 +36,7 @@
#include "dvb_net.h"
int debug = 0;
-#define dprintk if(debug != 0) printk
+#define dprintk(x...) do { if (debug) printk(x); } while (0)
#define SizeOfBufDMA1 0x3AC00
#define SizeOfBufDMA2 0x758
@@ -110,10 +110,6 @@ void linuxdelayms(u32 usecs)
}
}
-/////////////////////////////////////////////////////////////////////
-// register functions
-/////////////////////////////////////////////////////////////////////
-
void WriteRegDW(struct adapter *adapter, u32 reg, u32 value)
{
u32 flags;
@@ -149,10 +145,7 @@ u32 WriteRegOp(struct adapter * adapter, u32 reg, u32 operation, u32 andvalue, u
return tmp;
}
-/////////////////////////////////////////////////////////////////////
-// I2C
-////////////////////////////////////////////////////////////////////
-
+/* i2c functions */
u32 i2cMainWriteForFlex2(struct adapter * adapter, u32 command, u8 * buf, u32 retries)
{
u32 i;
@@ -182,11 +175,7 @@ u32 i2cMainWriteForFlex2(struct adapter * adapter, u32 command, u8 * buf, u32 re
return 0;
}
-/////////////////////////////////////////////////////////////////////
-// device = 0x10000000 for tuner
-// 0x20000000 for eeprom
-/////////////////////////////////////////////////////////////////////
-
+/* device = 0x10000000 for tuner, 0x20000000 for eeprom */
u32 i2cMainSetup(u32 device, u32 chip_addr, u8 op, u8 addr, u32 value, u32 len)
{
u32 command;
@@ -376,11 +365,8 @@ static int master_xfer(struct dvb_i2c_bus *i2c, const struct i2c_msg *msgs, int
return ret;
}
-/////////////////////////////////////////////////////////////////////
-// SRAM (Skystar2 rev2.3 has one "ISSI IS61LV256" chip on board,
-// but it seems that FlexCopII can work with more than one chip)
-/////////////////////////////////////////////////////////////////////
-
+/* SRAM (Skystar2 rev2.3 has one "ISSI IS61LV256" chip on board,
+ but it seems that FlexCopII can work with more than one chip) */
u32 SRAMSetNetDest(struct adapter * adapter, u8 dest)
{
u32 tmp;
@@ -456,17 +442,15 @@ u32 SRAMSetMediaDest(struct adapter * adapter, u8 dest)
return tmp;
}
-/////////////////////////////////////////////////////////////////////
-// SRAM memory is accessed through a buffer register in the FlexCop
-// chip (0x700). This register has the following structure:
-// bits 0-14 : address
-// bit 15 : read/write flag
-// bits 16-23 : 8-bit word to write
-// bits 24-27 : = 4
-// bits 28-29 : memory bank selector
-// bit 31 : busy flag
-////////////////////////////////////////////////////////////////////
-
+/* SRAM memory is accessed through a buffer register in the FlexCop
+ chip (0x700). This register has the following structure:
+ bits 0-14 : address
+ bit 15 : read/write flag
+ bits 16-23 : 8-bit word to write
+ bits 24-27 : = 4
+ bits 28-29 : memory bank selector
+ bit 31 : busy flag
+*/
void FlexSramWrite(struct adapter *adapter, u32 bank, u32 addr, u8 * buf, u32 len)
{
u32 i, command, retries;
@@ -703,21 +687,19 @@ u32 SRAM_length(struct adapter * adapter)
return 32768; // 32K
}
-//////////////////////////////////////////////////////////////////////
-// FlexcopII can work with 32K, 64K or 128K of external SRAM memory.
-// - for 128K there are 4x32K chips at bank 0,1,2,3.
-// - for 64K there are 2x32K chips at bank 1,2.
-// - for 32K there is one 32K chip at bank 0.
-//
-// FlexCop works only with one bank at a time. The bank is selected
-// by bits 28-29 of the 0x700 register.
-//
-// bank 0 covers addresses 0x00000-0x07FFF
-// bank 1 covers addresses 0x08000-0x0FFFF
-// bank 2 covers addresses 0x10000-0x17FFF
-// bank 3 covers addresses 0x18000-0x1FFFF
-/////////////////////////////////////////////////////////////////////
+/* FlexcopII can work with 32K, 64K or 128K of external SRAM memory.
+ - for 128K there are 4x32K chips at bank 0,1,2,3.
+ - for 64K there are 2x32K chips at bank 1,2.
+ - for 32K there is one 32K chip at bank 0.
+ FlexCop works only with one bank at a time. The bank is selected
+ by bits 28-29 of the 0x700 register.
+
+ bank 0 covers addresses 0x00000-0x07FFF
+ bank 1 covers addresses 0x08000-0x0FFFF
+ bank 2 covers addresses 0x10000-0x17FFF
+ bank 3 covers addresses 0x18000-0x1FFFF
+*/
int SramDetectForFlex2(struct adapter *adapter)
{
u32 tmp, tmp2, tmp3;
@@ -795,10 +777,7 @@ void SLL_detectSramSize(struct adapter *adapter)
SramDetectForFlex2(adapter);
}
-/////////////////////////////////////////////////////////////////////
-// EEPROM (Skystar2 has one "24LC08B" chip on board)
-////////////////////////////////////////////////////////////////////
-
+/* EEPROM (Skystar2 has one "24LC08B" chip on board) */
int EEPROM_write(struct adapter *adapter, u16 addr, u8 * buf, u16 len)
{
return FLEXI2C_write(adapter, 0x20000000, 0x50, addr, buf, len);
@@ -850,33 +829,31 @@ int EEPROM_LRC_write(struct adapter *adapter, u32 addr, u32 len, u8 * wbuf, u8 *
return 0;
}
-/////////////////////////////////////////////////////////////////////
-// These functions could be called from the initialization routine
-// to unlock SkyStar2 cards, locked by "Europe On Line".
-//
-// in cards from "Europe On Line" the key is:
-//
-// u8 key[20] = {
-// 0xB2, 0x01, 0x00, 0x00,
-// 0x00, 0x00, 0x00, 0x00,
-// 0x00, 0x00, 0x00, 0x00,
-// 0x00, 0x00, 0x00, 0x00,
-// };
-//
-// LRC = 0xB3;
-//
-// in unlocked cards the key is:
-//
-// u8 key[20] = {
-// 0xB2, 0x00, 0x00, 0x00,
-// 0x00, 0x00, 0x00, 0x00,
-// 0x00, 0x00, 0x00, 0x00,
-// 0x00, 0x00, 0x00, 0x00,
-// };
-//
-// LRC = 0xB2;
-/////////////////////////////////////////////////////////////////////
+/* These functions could be called from the initialization routine
+ to unlock SkyStar2 cards, locked by "Europe On Line".
+
+ in cards from "Europe On Line" the key is:
+
+ u8 key[20] = {
+ 0xB2, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ };
+ LRC = 0xB3;
+
+ in unlocked cards the key is:
+
+ u8 key[20] = {
+ 0xB2, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ };
+
+ LRC = 0xB2;
+*/
int EEPROM_writeKey(struct adapter *adapter, u8 * key, u32 len)
{
u8 rbuf[20];
@@ -982,10 +959,7 @@ char EEPROM_setMacAddr(struct adapter *adapter, char type, u8 * mac)
return 0;
}
-/////////////////////////////////////////////////////////////////////
-// PID filter
-/////////////////////////////////////////////////////////////////////
-
+/* PID filter */
void FilterEnableStream1Filter(struct adapter *adapter, u32 op)
{
dprintk("%s: op=%x\n", __FUNCTION__, op);
@@ -1500,10 +1474,7 @@ int RemovePID(struct adapter *adapter, u32 pid)
return -1;
}
-/////////////////////////////////////////////////////////////////////
-// DMA & IRQ
-/////////////////////////////////////////////////////////////////////
-
+/* dma & irq */
void CtrlEnableSmc(struct adapter *adapter, u32 op)
{
if (op == 0) {
@@ -1560,47 +1531,43 @@ u32 IrqDmaEnableDisableIrq(struct adapter * adapter, u32 op)
return value;
}
-///////////////////////////////////////////////////////////////////////
-//
-// FlexCopII has 2 dma channels. DMA1 is used to transfer TS data to
-// system memory.
-//
-// The DMA1 buffer is divided in 2 subbuffers of equal size.
-// FlexCopII will transfer TS data to one subbuffer, signal an interrupt
-// when the subbuffer is full and continue fillig the second subbuffer.
-//
-// For DMA1:
-// subbuffer size in 32-bit words is stored in the first 24 bits of
-// register 0x004. The last 8 bits of register 0x004 contain the number
-// of subbuffers.
-//
-// the first 30 bits of register 0x000 contain the address of the first
-// subbuffer. The last 2 bits contain 0, when dma1 is disabled and 1,
-// when dma1 is enabled.
-//
-// the first 30 bits of register 0x00C contain the address of the second
-// subbuffer. the last 2 bits contain 1.
-//
-// register 0x008 will contain the address of the subbuffer that was filled
-// with TS data, when FlexCopII will generate an interrupt.
-//
-// For DMA2:
-// subbuffer size in 32-bit words is stored in the first 24 bits of
-// register 0x014. The last 8 bits of register 0x014 contain the number
-// of subbuffers.
-//
-// the first 30 bits of register 0x010 contain the address of the first
-// subbuffer. The last 2 bits contain 0, when dma1 is disabled and 1,
-// when dma1 is enabled.
-//
-// the first 30 bits of register 0x01C contain the address of the second
-// subbuffer. the last 2 bits contain 1.
-//
-// register 0x018 contains the address of the subbuffer that was filled
-// with TS data, when FlexCopII generates an interrupt.
-//
-///////////////////////////////////////////////////////////////////////
+/* FlexCopII has 2 dma channels. DMA1 is used to transfer TS data to
+ system memory.
+ The DMA1 buffer is divided in 2 subbuffers of equal size.
+ FlexCopII will transfer TS data to one subbuffer, signal an interrupt
+ when the subbuffer is full and continue fillig the second subbuffer.
+
+ For DMA1:
+ subbuffer size in 32-bit words is stored in the first 24 bits of
+ register 0x004. The last 8 bits of register 0x004 contain the number
+ of subbuffers.
+
+ the first 30 bits of register 0x000 contain the address of the first
+ subbuffer. The last 2 bits contain 0, when dma1 is disabled and 1,
+ when dma1 is enabled.
+
+ the first 30 bits of register 0x00C contain the address of the second
+ subbuffer. the last 2 bits contain 1.
+
+ register 0x008 will contain the address of the subbuffer that was filled
+ with TS data, when FlexCopII will generate an interrupt.
+
+ For DMA2:
+ subbuffer size in 32-bit words is stored in the first 24 bits of
+ register 0x014. The last 8 bits of register 0x014 contain the number
+ of subbuffers.
+
+ the first 30 bits of register 0x010 contain the address of the first
+ subbuffer. The last 2 bits contain 0, when dma1 is disabled and 1,
+ when dma1 is enabled.
+
+ the first 30 bits of register 0x01C contain the address of the second
+ subbuffer. the last 2 bits contain 1.
+
+ register 0x018 contains the address of the subbuffer that was filled
+ with TS data, when FlexCopII generates an interrupt.
+*/
int DmaInitDMA(struct adapter *adapter, u32 dma_channel)
{
u32 subbuffers, subbufsize, subbuf0, subbuf1;
@@ -1689,10 +1656,9 @@ void CtrlEnableReceiveData(struct adapter *adapter, u32 op)
}
}
-///////////////////////////////////////////////////////////////////////////////
-// bit 0 of dma_mask is set to 1 if dma1 channel has to be enabled/disabled
-// bit 1 of dma_mask is set to 1 if dma2 channel has to be enabled/disabled
-
+/* bit 0 of dma_mask is set to 1 if dma1 channel has to be enabled/disabled
+ bit 1 of dma_mask is set to 1 if dma2 channel has to be enabled/disabled
+*/
void DmaStartStop0x2102(struct adapter *adapter, u32 dma_mask, u32 start_stop)
{
u32 dma_enable, dma1_enable, dma2_enable;
@@ -2260,10 +2226,7 @@ static int dvb_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
return 0;
}
-/////////////////////////////////////////////////////////////////////
-// LNB control
-/////////////////////////////////////////////////////////////////////
-
+/* lnb control */
void set_tuner_tone(struct adapter *adapter, u8 tone)
{
u16 wzHalfPeriodFor45MHz[] = { 0x01FF, 0x0154, 0x00FF, 0x00CC };
@@ -2509,7 +2472,6 @@ static void skystar2_remove(struct pci_dev *pdev)
dvb_unregister_adapter(adapter->dvb_adapter);
}
-
DriverHalt(pdev);
}
}
@@ -2528,15 +2490,11 @@ static struct pci_driver skystar2_pci_driver = {
static int skystar2_init(void)
{
- printk("\nTechnisat SkyStar2 driver loading\n");
-
return pci_module_init(&skystar2_pci_driver);
}
static void skystar2_cleanup(void)
{
- printk("\nTechnisat SkyStar2 driver unloading\n");
-
pci_unregister_driver(&skystar2_pci_driver);
}