33 Commits

Author SHA1 Message Date
mvoelkel
781686c87d Set version number to 0.9.22 2016-01-13 16:58:01 +01:00
Ralph Metzler
b354113d15 disable auto DVB-S/S2 switching 2016-01-07 21:13:21 +01:00
Ralph Metzler
8d0bb02239 add octoscan 2016-01-07 21:12:53 +01:00
mvoelkel
7eb4ff762c Release 0.9.21 2015-12-11 16:10:07 +01:00
mvoelkel
16f0d291b1 Version 0.9.21 2015-12-11 16:06:24 +01:00
Ralph Metzler
829929a41f cine s2 v7 has TS lines crossed 2015-12-10 18:26:45 +01:00
Ralph Metzler
af746a02dd spelling error 2015-11-05 19:06:52 +01:00
Ralph Metzler
e83dedf6b4 First check for LNBHs on 0x0c/0x0d. 2015-10-22 14:55:55 +02:00
Ralph Metzler
9bcb9a2c9a Remove unused status variable. 2015-10-22 14:54:48 +02:00
Ralph Metzler
66be95a2b9 Missing return value. 2015-10-22 14:53:34 +02:00
Ralph Metzler
bb334ea229 Change handling of card type attribute. 2015-10-22 14:52:59 +02:00
Ralph Metzler
535683dfb6 Octopus CI single has two TABs. Handle both I2C busses. 2015-10-22 14:52:27 +02:00
Ralph Metzler
d10c83f16a Change handling of card type attribute. 2015-10-22 14:51:36 +02:00
Ralph Metzler
18481e2ea6 destroy attribute devices earlier to prevent accesses after I2C devices are already gone 2015-09-25 17:45:48 +02:00
Ralph Metzler
8402c7ab05 show temperature on sleep 2015-09-24 23:29:40 +02:00
Ralph Metzler
e2145682e2 block opening of ci device with O_RDWR 2015-09-24 23:29:09 +02:00
Ralph Metzler
1173454c93 add sleep function 2015-09-20 18:49:16 +02:00
Ralph Metzler
1aacccef7c add remote interrupt status to debug message 2015-09-20 01:50:39 +02:00
Ralph Metzler
dd78dae68b loop over remote link interrupt status to prevent race condition 2015-09-20 01:45:11 +02:00
Ralph Metzler
0393ab4db4 remove debugging messages 2015-09-19 22:20:35 +02:00
Ralph Metzler
29dc0f9e31 Initial support for Max C2T2-8 2015-09-17 18:54:25 +02:00
mvoelkel
411a142c21 Release 0.9.20
some CAMs are really slow, increase timeout for link init
  more I2C debugging
  added README.md
  store ids for all links in link structure and add devid attribute
  - fix dynamic fmode changes - 69Mhz no longer needed for MaxS8 on GT link - show state in GT link change
  do not reference eth_rebuild_header in newer kernels
  fix reference to struct
  inc copyright year
  inc version number
  added support for SPANSION flash
2015-09-17 16:28:15 +02:00
Ralph Metzler
5932c6c52f some CAMs are really slow, increase timeout for link init 2015-09-16 22:50:53 +02:00
Ralph Metzler
4209e3a03a more I2C debugging 2015-09-09 12:13:11 +02:00
mvoelkel
71e4972863 added README.md 2015-09-07 16:50:43 +02:00
Ralph Metzler
4f53aa9a1b store ids for all links in link structure and add devid attribute 2015-09-06 19:08:57 +02:00
Ralph Metzler
4e1b527c35 - fix dynamic fmode changes
- 69Mhz no longer needed for MaxS8 on GT link
- show state in GT link change
2015-08-31 20:53:22 +02:00
Ralph Metzler
5c4db2b594 do not reference eth_rebuild_header in newer kernels 2015-08-31 20:51:44 +02:00
Ralph Metzler
5ed590a3c7 fix reference to struct 2015-08-31 20:47:19 +02:00
Ralph Metzler
5af6007152 inc copyright year 2015-08-31 20:46:28 +02:00
Ralph Metzler
151770c0d8 inc version number 2015-08-31 20:45:25 +02:00
Ralph Metzler
f2b6dbabd7 added support for SPANSION flash 2015-08-31 20:43:20 +02:00
mvoelkel
4c7e7afc84 Add gitignore 2015-08-05 18:37:42 +02:00
17 changed files with 457 additions and 148 deletions

15
.gitignore vendored Normal file
View File

@@ -0,0 +1,15 @@
#
# Normal rules
#
.*
*.o
*.o.*
*.a
*.s
*.ko
*.so
*.so.dbg
*.orig
*~
\#*#

11
README.md Normal file
View File

@@ -0,0 +1,11 @@
# DDBridge Driver
###Prepare for Building
TBD
###Building
TBD

View File

@@ -1,10 +1,11 @@
all: ddtest octonet octokey ddflash
all: ddtest octonet octokey ddflash octoscan
install: all
install -m 0755 ddtest $(DESTDIR)/usr/bin
install -m 0755 octonet $(DESTDIR)/usr/bin
install -m 0755 octokey $(DESTDIR)/usr/bin
install -m 0755 ddflash $(DESTDIR)/usr/bin
install -m 0755 octoscan $(DESTDIR)/usr/bin
ddflash: ddflash.c
$(CC) -o ddflash ddflash.c
@@ -17,3 +18,6 @@ octonet: octonet.c
octokey: octokey.c
$(CC) -o octokey octokey.c
octoscan: octoscan.c
$(CC) -o octoscan octoscan.c

View File

