Beispiel #1
0
static int __init compass_akm8963_init(void)
{
	struct sensor_operate *ops = compass_get_ops();
	int result = 0;
	int type = ops->type;
	result = sensor_register_slave(type, NULL, NULL, compass_get_ops);
				
	return result;
}
Beispiel #2
0
static int __init compass_init(void)
{
	struct sensor_operate *ops = compass_get_ops();
	int result = 0;
	int type = ops->type;
	result = sensor_register_slave(type, NULL, NULL, compass_get_ops);

	result = misc_register(&compass_aot_device);
	if (result < 0) {
		printk("%s:fail to register misc device %s\n", __func__, compass_aot_device.name);
		goto error;
	}

	/* As default, report all information */
	atomic_set(&m_flag, 1);
	atomic_set(&a_flag, 1);
	atomic_set(&mv_flag, 1);			
	atomic_set(&open_flag, 0);		
	init_waitqueue_head(&open_wq);
			
	printk("%s\n",__func__);
error:
	return result;
}
Beispiel #3
0
static void __exit compass_exit(void)
{
	struct sensor_operate *ops = compass_get_ops();
	int type = ops->type;
	sensor_unregister_slave(type, NULL, NULL, compass_get_ops);
}