예제 #1
0
static void hscd_poll(struct input_dev *idev)
{
	int xyz[3];

	if(hscd_get_magnetic_field_data(xyz) == 0) {
		input_report_abs(idev, EVENT_TYPE_MAGV_X, xyz[0]);
		input_report_abs(idev, EVENT_TYPE_MAGV_Y, xyz[1]);
		input_report_abs(idev, EVENT_TYPE_MAGV_Z, xyz[2]);
		idev->sync = 0;
		input_event(idev, EV_SYN, SYN_REPORT, 2);
	}
}
예제 #2
0
static void hscd_poll(struct input_dev *idev)
{
	int xyz[3] = {0, };

	if(hscd_get_magnetic_field_data(xyz) == 0) {
#ifdef ALPS_DEBUG
		alps_dbgmsg("%d, %d, %d\n", xyz[0], xyz[1], xyz[2]);
#endif
		input_report_rel(idev, EVENT_TYPE_MAGV_X, xyz[0]);
		input_report_rel(idev, EVENT_TYPE_MAGV_Y, xyz[1]);
		input_report_rel(idev, EVENT_TYPE_MAGV_Z, xyz[2]);
		input_sync(idev);
	}
}
예제 #3
0
static int alps_probe(struct platform_device *dev)
{
	int xyz[3];
	int ret;

	alps_info("is called\n");
	ret = hscd_get_magnetic_field_data(xyz);
	if (ret == -ENODEV) {
		pr_info("alps: hscd probe fail\n");
		return ret;
	}

	return 0;
}
예제 #4
0
static ssize_t hscd_position_show(struct device *dev,
		struct device_attribute *attr, char *buf)
{
	int x = 0, y = 0, z = 0;
	int xyz[3];

	if (probeM == PROBE_SUCCESS) {
		if (hscd_get_magnetic_field_data(xyz) == 0) {
			x = xyz[0];
			y = xyz[1];
			z = xyz[2];
		} else {
			x = 0;
			y = 0;
			z = 0;
		}
	}
	return snprintf(buf, PAGE_SIZE, "(%d %d %d)\n", x, y, z);
}
예제 #5
0
static ssize_t hscd_position_show(struct device *dev,
				   struct device_attribute *attr, char *buf)
{
	int x,y,z;
	int xyz[3];

        printk(KERN_INFO "[ALPS] hscd_position_show\n");  

	if(hscd_get_magnetic_field_data(xyz) == 0) {
		x = xyz[0];
		y = xyz[1];
		z = xyz[2];
	} else {
		x = 0;
		y = 0;
		z = 0;
	}
	return snprintf(buf, PAGE_SIZE, "(%d %d %d)\n",x,y,z);
}