@@ -61,6 +61,7 @@ struct ddflash {
uint32_t type;
uint32_t version;
uint32_t flash_type;
uint32_t sector_size;
uint32_t size;
@@ -88,6 +89,8 @@ enum {
ATMEL_AT45DB642D = 1,
SSTI_SST25VF016B = 2,
SSTI_SST25VF032B = 3,
SSTI_SST25VF064C = 4,
SPANSION_S25FL116K = 5,
};
static int flashread(int ddb, uint8_t *buf, uint32_t addr, uint32_t len)
@@ -131,6 +134,128 @@ void dump(const uint8_t *b, int l)
}
}
int flashwrite_pagemode(struct ddflash *ddf, int dev, uint32_t FlashOffset,
uint8_t LockBits, uint32_t fw_off)
{
int err = 0;
uint8_t cmd[260];
int i, j;
uint32_t flen, blen;
blen = flen = lseek(dev, 0, SEEK_END) - fw_off;
if (blen % 0xff)
blen = (blen + 0xff) & 0xffffff00;
printf("blen = %u, flen = %u\n", blen, flen);
do {
cmd[0] = 0x50; // EWSR
err = flashio(ddf->fd, cmd, 1, NULL, 0);
if (err < 0)
break;
cmd[0] = 0x01; // WRSR
cmd[1] = 0x00; // BPx = 0, Unlock all blocks
err = flashio(ddf->fd, cmd, 2, NULL, 0);
if (err < 0)
break;
for (i = 0; i < flen; i += 4096) {
if ((i & 0xFFFF) == 0)
printf(" Erase %08x\n", FlashOffset + i);
cmd[0] = 0x06; // WREN
err = flashio(ddf->fd, cmd, 1, NULL, 0);
if (err < 0)
break;
cmd[0] = 0x20; // Sector erase ( 4Kb)
cmd[1] = ( (( FlashOffset + i ) >> 16) & 0xFF );
cmd[2] = ( (( FlashOffset + i ) >> 8) & 0xFF );
cmd[3] = 0x00;
err = flashio(ddf->fd, cmd, 4, NULL, 0);
if (err < 0)
break;
while (1) {
cmd[0] = 0x05; // RDRS
err = flashio(ddf->fd, cmd, 1, &cmd[0], 1);
if (err < 0)
break;
if ((cmd[0] & 0x01) == 0)
break;
}
if (err < 0)
break;
}
if (err < 0)
break;
for (j = blen - 256; j >= 0; j -= 256 ) {
uint32_t len = 256;
ssize_t rlen;
if (lseek(dev, j + fw_off, SEEK_SET) < 0) {
printf("seek error\n");
return -1;
}
if (flen - j < 256) {
len = flen - j;
memset(ddf->buffer, 0xff, 256);
}
rlen = read(dev, ddf->buffer, len);
if (rlen < 0 || rlen != len) {
printf("file read error %d,%d at %u\n", rlen, errno, j);
return -1;
}
printf ("write %u bytes at %08x\n", len, j);
if ((j & 0xFFFF) == 0)
printf(" Programm %08x\n", FlashOffset + j);
cmd[0] = 0x06; // WREN
err = flashio(ddf->fd, cmd, 1, NULL, 0);
if (err < 0)
break;
cmd[0] = 0x02; // PP
cmd[1] = ( (( FlashOffset + j ) >> 16) & 0xFF );
cmd[2] = ( (( FlashOffset + j ) >> 8) & 0xFF );
cmd[3] = 0x00;
memcpy(&cmd[4], ddf->buffer, 256);
err = flashio(ddf->fd, cmd, 260, NULL, 0);
if (err < 0)
break;
while(1) {
cmd[0] = 0x05; // RDRS
err = flashio(ddf->fd, cmd,1, &cmd[0], 1);
if (err < 0)
break;
if ((cmd[0] & 0x01) == 0)
break;
}
if (err < 0)
break;
}
if (err < 0)
break;
cmd[0] = 0x50; // EWSR
err = flashio(ddf->fd, cmd, 1, NULL, 0);
if (err < 0)
break;
cmd[0] = 0x01; // WRSR
cmd[1] = LockBits; // BPx = 0, Lock all blocks
err = flashio(ddf->fd, cmd, 2, NULL, 0);
} while(0);
return err;
}
static int flashwrite_SSTI(struct ddflash *ddf, int fs, uint32_t FlashOffset, uint32_t maxlen, uint32_t fw_off)
{
int err = 0;
@@ -261,7 +386,16 @@ static int flashwrite_SSTI(struct ddflash *ddf, int fs, uint32_t FlashOffset, ui
static int flashwrite(struct ddflash *ddf, int fs, uint32_t addr, uint32_t maxlen, uint32_t fw_off)
{
flashwrite_SSTI(ddf, fs, addr, maxlen, fw_off);
switch (ddf->flash_type) {
case SSTI_SST25VF016B:
case SSTI_SST25VF032B:
return flashwrite_SSTI(ddf, fs, addr, maxlen, fw_off);
case SSTI_SST25VF064C:
return flashwrite_pagemode(ddf, fs, addr, 0x3c, fw_off);
case SPANSION_S25FL116K:
return flashwrite_pagemode(ddf, fs, addr, 0x1c, fw_off);
}
return -1;
}
static int flashcmp(struct ddflash *ddf, int fs, uint32_t addr, uint32_t maxlen, uint32_t fw_off)
@@ -314,29 +448,41 @@ static int flash_detect(struct ddflash *ddf)
return r;
if (id[0] == 0xBF && id[1] == 0x25 && id[2] == 0x41) {
r = SSTI_SST25VF016B;
//printf("Flash: SSTI SST25VF016B 16 MBit\n");
ddf->flash_type = SSTI_SST25VF016B;
printf("Flash: SSTI SST25VF016B 16 MBit\n");
ddf->sector_size = 4096;
ddf->size = 0x200000;
} else if (id[0] == 0xBF && id[1] == 0x25 && id[2] == 0x4A) {
r = SSTI_SST25VF032B;
//printf("Flash: SSTI SST25VF032B 32 MBit\n");
ddf->flash_type = SSTI_SST25VF032B;
printf("Flash: SSTI SST25VF032B 32 MBit\n");
ddf->sector_size = 4096;
ddf->size = 0x400000;
} else if (id[0] == 0xBF && id[1] == 0x25 && id[2] == 0x4B) {
ddf->flash_type = SSTI_SST25VF064C;
printf("Flash: SSTI SST25VF064C 64 MBit\n");
ddf->sector_size = 4096;
ddf->size = 0x800000;
} else if (id[0] == 0x01 && id[1] == 0x40 && id[2] == 0x15) {
ddf->flash_type = SPANSION_S25FL116K;
printf("Flash: SPANSION S25FL116K 16 MBit\n");
ddf->sector_size = 4096;
ddf->size = 0x200000;
} else if (id[0] == 0x1F && id[1] == 0x28) {
r = ATMEL_AT45DB642D;
//printf("Flash: Atmel AT45DB642D 64 MBit\n");
ddf->flash_type = ATMEL_AT45DB642D;
printf("Flash: Atmel AT45DB642D 64 MBit\n");
ddf->sector_size = 1024;
ddf->size = 0x800000;
} else {
r = UNKNOWN_FLASH;
//printf("Unknown Flash Flash ID = %02x %02x %02x\n", id[0], id[1], id[2]);
printf("Unknown Flash Flash ID = %02x %02x %02x\n", id[0], id[1], id[2]);
return -1;
}
if (ddf->sector_size) {
ddf->buffer = malloc(ddf->sector_size);
//printf("allocated buffer %08x@%08x\n", ddf->sector_size, (uint32_t) ddf->buffer);
printf("allocated buffer %08x@%08x\n", ddf->sector_size, (uint32_t) ddf->buffer);
if (!ddf->buffer)
return -1;
}
return r;
return 0;
}
@@ -777,6 +923,8 @@ int main(int argc, char **argv)
}
}
flash = flash_detect(&ddf);
if (flash < 0)
return -1;
get_id(&ddf);
res = update_flash(&ddf);

View File

