static int __init eemcs_helper_init(void)
{
	int ret;


/* Not ready, need check*/
#if 0
	// Init ccci helper sys fs
	memset( (void*)cmd_map_table, 0, sizeof(cmd_map_table) );
	mtk_ccci_sysfs();
#endif
	// init ccci kernel API register table
	memset((void*)eemcs_func_table, 0, sizeof(eemcs_func_table));
	memset((void*)eemcs_kern_func_err_num, 0, sizeof(eemcs_kern_func_err_num));

	// init ccci system channel call back function register table
	memset((void*)eemcs_sys_cb_table_100, 0, sizeof(eemcs_sys_cb_table_100));
	memset((void*)eemcs_sys_cb_table_1000, 0, sizeof(eemcs_sys_cb_table_1000));

	ret = platform_device_register(&eemcs_helper_device);
	if (ret) {
		printk("ccci_helper_device register fail(%d)\n", ret);
		return ret;
	}

	ret = platform_driver_register(&eemcs_helper_driver);
	if (ret) {
		printk("ccci_helper_driver register fail(%d)\n", ret);
		return ret;
	}
	
	return 0;
}
Exemplo n.º 2
0
static int __init eemcs_helper_init(void)
{
	int ret;


/* Not ready, need check*/
#if 0
	// Init ccci helper sys fs
	memset( (void*)cmd_map_table, 0, sizeof(cmd_map_table) );
	mtk_ccci_sysfs();
#endif
	// init ccci kernel API register table
	memset((void*)eemcs_func_table, 0, sizeof(eemcs_func_table));
	memset((void*)eemcs_kern_func_err_num, 0, sizeof(eemcs_kern_func_err_num));

	// init ccci system channel call back function register table
	memset((void*)eemcs_sys_cb_table_100, 0, sizeof(eemcs_sys_cb_table_100));
	memset((void*)eemcs_sys_cb_table_1000, 0, sizeof(eemcs_sys_cb_table_1000));

	ret = platform_device_register(&eemcs_helper_device);
	if (ret) {
		printk("[EEMCS/PLAT] [Error]eemcs_helper_device register fail: %d\n", ret);
		return ret;
	}

	ret = platform_driver_register(&eemcs_helper_driver);
	if (ret) {
		printk("[EEMCS/PLAT] [Error]eemcs_helper_driver register fail: %d\n", ret);
		return ret;
	}

	#if defined (CONFIG_MTK_MD_LOW_BAT_SUPPORT)
	register_low_battery_notify(&eemcs_low_battery_cb, LOW_BATTERY_PRIO_MD5);
	#endif
	
	return 0;
}