FI1236Ptr Detect_FI1236(I2CBusPtr b, I2CSlaveAddr addr) { FI1236Ptr f; I2CByte a; f = xcalloc(1,sizeof(FI1236Rec)); if(f == NULL) return NULL; f->d.DevName = strdup("FI12xx Tuner"); f->d.SlaveAddr = addr; f->d.pI2CBus = b; f->d.NextDev = NULL; f->d.StartTimeout = b->StartTimeout; f->d.BitTimeout = b->BitTimeout; f->d.AcknTimeout = b->AcknTimeout; f->d.ByteTimeout = b->ByteTimeout; f->type=TUNER_TYPE_FI1236; f->afc_timer_installed=FALSE; f->last_afc_hint=TUNER_OFF; f->video_if=45.7812; if(!I2C_WriteRead(&(f->d), NULL, 0, &a, 1)) { free(f); return NULL; } FI1236_set_tuner_type(f, TUNER_TYPE_FI1236); if(!I2CDevInit(&(f->d))) { free(f); return NULL; } return f; }
UDA1380Ptr Detect_uda1380(I2CBusPtr b, I2CSlaveAddr addr) { UDA1380Ptr t; I2CByte a; t = xcalloc(1, sizeof(UDA1380Rec)); if(t == NULL) return NULL; switch(addr) { case UDA1380_ADDR_1: case UDA1380_ADDR_2: t->d.DevName = "UDA1380 Stereo audion coder-decoder"; break; default: t->d.DevName = "Generic UDAxxxx"; break; } t->d.SlaveAddr = addr; t->d.pI2CBus = b; t->d.NextDev = NULL; t->d.StartTimeout = b->StartTimeout; t->d.BitTimeout = b->BitTimeout; t->d.AcknTimeout = b->AcknTimeout; t->d.ByteTimeout = b->ByteTimeout; if(!I2C_WriteRead(&(t->d), NULL, 0, &a, 1)) { xfree(t); return NULL; } /* set default parameters */ if(!I2CDevInit(&(t->d))) { xfree(t); return NULL; } xf86DrvMsg(t->d.pI2CBus->scrnIndex,X_INFO,"UDA1380 stereo coder-decoder detected\n"); return t; }
TDA9850Ptr Detect_tda9850(I2CBusPtr b, I2CSlaveAddr addr) { TDA9850Ptr t; I2CByte a; t = xcalloc(1, sizeof(TDA9850Rec)); if(t == NULL) return NULL; switch(addr) { case TDA9850_ADDR_1: t->d.DevName = "TDA9850 BTSC Stereo+SAP Audio Processor"; break; default: t->d.DevName = "Generic TDAxxxx"; break; } t->d.SlaveAddr = addr; t->d.pI2CBus = b; t->d.NextDev = NULL; t->d.StartTimeout = b->StartTimeout; t->d.BitTimeout = b->BitTimeout; t->d.AcknTimeout = b->AcknTimeout; t->d.ByteTimeout = b->ByteTimeout; if(!I2C_WriteRead(&(t->d), NULL, 0, &a, 1)) { xfree(t); return NULL; } /* set default parameters */ if(!I2CDevInit(&(t->d))) { xfree(t); return NULL; } return t; }