static int broadcast_Isdb_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) { int rc = 0; int addr; TcpalPrintLog("broadcast_Isdb_i2c_probe client:0x%X\n", (unsigned int)client); if(!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { TcpalPrintErr("need I2C_FUNC_I2C\n"); return -ENODEV; } /* taew00k.kang added for Device Tree Structure 2013-06-04 [start] */ addr = client->addr; //Slave Addr pr_err("[1seg] i2c Slaveaddr [%x] \n", addr); /* taew00k.kang added for Device Tree Structure 2013-06-04 [end] */ TcpalCreateSemaphore(&Tcc353xDrvSem, (I08S *) "Tcc353xDriverControlSemaphore", 1); IsdbCtrlInfo.pclient = client; //i2c_set_clientdata(client, (void*)&IsdbCtrlInfo.pclient); TchalInit(); #ifndef _NOT_USE_WAKE_LOCK_ wake_lock_init(&IsdbCtrlInfo.wake_lock, WAKE_LOCK_SUSPEND, dev_name(&client->dev)); #endif return rc; }
I32S Tcc353xI2cClose(I32S _moduleIndex) { if (_moduleIndex == 0) gI2cHanleInit0 = 0; else gI2cHanleInit1 = 0; if (gI2cHanleInit0 == 0 && gI2cHanleInit1 == 0) { gI2cHanleInited = 0; TcpalPrintLog((I08S *)"TcpalI2cClient :0x%X\n", (unsigned int)TcpalI2cClient); } return TCC353X_RETURN_SUCCESS; }
I32S Tcc353xI2cClose(I32S _moduleIndex) { #if !defined (_TCSPI_ONLY_) if (_moduleIndex == 0) gI2cHanleInit0 = 0; else gI2cHanleInit1 = 0; if (gI2cHanleInit0 == 0 && gI2cHanleInit1 == 0) { gI2cHanleInited = 0; TcpalPrintLog((I08S *)"[dtv][tcc3536][debug_info] TcpalI2cClient :0x%X\n", (unsigned int)TcpalI2cClient); } #endif return TCC353X_RETURN_SUCCESS; }
I32S TcpalCreateSemaphore(TcpalSemaphore_t * _semaphore, I08S * _name, I32U _initialCount) { struct mutex *lock; I32S index; index = TcpalGetSemaphoreAddress(); if(index<0) { TcpalPrintErr((I08S *)"######## Mutex Get Fail :%d \n", (int)index); return TCC353X_RETURN_FAIL; } lock = &MutexPool[index]; mutex_init(lock); TcpalPrintLog((I08S *)"######## MutexC %s [%d] \n", _name, (int)(lock)); *_semaphore = (TcpalSemaphore_t)lock; return TCC353X_RETURN_SUCCESS; }
static int broadcast_Isdb_i2c_probe(struct i2c_client *client, const struct i2c_device_id *id) { int rc = 0; int addr; TcpalPrintLog("broadcast_Isdb_i2c_probe client:0x%X\n", (unsigned int)client); if(!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) { TcpalPrintErr("need I2C_FUNC_I2C\n"); return -ENODEV; } /* */ addr = client->addr; // pr_err("[1seg] i2c Slaveaddr [%x] \n", addr); /* */ TcpalCreateSemaphore(&Tcc353xDrvSem, (I08S *) "Tcc353xDriverControlSemaphore", 1); TcpalCreateSemaphore(&Tcc353xStreamSema, (I08S *) "StreamSemaphore", 1); TcpalCreateSemaphore(&Tcc353xLnaControlSema, (I08S *) "LnaControlSemaphore", 1); IsdbCtrlInfo.pclient = client; // TchalInit(); TcpalRegisterIrqHandler(); TcpalIrqDisable(); #ifndef _NOT_USE_WAKE_LOCK_ wake_lock_init(&IsdbCtrlInfo.wake_lock, WAKE_LOCK_SUSPEND, dev_name(&client->dev)); #endif /* */ tcc353x_lnaControl_start(); return rc; }
I32S TcpalDeleteSemaphore(TcpalSemaphore_t * _semaphore) { struct mutex *lock = (struct mutex*)*_semaphore; I32U address; I32S index; if(lock == NULL) return TCC353X_RETURN_FAIL; address = (I32U)(lock); index = TcpalFreeSemaphoreAddress(address); if(index < 0) { TcpalPrintErr((I08S *)"####### Mutex Delete Fail :%d \n", (int)index); return TCC353X_RETURN_FAIL; } TcpalPrintLog((I08S *)"######## MutexR [%d] \n", (int)(lock)); mutex_destroy(lock); *_semaphore = 0; return TCC353X_RETURN_SUCCESS; }