/* The Bridge API needs to understand register widths (in bytes) for the * attached I2C devices, so we can simplify the virtual i2c mechansms * and keep the -i2c.c implementation clean.
*/ #define REGLEN_0bit 0 #define REGLEN_8bit 1 #define REGLEN_16bit 2
void saa7164_card_list(struct saa7164_dev *dev)
{ int i;
if (0 == dev->pci->subsystem_vendor &&
0 == dev->pci->subsystem_device) {
printk(KERN_ERR "%s: Board has no valid PCIe Subsystem ID and can't\n" "%s: be autodetected. Pass card= insmod option to\n" "%s: workaround that. Send complaints to the vendor\n" "%s: of the TV card. Best regards,\n" "%s: -- tux\n",
dev->name, dev->name, dev->name, dev->name, dev->name);
} else {
printk(KERN_ERR "%s: Your board isn't known (yet) to the driver.\n" "%s: Try to pick one of the existing card configs via\n" "%s: card= insmod option. Updating to the latest\n" "%s: version might help as well.\n",
dev->name, dev->name, dev->name, dev->name);
}
printk(KERN_ERR "%s: Here are valid choices for the card= insmod option:\n",
dev->name);
for (i = 0; i < saa7164_bcount; i++)
printk(KERN_ERR "%s: card=%d -> %s\n",
dev->name, i, saa7164_boards[i].name);
}
/* TODO: clean this define up into the -cards.c structs */ #define PCIEBRIDGE_UNITID 2
void saa7164_gpio_setup(struct saa7164_dev *dev)
{ switch (dev->board) { case SAA7164_BOARD_HAUPPAUGE_HVR2200: case SAA7164_BOARD_HAUPPAUGE_HVR2200_2: case SAA7164_BOARD_HAUPPAUGE_HVR2200_3: case SAA7164_BOARD_HAUPPAUGE_HVR2200_4: case SAA7164_BOARD_HAUPPAUGE_HVR2200_5: case SAA7164_BOARD_HAUPPAUGE_HVR2250: case SAA7164_BOARD_HAUPPAUGE_HVR2250_2: case SAA7164_BOARD_HAUPPAUGE_HVR2250_3: case SAA7164_BOARD_HAUPPAUGE_HVR2255proto: case SAA7164_BOARD_HAUPPAUGE_HVR2255: case SAA7164_BOARD_HAUPPAUGE_HVR2205: /* HVR2200 / HVR2250 GPIO 2: s5h1411 / tda10048-1 demod reset GPIO 3: s5h1411 / tda10048-2 demod reset GPIO 7: IRBlaster Zilog reset
*/
/* Reset parts by going in and out of reset */
saa7164_api_clear_gpiobit(dev, PCIEBRIDGE_UNITID, 2);
saa7164_api_clear_gpiobit(dev, PCIEBRIDGE_UNITID, 3);
/* Make sure we support the board model */ switch (tv.model) { case 88001: /* Development board - Limit circulation */ /* WinTV-HVR2250 (PCIe, Retail, full-height bracket)
* ATSC/QAM (TDA18271/S5H1411) and basic analog, no IR, FM */ case 88021: /* WinTV-HVR2250 (PCIe, Retail, full-height bracket)
* ATSC/QAM (TDA18271/S5H1411) and basic analog, MCE CIR, FM */ break; case 88041: /* WinTV-HVR2250 (PCIe, Retail, full-height bracket)
* ATSC/QAM (TDA18271/S5H1411) and basic analog, no IR, FM */ break; case 88061: /* WinTV-HVR2250 (PCIe, Retail, full-height bracket)
* ATSC/QAM (TDA18271/S5H1411) and basic analog, FM */ break; case 89519: case 89609: /* WinTV-HVR2200 (PCIe, Retail, full-height)
* DVB-T (TDA18271/TDA10048) and basic analog, no IR */ break; case 89619: /* WinTV-HVR2200 (PCIe, Retail, half-height)
* DVB-T (TDA18271/TDA10048) and basic analog, no IR */ break; case 151009: /* First production board rev B2I6 */ /* WinTV-HVR2205 (PCIe, Retail, full-height bracket)
* DVB-T/T2/C (SI2157/SI2168) and basic analog, FM */ break; case 151609: /* First production board rev B2I6 */ /* WinTV-HVR2205 (PCIe, Retail, half-height bracket)
* DVB-T/T2/C (SI2157/SI2168) and basic analog, FM */ break; case 151061: /* First production board rev B1I6 */ /* WinTV-HVR2255 (PCIe, Retail, full-height bracket)
* ATSC/QAM (SI2157/LGDT3306) and basic analog, FM */ break; default:
printk(KERN_ERR "%s: Warning: Unknown Hauppauge model #%d\n",
dev->name, tv.model); break;
}
if (dev->i2c_bus[0].i2c_rc == 0) { if (saa7164_api_read_eeprom(dev, &eeprom[0], sizeof(eeprom)) < 0) return;
}
switch (dev->board) { case SAA7164_BOARD_HAUPPAUGE_HVR2200: case SAA7164_BOARD_HAUPPAUGE_HVR2200_2: case SAA7164_BOARD_HAUPPAUGE_HVR2200_3: case SAA7164_BOARD_HAUPPAUGE_HVR2200_4: case SAA7164_BOARD_HAUPPAUGE_HVR2200_5: case SAA7164_BOARD_HAUPPAUGE_HVR2250: case SAA7164_BOARD_HAUPPAUGE_HVR2250_2: case SAA7164_BOARD_HAUPPAUGE_HVR2250_3: case SAA7164_BOARD_HAUPPAUGE_HVR2255proto: case SAA7164_BOARD_HAUPPAUGE_HVR2255: case SAA7164_BOARD_HAUPPAUGE_HVR2205:
hauppauge_eeprom(dev, &eeprom[0]); break;
}
}
/* With most other drivers, the kernel expects to communicate with subdrivers * through i2c. This bridge does not allow that, it does not expose any direct * access to I2C. Instead we have to communicate through the device f/w for * register access to 'processing units'. Each unit has a unique * id, regardless of how the physical implementation occurs across * the three physical i2c buses. The being said if we want leverge of * the existing kernel drivers for tuners and demods we have to 'speak i2c', * to this bridge implements 3 virtual i2c buses. This is a helper function * for those. * * Description: Translate the kernels notion of an i2c address and bus into * the appropriate unitid.
*/ int saa7164_i2caddr_to_unitid(struct saa7164_i2c *bus, int addr)
{ /* For a given bus and i2c device address, return the saa7164 unique
* unitid. < 0 on error */
struct saa7164_dev *dev = bus->dev; struct saa7164_unit *unit; int i;
for (i = 0; i < SAA7164_MAX_UNITS; i++) {
unit = &saa7164_boards[dev->board].unit[i];
if (unit->type == SAA7164_UNIT_UNDEFINED) continue; if ((bus->nr == unit->i2c_bus_nr) &&
(addr == unit->i2c_bus_addr)) return unit->id;
}
return -1;
}
/* The 7164 API needs to know the i2c register length in advance. * this is a helper function. Based on a specific chip addr and bus return the * reg length.
*/ int saa7164_i2caddr_to_reglen(struct saa7164_i2c *bus, int addr)
{ /* For a given bus and i2c device address, return the * saa7164 registry address width. < 0 on error
*/
struct saa7164_dev *dev = bus->dev; struct saa7164_unit *unit; int i;
for (i = 0; i < SAA7164_MAX_UNITS; i++) {
unit = &saa7164_boards[dev->board].unit[i];
if (unit->type == SAA7164_UNIT_UNDEFINED) continue;
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.