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;
}
static int broadcast_Isdb_spi_probe(struct spi_device *spi_dev)
{
	int rc = 0;

	xo_handle_tcc = msm_xo_get(MSM_XO_TCXO_A0, id);
	if(IS_ERR(xo_handle_tcc)) {
		pr_err("Failed to get MSM_XO_TCXO_A2 handle for TDMB (%ld)\n", PTR_ERR(xo_handle_tcc));
		return FALSE;
	}

	TcpalCreateSemaphore(&Tcc353xDrvSem,
			     (I08S *) "Tcc353xDriverControlSemaphore", 1);
	TcpalCreateSemaphore(&Tcc353xStreamSema,
			     (I08S *) "StreamSemaphore", 1);
	TcpalCreateSemaphore(&Tcc353xLnaControlSema,
			     (I08S *) "LnaControlSemaphore", 1);

	spi_dev->mode = SPI_MODE_0;
	spi_dev->bits_per_word = 8;
	spi_dev->max_speed_hz = 32*1000*1000;	/*        */
	rc = spi_setup(spi_dev);

	IsdbCtrlInfo.spi_dev = spi_dev;
	IsdbCtrlInfo.pwr_state = 0;
	TcpalPrintStatus((I08S *)"spi : %p\n", spi_dev);

	TchalInit();
	TcpalRegisterIrqHandler();
	TcpalIrqDisable();

#ifndef _NOT_USE_WAKE_LOCK_
	wake_lock_init(&IsdbCtrlInfo.wake_lock, WAKE_LOCK_SUSPEND,
					dev_name(&spi_dev->dev));	
#endif

	/*                        */
	tcc353x_lnaControl_start();

	return rc;
}
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;
}
void TcbdInitQueue(TcbdQueue_t *_queue, I32S _qsize, I08U *_buffer, I32S _buffSize)
{
    _queue->q            = (TcbdQueueItem_t*)TcpalMemoryAllocation(sizeof(TcbdQueueItem_t) * _qsize);
    _queue->front        = 0;
    _queue->rear         = 0;
    _queue->qsize        = _qsize;
    _queue->buffSize     = _buffSize;
    _queue->globalBuffer = _buffer;

    TcpalCreateSemaphore(&_queue->sem, "TcbdQueue", 0);

    TcbdDebug(1, "buff :0x%X, size:%d\n", _buffer, _buffSize);
}
I32S TcpalRegisterIrqHandler(TcbdDevice_t *_device)
{
#else
I32S TcpalRegisterIrqHandler(void)
{
	extern TcbdDevice_t *GetTcbdDevice(void);
	TcbdDevice_t *_device = GetTcbdDevice();
#endif

    struct spi_device *spi = TCC_GET_SPI_DRIVER();
	TcbdIrqData.isIrqEnable = 0;
#if defined(__WORKQUEUE__)
    TcbdIrqData.workQueue = create_singlethread_workqueue("TcbdStreamParsingWork");
    TcbdIrqData.device = _device;
    TcbdIrqData.tcbd_irq = spi->irq;
	TcpalCreateSemaphore(&TcbdIrqData.lock, "IRQ", 1);

    INIT_WORK(&TcbdIrqData.work, TcbdStreamParsingWork);
#endif //__WORKQUEUE__
    TcbdInitParser(TcbdStreamCallback);

    TchalIrqSetup();

    TcbdDebug(DEBUG_ERROR,"irq:%d\n", TcbdIrqData.tcbd_irq);
    return  request_irq(TcbdIrqData.tcbd_irq, TcbdIrqHandler,
        IRQF_DISABLED | IRQF_TRIGGER_FALLING, "tc317x_stream", &TcbdIrqData);
	
}

I32S TcpalUnRegisterIrqHandler(void)
{
    disable_irq(TcbdIrqData.tcbd_irq);
	flush_workqueue(TcbdIrqData.workQueue);
    destroy_workqueue(TcbdIrqData.workQueue);
	TcpalDeleteSemaphore(&TcbdIrqData.lock);
    return 0;
}