DAL_STATUS DAL_Init(unsigned long layerVA, unsigned long layerPA)
{
    NOT_REFERENCED(layerVA);
    NOT_REFERENCED(layerPA);
    
    return DAL_STATUS_OK;
}
Beispiel #2
0
DAL_STATUS DAL_Init(UINT32 layerVA, UINT32 layerPA)
{
    NOT_REFERENCED(layerVA);
    NOT_REFERENCED(layerPA);

    return DAL_STATUS_OK;
}
DAL_STATUS DAL_SetColor(unsigned int fgColor, unsigned int bgColor)
{
    NOT_REFERENCED(fgColor);
    NOT_REFERENCED(bgColor);

    return DAL_STATUS_OK;
}
Beispiel #4
0
void jpeg_drv_dec_power_on(void)
{  
    BOOL ret;
    ret = hwEnableClock(MT65XX_PDN_MM_GMC2,"JPEG");
    ret = hwEnableClock(MT65XX_PDN_MM_JPGDEC,"JPEG");
    NOT_REFERENCED(ret);
}
Beispiel #5
0
void jpeg_drv_enc_power_off(void)
{  
    BOOL ret;
    ret = hwDisableClock(MT65XX_PDN_MM_JPGENC,"JPEG");
    ret = hwDisableClock(MT65XX_PDN_MM_GMC2,"JPEG");
    NOT_REFERENCED(ret);
}
TPM_RC
TPM2_Clear(
	   Clear_In        *in             // IN: input parameter list
	   )
{
    // Input parameter is not reference in command action
    NOT_REFERENCED(in);
    // The command needs NV update.  Check if NV is available.
    // A TPM_RC_NV_UNAVAILABLE or TPM_RC_NV_RATE error may be returned at
    // this point
    RETURN_IF_NV_IS_NOT_AVAILABLE;
    // Input Validation
    // If Clear command is disabled, return an error
    if(gp.disableClear)
	return TPM_RC_DISABLED;
    // Internal Data Update
    // Reset storage hierarchy seed from RNG
    CryptRandomGenerate(sizeof(gp.SPSeed.t.buffer), gp.SPSeed.t.buffer);
    // Create new shProof and ehProof value from RNG
    CryptRandomGenerate(sizeof(gp.shProof.t.buffer), gp.shProof.t.buffer);
    CryptRandomGenerate(sizeof(gp.ehProof.t.buffer), gp.ehProof.t.buffer);
    // Enable storage and endorsement hierarchy
    gc.shEnable = gc.ehEnable = TRUE;
    // set the authValue buffers to zero
    MemorySet(&gp.ownerAuth, 0, sizeof(gp.ownerAuth));
    MemorySet(&gp.endorsementAuth, 0, sizeof(gp.endorsementAuth));
    MemorySet(&gp.lockoutAuth, 0, sizeof(gp.lockoutAuth));
    // Set storage, endorsement, and lockout authPolicy to null
    gp.ownerAlg = gp.endorsementAlg = gp.lockoutAlg = TPM_ALG_NULL;
    MemorySet(&gp.ownerPolicy, 0, sizeof(gp.ownerPolicy));
    MemorySet(&gp.endorsementPolicy, 0, sizeof(gp.endorsementPolicy));
    MemorySet(&gp.lockoutPolicy, 0, sizeof(gp.lockoutPolicy));
    // Flush loaded object in storage and endorsement hierarchy
    ObjectFlushHierarchy(TPM_RH_OWNER);
    ObjectFlushHierarchy(TPM_RH_ENDORSEMENT);
    // Flush owner and endorsement object and owner index in NV
    NvFlushHierarchy(TPM_RH_OWNER);
    NvFlushHierarchy(TPM_RH_ENDORSEMENT);
    // Initialize dictionary attack parameters
    DAPreInstall_Init();
    // Reset clock
    go.clock = 0;
    go.clockSafe = YES;
    NvWrite(NV_ORDERLY_DATA, sizeof(ORDERLY_DATA), &go);
    // Reset counters
    gp.resetCount = gr.restartCount = gr.clearCount = 0;
    gp.auditCounter = 0;
    // Save persistent data changes to NV
    // Note: since there are so many changes to the persistent data structure, the
    // entire PERSISTENT_DATA structure is written as a unit
    NvWrite(NV_PERSISTENT_DATA, sizeof(PERSISTENT_DATA), &gp);
    // Reset the PCR authValues (this does not change the PCRs)
    PCR_ClearAuth();
    // Bump the PCR counter
    PCRChanged(0);
    // orderly state should be cleared because of the update to state clear data
    g_clearOrderly = TRUE;
    return TPM_RC_SUCCESS;
}
Beispiel #7
0
static int g2d_probe(struct platform_device *pdev)
{
    struct class_device;
    struct class_device *class_dev = NULL;
    
    G2D_INF("\n\n\n===================== G2D probe ======================\n\n\n");

    if (alloc_chrdev_region(&g2d_devno, 0, 1, G2D_DEVNAME))
    {
        G2D_ERR("can't get device major number...\n");
        return -EFAULT;
    }

    G2D_INF("get device major number (%d)\n", g2d_devno);

    g2d_cdev = cdev_alloc();
    g2d_cdev->owner = THIS_MODULE;
    g2d_cdev->ops = &g2d_fops;

    cdev_add(g2d_cdev, g2d_devno, 1);

    g2d_class = class_create(THIS_MODULE, G2D_DEVNAME);
    class_dev = (struct class_device *)device_create(g2d_class, NULL, g2d_devno, NULL, G2D_DEVNAME);

#ifdef G2D_QUEUE
    if (_g2d_create_workqueue())
    {
        G2D_ERR("failed to create workqueue\n");
        return -EFAULT;
    }

    if (_g2d_create_queuebuffer())
    {
        G2D_ERR("failed to create queue buffer\n");
        return -EFAULT;
    }
#else
    init_waitqueue_head(&isr_wait_queue);

    if (!g2d_cmd_buffer)
    {
        g2d_cmd_buffer = (g2d_command_t *)kzalloc(sizeof(g2d_command_t), GFP_KERNEL);
        if (!g2d_cmd_buffer) return -EFAULT;
    }
#endif

    mt6575_irq_set_sens(MT6575_G2D_IRQ_ID, MT65xx_EDGE_SENSITIVE);
    mt6575_irq_set_polarity(MT6575_G2D_IRQ_ID, MT65xx_POLARITY_LOW);

    if (request_irq(MT6575_G2D_IRQ_ID, g2d_drv_isr, 0, "G2D ISR" , NULL))
    {
        G2D_ERR("request irq failed\n");
    }

    G2D_INF("probe is done\n");

    NOT_REFERENCED(class_dev);
    return 0;
}
void gdma_drv_power_off(void)
{  
#ifdef FOR_COMPILE   
    BOOL ret;
    ret = disable_clock(MT65XX_PDN_MM_GDMA_DEC,"GDMA");
    NOT_REFERENCED(ret);
#endif
}
Beispiel #9
0
void g2d_drv_power_off(void)
{
    BOOL ret;

    ret = hwDisableClock(MT65XX_PDN_MM_G2D, "G2D");

    NOT_REFERENCED(ret);
}
Beispiel #10
0
/* This function requires that NV be available and not rate limiting. */
void
DAStartup(
	  STARTUP_TYPE     type           // IN: startup type
	  )
{
    NOT_REFERENCED(type);
#if !ACCUMULATE_SELF_HEAL_TIMER
    _plat__TimerWasReset();
    s_selfHealTimer = 0;
    s_lockoutTimer = 0;
#else
    if(_plat__TimerWasReset())
	{
	    if(!NV_IS_ORDERLY)
		{
		    // If shutdown was not orderly, then don't really know if go.time has
		    // any useful value so reset the timer to 0. This is what the tick
		    // was reset to
		    s_selfHealTimer = 0;
		    s_lockoutTimer = 0;
		}
	    else
		{
		    // If we know how much time was accumulated at the last orderly shutdown
		    // subtract that from the saved timer values so that they effectively
		    // have the accumulated values
		    s_selfHealTimer -= go.time;
		    s_lockoutTimer -= go.time;
		}
	}
#endif
    // For any Startup(), if lockoutRecovery is 0, enable use of lockoutAuth.
    if(gp.lockoutRecovery == 0)
	{
	    gp.lockOutAuthEnabled = TRUE;
	    // Record the changes to NV
	    NV_SYNC_PERSISTENT(lockOutAuthEnabled);
	}
    // If DA has not been disabled and the previous shutdown is not orderly
    // failedTries is not already at its maximum then increment 'failedTries'
    if(gp.recoveryTime != 0
       && gp.failedTries < gp.maxTries
       && !IS_ORDERLY(g_prevOrderlyState))
	{
#if USE_DA_USED
	    gp.failedTries += g_daUsed;
	    g_daUsed = FALSE;
#else
	    gp.failedTries++;
#endif
	    // Record the change to NV
	    NV_SYNC_PERSISTENT(failedTries);
	}
    // Before Startup, the TPM will not do clock updates. At startup, need to
    // do a time update which will do the DA update.
    TimeUpdate();
    return;
}
Beispiel #11
0
void jpeg_drv_enc_power_off(void)
{
    disable_clock(MT_CG_IMAGE_JPGE_SMI,"JPEG");
    disable_clock(MT_CG_IMAGE_JPGE_JPG,"JPEG");
#ifdef FOR_COMPILE
    BOOL ret;
    ret = disable_clock(MT65XX_PDN_MM_JPEG_ENC,"JPEG");
    NOT_REFERENCED(ret);
#endif
}
void gdma_drv_power_on(void)
{  

    //REG_GDMA_MM_REG_MASK = 0;   
   
#ifdef FOR_COMPILE   
    BOOL ret;
    ret = enable_clock(MT65XX_PDN_MM_GDMA_DEC,"GDMA");
    NOT_REFERENCED(ret);
#endif
}
Beispiel #13
0
static int jpeg_probe(struct platform_device *pdev)
{
    struct class_device;
    
	int ret;
    struct class_device *class_dev = NULL;
    
    printk("jpeg driver probe\n");
	ret = alloc_chrdev_region(&jpeg_devno, 0, 1, JPEG_DEVNAME);

	if(ret)
	{
	    printk("Error: Can't Get Major number for JPEG Device\n");
	}
	else
	{
	    printk("Get JPEG Device Major number (%d)\n", jpeg_devno);
    }

	jpeg_cdev = cdev_alloc();
    jpeg_cdev->owner = THIS_MODULE;
	jpeg_cdev->ops = &jpeg_fops;

	ret = cdev_add(jpeg_cdev, jpeg_devno, 1);

    jpeg_class = class_create(THIS_MODULE, JPEG_DEVNAME);
    class_dev = (struct class_device *)device_create(jpeg_class, NULL, jpeg_devno, NULL, JPEG_DEVNAME);

    spin_lock_init(&jpeg_dec_lock);
    spin_lock_init(&jpeg_enc_lock);

    // initial codec, register codec ISR
    dec_status = 0;
    enc_status = 0;
    _jpeg_dec_int_status = 0;
    _jpeg_enc_int_status = 0;

    init_waitqueue_head(&dec_wait_queue);
    init_waitqueue_head(&enc_wait_queue);  
    
    mt6573_irq_set_sens(MT6573_JPG_CODEC_IRQ_LINE, MT65xx_LEVEL_SENSITIVE);
    mt6573_irq_unmask(MT6573_JPG_CODEC_IRQ_LINE);

    enable_irq(MT6573_JPG_CODEC_IRQ_LINE);
    if(request_irq(MT6573_JPG_CODEC_IRQ_LINE, (irq_handler_t)jpeg_drv_isr, 0, "jpeg_driver" , NULL))
    {
        printk("JPEG Codec Driver request irq failed\n");
    }
  
	printk("JPEG Probe Done\n");

	NOT_REFERENCED(class_dev);
	return 0;
}
static int gdma_probe(struct platform_device *pdev)
{
#ifdef GDMA_DEV
	int ret;
    struct class_device *class_dev = NULL;
    
    GDMA_MSG("-------------gdma driver probe-------\n");
	ret = alloc_chrdev_region(&gdma_devno, 0, 1, GDMA_DEVNAME);

	if(ret)
	{
	    GDMA_ERR("Error: Can't Get Major number for GDMA Device\n");
	}
	else
	{
	    GDMA_MSG("Get GDMA Device Major number (%d)\n", gdma_devno);
    }

	gdma_cdev = cdev_alloc();
    gdma_cdev->owner = THIS_MODULE;
	gdma_cdev->ops = &gdma_fops;

	ret = cdev_add(gdma_cdev, gdma_devno, 1);

    gdma_class = class_create(THIS_MODULE, GDMA_DEVNAME);
    class_dev = (struct class_device *)device_create(gdma_class, NULL, gdma_devno, NULL, GDMA_DEVNAME);
#else

    proc_create("mtk_gdma", 0, NULL, &gdma_fops);

#endif
    spin_lock_init(&gdma_ctl_lock);

    // initial GDMA, register ISR
    ctr_status = 0;
    _gdma_ctr_int_status = 0;

//#ifdef GDMA_IRQ
//    init_waitqueue_head(&gdma_wait_queue);  
//    
//
//    enable_irq(MT6575_GDMA_IRQ_ID);
//    if(request_irq(MT6575_GDMA_IRQ_ID, gdma_drv_isr, IRQF_TRIGGER_LOW, "gdma_driver" , NULL))
//    {
//        GDMA_ERR("GDMA Driver request irq failed\n");
//    }
//#endif
	GDMA_MSG("GDMA Probe Done\n");

#ifdef GDMA_DEV
	NOT_REFERENCED(class_dev);
#endif
	return 0;
}
static int jpeg_probe(struct platform_device *pdev)
{
    struct class_device;
    
	int ret;
    struct class_device *class_dev = NULL;
    
    JPEG_MSG("-------------jpeg driver probe-------\n");
	ret = alloc_chrdev_region(&jpeg_devno, 0, 1, JPEG_DEVNAME);

	if(ret)
	{
	    JPEG_ERR("Error: Can't Get Major number for JPEG Device\n");
	}
	else
	{
	    JPEG_MSG("Get JPEG Device Major number (%d)\n", jpeg_devno);
    }

	jpeg_cdev = cdev_alloc();
    jpeg_cdev->owner = THIS_MODULE;
	jpeg_cdev->ops = &jpeg_fops;

	ret = cdev_add(jpeg_cdev, jpeg_devno, 1);

    jpeg_class = class_create(THIS_MODULE, JPEG_DEVNAME);
    class_dev = (struct class_device *)device_create(jpeg_class, NULL, jpeg_devno, NULL, JPEG_DEVNAME);

    spin_lock_init(&jpeg_dec_lock);
    spin_lock_init(&jpeg_enc_lock);

    // initial codec, register codec ISR
    dec_status = 0;
    enc_status = 0;
    _jpeg_dec_int_status = 0;
    _jpeg_enc_int_status = 0;

#ifndef FPGA_VERSION
    init_waitqueue_head(&dec_wait_queue);
    init_waitqueue_head(&enc_wait_queue);

    enable_irq(MT_JPEG_CODEC_IRQ_ID);
    if(request_irq(MT_JPEG_CODEC_IRQ_ID, jpeg_drv_isr, IRQF_TRIGGER_LOW, "jpeg_driver" , NULL))
    {
        JPEG_ERR("JPEG Codec Driver request irq failed\n");
    }
#endif
	JPEG_MSG("JPEG Probe Done\n");

	NOT_REFERENCED(class_dev);
	return 0;
}
Beispiel #16
0
void jpeg_drv_dec_power_off(void)
{  
#ifndef FPGA_VERSION   
   //disable_clock(MT_CG_IMAGE_JPGD_SMI,"JPEG");
   //disable_clock(MT_CG_IMAGE_JPGD_JPG,"JPEG");   
#endif
   
#ifdef FOR_COMPILE   
    BOOL ret;
    ret = disable_clock(MT65XX_PDN_MM_JPEG_DEC,"JPEG");
    NOT_REFERENCED(ret);
#endif
}
Beispiel #17
0
void jpeg_drv_enc_power_off(void)
{  
#ifndef FPGA_VERSION    
   disable_clock(MT_CG_IMAGE_LARB2_SMI,"JPEG");
   disable_clock(MT_CG_IMAGE_VENC_JPENC,"JPEG");   
   disable_clock(MT_CG_DISP0_SMI_COMMON,"JPEG");  
#endif   

#ifdef FOR_COMPILE   
    BOOL ret;
    ret = disable_clock(MT65XX_PDN_MM_JPEG_ENC,"JPEG");
    NOT_REFERENCED(ret);
#endif    
}
static int gfmt_probe(struct platform_device *pdev)
{
    struct class_device;
    
	int ret;
    struct class_device *class_dev = NULL;
    
    GFMT_MSG("-------------gfmt driver probe-------\n");
	ret = alloc_chrdev_region(&gfmt_devno, 0, 1, GFMT_DEVNAME);

	if(ret)
	{
	    GFMT_ERR("Error: Can't Get Major number for GFMT Device\n");
	}
	else
	{
	    GFMT_MSG("Get GFMT Device Major number (%d)\n", gfmt_devno);
    }

	gfmt_cdev = cdev_alloc();
    gfmt_cdev->owner = THIS_MODULE;
	gfmt_cdev->ops = &gfmt_fops;

	ret = cdev_add(gfmt_cdev, gfmt_devno, 1);

    gfmt_class = class_create(THIS_MODULE, GFMT_DEVNAME);
    class_dev = (struct class_device *)device_create(gfmt_class, NULL, gfmt_devno, NULL, GFMT_DEVNAME);

    spin_lock_init(&gdma_fmt_lock);

    // initial , register ISR
    fmt_status = 0;
    _gfmt_only_int_status = 0;

#ifdef GDMA_FMT_IRQ
    init_waitqueue_head(&gfmt_wait_queue);  
    

    enable_irq(CAMERA_ISP_IRQ3_ID);
    if(request_irq(CAMERA_ISP_IRQ3_ID, gfmt_drv_isr, IRQF_TRIGGER_LOW, "gfmt_driver" , NULL))
    {
        GFMT_ERR("GFMT Driver request irq failed\n");
    }
#endif
	GFMT_MSG("GFMT Probe Done\n");

	NOT_REFERENCED(class_dev);
	return 0;
}
Beispiel #19
0
void jpeg_drv_enc_power_on(void)
{
    //REG_JPEG_MM_REG_MASK  = 0;
    enable_clock(MT_CG_IMAGE_JPGE_SMI,"JPEG");
    enable_clock(MT_CG_IMAGE_JPGE_JPG,"JPEG");

#if 0
    //MCI
    *(volatile kal_uint32 *)(0xF0208100) |= (0x4|0x8|0x10);
    dsb();
    *(volatile kal_uint32 *)(0xF0208100)  |= (0x11);
    dsb();
#endif

#ifdef FOR_COMPILE
    BOOL ret;
    ret = enable_clock(MT65XX_PDN_MM_JPEG_ENC,"JPEG");
    NOT_REFERENCED(ret);
#endif
}
TPM_RC
TPM2_ChangePPS(
	       ChangePPS_In    *in             // IN: input parameter list
	       )
{
    UINT32          i;
    // Check if NV is available.  A TPM_RC_NV_UNAVAILABLE or TPM_RC_NV_RATE
    // error may be returned at this point
    RETURN_IF_NV_IS_NOT_AVAILABLE;
    // Input parameter is not reference in command action
    NOT_REFERENCED(in);
    // Internal Data Update
    // Reset platform hierarchy seed from RNG
    CryptRandomGenerate(sizeof(gp.PPSeed.t.buffer), gp.PPSeed.t.buffer);
    // Create a new phProof value from RNG to prevent the saved platform
    // hierarchy contexts being loaded
    CryptRandomGenerate(sizeof(gp.phProof.t.buffer), gp.phProof.t.buffer);
    // Set platform authPolicy to null
    gc.platformAlg = TPM_ALG_NULL;
    gc.platformPolicy.t.size = 0;
    // Flush loaded object in platform hierarchy
    ObjectFlushHierarchy(TPM_RH_PLATFORM);
    // Flush platform evict object and index in NV
    NvFlushHierarchy(TPM_RH_PLATFORM);
    // Save hierarchy changes to NV
    NV_SYNC_PERSISTENT(PPSeed);
    NV_SYNC_PERSISTENT(phProof);
    // Re-initialize PCR policies
#if defined NUM_POLICY_PCR_GROUP && NUM_POLICY_PCR_GROUP > 0
    for(i = 0; i < NUM_POLICY_PCR_GROUP; i++)
	{
	    gp.pcrPolicies.hashAlg[i] = TPM_ALG_NULL;
	    gp.pcrPolicies.policy[i].t.size = 0;
	}
    NV_SYNC_PERSISTENT(pcrPolicies);
#endif
    // orderly state should be cleared because of the update to state clear data
    g_clearOrderly = TRUE;
    return TPM_RC_SUCCESS;
}
TPM_RC
TPM2_ChangeEPS(
	       ChangeEPS_In    *in             // IN: input parameter list
	       )
{
    // The command needs NV update.  Check if NV is available.
    // A TPM_RC_NV_UNAVAILABLE or TPM_RC_NV_RATE error may be returned at
    // this point
    RETURN_IF_NV_IS_NOT_AVAILABLE;
    // Input parameter is not reference in command action
    NOT_REFERENCED(in);
    // Internal Data Update
    // Reset endorsement hierarchy seed from RNG
    CryptRandomGenerate(sizeof(gp.EPSeed.t.buffer), gp.EPSeed.t.buffer);
    // Create new ehProof value from RNG
    CryptRandomGenerate(sizeof(gp.ehProof.t.buffer), gp.ehProof.t.buffer);
    // Enable endorsement hierarchy
    gc.ehEnable = TRUE;
    // set authValue buffer to zeros
    MemorySet(gp.endorsementAuth.t.buffer, 0, gp.endorsementAuth.t.size);
    // Set endorsement authValue to null
    gp.endorsementAuth.t.size = 0;
    // Set endorsement authPolicy to null
    gp.endorsementAlg = TPM_ALG_NULL;
    gp.endorsementPolicy.t.size = 0;
    // Flush loaded object in endorsement hierarchy
    ObjectFlushHierarchy(TPM_RH_ENDORSEMENT);
    // Flush evict object of endorsement hierarchy stored in NV
    NvFlushHierarchy(TPM_RH_ENDORSEMENT);
    // Save hierarchy changes to NV
    NV_SYNC_PERSISTENT(EPSeed);
    NV_SYNC_PERSISTENT(ehProof);
    NV_SYNC_PERSISTENT(endorsementAuth);
    NV_SYNC_PERSISTENT(endorsementAlg);
    NV_SYNC_PERSISTENT(endorsementPolicy);
    // orderly state should be cleared because of the update to state clear data
    g_clearOrderly = TRUE;
    return TPM_RC_SUCCESS;
}
Beispiel #22
0
void jpeg_drv_enc_power_on(void)
{  
#ifndef FPGA_VERSION    
    //REG_JPEG_MM_REG_MASK  = 0;
   enable_clock(MT_CG_DISP0_SMI_COMMON,"JPEG");
   enable_clock(MT_CG_VENC_LARB,"JPEG");
   enable_clock(MT_CG_VENC_JPGENC,"JPEG");
#endif   

#if 0
    //MCI
    *(volatile kal_uint32 *)(0xF0208100) |= (0x4|0x8|0x10);
     dsb();
    *(volatile kal_uint32 *)(0xF0208100)  |= (0x11);
     dsb();
#endif 
   
#ifdef FOR_COMPILE   
    BOOL ret;
    ret = enable_clock(MT65XX_PDN_MM_JPEG_ENC,"JPEG");
    NOT_REFERENCED(ret);
#endif    
}
Beispiel #23
0
static int jpeg_probe(struct platform_device *pdev)
{
    struct class_device;

    int ret;
    struct class_device *class_dev = NULL;

    JPEG_MSG("-------------jpeg driver probe-------\n");
    ret = alloc_chrdev_region(&jpeg_devno, 0, 1, JPEG_DEVNAME);

    if(ret)
    {
        JPEG_ERR("Error: Can't Get Major number for JPEG Device\n");
    }
    else
    {
        JPEG_MSG("Get JPEG Device Major number (%d)\n", jpeg_devno);
    }

    jpeg_cdev = cdev_alloc();
    jpeg_cdev->owner = THIS_MODULE;
    jpeg_cdev->ops = &jpeg_fops;

    ret = cdev_add(jpeg_cdev, jpeg_devno, 1);

    jpeg_class = class_create(THIS_MODULE, JPEG_DEVNAME);
    class_dev = (struct class_device *)device_create(jpeg_class, NULL, jpeg_devno, NULL, JPEG_DEVNAME);

    spin_lock_init(&jpeg_dec_lock);
    spin_lock_init(&jpeg_enc_lock);

    // initial codec, register codec ISR
    dec_status = 0;
    enc_status = 0;
    _jpeg_dec_int_status = 0;
    _jpeg_enc_int_status = 0;
    _jpeg_dec_mode = 0;

#ifndef FPGA_VERSION
    init_waitqueue_head(&dec_wait_queue);
    init_waitqueue_head(&enc_wait_queue);

    //mt6575_irq_set_sens(MT6575_JPEG_CODEC_IRQ_ID, MT65xx_LEVEL_SENSITIVE);
    //mt6575_irq_set_polarity(MT6575_JPEG_CODEC_IRQ_ID, MT65xx_POLARITY_LOW);
    //mt6575_irq_unmask(MT6575_JPEG_CODEC_IRQ_ID);
    JPEG_MSG("request JPEG Encoder IRQ \n");
    enable_irq(MT6589_JPEG_ENC_IRQ_ID);
    if(request_irq(MT6589_JPEG_ENC_IRQ_ID, jpeg_drv_enc_isr, IRQF_TRIGGER_LOW, "jpeg_enc_driver" , NULL))
        //if(request_irq(MT6589_JPEG_ENC_IRQ_ID, jpeg_drv_enc_isr, /*IRQF_TRIGGER_RISING*/ IRQF_TRIGGER_HIGH, "jpeg_enc_driver" , NULL))
        //if(request_irq(MT6589_JPEG_ENC_IRQ_ID, jpeg_drv_enc_isr, IRQF_TRIGGER_RISING , "jpeg_enc_driver" , NULL))
    {
        JPEG_ERR("JPEG ENC Driver request irq failed\n");
    }
    enable_irq(MT6589_JPEG_DEC_IRQ_ID);
    JPEG_MSG("request JPEG Decoder IRQ \n");
    //if(request_irq(MT6589_JPEG_DEC_IRQ_ID, jpeg_drv_dec_isr, IRQF_TRIGGER_LOW, "jpeg_dec_driver" , NULL))
    //if(request_irq(MT6589_JPEG_DEC_IRQ_ID, jpeg_drv_dec_isr, /*IRQF_TRIGGER_RISING*/ IRQF_TRIGGER_HIGH, "jpeg_dec_driver" , NULL))
    //if(request_irq(MT6589_JPEG_DEC_IRQ_ID, jpeg_drv_dec_isr, IRQF_TRIGGER_RISING , "jpeg_dec_driver" , NULL))
    if(request_irq(MT6589_JPEG_DEC_IRQ_ID, jpeg_drv_dec_isr, IRQF_TRIGGER_FALLING , "jpeg_dec_driver" , NULL))
    {
        JPEG_ERR("JPEG DEC Driver request irq failed\n");
    }

#endif
    JPEG_MSG("JPEG Probe Done\n");

    NOT_REFERENCED(class_dev);
    return 0;
}
void jpeg_drv_enc_power_off(void)
{  
    BOOL ret;
    ret = disable_clock(MT65XX_PDN_MM_JPEG_ENC,"JPEG");
    NOT_REFERENCED(ret);
}
DAL_STATUS DAL_Printf(const char *fmt, ...)
{
    NOT_REFERENCED(fmt);
    printk("[MTKFB_DAL] DAL_Printf is not implemented\n");
    return DAL_STATUS_OK;
}
void jpeg_drv_dec_power_on(void)
{  
    BOOL ret;
    ret = enable_clock(MT65XX_PDN_MM_JPEG_DEC,"JPEG");
    NOT_REFERENCED(ret);
}
Beispiel #27
0
static int jpeg_probe(struct platform_device *pdev)
{

#ifdef CONFIG_OF

    int new_count;
    struct JpegDeviceStruct* jpegDev;
    struct device_node *node = NULL;

    new_count = nrJpegDevs + 1;
    gJpegqDevs = krealloc(gJpegqDevs, 
        sizeof(struct JpegDeviceStruct) * new_count, GFP_KERNEL);
    if (!gJpegqDevs) {
        dev_err(&pdev->dev, "Unable to allocate cam_isp_devs\n");
        return -ENOMEM;
    }

    jpegDev = &(gJpegqDevs[nrJpegDevs]);
    jpegDev->pDev = &pdev->dev;

    memset(&gJpegqDev, 0x0, sizeof(JpegDeviceStruct));

    node = of_find_compatible_node(NULL, NULL, "mediatek,JPGENC");
    jpegDev->encRegBaseVA = (unsigned long)of_iomap(node, 0);
    jpegDev->encIrqId = irq_of_parse_and_map(node, 0);

    node = of_find_compatible_node(NULL, NULL, "mediatek,JPGDEC");
    jpegDev->decRegBaseVA = (unsigned long)of_iomap(node, 0);
    jpegDev->decIrqId = irq_of_parse_and_map(node, 0);

    gJpegqDev = *jpegDev;

#else

    gJpegqDev.encRegBaseVA = (0L | 0xF7003000);
    gJpegqDev.decRegBaseVA = (0L | 0xF7004000);
    gJpegqDev.encIrqId = JPGENC_IRQ_BIT_ID;
    gJpegqDev.decIrqId = JPGDEC_IRQ_BIT_ID;

    gJpegqDev.pDev = &pdev->dev;

#endif

#ifdef JPEG_DEV    
    int ret;
    struct class_device *class_dev = NULL;
    
    JPEG_MSG("-------------jpeg driver probe-------\n");
    ret = alloc_chrdev_region(&jpeg_devno, 0, 1, JPEG_DEVNAME);

    if(ret)
    {
        JPEG_ERR("Error: Can't Get Major number for JPEG Device\n");
    }
    else
    {
        JPEG_MSG("Get JPEG Device Major number (%d)\n", jpeg_devno);
    }

    jpeg_cdev = cdev_alloc();
    jpeg_cdev->owner = THIS_MODULE;
    jpeg_cdev->ops = &jpeg_fops;

    ret = cdev_add(jpeg_cdev, jpeg_devno, 1);

    jpeg_class = class_create(THIS_MODULE, JPEG_DEVNAME);
    class_dev = (struct class_device *)device_create(jpeg_class, NULL, jpeg_devno, NULL, JPEG_DEVNAME);
#else
    
    proc_create("mtk_jpeg", 0, NULL, &jpeg_fops);

#endif

    spin_lock_init(&jpeg_dec_lock);
    spin_lock_init(&jpeg_enc_lock);

    // initial codec, register codec ISR
    dec_status = 0;
    enc_status = 0;
    _jpeg_dec_int_status = 0;
    _jpeg_enc_int_status = 0;
    _jpeg_dec_mode = 0;

#ifndef FPGA_VERSION

#ifdef JPEG_DEC_DRIVER
    init_waitqueue_head(&dec_wait_queue);
#endif    
    init_waitqueue_head(&enc_wait_queue);  
    
    //mt6575_irq_set_sens(MT6575_JPEG_CODEC_IRQ_ID, MT65xx_LEVEL_SENSITIVE);
    //mt6575_irq_set_polarity(MT6575_JPEG_CODEC_IRQ_ID, MT65xx_POLARITY_LOW);
    //mt6575_irq_unmask(MT6575_JPEG_CODEC_IRQ_ID);
    JPEG_MSG("request JPEG Encoder IRQ \n");
    enable_irq(gJpegqDev.encIrqId);
    if(request_irq(gJpegqDev.encIrqId, jpeg_drv_enc_isr, IRQF_TRIGGER_LOW, "jpeg_enc_driver" , NULL))
    //if(request_irq(JPGENC_IRQ_BIT_ID, jpeg_drv_enc_isr, /*IRQF_TRIGGER_RISING*/ IRQF_TRIGGER_HIGH, "jpeg_enc_driver" , NULL))
    //if(request_irq(JPGENC_IRQ_BIT_ID, jpeg_drv_enc_isr, IRQF_TRIGGER_RISING , "jpeg_enc_driver" , NULL))
    {
        JPEG_ERR("JPEG ENC Driver request irq failed\n");
    }

#ifdef JPEG_DEC_DRIVER    
    enable_irq(gJpegqDev.decIrqId);
    JPEG_MSG("request JPEG Decoder IRQ \n");
    //if(request_irq(JPGDEC_IRQ_BIT_ID, jpeg_drv_dec_isr, IRQF_TRIGGER_LOW, "jpeg_dec_driver" , NULL))
    //if(request_irq(JPGDEC_IRQ_BIT_ID, jpeg_drv_dec_isr, /*IRQF_TRIGGER_RISING*/ IRQF_TRIGGER_HIGH, "jpeg_dec_driver" , NULL))
    //if(request_irq(JPGDEC_IRQ_BIT_ID, jpeg_drv_dec_isr, IRQF_TRIGGER_RISING , "jpeg_dec_driver" , NULL))
    if(request_irq(gJpegqDev.decIrqId, jpeg_drv_dec_isr, IRQF_TRIGGER_FALLING , "jpeg_dec_driver" , NULL))
    {
        JPEG_ERR("JPEG DEC Driver request irq failed\n");
    }    
#endif    
    
#endif
    JPEG_MSG("JPEG Probe Done\n");

#ifdef JPEG_DEV    
    NOT_REFERENCED(class_dev);
#endif
    return 0;
}
DAL_STATUS DAL_Dynamic_Change_FB_Layer(unsigned int isAEEEnabled)
{
    NOT_REFERENCED(isAEEEnabled);
    printk("[MTKFB_DAL] DAL_Dynamic_Change_FB_Layer is not implemented\n");
    return DAL_STATUS_OK;
}
Beispiel #29
0
DAL_STATUS DAL_Printf(const char *fmt, ...)
{
    NOT_REFERENCED(fmt);
    return DAL_STATUS_OK;
}
DAL_STATUS DAL_SetScreenColor(DAL_COLOR color)
{
    NOT_REFERENCED(color);
    return DAL_STATUS_OK;
}