1 #include <linux/init.h>
2 #include <linux/module.h>
3 #include <linux/kernel.h>
4 #include <linux/version.h>
6 #include <mach/mt_typedefs.h>
7 #include <mach/mt_power_gs.h>
9 extern unsigned int *mt8127_power_gs_2g_paging
;
10 extern unsigned int mt8127_power_gs_2g_paging_len
;
12 extern unsigned int *mt6323_power_gs_2g_paging
;
13 extern unsigned int mt6323_power_gs_2g_paging_len
;
15 unsigned int mt6333_power_gs_2g_paging
[] = {
17 0x009F, 0x0080, 0x0000,
18 0x00A0, 0x0007, 0x0003,
19 0x006D, 0x007f, 0x0010,
22 void mt_power_gs_dump_2g_paging(void)
24 mt_power_gs_compare("2G Paging", \
25 mt8127_power_gs_2g_paging
, mt8127_power_gs_2g_paging_len
, \
26 mt6323_power_gs_2g_paging
, mt6323_power_gs_2g_paging_len
, \
27 mt6333_power_gs_2g_paging
, sizeof(mt6333_power_gs_2g_paging
));
30 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
31 static int dump_2g_paging_read(char *buf
, char **start
, off_t off
, int count
, int *eof
, void *data
)
36 p
+= sprintf(p
, "mt_power_gs : 2g_paging\n");
38 mt_power_gs_dump_2g_paging();
44 static ssize_t
dump_2g_paging_read(struct file
*flip
, char __user
*buf
, size_t count
, loff_t
*offset
)
49 p
+= sprintf(p
, "mt_power_gs : 2g_paging\n");
51 mt_power_gs_dump_2g_paging();
57 static const struct file_operations paging_2g_proc_fops
= {
59 .read
= dump_2g_paging_read
,
63 static void __exit
mt_power_gs_2g_paging_exit(void)
68 static int __init
mt_power_gs_2g_paging_init(void)
70 struct proc_dir_entry
*mt_entry
= NULL
;
74 printk("[%s]: mkdir /proc/mt_power_gs failed\n", __FUNCTION__
);
78 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
79 mt_entry
= create_proc_entry("dump_2g_paging", S_IRUGO
| S_IWUSR
| S_IWGRP
, mt_power_gs_dir
);
82 mt_entry
->read_proc
= dump_2g_paging_read
;
85 mt_entry
= proc_create("dump_2g_paging", S_IRUGO
| S_IWUSR
| S_IWGRP
, mt_power_gs_dir
, &paging_2g_proc_fops
);
88 printk("[%s]: create proc file /proc/mt_power_gs/dump_2g_paging failed\n", __FUNCTION__
);
96 module_init(mt_power_gs_2g_paging_init
);
97 module_exit(mt_power_gs_2g_paging_exit
);
99 MODULE_DESCRIPTION("MT8127 Power Golden Setting - 2G Paging");