Commit graph

3417 commits

Author SHA1 Message Date
Dmitry Torokhov ce856634af HID: input: add mapping for Assistant key
According to HUTRR89 usage 0x1cb from the consumer page was assigned to
allow launching desktop-aware assistant application, so let's add the
mapping.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-04-03 13:33:25 +02:00
Hui Wang 74e7c6c877 HID: i2c-hid: Disable runtime PM on Synaptics touchpad
We have a new Dell laptop which has the synaptics I2C touchpad
(06cb:7e7e) on it. After booting up the Linux, the touchpad doesn't
work, there is no interrupt when touching the touchpad, after
disable the runtime PM, everything works well.

I also tried the quirk of I2C_HID_QUIRK_DELAY_AFTER_SLEEP, it is
better after applied this quirk, there are interrupts but data it
reports is invalid.

Signed-off-by: Hui Wang <hui.wang@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-04-01 15:57:38 +02:00
Jeffrey Hugo 2bafa1e962 HID: quirks: Fix keyboard + touchpad on Lenovo Miix 630
Similar to commit edfc3722cf ("HID: quirks: Fix keyboard + touchpad on
Toshiba Click Mini not working"), the Lenovo Miix 630 has a combo
keyboard/touchpad device with vid:pid of 04F3:0400, which is shared with
Elan touchpads.  The combo on the Miix 630 has an ACPI id of QTEC0001,
which is not claimed by the elan_i2c driver, so key on that similar to
what was done for the Toshiba Click Mini.

Signed-off-by: Jeffrey Hugo <jeffrey.l.hugo@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-27 14:16:50 +01:00
Peter Hutterer fd35759ce3 HID: logitech: Handle 0 scroll events for the m560
hidpp_scroll_counter_handle_scroll() doesn't expect a 0-value scroll event, it
gets interpreted as a negative scroll direction event. This can cause scroll
direction resets and thus broken scrolling.

Fixes: 4435ff2f09 ("HID: logitech: Enable high-resolution scrolling on Logitech mice")
Cc: stable@vger.kernel.org # v5.0
Reported-and-tested-by: Aimo Metsälä <aimetsal@outlook.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-03-20 14:28:00 +01:00
He, Bo cef0d4948c HID: debug: fix race condition with between rdesc_show() and device removal
There is a race condition that could happen if hid_debug_rdesc_show()
is running while hdev is in the process of going away (device removal,
system suspend, etc) which could result in NULL pointer dereference:

	 BUG: unable to handle kernel paging request at 0000000783316040
	 CPU: 1 PID: 1512 Comm: getevent Tainted: G     U     O 4.19.20-quilt-2e5dc0ac-00029-gc455a447dd55 #1
	 RIP: 0010:hid_dump_device+0x9b/0x160
	 Call Trace:
	  hid_debug_rdesc_show+0x72/0x1d0
	  seq_read+0xe0/0x410
	  full_proxy_read+0x5f/0x90
	  __vfs_read+0x3a/0x170
	  vfs_read+0xa0/0x150
	  ksys_read+0x58/0xc0
	  __x64_sys_read+0x1a/0x20
	  do_syscall_64+0x55/0x110
	  entry_SYSCALL_64_after_hwframe+0x49/0xbe

Grab driver_input_lock to make sure the input device exists throughout the
whole process of dumping the rdesc.

[jkosina@suse.cz: update changelog a bit]
Signed-off-by: he, bo <bo.he@intel.com>
Signed-off-by: "Zhang, Jun" <jun.zhang@intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-19 15:41:08 +01:00
Kangjie Lu 6c44b15e1c HID: logitech: check the return value of create_singlethread_workqueue
create_singlethread_workqueue may fail and return NULL. The fix checks if it is
NULL to avoid NULL pointer dereference.  Also, the fix moves the call of
create_singlethread_workqueue earlier to avoid resource-release issues.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-19 11:47:31 +01:00
Kai-Heng Feng 94a9992f7d HID: Increase maximum report size allowed by hid_field_extract()
Commit 71f6fa90a3 ("HID: increase maximum global item tag report size
to 256") increases the max report size from 128 to 256.

We also need to update the report size in hid_field_extract() otherwise
it complains and truncates now valid report size:
[ 406.165461] hid-sensor-hub 001F:8086:22D8.0002: hid_field_extract() called with n (192) > 32! (kworker/5:1)

BugLink: https://bugs.launchpad.net/bugs/1818547
Fixes: 71f6fa90a3 ("HID: increase maximum global item tag report size to 256")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-18 14:48:17 +01:00
Rodrigo Rivas Costa 6b538cc213 HID: steam: fix deadlock with input devices.
When using this driver with the wireless dongle and some usermode
program that monitors every input device (acpid, for example), while
another usermode client opens and closes the low-level device
repeadedly, the system eventually deadlocks.

The reason is that steam_input_register_device() must not be called with
the mutex held, because the input subsystem has its own synchronization
that clashes with this one: it is possible that steam_input_open() is
called before input_register_device() returns, and since
steam_input_open() needs to lock the mutex, it deadlocks.

However we must hold the mutex when calling any function that sends
commands to the controller. If not, random commands end up falling fail.

Reported-by: Simon Gene Gottlieb <simon@gottliebtfreitag.de>
Signed-off-by: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
Tested-by: Simon Gene Gottlieb <simon@gottliebtfreitag.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-03-18 14:44:20 +01:00
Colin Ian King 1cbbd85fbc HID: uclogic: remove redudant duplicated null check on ver_ptr
Currently ver_ptr is being null checked twice, once before calling
usb_string and once afterwards.  The second null check is redundant
and can be removed, remove it.

Detected by CoverityScan, CID#1477308 ("Logically dead code")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-03-11 14:43:14 +01:00
Andy Shevchenko 78b92f5f00 HID: quirks: Drop misused kernel-doc annotation
The kernel-doc annotation is misused for hid_mouse_ignore_list. The script
complains about it:

drivers/hid/hid-quirks.c:894: warning: cannot understand function prototype: 'const struct hid_device_id hid_mouse_ignore_list[] = '

Drop the annotation to make script happy.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-03-11 14:41:37 +01:00
Arnd Bergmann a23eab8934 HID: hid-asus: select CONFIG_POWER_SUPPLY
The newly added power supply code fails to link when the power supply core
code is disabled:

drivers/hid/hid-asus.o: In function `asus_battery_get_property':
hid-asus.c:(.text+0x11de): undefined reference to `power_supply_get_drvdata'
drivers/hid/hid-asus.o: In function `asus_probe':
hid-asus.c:(.text+0x170c): undefined reference to `devm_power_supply_register'
hid-asus.c:(.text+0x1734): undefined reference to `power_supply_powers'
drivers/hid/hid-asus.o: In function `asus_raw_event':
hid-asus.c:(.text+0x1914): undefined reference to `power_supply_changed'

Select the subsystem from Kconfig as we do for other hid drivers already.

Fixes: 6311d329e1 ("HID: hid-asus: Add BT keyboard dock battery monitoring support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-03-11 14:41:03 +01:00
Louis Taylor 7d01427aaa HID: quirks: use correct format chars in dbg_hid
When building with -Wformat, clang warns:

drivers/hid/hid-quirks.c:1075:27: warning: format specifies type
'unsigned short' but the argument has type '__u32' (aka 'unsigned int')
[-Wformat]
		  bl_entry->driver_data, bl_entry->vendor,
					 ^~~~~~~~~~~~~~~~
./include/linux/hid.h:1170:48: note: expanded from macro 'dbg_hid'
	  printk(KERN_DEBUG "%s: " format, __FILE__, ##arg);      \
				   ~~~~~~              ^~~
drivers/hid/hid-quirks.c:1076:4: warning: format specifies type
'unsigned short' but the argument has type '__u32' (aka 'unsigned int')
[-Wformat]
		  bl_entry->product);
		  ^~~~~~~~~~~~~~~~~
./include/linux/hid.h:1170:48: note: expanded from macro 'dbg_hid'
	  printk(KERN_DEBUG "%s: " format, __FILE__, ##arg);      \
				   ~~~~~~              ^~~
drivers/hid/hid-quirks.c:1242:12: warning: format specifies type
'unsigned short' but the argument has type '__u32' (aka 'unsigned int')
[-Wformat]
		  quirks, hdev->vendor, hdev->product);
			  ^~~~~~~~~~~~
./include/linux/hid.h:1170:48: note: expanded from macro 'dbg_hid'
	  printk(KERN_DEBUG "%s: " format, __FILE__, ##arg);      \
				   ~~~~~~              ^~~
drivers/hid/hid-quirks.c:1242:26: warning: format specifies type
'unsigned short' but the argument has type '__u32' (aka 'unsigned int')
[-Wformat]
		  quirks, hdev->vendor, hdev->product);
					^~~~~~~~~~~~~
./include/linux/hid.h:1170:48: note: expanded from macro 'dbg_hid'
	  printk(KERN_DEBUG "%s: " format, __FILE__, ##arg);      \
				   ~~~~~~              ^~~
4 warnings generated.

This patch fixes the format strings to use the correct format type for unsigned
ints.

Link: https://github.com/ClangBuiltLinux/linux/issues/378
Signed-off-by: Louis Taylor <louis@kragniz.eu>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-03-11 14:38:53 +01:00
Jiri Kosina 49374f0061 Merge branch 'for-5.1/wacom' into for-linus
Wacom driver cleanups from Gustavo A. R. Silva and Jason Gerecke
Support for Pro Pen slim from Jason Gerecke
2019-03-05 15:43:05 +01:00
Jiri Kosina 9f66d83ed7 Merge branch 'for-5.1/i2c-hid' into for-linus
Fix dmesg flood for Elan touchpanels which are too slow to assert IRQ from Kai-Heng Feng
2019-03-05 15:42:51 +01:00
Jiri Kosina edaea3d904 Merge branch 'for-5.1/ish' into for-linus
Power management improvements from Song Hongyan
Switch to new UUID API from Andy Shevchenko
Generalization the driver bindin to support more than just sensors from Srinivas Pandruvada
2019-03-05 15:33:04 +01:00
Jiri Kosina 487b6d0c87 Merge branch 'for-5.1/hid-uclogic' into for-linus
hid-uclogic driver revamp, in order to support wider range of Huion
tablets, from Nikolai Kondrashov
2019-03-05 15:30:16 +01:00
Jiri Kosina 7ff6dae4ab Merge branch 'for-5.1/hid-topseed' into for-linus
Toshiba WT10A tablet bluetooth keyboard support from Hans de Goede
2019-03-05 15:27:46 +01:00
Jiri Kosina 97809a31fb Merge branch 'for-5.1/hid-sony' into for-linus
Fixes for Shanwan PS3 support from Hongye Yuan
2019-03-05 15:27:03 +01:00
Jiri Kosina 8311463d13 Merge branch 'for-5.1/hid-maltron' into for-linus
Support for Maltron L90 from William Whistler
2019-03-05 15:26:21 +01:00
Jiri Kosina ae18691acc Merge branch 'for-5.1/hid-logitech' into for-linus
Logitech WingMan Formula GP fix from Jarrad Whitaker
2019-03-05 15:25:46 +01:00
Jiri Kosina 3a69ae20cb Merge branch 'for-5.1/hid-elan' into for-linus 2019-03-05 15:25:12 +01:00
Jiri Kosina 2c2e5bb975 Merge branch 'for-5.1/hid-asus' into for-linus
Asus Transbook T100CHI and T90CHI support from NOGUCHI Hiroshi
2019-03-05 15:24:43 +01:00
Nikolai Kondrashov 24b2f66628 HID: Remove Waltop tablets from hid_have_special_driver
Tested with a Waltop tablet and it seems to work fine.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:54 +01:00
Nikolai Kondrashov 3c261a14f5 HID: Remove KYE tablets from hid_have_special_driver
Tested with one KYE tablet and it seems to work fine.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:54 +01:00
Nikolai Kondrashov c970f8453f HID: Remove hid-uclogic entries from hid_have_special_driver
Tested with a couple UC-Logic tablets and it seems to work fine.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:54 +01:00
Nikolai Kondrashov 8547b7789c HID: uclogic: Do not initialize non-USB devices
Do not try to initialize UC-Logic tablets if the underlying device is
not a USB device, but e.g. a uhid device.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:54 +01:00
Nikolai Kondrashov e902ed9344 HID: uclogic: Add support for Ugee G5
Add support for Ugee G5 to hid-uclogic.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:54 +01:00
Nikolai Kondrashov 8a47670c35 HID: uclogic: Support Gray-coded rotary encoders
Add support for converting Gray-coded rotary encoder input into dial
input compatible with HID standard. Needed for Ugee G5 support.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:54 +01:00
Nikolai Kondrashov fde44ac556 HID: uclogic: Support faking Wacom pad device ID
Add support for inserting a Wacom pad device ID into hid-uclogic
reports. This allows reporting dial inputs in a way compatible with the
Wacom driver. Needed for Ugee G5 support in particular.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:54 +01:00
Nikolai Kondrashov 08367be171 HID: uclogic: Add support for XP-Pen Deco 01
Add support for XP-Pen Deco 01 to hid-uclogic.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:54 +01:00
Nikolai Kondrashov 492a9e9a3c HID: uclogic: Add support for XP-Pen Star G640
Add support for XP-Pen Star G640 to hid-uclogic.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:54 +01:00
Nikolai Kondrashov c3e5a67c46 HID: uclogic: Add support for XP-Pen Star G540
Add support for XP-Pen Star G540 to hid-uclogic.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:54 +01:00
Nikolai Kondrashov 1ee7c68523 HID: uclogic: Add support for Ugee EX07S frame controls
Add proper support for Ugee EX07(S) frame controls to hid-uclogic.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:54 +01:00
Nikolai Kondrashov 9c17f73539 HID: uclogic: Add support for Ugee M540
Add support for Ugee M540 to hid-uclogic.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:53 +01:00
Nikolai Kondrashov 0c15efe9ef HID: uclogic: Add support for Ugee 2150
Add support for Ugee 2150 to hid-uclogic.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:53 +01:00
Nikolai Kondrashov 2c3a88c64c HID: uclogic: Support v2 protocol
Add support for UC-Logic v2 protocol to hid-uclogic.
This adds support for a bunch of new Huion models.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:53 +01:00
Nikolai Kondrashov 59f2e0fca8 HID: uclogic: Support fragmented high-res reports
Support parsing fragmented high-resolution reports in hid-uclogic to
support v2 reporting protocol.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:53 +01:00
Nikolai Kondrashov 01309e29eb HID: uclogic: Support in-range reporting emulation
Newer UC-Logic tablets, such as ones made by Huion have stopped
reporting in-range state, but they're otherwise worthy tablets. The
manufacturer was notified of the problem and promised to fix this in the
future. Meanwhile, detect pen coming in range, and emulate the reports
to the userspace, to make the tablets useable.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:53 +01:00
Nikolai Kondrashov eecb5b845b HID: uclogic: Designate current protocol v1
Designate the current UC-Logic tablet initialization protocol v1, in
preparation for adding support for v2 protocol.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:53 +01:00
Nikolai Kondrashov 251b427566 HID: uclogic: Re-initialize tablets on resume
Re-initialize UC-Logic tablets on resume. UC-Logic tablet initialization
and parameter retrieval cannot be separated for the large part, so
simply discard the retrieved parameters after initialization.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:53 +01:00
Nikolai Kondrashov 9614219e93 HID: uclogic: Extract tablet parameter discovery into a module
Refactor and extract UC-Logic tablet initialization and parameter
discovery into a module. For these tablets, the major part of parameter
discovery cannot be separated from initialization so they have to be in
the same module. Define explicitly and clearly what possible quirks the
tablets may have to make the driver implementation easier and simpler.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:53 +01:00
Nikolai Kondrashov ff0c13d6d2 HID: uclogic: Extract report descriptors to a module
As hid-uclogic has a lot of report descriptors already and there's going
to be more, move them out of the driver code and into a separate module.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:53 +01:00
Nikolai Kondrashov bf226cd331 HID: Clarify vendor ID reuse by Ugee tablets
Add "_UCLOGIC" to Ugee tablet device ID macros so it's clear they come
with UC-Logic vendor ID.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:53 +01:00
Nikolai Kondrashov 7c2af0a16e HID: viewsonic: Support PD1011 signature pad
Add support for ViewSonic PD1011 signature (display) pad, which is also
sold by Signotec under a different name.

Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:53 +01:00
Nikolai Kondrashov 5e55e2aa80 HID: kye: Add support for EasyPen M406XE
Originally contributed by Andrey Alekseenko <al42and@gmail.com>.

Signed-off-by: Andrey Alekseenko <al42and@gmail.com>
Signed-off-by: Nikolai Kondrashov <spbnick@gmail.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-21 12:00:53 +01:00
Jason Gerecke 4e6e7d7252 HID: wacom: Add support for Pro Pen slim
Wacom has introduced a new pen compatible with its MobileStudio Pro and
other tablets. Although adding it to the tool ID tablet is not strictly
necessary  unrecognized pens are reported as BTN_TOOL_PEN already, unless
the tablet sends the "eraser" bit, when BTN_TOOL_RUBBER is used instead),
we'll keep it updated anyway.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2019-02-20 17:44:29 +01:00
Gustavo A. R. Silva 9b6872a123 HID: roccat: Mark expected switch fall-through
In preparation to enabling -Wimplicit-fallthrough, mark switch
cases where we are expecting to fall through.

This patch fixes the following warning:

drivers/hid/hid-roccat-kone.c: In function ‘kone_keep_values_up_to_date’:
drivers/hid/hid-roccat-kone.c:784:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
   kone->actual_dpi = kone->profiles[event->value - 1].
   ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     startup_dpi;
     ~~~~~~~~~~~
drivers/hid/hid-roccat-kone.c:786:2: note: here
  case kone_mouse_event_osd_profile:
  ^~~~

Warning level 3 was used: -Wimplicit-fallthrough=3

This patch is part of the ongoing efforts to enable
-Wimplicit-fallthrough.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-02-20 09:39:15 +01:00
Hong Liu 09cc8b3618 HID: intel-ish-hid: remove data[128] usage on stack when sending HBM request
Instead of using an 128-byte on-stack array to store the request, we can
instantiate the request on stack directly. This can save the stack usage of
these functions, since most of the requests are much smaller than 128 bytes.

Signed-off-by: Hong Liu <hong.liu@intel.com>
Tested-by: Hongyan Song <hongyan.song@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-02-15 22:47:21 +01:00
Hong Liu 7e06e0d549 HID: intel-ish-hid: move doorbell writing before flush
Reading of IPC_REG_ISH_HOST_FWSTS will flush both message register
and doorbell. So move the doorbell write before reading of
IPC_REG_ISH_HOST_FWSTS.

Signed-off-by: Hong Liu <hong.liu@intel.com>
Tested-by: Hongyan Song <hongyan.song@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-02-15 22:47:21 +01:00
Hong Liu b22f805bbe HID: intel-ish-hid: Optimize writing ipc message from queue
Currently we are using one additional static variable and a spinlock to
prevent contention of writing IPC messages to ISH hardware, which is
not necessary. Once ISH is ready to accept new data, we can push new
data to hardware. This pushing of new data is already protected by
wr_processing_spinlock for contention, which is enough. So use this
spinlock to check both readiness for accepting new data and once ready
allow writing of ipc message from queue to ISH hardware.

While here, cleaned up some space after return.

Signed-off-by: Hong Liu <hong.liu@intel.com>
Tested-by: Hongyan Song <hongyan.song@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2019-02-15 22:47:21 +01:00