@@ -842,7 +842,8 @@ static int ts_open(struct inode *inode, struct file *file)
} else if ((file->f_flags & O_ACCMODE) == O_WRONLY) {
if (!output)
return -EINVAL;
}
} else
return -EINVAL;
err = dvb_generic_open(inode, file);
if (err < 0)
return err;
@@ -1222,14 +1223,7 @@ static int tuner_attach_stv6110(struct ddb_input *input, int type)
return 0;
}
static struct stv0910_cfg stv0910 = {
.adr = 0x6c,
.parallel = 1,
.rptlvl = 4,
.clk = 30000000,
};
static struct stv0910_cfg stv0910_aa = {
static struct stv0910_cfg stv0910_p = {
.adr = 0x68,
.parallel = 1,
.rptlvl = 4,
@@ -1240,19 +1234,24 @@ static int demod_attach_stv0910(struct ddb_input *input, int type)
{
struct i2c_adapter *i2c = &input->port->i2c->adap;
struct ddb_dvb *dvb = &input->port->dvb[input->nr & 1];
struct stv0910_cfg cfg = stv0910_p;
dvb->fe = dvb_attach(stv0910_attach, i2c, &stv0910_aa, (input->nr & 1));
if (!dvb->fe)
if (type)
cfg.parallel = 2;
dvb->fe = dvb_attach(stv0910_attach, i2c, &cfg, (input->nr & 1));
if (!dvb->fe) {
cfg.adr = 0x6c;
dvb->fe = dvb_attach(stv0910_attach, i2c,
&stv0910, (input->nr & 1));
&cfg, (input->nr & 1));
}
if (!dvb->fe) {
pr_err("No STV0910 found!\n");
return -ENODEV;
}
if (!dvb_attach(lnbh25_attach, dvb->fe, i2c,
((input->nr & 1) ? 0x09 : 0x08))) {
((input->nr & 1) ? 0x0d : 0x0c))) {
if (!dvb_attach(lnbh25_attach, dvb->fe, i2c,
((input->nr & 1) ? 0x0d : 0x0c))) {
((input->nr & 1) ? 0x09 : 0x08))) {
pr_err("No LNBH25 found!\n");
return -ENODEV;
}
@@ -1292,6 +1291,8 @@ static int lnb_command(struct ddb *dev, u32 link, u32 lnb, u32 cmd)
break;
msleep(20);
}
if (c == 10)
pr_info("lnb_command lnb = %08x cmd = %08x\n", lnb, cmd);
return 0;
}
@@ -1542,14 +1543,15 @@ static int mxl_fw_read(void *priv, u8 *buf, u32 len)
return ddbridge_flashread(dev, link->nr, buf, 0xc0000, len);
}
static int lnb_init_fmode(struct ddb *dev, struct ddb_link *link, u32 fmode)
static int lnb_init_fmode(struct ddb *dev, struct ddb_link *link, u32 fm)
{
u32 l = link->nr;
if (link->lnb.setmode == fmode)
if (link->lnb.fmode == fm)
return 0;
if (fmode == 2 || fmode == 1) {
mutex_lock(&link->lnb.lock);
pr_info("Set fmode link %u = %u\n", l, fm);
mutex_lock(&link->lnb.lock);
if (fm == 2 || fm == 1) {
lnb_set_tone(dev, l, 0, SEC_TONE_OFF);
if (old_quattro) {
lnb_set_tone(dev, l, 1, SEC_TONE_OFF);
@@ -1559,9 +1561,9 @@ static int lnb_init_fmode(struct ddb *dev, struct ddb_link *link, u32 fmode)
lnb_set_tone(dev, l, 2, SEC_TONE_OFF);
}
lnb_set_tone(dev, l, 3, SEC_TONE_ON);
mutex_unlock(&link->lnb.lock);
}
link->lnb.setmode = fmode;
link->lnb.fmode = fm;
mutex_unlock(&link->lnb.lock);
return 0;
}
@@ -1584,12 +1586,10 @@ static int fe_attach_mxl5xx(struct ddb_input *input)
struct mxl5xx_cfg cfg;
int demod, tuner;
link->lnb.fmode = fmode;
cfg = mxl5xx;
cfg.fw_priv = link;
if (dev->link[0].info->type == DDB_OCTONET)
cfg.ts_clk = 69;
;//cfg.ts_clk = 69;
demod = input->nr;
tuner = demod & 3;
@@ -1854,7 +1854,8 @@ static int dvb_input_attach(struct ddb_input *input)
struct ddb_port *port = input->port;
struct dvb_adapter *adap = dvb->adap;
struct dvb_demux *dvbdemux = &dvb->demux;
int par = 0;
dvb->attached = 0x01;
ret = my_dvb_dmx_ts_card_init(dvbdemux, "SW demux",
@@ -1907,12 +1908,18 @@ static int dvb_input_attach(struct ddb_input *input)
if (tuner_attach_stv6111(input, 0) < 0)
return -ENODEV;
break;
case DDB_TUNER_DVBS_STV0910_P:
case DDB_TUNER_DVBS_STV0910_PR:
if (demod_attach_stv0910(input, 1) < 0)
return -ENODEV;
if (tuner_attach_stv6111(input, 1) < 0)
return -ENODEV;
break;
case DDB_TUNER_DVBS_STV0910_P:
if (demod_attach_stv0910(input, 0) < 0)
return -ENODEV;
if (tuner_attach_stv6111(input, 1) < 0)
return -ENODEV;
break;
#ifdef CONFIG_DVB_DRXK
case DDB_TUNER_DVBCT_TR:
if (demod_attach_drxk(input) < 0)
@@ -1927,18 +1934,17 @@ static int dvb_input_attach(struct ddb_input *input)
if (tuner_attach_tda18212dd(input) < 0)
return -ENODEV;
break;
case DDB_TUNER_DVBCT2_SONY:
case DDB_TUNER_DVBC2T2_SONY:
case DDB_TUNER_ISDBT_SONY:
if (demod_attach_cxd2843(input, 0) < 0)
return -ENODEV;
if (tuner_attach_tda18212dd(input) < 0)
return -ENODEV;
break;
case DDB_TUNER_DVBCT2_SONY_P:
case DDB_TUNER_DVBC2T2_SONY_P:
case DDB_TUNER_ISDBT_SONY_P:
if (demod_attach_cxd2843(input, 1) < 0)
if (input->port->dev->link[input->port->lnr].info->ts_quirks & TS_QUIRK_SERIAL)
par = 0;
else
par = 1;
case DDB_TUNER_DVBCT2_SONY:
case DDB_TUNER_DVBC2T2_SONY:
case DDB_TUNER_ISDBT_SONY:
if (demod_attach_cxd2843(input, par) < 0)
return -ENODEV;
if (tuner_attach_tda18212dd(input) < 0)
return -ENODEV;
@@ -2166,6 +2172,12 @@ static char *xo2names[] = {
"", ""
};
static char *xo2types[] = {
"DVBS_ST", "DVBCT2_SONY",
"ISDBT_SONY", "DVBC2T2_SONY",
"ATSC_ST", "DVBC2T2_ST"
};
static void ddb_port_probe(struct ddb_port *port)
{
struct ddb *dev = port->dev;
@@ -2173,9 +2185,9 @@ static void ddb_port_probe(struct ddb_port *port)
u8 id, type;
port->name = "NO MODULE";
port->type_name = "NONE";
port->class = DDB_PORT_NONE;
/* Handle missing ports and ports without I2C */
if (port->nr == ts_loop) {
@@ -2199,6 +2211,7 @@ static void ddb_port_probe(struct ddb_port *port)
if (dev->link[l].info->type == DDB_OCTOPUS_MAX) {
port->name = "DUAL DVB-S2 MAX";
port->type_name = "MXL5XX";
port->class = DDB_PORT_TUNER;
port->type = DDB_TUNER_MXL5XX;
if (port->i2c)
@@ -2209,6 +2222,7 @@ static void ddb_port_probe(struct ddb_port *port)
if (port->nr > 1 && dev->link[l].info->type == DDB_OCTOPUS_CI) {
port->name = "CI internal";
port->type_name = "INTERNAL";
port->class = DDB_PORT_CI;
port->type = DDB_CI_INTERNAL;
}
@@ -2221,6 +2235,7 @@ static void ddb_port_probe(struct ddb_port *port)
if (port_has_cxd(port, &id)) {
if (id == 1) {
port->name = "CI";
port->type_name = "CXD2099";
port->class = DDB_PORT_CI;
port->type = DDB_CI_EXTERNAL_SONY;
ddbwritel(dev, I2C_SPEED_400,
@@ -2237,31 +2252,37 @@ static void ddb_port_probe(struct ddb_port *port)
port->name = "DuoFlex CI";
port->class = DDB_PORT_CI;
port->type = DDB_CI_EXTERNAL_XO2;
port->type_name = "CI_XO2";
init_xo2_ci(port);
return;
}
id >>= 2;
if (id > 5) {
port->name = "unknown XO2 DuoFlex";
port->type_name = "UNKNOWN";
} else {
port->name = xo2names[id];
port->class = DDB_PORT_TUNER;
port->type = DDB_TUNER_XO2 + id;
port->type_name = xo2types[id];
init_xo2(port);
}
} else if (port_has_cxd28xx(port, &id)) {
switch (id) {
case 0xa4:
port->name = "DUAL DVB-CT2 CXD2843";
port->name = "DUAL DVB-C2T2 CXD2843";
port->type = DDB_TUNER_DVBC2T2_SONY_P;
port->type_name = "DVBC2T2_SONY";
break;
case 0xb1:
port->name = "DUAL DVB-CT2 CXD2837";
port->type = DDB_TUNER_DVBCT2_SONY_P;
port->type_name = "DVBCT2_SONY";
break;
case 0xb0:
port->name = "DUAL ISDB-T CXD2838";
port->type = DDB_TUNER_ISDBT_SONY_P;
port->type_name = "ISDBT_SONY";
break;
default:
return;
@@ -2272,25 +2293,34 @@ static void ddb_port_probe(struct ddb_port *port)
port->name = "DUAL DVB-S2";
port->class = DDB_PORT_TUNER;
port->type = DDB_TUNER_DVBS_ST;
port->type_name = "DVBS_ST";
ddbwritel(dev, I2C_SPEED_100, port->i2c->regs + I2C_TIMING);
} else if (port_has_stv0900_aa(port, &id)) {
port->name = "DUAL DVB-S2";
port->class = DDB_PORT_TUNER;
port->type = DDB_TUNER_DVBS_ST_AA;
if (id == 0x51)
port->type = DDB_TUNER_DVBS_STV0910_P;
else
if (id == 0x51) {
if (port->nr == 0 &&
dev->link[l].info->ts_quirks & TS_QUIRK_REVERSED)
port->type = DDB_TUNER_DVBS_STV0910_PR;
else
port->type = DDB_TUNER_DVBS_STV0910_P;
port->type_name = "DVBS_ST_0910";
} else {
port->type = DDB_TUNER_DVBS_ST_AA;
port->type_name = "DVBS_ST_AA";
}
ddbwritel(dev, I2C_SPEED_100, port->i2c->regs + I2C_TIMING);
} else if (port_has_drxks(port)) {
port->name = "DUAL DVB-C/T";
port->class = DDB_PORT_TUNER;
port->type = DDB_TUNER_DVBCT_TR;
port->type_name = "DVBCT_TR";
ddbwritel(dev, I2C_SPEED_400, port->i2c->regs + I2C_TIMING);
} else if (port_has_stv0367(port)) {
port->name = "DUAL DVB-C/T";
port->class = DDB_PORT_TUNER;
port->type = DDB_TUNER_DVBCT_ST;
port->type_name = "DVBCT_ST";
ddbwritel(dev, I2C_SPEED_100, port->i2c->regs + I2C_TIMING);
} else if (port_has_encti(port)) {
port->name = "ENCTI";
@@ -3039,6 +3069,7 @@ static void ddb_ports_init(struct ddb *dev)
ddb_output_init(port, i, i + 8);
break;
case DDB_OCTOPUS_MAX:
case DDB_OCTOPUS_MAX_CT:
ddb_input_init(port, 2 * i, 0, 2 * i, 2 * p);
ddb_input_init(port, 2 * i + 1, 1, 2 * i + 1, 2 * p + 1);
break;
@@ -3660,10 +3691,10 @@ static long ddb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
struct ddb_id ddbid;
ddbid.vendor = dev->ids.vendor;
ddbid.device = dev->ids.device;
ddbid.subvendor = dev->ids.subvendor;
ddbid.subdevice = dev->ids.subdevice;
ddbid.vendor = dev->link[0].ids.vendor;
ddbid.device = dev->link[0].ids.device;
ddbid.subvendor = dev->link[0].ids.subvendor;
ddbid.subdevice = dev->link[0].ids.subdevice;
ddbid.hw = ddbreadl(dev, 0);
ddbid.regmap = ddbreadl(dev, 4);
if (copy_to_user(parg, &ddbid, sizeof(ddbid)))
@@ -3856,15 +3887,6 @@ static char *class_name[] = {
"NONE", "CI", "TUNER", "LOOP", "MOD"
};
static char *type_name[] = {
"NONE", "DVBS_ST", "DVBS_ST_AA", "DVBCT_TR",
"DVBCT_ST", "INTERNAL", "CXD2099", "DVBCT2_SONY",
"DVBC2T2_SONY", "ISDBT_SONY", "DVBS_ST", "MXL5XX",
"TYPE0C", "TYPE0D", "TYPE0E", "TYPE0F",
"DVBS_ST", "DVBCT2_SONY", "ISDBT_SONY", "DVBC2T2_SONY",
"ATSC_ST", "DVBC2T2_ST"
};
static ssize_t fan_show(struct device *device,
struct device_attribute *attr, char *buf)
{
@@ -3977,7 +3999,7 @@ static ssize_t mod_show(struct device *device,
return sprintf(buf, "%s:%s\n",
class_name[dev->port[num].class],
type_name[dev->port[num].type]);
dev->port[num].type_name);
}
static ssize_t led_show(struct device *device,
@@ -4164,7 +4186,7 @@ static ssize_t version_show(struct device *device,
struct ddb *dev = dev_get_drvdata(device);
return sprintf(buf, "%08x %08x\n",
dev->ids.hwid, dev->ids.regmapid);
dev->link[0].ids.hwid, dev->link[0].ids.regmapid);
}
static ssize_t hwid_show(struct device *device,
@@ -4172,7 +4194,7 @@ static ssize_t hwid_show(struct device *device,
{
struct ddb *dev = dev_get_drvdata(device);
return sprintf(buf, "0x%08X\n", dev->ids.hwid);
return sprintf(buf, "0x%08X\n", dev->link[0].ids.hwid);
}
static ssize_t regmap_show(struct device *device,
@@ -4180,7 +4202,7 @@ static ssize_t regmap_show(struct device *device,
{
struct ddb *dev = dev_get_drvdata(device);
return sprintf(buf, "0x%08X\n", dev->ids.regmapid);
return sprintf(buf, "0x%08X\n", dev->link[0].ids.regmapid);
}
static ssize_t vlan_show(struct device *device,
@@ -4217,6 +4239,15 @@ static ssize_t fmode_show(struct device *device,
return sprintf(buf, "%u\n", dev->link[num].lnb.fmode);
}
static ssize_t devid_show(struct device *device,
struct device_attribute *attr, char *buf)
{
int num = attr->attr.name[5] - 0x30;
struct ddb *dev = dev_get_drvdata(device);
return sprintf(buf, "%08x\n", dev->link[num].ids.devid);
}
static ssize_t fmode_store(struct device *device, struct device_attribute *attr,
const char *buf, size_t count)
{
@@ -4228,8 +4259,7 @@ static ssize_t fmode_store(struct device *device, struct device_attribute *attr,
return -EINVAL;
if (val > 3)
return -EINVAL;
dev->link[num].lnb.fmode = val;
lnb_init_fmode(dev, &dev->link[num], fmode);
lnb_init_fmode(dev, &dev->link[num], val);
return count;
}
@@ -4247,6 +4277,10 @@ static struct device_attribute ddb_attrs[] = {
__ATTR(fmode1, 0664, fmode_show, fmode_store),
__ATTR(fmode2, 0664, fmode_show, fmode_store),
__ATTR(fmode3, 0664, fmode_show, fmode_store),
__ATTR_MRO(devid0, devid_show),
__ATTR_MRO(devid1, devid_show),
__ATTR_MRO(devid2, devid_show),
__ATTR_MRO(devid3, devid_show),
__ATTR_RO(hwid),
__ATTR_RO(regmap),
#if 0
@@ -4421,7 +4455,11 @@ static void ddb_device_destroy(struct ddb *dev)
static void gtl_link_handler(unsigned long priv)
{
printk("GT link change\n");
struct ddb *dev = (struct ddb *) priv;
u32 regs = dev->link[0].info->regmap->gtl->base;
printk("GT link change: %u\n",
(1 & ddbreadl(dev, regs)));
}
static void link_tasklet(unsigned long data)
@@ -4449,15 +4487,13 @@ static void gtl_irq_handler(unsigned long priv)
struct ddb *dev = link->dev;
u32 s, off = 32 * link->nr, tag = DDB_LINK_TAG(link->nr);
s = ddbreadl(dev, tag | INTERRUPT_STATUS);
//printk("gtl_irq %08x = %08x\n", tag | INTERRUPT_STATUS, s);
if (!s)
return;
ddbwritel(dev, s, tag | INTERRUPT_ACK);
LINK_IRQ_HANDLE(0);
LINK_IRQ_HANDLE(1);
LINK_IRQ_HANDLE(2);
LINK_IRQ_HANDLE(3);
while ((s = ddbreadl(dev, tag | INTERRUPT_STATUS))) {
ddbwritel(dev, s, tag | INTERRUPT_ACK);
LINK_IRQ_HANDLE(0);
LINK_IRQ_HANDLE(1);
LINK_IRQ_HANDLE(2);
LINK_IRQ_HANDLE(3);
}
#else
printk("gtlirq\n");
tasklet_schedule(&link->tasklet);
@@ -4491,6 +4527,35 @@ static struct ddb_info octopus_max_gtl = {
};
static struct ddb_regset octopus_maxct_gtl_i2c = {
.base = 0x80,
.num = 0x04,
.size = 0x20,
};
static struct ddb_regset octopus_maxct_gtl_i2c_buf = {
.base = 0x1000,
.num = 0x04,
.size = 0x200,
};
static struct ddb_regmap octopus_maxct_gtl_map = {
.i2c = &octopus_maxct_gtl_i2c,
.i2c_buf = &octopus_maxct_gtl_i2c_buf,
};
static struct ddb_info octopus_ct_gtl = {
.type = DDB_OCTOPUS_MAX_CT,
.name = "Digital Devices Octopus MAX CT GTL",
.regmap = &octopus_maxct_gtl_map,
.port_num = 4,
.i2c_mask = 0x0f,
.board_control = 0xff,
.board_control_2 = 0xf00,
.ts_quirks = TS_QUIRK_SERIAL,
};
static int ddb_gtl_init_link(struct ddb *dev, u32 l)
{
struct ddb_link *link = &dev->link[l];
@@ -4502,6 +4567,7 @@ static int ddb_gtl_init_link(struct ddb *dev, u32 l)
spin_lock_init(&link->lock);
mutex_init(&link->lnb.lock);
link->lnb.fmode = 0xffffffff;
mutex_init(&link->flash_mutex);
if (!(1 & ddbreadl(dev, regs))) {
@@ -4523,14 +4589,20 @@ static int ddb_gtl_init_link(struct ddb *dev, u32 l)
link->regs = regs;
id = ddbreadl(dev, DDB_LINK_TAG(l) | 8);
if (id == 0x0007dd01)
switch (id) {
case 0x0007dd01:
link->info = &octopus_max_gtl;
else {
break;
case 0x0008dd01:
link->info = &octopus_ct_gtl;
break;
default:
pr_info("DDBridge: Detected GT link but found invalid ID %08x. "
"You might have to update (flash) the add-on card first.",
id);
return -1;
}
link->ids.devid = id;
ddbwritel(dev, 1, 0x1a0);
@@ -4546,7 +4618,7 @@ static int ddb_gtl_init_link(struct ddb *dev, u32 l)
tasklet_init(&link->tasklet, link_tasklet, (unsigned long) link);
ddbwritel(dev, 0xffffffff, DDB_LINK_TAG(l) | INTERRUPT_ACK);
ddbwritel(dev, 1, DDB_LINK_TAG(l) | INTERRUPT_ENABLE);
ddbwritel(dev, 0xf, DDB_LINK_TAG(l) | INTERRUPT_ENABLE);
return 0;
}
@@ -4576,9 +4648,9 @@ static int ddb_init_boards(struct ddb *dev)
if (info->board_control) {
ddbwritel(dev, 0, DDB_LINK_TAG(l) | BOARD_CONTROL);
msleep(100);
ddbwritel(dev, 4, DDB_LINK_TAG(l) | BOARD_CONTROL);
ddbwritel(dev, info->board_control_2, DDB_LINK_TAG(l) | BOARD_CONTROL);
usleep_range(2000, 3000);
ddbwritel(dev, 4 | info->board_control,
ddbwritel(dev, info->board_control_2 | info->board_control,
DDB_LINK_TAG(l) | BOARD_CONTROL);
usleep_range(2000, 3000);
}

View File

@@ -113,20 +113,32 @@ static int ddb_i2c_cmd(struct ddb_i2c *i2c, u32 adr, u32 cmd)
ddbwritel(dev, (adr << 9) | cmd, i2c->regs + I2C_COMMAND);
stat = wait_for_completion_timeout(&i2c->completion, HZ);
val = ddbreadl(dev, i2c->regs + I2C_COMMAND);
if (stat == 0) {
pr_err("DDBridge I2C timeout, card %d, port %d, link %u\n",
dev->nr, i2c->nr, i2c->link);
#ifdef CONFIG_PCI_MSI
{ /* MSI debugging*/
#if 1
{
u32 istat = ddbreadl(dev, INTERRUPT_STATUS);
dev_err(dev->dev, "DDBridge IRS %08x\n", istat);
ddbwritel(dev, istat, INTERRUPT_ACK);
if (i2c->link) {
u32 listat = ddbreadl(dev, DDB_LINK_TAG(i2c->link) | INTERRUPT_STATUS);
dev_err(dev->dev, "DDBridge link %u IRS %08x\n",
i2c->link, listat);
}
if (istat & 1) {
ddbwritel(dev, istat & 1, INTERRUPT_ACK);
} else {
u32 mon = ddbreadl(dev, i2c->regs + I2C_MONITOR);
dev_err(dev->dev, "I2C cmd=%08x mon=%08x\n",
val, mon);
}
}
#endif
return -EIO;
}
val = ddbreadl(dev, i2c->regs + I2C_COMMAND);
if (val & 0x70000)
return -EIO;
return 0;

View File

@@ -102,7 +102,7 @@ static int ns_set_pids(struct dvbnss *nss)
struct ddb *dev = input->port->dev;
struct ddb_ns *dns = (struct ddb_ns *) nss->priv;
if (dev->ids.devid == 0x0301dd01) {
if (dev->link[0].ids.devid == 0x0301dd01) {
u32 sys = 0;
int pid, j = 1;
@@ -134,7 +134,7 @@ static int ns_set_pid(struct dvbnss *nss, u16 pid)
u32 off = STREAM_PIDS(dns->nr);
#if 1
if (dev->ids.devid == 0x0301dd01) {
if (dev->link[0].ids.devid == 0x0301dd01) {
if (pid & 0x2000) {
if (pid & 0x8000)
memset(nss->pids, 0xff, 0x400);

View File

@@ -63,6 +63,7 @@ static void __devexit ddb_remove(struct pci_dev *pdev)
{
struct ddb *dev = (struct ddb *) pci_get_drvdata(pdev);
ddb_device_destroy(dev);
ddb_nsd_detach(dev);
ddb_ports_detach(dev);
ddb_i2c_release(dev);
@@ -70,6 +71,7 @@ static void __devexit ddb_remove(struct pci_dev *pdev)
if (dev->link[0].info->ns_num)
ddbwritel(dev, 0, ETHER_CONTROL);
ddbwritel(dev, 0, INTERRUPT_ENABLE);
ddbwritel(dev, 0, MSI1_ENABLE);
if (dev->msi == 2)
free_irq(dev->pdev->irq + 1, dev);
@@ -80,7 +82,6 @@ static void __devexit ddb_remove(struct pci_dev *pdev)
#endif
ddb_ports_release(dev);
ddb_buffers_free(dev);
ddb_device_destroy(dev);
ddb_unmap(dev);
pci_set_drvdata(pdev, 0);
@@ -112,10 +113,10 @@ static int __devinit ddb_probe(struct pci_dev *pdev,
dev->dev = &pdev->dev;
pci_set_drvdata(pdev, dev);
dev->ids.vendor = id->vendor;
dev->ids.device = id->device;
dev->ids.subvendor = id->subvendor;
dev->ids.subdevice = id->subdevice;
dev->link[0].ids.vendor = id->vendor;
dev->link[0].ids.device = id->device;
dev->link[0].ids.subvendor = id->subvendor;
dev->link[0].ids.subdevice = id->subdevice;
dev->link[0].dev = dev;
dev->link[0].info = (struct ddb_info *) id->driver_data;
@@ -136,11 +137,11 @@ static int __devinit ddb_probe(struct pci_dev *pdev,
goto fail;
}
dev->ids.hwid = ddbreadl(dev, 0);
dev->ids.regmapid = ddbreadl(dev, 4);
dev->link[0].ids.hwid = ddbreadl(dev, 0);
dev->link[0].ids.regmapid = ddbreadl(dev, 4);
pr_info("DDBridge: HW %08x REGMAP %08x\n",
dev->ids.hwid, dev->ids.regmapid);
dev->link[0].ids.hwid, dev->link[0].ids.regmapid);
if (dev->link[0].info->ns_num) {
int i;
@@ -357,7 +358,9 @@ static struct ddb_info ddb_v7 = {
.regmap = &octopus_map,
.port_num = 4,
.i2c_mask = 0x0f,
.board_control = 2,
.board_control = 2,
.board_control_2 = 4,
.ts_quirks = TS_QUIRK_REVERSED,
};
static struct ddb_info ddb_ctv7 = {
@@ -366,7 +369,8 @@ static struct ddb_info ddb_ctv7 = {
.regmap = &octopus_map,
.port_num = 4,
.i2c_mask = 0x0f,
.board_control = 3,
.board_control = 3,
.board_control_2 = 4,
};
static struct ddb_info ddb_satixS2v3 = {
@@ -390,7 +394,7 @@ static struct ddb_info ddb_cis = {
.name = "Digital Devices Octopus CI single",
.regmap = &octopus_map,
.port_num = 3,
.i2c_mask = 0x01,
.i2c_mask = 0x03,
};
static struct ddb_info ddb_ci_s2_pro = {
@@ -399,7 +403,8 @@ static struct ddb_info ddb_ci_s2_pro = {
.regmap = &octopus_map,
.port_num = 4,
.i2c_mask = 0x01,
.board_control = 3,
.board_control = 2,
.board_control_2 = 4,
};
static struct ddb_info ddb_dvbct = {
@@ -421,6 +426,17 @@ static struct ddb_info ddb_s2_48 = {
.board_control = 1,
};
static struct ddb_info ddb_ct_8 = {
.type = DDB_OCTOPUS_MAX_CT,
.name = "Digital Devices MAX CT8",
.regmap = &octopus_map,
.port_num = 4,
.i2c_mask = 0x0f,
.board_control = 0x0ff,
.board_control_2 = 0xf00,
.ts_quirks = TS_QUIRK_SERIAL,
};
static struct ddb_info ddb_mod = {
.type = DDB_MOD,
.name = "Digital Devices DVB-C modulator",
@@ -467,6 +483,7 @@ static const struct pci_device_id ddb_id_tbl[] __devinitconst = {
DDB_ID(DDVID, 0x0006, DDVID, 0x0032, ddb_ctv7),
DDB_ID(DDVID, 0x0006, DDVID, 0x0033, ddb_ctv7),
DDB_ID(DDVID, 0x0007, DDVID, 0x0023, ddb_s2_48),
DDB_ID(DDVID, 0x0008, DDVID, 0x0034, ddb_ct_8),
DDB_ID(DDVID, 0x0011, DDVID, 0x0040, ddb_ci),
DDB_ID(DDVID, 0x0011, DDVID, 0x0041, ddb_cis),
DDB_ID(DDVID, 0x0012, DDVID, 0x0042, ddb_ci),

View File

@@ -147,6 +147,7 @@ struct ddb_info {
#define DDB_MOD 3
#define DDB_OCTONET 4
#define DDB_OCTOPUS_MAX 5
#define DDB_OCTOPUS_MAX_CT 6
char *name;
u32 i2c_mask;
u8 port_num;
@@ -154,10 +155,14 @@ struct ddb_info {
u8 fan_num;
u8 temp_num;
u8 temp_bus;
u8 board_control;
u32 board_control;
u32 board_control_2;
u8 ns_num;
u8 mdio_num;
u8 con_clock;
u8 con_clock; /* use a continuous clock */
u8 ts_quirks;
#define TS_QUIRK_SERIAL 1
#define TS_QUIRK_REVERSED 2
struct ddb_regmap *regmap;
};
@@ -271,6 +276,7 @@ struct ddb_port {
#define DDB_PORT_LOOP 3
#define DDB_PORT_MOD 4
char *name;
char *type_name;
u32 type;
#define DDB_TUNER_NONE 0
#define DDB_TUNER_DVBS_ST 1
@@ -286,14 +292,15 @@ struct ddb_port {
#define DDB_TUNER_MXL5XX 11
#define DDB_CI_EXTERNAL_XO2 12
#define DDB_CI_EXTERNAL_XO2_B 13
#define DDB_TUNER_DVBS_STV0910_PR 14
#define DDB_TUNER_XO2 16
#define DDB_TUNER_DVBS_STV0910 16
#define DDB_TUNER_DVBCT2_SONY 17
#define DDB_TUNER_ISDBT_SONY 18
#define DDB_TUNER_DVBC2T2_SONY 19
#define DDB_TUNER_ATSC_ST 20
#define DDB_TUNER_DVBC2T2_ST 21
#define DDB_TUNER_XO2 32
#define DDB_TUNER_DVBS_STV0910 (DDB_TUNER_XO2 + 0)
#define DDB_TUNER_DVBCT2_SONY (DDB_TUNER_XO2 + 1)
#define DDB_TUNER_ISDBT_SONY (DDB_TUNER_XO2 + 2)
#define DDB_TUNER_DVBC2T2_SONY (DDB_TUNER_XO2 + 3)
#define DDB_TUNER_ATSC_ST (DDB_TUNER_XO2 + 4)
#define DDB_TUNER_DVBC2T2_ST (DDB_TUNER_XO2 + 5)
struct ddb_input *input[2];
struct ddb_output *output;
@@ -371,7 +378,6 @@ struct ddb_lnb {
u32 voltage[4];
u32 voltages;
u32 fmode;
u32 setmode;
};
struct ddb_link {
@@ -383,13 +389,13 @@ struct ddb_link {
struct mutex flash_mutex;
struct ddb_lnb lnb;
struct tasklet_struct tasklet;
struct ddb_ids ids;
};
struct ddb {
struct pci_dev *pdev;
struct platform_device *pfdev;
struct device *dev;
struct ddb_ids ids;
int msi;
struct workqueue_struct *wq;
@@ -706,6 +712,6 @@ void ddbridge_mod_rate_handler(unsigned long data);
int ddbridge_flashread(struct ddb *dev, u32 link, u8 *buf, u32 addr, u32 len);
#define DDBRIDGE_VERSION "0.9.19"
#define DDBRIDGE_VERSION "0.9.22"
#endif

View File

@@ -113,16 +113,17 @@ static int __exit octonet_remove(struct platform_device *pdev)
dev = platform_get_drvdata(pdev);
ddb_device_destroy(dev);
ddb_nsd_detach(dev);
ddb_ports_detach(dev);
ddb_i2c_release(dev);
ddbwritel(dev, 0, ETHER_CONTROL);
if (dev->link[0].info->ns_num)
ddbwritel(dev, 0, ETHER_CONTROL);
ddbwritel(dev, 0, INTERRUPT_ENABLE);
free_irq(platform_get_irq(dev->pfdev, 0), dev);
free_irq(platform_get_irq(dev->pfdev, 0), dev);
ddb_ports_release(dev);
ddb_device_destroy(dev);
octonet_unmap(dev);
platform_set_drvdata(pdev, 0);
return 0;
@@ -156,28 +157,28 @@ static int __init octonet_probe(struct platform_device *pdev)
return -ENOMEM;
}
dev->ids.hwid = ddbreadl(dev, 0);
dev->ids.regmapid = ddbreadl(dev, 4);
dev->ids.devid = ddbreadl(dev, 8);
dev->ids.mac = ddbreadl(dev, 12);
dev->link[0].ids.hwid = ddbreadl(dev, 0);
dev->link[0].ids.regmapid = ddbreadl(dev, 4);
dev->link[0].ids.devid = ddbreadl(dev, 8);
dev->link[0].ids.mac = ddbreadl(dev, 12);
dev->ids.vendor = dev->ids.devid & 0xffff;
dev->ids.device = dev->ids.devid >> 16;
dev->ids.subvendor = dev->ids.devid & 0xffff;
dev->ids.subdevice = dev->ids.devid >> 16;
dev->link[0].ids.vendor = dev->link[0].ids.devid & 0xffff;
dev->link[0].ids.device = dev->link[0].ids.devid >> 16;
dev->link[0].ids.subvendor = dev->link[0].ids.devid & 0xffff;
dev->link[0].ids.subdevice = dev->link[0].ids.devid >> 16;
dev->link[0].dev = dev;
if (dev->ids.devid == 0x0300dd01)
if (dev->link[0].ids.devid == 0x0300dd01)
dev->link[0].info = &ddb_octonet;
else if (dev->ids.devid == 0x0301dd01)
else if (dev->link[0].ids.devid == 0x0301dd01)
dev->link[0].info = &ddb_octonet_jse;
else if (dev->ids.devid == 0x0307dd01)
else if (dev->link[0].ids.devid == 0x0307dd01)
dev->link[0].info = &ddb_octonet_gtl;
else
dev->link[0].info = &ddb_octonet_tbd;
pr_info("HW %08x REGMAP %08x\n", dev->ids.hwid, dev->ids.regmapid);
pr_info("MAC %08x DEVID %08x\n", dev->ids.mac, dev->ids.devid);
pr_info("HW %08x REGMAP %08x\n", dev->link[0].ids.hwid, dev->link[0].ids.regmapid);
pr_info("MAC %08x DEVID %08x\n", dev->link[0].ids.mac, dev->link[0].ids.devid);
ddbwritel(dev, 0, ETHER_CONTROL);
ddbwritel(dev, 0x00000000, INTERRUPT_ENABLE);
@@ -233,7 +234,7 @@ static __init int init_octonet(void)
int res;
pr_info("Digital Devices OctopusNet driver " DDBRIDGE_VERSION
", Copyright (C) 2010-14 Digital Devices GmbH\n");
", Copyright (C) 2010-15 Digital Devices GmbH\n");
res = ddb_class_create();
if (res)
return res;

View File

@@ -315,7 +315,7 @@ static int dvb_ca_en50221_link_init(struct dvb_ca_private *ca, int slot)
/* read the buffer size from the CAM */
if ((ret = ca->pub->write_cam_control(ca->pub, slot, CTRLIF_COMMAND, IRQEN | CMDREG_SR)) != 0)
return ret;
if ((ret = dvb_ca_en50221_wait_if_status(ca, slot, STATUSREG_DA, HZ / 10)) != 0)
if ((ret = dvb_ca_en50221_wait_if_status(ca, slot, STATUSREG_DA, HZ)) != 0)
return ret;
if ((ret = dvb_ca_en50221_read_data(ca, slot, buf, 2)) != 2)
return -EIO;

View File

@@ -1227,7 +1227,9 @@ static int dvb_net_stop(struct net_device *dev)
static const struct header_ops dvb_header_ops = {
.create = eth_header,
.parse = eth_header_parse,
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 2)
.rebuild = eth_rebuild_header,
#endif
};

View File

@@ -1008,6 +1008,15 @@ static void release(struct dvb_frontend *fe)
kfree(state);
}
static int sleep(struct dvb_frontend *fe)
{
struct cxd_state *state = fe->demodulator_priv;
Stop(state);
ShutDown(state);
return 0;
}
static int Start(struct cxd_state *state, u32 IntermediateFrequency)
{
enum demod_state newDemodState = Unknown;
@@ -1889,9 +1898,10 @@ static struct dvb_frontend_ops common_ops_2843 = {
FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
FE_CAN_TRANSMISSION_MODE_AUTO |
FE_CAN_GUARD_INTERVAL_AUTO | FE_CAN_HIERARCHY_AUTO |
FE_CAN_RECOVER | FE_CAN_MUTE_TS
FE_CAN_RECOVER | FE_CAN_MUTE_TS | FE_CAN_2G_MODULATION
},
.release = release,
.sleep = sleep,
.i2c_gate_ctrl = gate_ctrl,
.set_frontend = set_parameters,
@@ -1926,9 +1936,10 @@ static struct dvb_frontend_ops common_ops_2837 = {
FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
FE_CAN_TRANSMISSION_MODE_AUTO |
FE_CAN_GUARD_INTERVAL_AUTO | FE_CAN_HIERARCHY_AUTO |
FE_CAN_RECOVER | FE_CAN_MUTE_TS
FE_CAN_RECOVER | FE_CAN_MUTE_TS | FE_CAN_2G_MODULATION
},
.release = release,
.sleep = sleep,
.i2c_gate_ctrl = gate_ctrl,
.set_frontend = set_parameters,
@@ -1955,15 +1966,16 @@ static struct dvb_frontend_ops common_ops_2838 = {
.frequency_max = 865000000,
.symbol_rate_min = 870000,
.symbol_rate_max = 11700000,
.caps = FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
.caps = FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 | FE_CAN_QAM_AUTO |
FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
FE_CAN_FEC_4_5 |
FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
FE_CAN_TRANSMISSION_MODE_AUTO |
FE_CAN_GUARD_INTERVAL_AUTO | FE_CAN_HIERARCHY_AUTO |
FE_CAN_RECOVER | FE_CAN_MUTE_TS
FE_CAN_RECOVER | FE_CAN_MUTE_TS | FE_CAN_2G_MODULATION
},
.release = release,
.sleep = sleep,
.i2c_gate_ctrl = gate_ctrl,
.set_frontend = set_parameters,

View File

@@ -559,6 +559,7 @@ static int tune(struct dvb_frontend *fe, bool re_tune,
if (r)
return r;
#if 0
if (*status & FE_HAS_LOCK)
return 0;
@@ -567,6 +568,7 @@ static int tune(struct dvb_frontend *fe, bool re_tune,
else
p->delivery_system = SYS_DVBS;
set_parameters(fe);
#endif
return 0;
}
@@ -585,7 +587,7 @@ static int sleep(struct dvb_frontend *fe)
if (p->tuner_in_use == state->tuner)
break;
}
if (p == &state->base->mxls)
if (&p->mxl == &state->base->mxls)
enable_tuner(state, state->tuner, 0);
mutex_unlock(&state->base->tune_lock);
}

View File

@@ -103,6 +103,7 @@ struct stv {
u16 regoff;
u8 i2crpt;
u8 tscfgh;
u8 tsgeneral;
u8 tsspeed;
unsigned long tune_time;
@@ -932,7 +933,7 @@ static int probe(struct stv *state)
if (id != 0x51)
return -EINVAL;
pr_info("stv0910: found STV0910 id=0x%02x\n", id);
/* pr_info("stv0910: found STV0910 id=0x%02x\n", id); */
/* Configure the I2C repeater to off */
write_reg(state, RSTV0910_P1_I2CRPT, 0x24);
@@ -944,7 +945,7 @@ static int probe(struct stv *state)
write_reg(state, RSTV0910_OUTCFG, 0x00); /* OUTCFG */
write_reg(state, RSTV0910_PADCFG, 0x05); /* RF AGC Pads Dev = 05 */
write_reg(state, RSTV0910_SYNTCTRL, 0x02); /* SYNTCTRL */
write_reg(state, RSTV0910_TSGENERAL, 0x00); /* TSGENERAL */
write_reg(state, RSTV0910_TSGENERAL, state->tsgeneral); /* TSGENERAL */
write_reg(state, RSTV0910_CFGEXT, 0x02); /* CFGEXT */
write_reg(state, RSTV0910_GENCFG, 0x15); /* GENCFG */
@@ -1359,6 +1360,7 @@ struct dvb_frontend *stv0910_attach(struct i2c_adapter *i2c,
return NULL;
state->tscfgh = 0x20 | (cfg->parallel ? 0 : 0x40);
state->tsgeneral = (cfg->parallel == 2) ? 0x02 : 0x00;
state->i2crpt = 0x0A | ((cfg->rptlvl & 0x07) << 4);
state->tsspeed = 0x40;
state->nr = nr;

View File

@@ -306,7 +306,6 @@ static int set_params(struct dvb_frontend *fe)
{
struct stv *state = fe->tuner_priv;
struct dtv_frontend_properties *p = &fe->dtv_property_cache;
int status;
u32 freq, symb, cutoff;
if (p->delivery_system != SYS_DVBS && p->delivery_system != SYS_DVBS2)
@@ -321,7 +320,7 @@ static int set_params(struct dvb_frontend *fe)
set_lof(state, freq, cutoff);
if (fe->ops.i2c_gate_ctrl)
fe->ops.i2c_gate_ctrl(fe, 0);
return status;
return 0;
}
static int get_frequency(struct dvb_frontend *fe, u32 *frequency)

View File

@@ -447,8 +447,8 @@ static int attach_init(struct tda_state *state)
if (!state->m_isMaster)
state->m_bLTEnable = false;
pr_info("tda18212dd: ChipID %04x %s\n", state->m_ID,
state->m_isMaster ? "master" : "slave");
/*pr_info("tda18212dd: ChipID %04x %s\n", state->m_ID,
state->m_isMaster ? "master" : "slave");*/
if (state->m_ID != 18212)
return -1;
@@ -457,7 +457,7 @@ static int attach_init(struct tda_state *state)
if (stat < 0)
return stat;
pr_info("tda18212dd: PowerState %02x\n", PowerState);
/*pr_info("tda18212dd: PowerState %02x\n", PowerState);*/
if (state->m_isMaster) {
if (PowerState & 0x02) {
@@ -487,6 +487,7 @@ static int attach_init(struct tda_state *state)
FinishCalibration(state);
Standby(state);
#if 0
{
u8 RFCal_Log[12];
@@ -499,6 +500,7 @@ static int attach_init(struct tda_state *state)
RFCal_Log[8], RFCal_Log[9],
RFCal_Log[10], RFCal_Log[11]);
}
#endif
return stat;
}
@@ -775,6 +777,10 @@ static int sleep(struct dvb_frontend *fe)
struct tda_state *state = fe->tuner_priv;
Standby(state);
write_reg(state, THERMO_2, 0x01);
read_reg1(state, THERMO_1);
write_reg(state, THERMO_2, 0x00);
printk("sleep: temp = %u\n", state->Regs[THERMO_1]);
return 0;
}