| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- #define LOG_TAG "mtk_mira"
- #include "disp_drv_log.h"
- #include <linux/kernel.h>
- #include <linux/mm.h>
- #include <linux/proc_fs.h>
- #include <linux/module.h>
- #include "mtk_mira.h"
- #include "mtk_disp_mgr.h"
- #define DISP_DEVNAME "mtk_mira"
- static struct proc_dir_entry *proc_entry;
- static long disp_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
- {
- return mtk_disp_mgr_ioctl(file, cmd, arg);
- }
- static int disp_open(struct inode *inode, struct file *file)
- {
- return 0;
- }
- static ssize_t disp_read(struct file *file, char __user *data, size_t len, loff_t *ppos)
- {
- return 0;
- }
- static int disp_release(struct inode *inode, struct file *file)
- {
- return 0;
- }
- static int disp_flush(struct file *file, fl_owner_t a_id)
- {
- return 0;
- }
- /* remap register to user space */
- static int disp_mmap(struct file *file, struct vm_area_struct *a_pstVMArea)
- {
- return 0;
- }
- #ifdef CONFIG_COMPAT
- static long disp_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
- {
- long ret = -ENOIOCTLCMD;
- switch (cmd) {
- /* add cases here for 32bit/64bit conversion */
- /* ... */
- default:
- return mtk_disp_mgr_ioctl(file, cmd, arg);
- }
- return ret;
- }
- #endif
- /* Kernel interface */
- static const struct file_operations disp_fops = {
- .owner = THIS_MODULE,
- .unlocked_ioctl = disp_unlocked_ioctl,
- #ifdef CONFIG_COMPAT
- .compat_ioctl = disp_compat_ioctl,
- #endif
- .open = disp_open,
- .release = disp_release,
- .flush = disp_flush,
- .read = disp_read,
- .mmap = disp_mmap
- };
- static int __init disp_init(void)
- {
- int ret = 0;
- DISPMSG("Register the disp driver\n");
- proc_entry = proc_create(DISP_DEVNAME, 0644, NULL, &disp_fops);
- if (proc_entry == NULL)
- ret = -ENOMEM;
- return ret;
- }
- static void __exit disp_exit(void)
- {
- remove_proc_entry(DISP_DEVNAME, proc_entry);
- DISPMSG("Done\n");
- }
- module_init(disp_init);
- module_exit(disp_exit);
- MODULE_AUTHOR("Tzu-Meng, Chung <Tzu-Meng.Chung@mediatek.com>");
- MODULE_DESCRIPTION("Display subsystem Driver");
- MODULE_LICENSE("GPL");
|