1 /**********************************************************************
3 * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful but, except
10 * as otherwise stated in writing, without any warranty; without even the
11 * implied warranty of merchantability or fitness for a particular purpose.
12 * See the GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18 * The full GNU General Public License is included in this distribution in
19 * the file called "COPYING".
21 * Contact Information:
22 * Imagination Technologies Ltd. <gpl-support@imgtec.com>
23 * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
25 ******************************************************************************/
27 #include <linux/version.h>
28 #include <linux/module.h>
30 #include <linux/pci.h>
31 #include <linux/uaccess.h>
32 #include <linux/slab.h>
33 #include <linux/errno.h>
34 #include <linux/interrupt.h>
36 #include <linux/platform_device.h>
41 #include "servicesext.h"
42 #include "kerneldisplay.h"
44 #include "pvrmodule.h"
46 #include <plat/display.h>
48 MODULE_SUPPORTED_DEVICE(DEVNAME);
50 #define unref__ __attribute__ ((unused))
52 void *OMAPLFBAllocKernelMem(u32 ui32Size)
54 return kmalloc(ui32Size, GFP_KERNEL);
57 void OMAPLFBFreeKernelMem(void *pvMem)
62 enum PVRSRV_ERROR OMAPLFBGetLibFuncAddr(char *szFunctionName,
63 IMG_BOOL (**ppfnFuncTable)(struct PVRSRV_DC_DISP2SRV_KMJTABLE *))
65 if (strcmp("PVRGetDisplayClassJTable", szFunctionName) != 0)
66 return PVRSRV_ERROR_INVALID_PARAMS;
68 *ppfnFuncTable = PVRGetDisplayClassJTable;
73 static int OMAPLFBDriverSuspend_Entry(struct platform_device unref__ * pDevice,
74 pm_message_t unref__ state)
76 DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX
77 ": OMAPLFBDriverSuspend_Entry\n"));
81 static int OMAPLFBDriverResume_Entry(struct platform_device unref__ * pDevice)
83 DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX ": OMAPLFBDriverResume_Entry\n"));
87 static void OMAPLFBDriverShutdown_Entry(struct platform_device unref__ *
90 DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX
91 ": OMAPLFBDriverShutdown_Entry\n"));
94 static void OMAPLFBDeviceRelease_Entry(struct device unref__ * pDevice)
96 DEBUG_PRINTK((KERN_INFO DRIVER_PREFIX
97 ": OMAPLFBDriverRelease_Entry\n"));
100 static struct platform_driver omaplfb_driver = {
104 .suspend = OMAPLFBDriverSuspend_Entry,
105 .resume = OMAPLFBDriverResume_Entry,
106 .shutdown = OMAPLFBDriverShutdown_Entry,
109 static struct platform_device omaplfb_device = {
113 .release = OMAPLFBDeviceRelease_Entry
117 static int __init OMAPLFB_Init(void)
121 if (OMAPLFBInit() != PVRSRV_OK) {
122 printk(KERN_WARNING DRIVER_PREFIX
123 ": OMAPLFB_Init: OMAPLFBInit failed\n");
126 error = platform_driver_register(&omaplfb_driver);
128 printk(KERN_WARNING DRIVER_PREFIX
129 ": OMAPLFB_Init: Unable to register platform driver (%d)\n",
135 error = platform_device_register(&omaplfb_device);
137 printk(KERN_WARNING DRIVER_PREFIX
138 ": OMAPLFB_Init: Unable to register platform device (%d)\n",
141 goto ExitDriverUnregister;
146 ExitDriverUnregister:
147 platform_driver_unregister(&omaplfb_driver);
150 if (OMAPLFBDeinit() != PVRSRV_OK)
151 printk(KERN_WARNING DRIVER_PREFIX
152 ": OMAPLFB_Init: OMAPLFBDeinit failed\n");
157 static void __exit OMAPLFB_Cleanup(void)
159 platform_device_unregister(&omaplfb_device);
160 platform_driver_unregister(&omaplfb_driver);
162 if (OMAPLFBDeinit() != PVRSRV_OK)
163 printk(KERN_WARNING DRIVER_PREFIX
164 ": OMAPLFB_Cleanup: OMAPLFBDeinit failed\n");
167 module_init(OMAPLFB_Init);
168 module_exit(OMAPLFB_Cleanup);