Lines Matching +full:invert +full:- +full:enable
1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Copyright (C) 2006 Michael Hanselmann (linux-kernel@hansmi.ch)
20 MODULE_PARM_DESC(joystick, "Enable the input class device on module load");
22 static bool invert; variable
23 module_param(invert, bool, S_IWUSR | S_IRUGO);
24 MODULE_PARM_DESC(invert, "Invert input data on X and Y axis");
36 x -= ams_info.xcalib; in ams_idev_poll()
37 y -= ams_info.ycalib; in ams_idev_poll()
38 z -= ams_info.zcalib; in ams_idev_poll()
40 input_report_abs(idev, ABS_X, invert ? -x : x); in ams_idev_poll()
41 input_report_abs(idev, ABS_Y, invert ? -y : y); in ams_idev_poll()
63 return -ENOMEM; in ams_input_enable()
65 input->name = "Apple Motion Sensor"; in ams_input_enable()
66 input->id.bustype = ams_info.bustype; in ams_input_enable()
67 input->id.vendor = 0; in ams_input_enable()
68 input->dev.parent = &ams_info.of_dev->dev; in ams_input_enable()
70 input_set_abs_params(input, ABS_X, -50, 50, 3, 0); in ams_input_enable()
71 input_set_abs_params(input, ABS_Y, -50, 50, 3, 0); in ams_input_enable()
72 input_set_abs_params(input, ABS_Z, -50, 50, 3, 0); in ams_input_enable()
114 unsigned long enable; in ams_input_store_joystick() local
118 ret = kstrtoul(buf, 0, &enable); in ams_input_store_joystick()
121 if (enable > 1) in ams_input_store_joystick()
122 return -EINVAL; in ams_input_store_joystick()
126 if (enable != joystick) { in ams_input_store_joystick()
127 if (enable) in ams_input_store_joystick()
146 return device_create_file(&ams_info.of_dev->dev, &dev_attr_joystick); in ams_input_init()
151 device_remove_file(&ams_info.of_dev->dev, &dev_attr_joystick); in ams_input_exit()