13 #include <linux/module.h>
15 #include <linux/types.h>
16 #include <linux/errno.h>
32 static void ams_idev_poll(
struct input_polled_dev *
dev)
34 struct input_dev *
idev = dev->input;
45 input_report_abs(idev,
ABS_X, invert ? -x : x);
46 input_report_abs(idev,
ABS_Y, invert ? -y : y);
47 input_report_abs(idev,
ABS_Z, z);
55 static int ams_input_enable(
void)
57 struct input_dev *
input;
74 input->name =
"Apple Motion Sensor";
75 input->id.bustype =
ams_info.bustype;
77 input->dev.parent = &
ams_info.of_dev->dev;
79 input_set_abs_params(input,
ABS_X, -50, 50, 3, 0);
80 input_set_abs_params(input,
ABS_Y, -50, 50, 3, 0);
81 input_set_abs_params(input,
ABS_Z, -50, 50, 3, 0);
99 static void ams_input_disable(
void)
113 return sprintf(buf,
"%d\n", joystick);
127 if (enable != joystick) {
129 error = ams_input_enable();
136 return error ? error :
count;
140 ams_input_show_joystick, ams_input_store_joystick);