#include "proc.h"
#include "pvrmodule.h"
#include "private_data.h"
+#include "pvr_events.h"
+
+#ifdef CONFIG_DEBUG_FS
+#include "pvr_debugfs.h"
+#endif
#define DRVNAME "pvrsrvkm"
pvr_lock();
+ if (pvr_is_disabled()) {
+ ret = -ENODEV;
+ goto err_unlock;
+ }
+
pid = OSGetCurrentProcessIDKM();
if (PVRSRVProcessConnect(pid) != PVRSRV_OK)
priv->ui32OpenPID = pid;
priv->hBlockAlloc = block_alloc;
+ priv->proc = PVRSRVPerProcessData(pid);
filp->private_data = priv;
INIT_LIST_HEAD(&priv->event_list);
priv = filp->private_data;
+ pvr_release_events(priv);
+
PVRSRVProcessDisconnect(priv->ui32OpenPID);
OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
.open = pvr_open,
.release = pvr_release,
.mmap = PVRMMap,
+ .poll = pvr_poll,
+ .read = pvr_read,
};
static void pvr_shutdown(struct platform_device *pdev)
.shutdown = pvr_shutdown,
};
+static void pvr_dummy_release(struct device *dev)
+{
+}
+
+static struct sgx_platform_data pvr_pdata;
+
+static struct platform_device pvr_device = {
+ .name = DRVNAME,
+ .id = -1,
+ .dev = {
+ .platform_data = &pvr_pdata,
+ .release = pvr_dummy_release,
+ }
+};
+
static int __init pvr_init(void)
{
int error;
PVR_TRACE("pvr_init");
- pvr_init_lock();
-
#ifdef CONFIG_PVR_DEBUG_EXTRA
PVRDebugSetLevel(debug);
#endif
+#ifdef CONFIG_DEBUG_FS
+ pvr_debugfs_init();
+#endif
+
error = CreateProcEntries();
if (error < 0)
goto err1;
if (error < 0)
goto err4;
+ pvr_pdata.fclock_max = 200000000;
+ error = platform_device_register(&pvr_device);
+ if (error < 0)
+ goto err5;
+
+ pvr_init_events();
+
return 0;
+err5:
+ platform_driver_unregister(&pvr_driver);
err4:
PVRMMapCleanup();
LinuxBridgeDeInit();
static void __exit pvr_cleanup(void)
{
- struct SYS_DATA *sysdata;
-
PVR_TRACE("pvr_cleanup");
- SysAcquireData(&sysdata);
+ pvr_exit_events();
platform_driver_unregister(&pvr_driver);
+ platform_device_unregister(&pvr_device);
PVRMMapCleanup();
LinuxMMCleanup();
PVR_TRACE("pvr_cleanup: unloading");
+#ifdef CONFIG_DEBUG_FS
+ pvr_debugfs_cleanup();
+#endif
pvr_dbg_cleanup();
}