/* this is only called for old HV-PCI6/Orion cards
without eeprom */ staticint hexium_probe(struct saa7146_dev *dev)
{ struct hexium *hexium = NULL; union i2c_smbus_data data; int err = 0;
DEB_EE("\n");
/* there are no hexium orion cards with revision 0 saa7146s */ if (0 == dev->revision) { return -EFAULT;
}
hexium = kzalloc(sizeof(*hexium), GFP_KERNEL); if (!hexium) return -ENOMEM;
/* set SAA7110 control GPIO 0 */
saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTHI); /* set HWControl GPIO number 2 */
saa7146_setgpio(dev, 2, SAA7146_GPIO_OUTHI);
mdelay(10);
/* detect newer Hexium Orion cards by subsystem ids */ if (0x17c8 == dev->pci->subsystem_vendor && 0x0101 == dev->pci->subsystem_device) {
pr_info("device is a Hexium Orion w/ 1 SVHS + 3 BNC inputs\n"); /* we store the pointer in our private data field */
dev->ext_priv = hexium;
hexium->type = HEXIUM_ORION_1SVHS_3BNC; return0;
}
if (0x17c8 == dev->pci->subsystem_vendor && 0x2101 == dev->pci->subsystem_device) {
pr_info("device is a Hexium Orion w/ 4 BNC inputs\n"); /* we store the pointer in our private data field */
dev->ext_priv = hexium;
hexium->type = HEXIUM_ORION_4BNC; return0;
}
/* check if this is an old hexium Orion card by looking at
a saa7110 at address 0x4e */
err = i2c_smbus_xfer(&hexium->i2c_adapter, 0x4e, 0, I2C_SMBUS_READ, 0x00, I2C_SMBUS_BYTE_DATA, &data); if (err == 0) {
pr_info("device is a Hexium HV-PCI6/Orion (old)\n"); /* we store the pointer in our private data field */
dev->ext_priv = hexium;
hexium->type = HEXIUM_HV_PCI6_ORION; return0;
}
/* bring hardware to a sane state. this has to be done, just in case someone wantstocapturefromthisdevicebeforeithasbeenproperlyinitialized. thecaptureenginewouldbadlyfail,becausenovalidsignalarrivesonthe
saa7146, thus leading to timeouts and stuff. */ staticint hexium_init_done(struct saa7146_dev *dev)
{ struct hexium *hexium = (struct hexium *) dev->ext_priv; union i2c_smbus_data data; int i = 0;
DEB_D("hexium_init_done called\n");
/* initialize the helper ics to useful values */ for (i = 0; i < sizeof(hexium_saa7110); i++) {
data.byte = hexium_saa7110[i]; if (0 != i2c_smbus_xfer(&hexium->i2c_adapter, 0x4e, 0, I2C_SMBUS_WRITE, i, I2C_SMBUS_BYTE_DATA, &data)) {
pr_err("failed for address 0x%02x\n", i);
}
}
return0;
}
staticint hexium_set_input(struct hexium *hexium, int input)
{ union i2c_smbus_data data; int i = 0;
DEB_D("\n");
for (i = 0; i < 8; i++) { int adr = hexium_input_select[input].data[i].adr;
data.byte = hexium_input_select[input].data[i].byte; if (0 != i2c_smbus_xfer(&hexium->i2c_adapter, 0x4e, 0, I2C_SMBUS_WRITE, adr, I2C_SMBUS_BYTE_DATA, &data)) { return -1;
}
pr_debug("%d: 0x%02x => 0x%02x\n", input, adr, data.byte);
}
/* this function only gets called when the probing was successful */ staticint hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_data *info)
{ struct hexium *hexium = (struct hexium *) dev->ext_priv; int ret;
DEB_EE("\n");
ret = saa7146_vv_init(dev, &vv_data); if (ret) {
pr_err("Error in saa7146_vv_init()\n"); return ret;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.