aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-alps.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-10-26HID: alps: allow incoming reports when only the trackstick is openedBenjamin Tissoires1-0/+18
If userspace only reads the trackstick node, and no one is listening to the touchpad nor the hidraw node then, the device is not powered on. Add open/close callbacks to allow users to disable the touchpad in Gnome while keeping the trackstick active. Link: https://bugzilla.redhat.com/show_bug.cgi?id=1559632 Link: https://gitlab.gnome.org/GNOME/mutter/issues/128 Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-04-26HID: alps: Fix some style in 't4_read_write_register()'Christophe JAILLET1-3/+3
Better indent the code to improve readability. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-04-26HID: alps: Check errors returned by 't4_read_write_register()'Christophe JAILLET1-0/+18
If only the first 't4_read_write_register()' call fails, the error code will be overwritten and lost. Directly report the error instead. While at it, log some errors if 't4_read_write_register()' fails, as done in the rest of the driver. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-04-26HID: alps: Save a memory allocation in 't4_read_write_register()' when writing dataChristophe JAILLET1-2/+2
if 'read_flag' is false, there is no need to allocate and free memory. We can simply avoid the memory allocation and pass NULL to kfree. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2018-04-26HID: alps: Report an error if we receive invalid data in 't4_read_write_register()'Christophe JAILLET1-0/+2
If the data received is not what is expected, we should return an error. Otherwise, we return 0 or a positive value which will be interpreted as success, but '*read_val' has not been updated. Fixes: 73196ebe134d ("HID: alps: add support for Alps T4 Touchpad device") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-10-17HID: alps: add new U1 device IDMasaki Ota1-0/+3
Add new U1 device Product ID This device is used on HP Elite book x360 series. [jkosina@suse.cz: update changelog] Signed-off-by: Masaki Ota <masaki.ota@jp.alps.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-10-17HID: alps: add support for Alps T4 Touchpad deviceMasaki Ota1-20/+319
- Define T4 device specification value for support T4 device. - Creeate "t4_contact_data" and "t4_input_report" structure for decoding and storing T4-specific data - Create "t4_calc_check_sum()" function for calculating checksum value to send to the device. T4 needs to send this value when reading or writing device address value. - Create "t4_read_write_register()" function for reading and writing device address value. - Create "t4_raw_event()" function for decodin XYZ, palm and button data. - Replace "MAX_TOUCHES" fixed variable to "max_fingers" variable. - Add T4 devuce product ID. (0x120C) T4 device is used on HP EliteBook 1000 series and Zbook Stduio [jkosina@suse.cz: rewrite changelog] Signed-off-by: Masaki Ota <masaki.ota@jp.alps.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-10-17HID: alps: remove variables local to u1_init() from the device structMasaki Ota1-40/+27
Move dev_ctrl, dev_type, sen_line_num_x, sen_line_num_y, pitch_x, pitch_y, resolution, btn_info from u1_dev structure to "u1_init()", because these variables are only used in there. [jkosina@suse.cz: rewrite changelog] Signed-off-by: Masaki Ota <masaki.ota@jp.alps.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-10-17HID: alps: properly handle max_fingers and minimum on X and Y axisMasaki Ota1-14/+24
Create x_min, y_min and max_fingers variables for set correct XY minimum value and the number of max finger on each devices. [jkosina@suse.cz: update shortlog] Signed-off-by: Masaki Ota <masaki.ota@jp.alps.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-10-17HID: alps: Separate U1 device codeMasaki Ota1-53/+67
Create 'static int u1_init()' and factor out U1 device initialization code from main initialization and introduce per-device 'has_sp' flag. [jkosina@suse.cz: rewrite changelog] Signed-off-by: Masaki Ota <masaki.ota@jp.alps.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2017-10-17HID: alps: delete unnecessary struct u1_dev devInfoMasaki Ota1-35/+34
Delete "struct u1_dev devInfo" structure, because u1_dev structure is already declared as "struct u1_dev *data". [jkosina@suse.cz: rewrite changelog] Signed-off-by: Masaki Ota <masaki.ota@jp.alps.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2016-10-07Merge branches 'for-4.8/upstream-fixes', 'for-4.9/alps', 'for-4.9/hid-input', 'for-4.9/intel-ish', 'for-4.9/kye-uclogic-waltop-fixes', 'for-4.9/logitech', 'for-4.9/sony', 'for-4.9/upstream' and 'for-4.9/wacom' into for-linusJiri Kosina1-8/+9
2016-09-27HID: alps: fix multitouch cursor issueMasaki Ota1-6/+6
Issue reproduction procedure: 1. three or more fingers put on Touchpad. 2. release fingers from Touchpad. 3. move the cursor by one finger. 4. the cursor does not move. Cause: We do not notify multi fingers state correctly to input subsystem. For example, when three fingers release from Touchpad, fingers state is 3 -> 0. It needs to notify first, second and third finger's releasing state. Fix this by not breaking out on z axis and move x,y,z input handling code to the correct place so that it's in fact per-finger. [jkosina@suse.cz: reword changelog] Signed-off-by: Masaki Ota <masaki.ota@jp.alps.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2016-09-22HID: alps: fix error return code in alps_input_configured()Wei Yongjun1-2/+3
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. While at it, remove redundant input_free_device(NULL) call. [jkosina@suse.cz: ammend changelog] Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2016-09-22HID: alps: fix stick device not working after resumeKai-Heng Feng1-2/+2
The stick device does not work after resume, add U1_SP_ABS_MODE flag can make the device work after resume. This has been discovered by pure guesswork, based on how the existing code uses U1_TP_ABS_MODE flag on both initialization and resume. I also tested the the patch on an ALPS touchpad without stick device, did not notice any side effect on suspend/resume, so I made the U1_SP_ABS_MODE flag mandatory. [jkosina@suse.cz: made changelog more verbose] Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2016-09-19HID: alps: Fix memory leakAxel Lin1-2/+3
A kfree(readbuf) call was missed if hid_hw_raw_request() fails, fix it. Also avoid mixing direct return with goto in the error paths. Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2016-06-23HID: alps: a few cleanupsMasaki Ota1-68/+48
Remove an unnecessary codes. Change input_ivent() function to appropriate function. Add the device ID of "HID_DEVICE_ID_ALPS_U1_DUAL". [jkosina@suse.cz: removed unnecessary bitshifts of values passed input_report_key() as spotted by Dmitry] Signed-off-by: Masaki Ota <masaki.ota@jp.alps.com> Reviewed-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2016-06-20HID: alps: pass correct sizes to hid_hw_raw_request()Jiri Kosina1-3/+4
Calculating size of the report as sizeof(pointer) always passess the length corresponding to the pointer type, not the underlying data report. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2016-06-17HID: alps: struct u1_dev *priv is internal to the driverJiri Kosina1-1/+1
... and therefore should be marked static. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2016-06-17HID: add Alps I2C HID Touchpad-Stick supportMasaki Ota1-0/+525
Add support Alps I2C HID Touchpad and Stick device. Signed-off-by: Masaki Ota <masaki.ota@jp.alps.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>