Message ID | 20240115144538.12018-4-max@enpas.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-26137-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp1751177dyc; Mon, 15 Jan 2024 06:54:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IE4FuIn1DtOL2b8yes5AWGw9fV5wwAQ1Z1Jviz+IqNYqVj1cvmzqCPlWMzuzqLw4GeWgSDj X-Received: by 2002:a05:6358:189:b0:175:77d7:67b2 with SMTP id d9-20020a056358018900b0017577d767b2mr6383516rwa.32.1705330484723; Mon, 15 Jan 2024 06:54:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705330484; cv=none; d=google.com; s=arc-20160816; b=Ww8UwzaeK0/rhXztkf8wUgLsX9n0uJvXc7+yWHIE26A7HKIkjct9pZCPfbwv5Jwo6G td57EeEh2V+DkUdTaS5tu6SHYRyBHPuowc7uZYgGI7I7I8kTFTd1Jn6c/d3E/ER0lp4s YvlY1kN/jURhMB4uuaM6k4k5WsWWvviAmXsanqLU68dS8aB57HbDPd3J1Kr1/0xrdRLJ +Prpfy1g7wLpbD4kCQkb9Uy2GTckZ9YCKtwXV451vlXeFG4zQS9W/iXbnH4fsH2E9Hhp jXdvaKdrJSSia97uSS6lW5j8kbYEtAcJeYb9+WM3UgG6LHHU1KVg9RzQHT9yZZbqPpoU HL/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=hVb10Q92WOfhp2iU7dZiB2FAv+ssZBUdjpky+Xil0g8=; fh=3M1PHg4byxu2MygWip944LqLZSq0Urk5Qa4iYXrexb8=; b=gPq+HkNMIiyqjjybmI9AfebiOJ8I85Bq9oAPCHQ4JaQkO54nyKEUMlaf1OxgPpseEY ihvJpcesvQH4uBHI5mMWn9/L16xEZz/2Ey2iQ2eKBA8mNhXOgM4a7YhxGRyIDC31bZGm mdZTmhg1+0Byj+3TL12zZrHKZtv4qFmZZBFHuBAUCOJPAHfKxzj8tUyAq6JE/FICKu8n +C6FGxBzwcdvdV3/Mz9fECpnC2l6BJfB4wD1Rl5e9SN+MzXqkpDlq/Zj+KdnWlvxNs9t XlJRRJACqKICNLe1hjIirLBahDQSDOH7+V5+1Vt+Tcpe4YU3dtPrHo968kxfOMyxXdkC tQcw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26137-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26137-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e11-20020a65688b000000b005cdf85aa782si8846886pgt.279.2024.01.15.06.54.44 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jan 2024 06:54:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-26137-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-26137-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-26137-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id CA60EB21A84 for <ouuuleilei@gmail.com>; Mon, 15 Jan 2024 14:51:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8E284179B0; Mon, 15 Jan 2024 14:48:58 +0000 (UTC) Received: from mail.enpas.org (zhong.enpas.org [46.38.239.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7FDF175B6; Mon, 15 Jan 2024 14:48:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=enpas.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=enpas.org Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail.enpas.org (Postfix) with ESMTPSA id D55ED101649; Mon, 15 Jan 2024 14:48:49 +0000 (UTC) From: Max Staudt <max@enpas.org> To: Roderick Colenbrander <roderick.colenbrander@sony.com>, Jiri Kosina <jikos@kernel.org>, Benjamin Tissoires <benjamin.tissoires@redhat.com> Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, max@enpas.org Subject: [PATCH v1 3/7] HID: playstation: DS4: Don't fail on FW/HW version request Date: Mon, 15 Jan 2024 23:45:34 +0900 Message-Id: <20240115144538.12018-4-max@enpas.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240115144538.12018-1-max@enpas.org> References: <20240115144538.12018-1-max@enpas.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788168618214485722 X-GMAIL-MSGID: 1788168618214485722 |
Series |
HID: playstation: DS4: LED bugfix, third-party gamepad support
|
|
Commit Message
Max Staudt
Jan. 15, 2024, 2:45 p.m. UTC
Some third-party controllers can't report firmware/hardware version.
Unlike for the DualSense, the driver does not use these values for
anything in the DualShock 4 case, but merely exposes them via sysfs.
They will simply be 0x0.
Signed-off-by: Max Staudt <max@enpas.org>
---
drivers/hid/hid-playstation.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Jan 15, 2024 at 6:51 AM Max Staudt <max@enpas.org> wrote: > > Some third-party controllers can't report firmware/hardware version. > > Unlike for the DualSense, the driver does not use these values for > anything in the DualShock 4 case, but merely exposes them via sysfs. > They will simply be 0x0. > > Signed-off-by: Max Staudt <max@enpas.org> > --- > drivers/hid/hid-playstation.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c > index 0a3c442af305..12321cae4416 100644 > --- a/drivers/hid/hid-playstation.c > +++ b/drivers/hid/hid-playstation.c > @@ -2561,7 +2561,7 @@ static struct ps_device *dualshock4_create(struct hid_device *hdev) > ret = dualshock4_get_firmware_info(ds4); > if (ret) { > hid_err(hdev, "Failed to get firmware info from DualShock4\n"); > - return ERR_PTR(ret); > + hid_err(hdev, "HW/FW version data in sysfs will be invalid.\n"); > } > > ret = ps_devices_list_add(ps_dev); > -- > 2.39.2 > > This looks good. Perhaps could have been a hid_warn then, but err is probably fine. Roderick
On 1/25/24 09:43, Roderick Colenbrander wrote: > On Mon, Jan 15, 2024 at 6:51 AM Max Staudt <max@enpas.org> wrote: >> >> ret = dualshock4_get_firmware_info(ds4); >> if (ret) { >> hid_err(hdev, "Failed to get firmware info from DualShock4\n"); >> - return ERR_PTR(ret); >> + hid_err(hdev, "HW/FW version data in sysfs will be invalid.\n"); >> } > > This looks good. Perhaps could have been a hid_warn then, but err is > probably fine. I didn't think about it and kept the hid_err that was already there :) I agree, and maybe we can take this further: If this code block is not a fatal error anymore, maybe it makes sense to change *both* lines to hid_warn? If you prefer this, then I'll update the other patches accordingly. Max
diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c index 0a3c442af305..12321cae4416 100644 --- a/drivers/hid/hid-playstation.c +++ b/drivers/hid/hid-playstation.c @@ -2561,7 +2561,7 @@ static struct ps_device *dualshock4_create(struct hid_device *hdev) ret = dualshock4_get_firmware_info(ds4); if (ret) { hid_err(hdev, "Failed to get firmware info from DualShock4\n"); - return ERR_PTR(ret); + hid_err(hdev, "HW/FW version data in sysfs will be invalid.\n"); } ret = ps_devices_list_add(ps_dev);