static void ivtv_process_eeprom(struct ivtv *itv)
{
	struct tveeprom tv;
	int pci_slot = PCI_SLOT(itv->pdev->devfn);

	ivtv_read_eeprom(itv, &tv);

	switch (tv.model) {
		case 30012 ... 30039:  
		case 32000 ... 32999:
		case 48000 ... 48099:  
		case 48400 ... 48599:
			itv->card = ivtv_get_card(IVTV_CARD_PVR_250);
			break;
		case 48100 ... 48399:
		case 48600 ... 48999:
			itv->card = ivtv_get_card(IVTV_CARD_PVR_350);
			break;
		case 23000 ... 23999:  
		case 25000 ... 25999:  
		case 26000 ... 26999:  
			itv->card = ivtv_get_card(IVTV_CARD_PVR_150);
			break;
		case 0:
			IVTV_ERR("Invalid EEPROM\n");
			return;
		default:
			IVTV_ERR("Unknown model %d, defaulting to PVR-150\n", tv.model);
			itv->card = ivtv_get_card(IVTV_CARD_PVR_150);
			break;
	}

	switch (tv.model) {
		case 48254:
			itv->card = ivtv_get_card(IVTV_CARD_PVR_350_V1);
			break;
		default:
			break;
	}

	itv->v4l2_cap = itv->card->v4l2_capabilities;
	itv->card_name = itv->card->name;
	itv->card_i2c = itv->card->i2c;

	if (tv.model / 1000 == 23) {
		static const struct ivtv_card_tuner_i2c ivtv_i2c_radio = {
			.radio = { 0x60, I2C_CLIENT_END },
			.demod = { 0x43, I2C_CLIENT_END },
			.tv = { 0x61, I2C_CLIENT_END },
		};
Пример #2
0
static void ivtv_process_eeprom(struct ivtv *itv)
{
	struct tveeprom tv;
	int pci_slot = PCI_SLOT(itv->pdev->devfn);

	ivtv_read_eeprom(itv, &tv);

	/* Many thanks to Steven Toth from Hauppauge for providing the
	   model numbers */
	switch (tv.model) {
		/* In a few cases the PCI subsystem IDs do not correctly
		   identify the card. A better method is to check the
		   model number from the eeprom instead. */
		case 30012 ... 30039:  /* Low profile PVR250 */
		case 32000 ... 32999:
		case 48000 ... 48099:  /* 48??? range are PVR250s with a cx23415 */
		case 48400 ... 48599:
			itv->card = ivtv_get_card(IVTV_CARD_PVR_250);
			break;
		case 48100 ... 48399:
		case 48600 ... 48999:
			itv->card = ivtv_get_card(IVTV_CARD_PVR_350);
			break;
		case 23000 ... 23999:  /* PVR500 */
		case 25000 ... 25999:  /* Low profile PVR150 */
		case 26000 ... 26999:  /* Regular PVR150 */
			itv->card = ivtv_get_card(IVTV_CARD_PVR_150);
			break;
		case 0:
			IVTV_ERR("Invalid EEPROM\n");
			return;
		default:
			IVTV_ERR("Unknown model %d, defaulting to PVR-150\n", tv.model);
			itv->card = ivtv_get_card(IVTV_CARD_PVR_150);
			break;
	}

	switch (tv.model) {
		/* Old style PVR350 (with an saa7114) uses this input for
		   the tuner. */
		case 48254:
			itv->card = ivtv_get_card(IVTV_CARD_PVR_350_V1);
			break;
		default:
			break;
	}

	itv->v4l2_cap = itv->card->v4l2_capabilities;
	itv->card_name = itv->card->name;
	itv->card_i2c = itv->card->i2c;

	/* If this is a PVR500 then it should be possible to detect whether it is the
	   first or second unit by looking at the subsystem device ID: is bit 4 is
	   set, then it is the second unit (according to info from Hauppauge).

	   However, while this works for most cards, I have seen a few PVR500 cards
	   where both units have the same subsystem ID.

	   So instead I look at the reported 'PCI slot' (which is the slot on the PVR500
	   PCI bridge) and if it is 8, then it is assumed to be the first unit, otherwise
	   it is the second unit. It is possible that it is a different slot when ivtv is
	   used in Xen, in that case I ignore this card here. The worst that can happen
	   is that the card presents itself with a non-working radio device.

	   This detection is needed since the eeprom reports incorrectly that a radio is
	   present on the second unit. */
	if (tv.model / 1000 == 23) {
		static const struct ivtv_card_tuner_i2c ivtv_i2c_radio = {
			.radio = { 0x60, I2C_CLIENT_END },
			.demod = { 0x43, I2C_CLIENT_END },
			.tv = { 0x61, I2C_CLIENT_END },
		};