Exemplo n.º 1
0
/*
 * Driver init function
 */
static int __init OMAPLFB_Init(void)
{
	int Major;
	if(OMAPLFBInit() != OMAP_OK)
	{
		WARNING_PRINTK("Driver init failed");
		return -ENODEV;
	}

#if defined(LDM_PLATFORM)
	DEBUG_PRINTK("Registering platform driver");
	if (platform_driver_register(&omaplfb_driver))
	{
		WARNING_PRINTK("Unable to register platform driver");
		if(OMAPLFBDeinit() != OMAP_OK)
			WARNING_PRINTK("Driver cleanup failed\n");
		return -ENODEV;
	}
	Major = register_chrdev(OMAPLFB_MAJOR,"omaplfb",&omaplfb_fops);
	if (Major < 0)
		printk("unable to get major  %d for fb devs!!!!\n", Major);

#if defined(SGX_EARLYSUSPEND)
	omaplfb_early_suspend.suspend = OMAPLFBDriverSuspend_Entry;
        omaplfb_early_suspend.resume = OMAPLFBDriverResume_Entry;
        //omaplfb_early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN;	
	omaplfb_early_suspend.level = EARLY_SUSPEND_LEVEL_STOP_DRAWING;
        register_early_suspend(&omaplfb_early_suspend);
	DEBUG_PRINTK("Registered early suspend support");
#endif

#endif
	return 0;
}
Exemplo n.º 2
0
static int OMAPLFBDriverProbe_Entry(struct platform_device *pdev)
{
	dev_dbg(&pdev->dev, "probe\n");
	if(OMAPLFBInit() != OMAP_OK)
	{
		printk(KERN_WARNING DRIVER_PREFIX ": OMAPLFB_Init: OMAPLFBInit failed\n");
		return -ENODEV;
	}

	return 0;
}
static int __init OMAPLFB_Init(void)
#endif
{

	if(OMAPLFBInit() != OMAPLFB_OK)
	{
		printk(KERN_ERR DRIVER_PREFIX ": %s: OMAPLFBInit failed\n", __FUNCTION__);
		return -ENODEV;
	}

	return 0;

}
Exemplo n.º 4
0
static int __init OMAPLFB_Init(void)
{
#if defined(LDM_PLATFORM)
	int error;
#endif

	if(OMAPLFBInit() != OMAP_OK)
	{
		printk(KERN_WARNING DRIVER_PREFIX ": OMAPLFB_Init: OMAPLFBInit failed\n");
		return -ENODEV;
	}

#if defined(LDM_PLATFORM)
	if ((error = platform_driver_register(&omaplfb_driver)) != 0)
	{
		printk(KERN_WARNING DRIVER_PREFIX ": OMAPLFB_Init: Unable to register platform driver (%d)\n", error);

		goto ExitDeinit;
	}

#if defined(MODULE)
	if ((error = platform_device_register(&omaplfb_device)) != 0)
	{
		platform_driver_unregister(&omaplfb_driver);

		printk(KERN_WARNING DRIVER_PREFIX ": OMAPLFB_Init: Unable to register platform device (%d)\n", error);

		goto ExitDeinit;
	}
#endif

#endif 

	return 0;

#if defined(LDM_PLATFORM)
ExitDeinit:
	if(OMAPLFBDeinit() != OMAP_OK)
	{
		printk(KERN_WARNING DRIVER_PREFIX ": OMAPLFB_Init: OMAPLFBDeinit failed\n");
	}

	return -ENODEV;
#endif 
}
Exemplo n.º 5
0
static int omaplfb_probe(struct platform_device *pdev)
{
	struct omaplfb_device *odev;

	odev = kzalloc(sizeof(*odev), GFP_KERNEL);

	if (!odev)
		return -ENOMEM;

	if (OMAPLFBInit(odev) != OMAP_OK) {
		dev_err(&pdev->dev, "failed to setup omaplfb\n");
		kfree(odev);
		return -ENODEV;
	}

	odev->dev = &pdev->dev;
	platform_set_drvdata(pdev, odev);
	omaplfb_create_sysfs(odev);

	return 0;
}
Exemplo n.º 6
0
static int __init OMAPLFB_Init(void)
{
	int error;

	if (OMAPLFBInit() != PVRSRV_OK) {
		printk(KERN_WARNING DRIVER_PREFIX
		       ": OMAPLFB_Init: OMAPLFBInit failed\n");
		return -ENODEV;
	}
	error = platform_driver_register(&omaplfb_driver);
	if (error) {
		printk(KERN_WARNING DRIVER_PREFIX
		    ": OMAPLFB_Init: Unable to register platform driver (%d)\n",
		       error);

		goto ExitDeinit;
	}

	error = platform_device_register(&omaplfb_device);
	if (error) {
		printk(KERN_WARNING DRIVER_PREFIX
		   ": OMAPLFB_Init:  Unable to register platform device (%d)\n",
		       error);

		goto ExitDriverUnregister;
	}

	return 0;

ExitDriverUnregister:
	platform_driver_unregister(&omaplfb_driver);

ExitDeinit:
	if (OMAPLFBDeinit() != PVRSRV_OK)
		printk(KERN_WARNING DRIVER_PREFIX
		       ": OMAPLFB_Init: OMAPLFBDeinit failed\n");

	return -ENODEV;
}
Exemplo n.º 7
0
static int __init OMAPLFB_Init(void)
{
#if defined(LDM_PLATFORM)
	int error;
#endif

	if(OMAPLFBInit() != OMAP_OK)
	{
		printk(KERN_WARNING DRIVER_PREFIX ": OMAPLFB_Init: OMAPLFBInit failed\n");
		return -ENODEV;
	}

	/* Get the LCD manager which corresponds to the primary display*/
	GetLcdManager();

#if defined(LDM_PLATFORM)
	if ((error = platform_driver_register(&omaplfb_driver)) != 0)
	{
		printk(KERN_WARNING DRIVER_PREFIX ": OMAPLFB_Init: Unable to register platform driver (%d)\n", error);

		goto ExitDeinit;
	}

#if defined(MODULE)
	if ((error = platform_device_register(&omaplfb_device)) != 0)
	{
		printk(KERN_WARNING DRIVER_PREFIX ": OMAPLFB_Init: Unable to register platform device (%d)\n", error);

		goto ExitDeinit;
	}
#endif /* defined(MODULE) */

#if defined(SGX_EARLYSUSPEND)
	psDevInfo = NULL;
	psDevInfo = GetAnchorPtr();

	if (psDevInfo == NULL)
	{
		DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX ": OMAPLFB_Init: Unable to get DevInfo anchor pointer\n"));
		goto ExitDeinit;
	}

	psDevInfo->sFBInfo.early_suspend.suspend = OMAPLFBDriverSuspend_Entry;
        psDevInfo->sFBInfo.early_suspend.resume = OMAPLFBDriverResume_Entry;
        psDevInfo->sFBInfo.early_suspend.level = EARLY_SUSPEND_LEVEL_DISABLE_FB;
        register_early_suspend(&psDevInfo->sFBInfo.early_suspend);
#endif /* defined(SGX_EARLYSUSPEND) */

#endif /* defined(LDM_PLATFORM) */

	return 0;

#if defined(LDM_PLATFORM)
ExitDeinit:
	platform_driver_unregister(&omaplfb_driver);

#if defined(SGX_EARLYSUSPEND)
        unregister_early_suspend(&psDevInfo->sFBInfo.early_suspend);
#endif
	if(OMAPLFBDeinit() != OMAP_OK)
	{
		printk(KERN_WARNING DRIVER_PREFIX ": OMAPLFB_Init: OMAPLFBDeinit failed\n");
	}

	return -ENODEV;
#endif /* defined(LDM_PLATFORM) */ 
}