--- margi2/margi.c 2001/10/15 12:40:29 1.18 +++ margi2/margi.c 2002/02/04 12:20:13 1.19 @@ -59,6 +59,12 @@ MODULE_LICENSE("GPL"); /*====================================================================*/ /* Parameters that can be set with 'insmod' */ +static int svhs = 1; +MODULE_PARM(svhs,"i"); +static int composite = 1; +MODULE_PARM(composite,"i"); +static int use_zv = 1; +MODULE_PARM(use_zv,"i"); /* Release IO ports after configuration? */ static int free_ports = 0; @@ -733,6 +739,50 @@ void ZV_init(struct cvdv_cards *card) write_indexed_register(card, IIO_VIDEO_CONTROL1, reg); } +void set_svhs(struct cvdv_cards *card, int onoff) +{ + uint8_t val; + + val = I2CRead(card, card->i2c_addr, CS_DAC)&0x0f; + MDEBUG(1, ": --svhs val 0x%02x\n",val); + + if (onoff){ + if (!card->svhs){ + I2CWrite(card, card->i2c_addr, CS_DAC, val|0x03); + card->svhs = 1; + } + } else { + if (!card->svhs){ + I2CWrite(card, card->i2c_addr, CS_DAC, val|0x30); + card->svhs = 1; + } + } + +} + +void set_composite(struct cvdv_cards *card, int onoff) +{ + uint8_t val; + + val = I2CRead(card, card->i2c_addr, CS_DAC)&0x0f; + MDEBUG(1, ": --composite val 0x%02x\n",val); + + + if (onoff){ + if (!card->composite){ + I2CWrite(card, card->i2c_addr, CS_DAC, val|0x84); + card->composite = 1; + } + } else { + if (!card->svhs){ + I2CWrite(card, card->i2c_addr, CS_DAC, val|0xE0); + card->composite = 1; + } + } + +} + + int L64014Init(struct cvdv_cards *card) { uint16_t testram[16]; @@ -770,14 +820,16 @@ int L64014Init(struct cvdv_cards *card) I2CWrite(card, card->i2c_addr, CS_SC_SYNTH2, 0x13); I2CWrite(card, card->i2c_addr, CS_SC_SYNTH3, 0x54); - I2CWrite(card, card->i2c_addr, CS_DAC, 0x87); +// I2CWrite(card, card->i2c_addr, CS_DAC, 0x87); + if (svhs) set_svhs(card, 1); + if (composite) set_composite(card, 1); I2CWrite(card, card->i2c_addr, CS_BKG_COL, 0x03); MDEBUG(0,"Decoder Status: %d\n", read_lsi_status(card)); MDEBUG(0,"lsi stat %d\n", DecoderReadByte(card, 0x005)); #ifdef USE_ZV - ZV_init(card); + if (use_zv) ZV_init(card); #endif L64021Init(card);