static void accsns_poll(struct input_dev *idev) { int xyz[3]; if(accsns_get_acceleration_data(xyz) == 0) { input_report_abs(idev, EVENT_TYPE_ACCEL_X, xyz[0]); input_report_abs(idev, EVENT_TYPE_ACCEL_Y, xyz[1]); input_report_abs(idev, EVENT_TYPE_ACCEL_Z, xyz[2]); idev->sync = 0; input_event(idev, EV_SYN, SYN_REPORT, 1); } }
static ssize_t accsns_position_show(struct device *dev, struct device_attribute *attr, char *buf) { int x = 0, y = 0, z = 0; int xyz[3]; if (probeA == PROBE_SUCCESS) { if (accsns_get_acceleration_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); }
static ssize_t accsns_position_show(struct device *dev, struct device_attribute *attr, char *buf) { int x,y,z; int xyz[3]; printk(KERN_INFO "[ALPS] accsns_position_show\n"); if(accsns_get_acceleration_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); }