Linux Input Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] HID: steam: Fix input device disappearing
@ 2020-01-07 19:48 Rodrigo Rivas Costa
  2020-01-09  9:58 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Rodrigo Rivas Costa @ 2020-01-07 19:48 UTC (permalink / raw)
  To: Benjamin Tissoires, Jiri Kosina, Pierre-Loup A. Griffais, lkml,
	linux-input
  Cc: Rodrigo Rivas Costa

The `connected` value for wired devices was not properly initialized,
it must be set to `true` upon creation, because wired devices do not
generate connection events.

When a raw client (the Steam Client) uses the device, the input device
is destroyed. Then, when the raw client finishes, it must be recreated.
But since the `connected` variable was false this never happended.

Signed-off-by: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>
---
 drivers/hid/hid-steam.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/hid/hid-steam.c b/drivers/hid/hid-steam.c
index 8dae0f9b819e..6286204d4c56 100644
--- a/drivers/hid/hid-steam.c
+++ b/drivers/hid/hid-steam.c
@@ -768,8 +768,12 @@ static int steam_probe(struct hid_device *hdev,
 
 	if (steam->quirks & STEAM_QUIRK_WIRELESS) {
 		hid_info(hdev, "Steam wireless receiver connected");
+		/* If using a wireless adaptor ask for connection status */
+		steam->connected = false;
 		steam_request_conn_status(steam);
 	} else {
+		/* A wired connection is always present */
+		steam->connected = true;
 		ret = steam_register(steam);
 		if (ret) {
 			hid_err(hdev,
-- 
2.24.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: steam: Fix input device disappearing
  2020-01-07 19:48 [PATCH] HID: steam: Fix input device disappearing Rodrigo Rivas Costa
@ 2020-01-09  9:58 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2020-01-09  9:58 UTC (permalink / raw)
  To: Rodrigo Rivas Costa
  Cc: Benjamin Tissoires, Pierre-Loup A. Griffais, lkml, linux-input

On Tue, 7 Jan 2020, Rodrigo Rivas Costa wrote:

> The `connected` value for wired devices was not properly initialized,
> it must be set to `true` upon creation, because wired devices do not
> generate connection events.
> 
> When a raw client (the Steam Client) uses the device, the input device
> is destroyed. Then, when the raw client finishes, it must be recreated.
> But since the `connected` variable was false this never happended.
> 
> Signed-off-by: Rodrigo Rivas Costa <rodrigorivascosta@gmail.com>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07 19:48 [PATCH] HID: steam: Fix input device disappearing Rodrigo Rivas Costa
2020-01-09  9:58 ` Jiri Kosina

Linux Input Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-input/0 linux-input/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-input linux-input/ https://lore.kernel.org/linux-input \
		linux-input@vger.kernel.org
	public-inbox-index linux-input

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-input


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git