From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 45653235BE5; Mon, 31 Mar 2025 14:55:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743432925; cv=none; b=orc1wB16r4BVApdxeeSQgXSkSwnzrsTFDaH0E52kkowMGX+VjX8HpQrTrcf6fHuuqYqU8IRgl4iPWRkdX7vcrE45948Rw1dgSeVfuBaN8d8dJvvf5sJnee9ZwHB5FNYs7bfCvH0tYyfrd/CKEvm5EPF6zrm62YfJx5CaORJ/urQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743432925; c=relaxed/simple; bh=vY25fNvjbuqmV9Td+aM6L+gb8xpy2HhM1RPtyE96TMM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=cc1390UPR8UorzAJ129Zz9kpT/gqfryjLx+s3Ci6QtQUoTerEgFXJOsIEgnn87fnKsXbFqalelw/HwSYT+Xc9xc8u3BQf5UTfG3gW0O/uHPLn6+tzDnNETHU/RAEO9IP7YvlHis8n5V1/PWZhihMlf1tcUZXik98HoiM+mhSJZU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hFeyukN7; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hFeyukN7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32549C4CEE9; Mon, 31 Mar 2025 14:55:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743432924; bh=vY25fNvjbuqmV9Td+aM6L+gb8xpy2HhM1RPtyE96TMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hFeyukN7uQXVHug44jKQUkku0a1xR+7LbwVXhlXFWyeuoBYQIwbh2cdAcz1l/I0tD sGXyIHUIcq6WAdE7cJFQ6caQvDf1FFUOi6DNypiuFGMass9fADAUXGGUvk1O8u/u5R uuYlQTNVlf6cIuvrXEXdJCZVKeOCYZ2xpiuKdf78o1oafiku7xZ+/BqqDV2bV5pOvS hxtUOfWcBYUlDw/+s/9iwi3LqeONYTkVzoI2iKtxjE367XsQkOMMxu0gy8qYCXM4gi oA/xt+Dw9GMlowvoVAW166ijt+qFjWuUdtBe/sIBNnhvq29ea/kwzouHR9kY3Ck7FY xgcXYKMJFlO+g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Tomasz=20Paku=C5=82a?= , Makarenko Oleg , =?UTF-8?q?Micha=C5=82=20Kope=C4=87?= , Paul Dino Jones , =?UTF-8?q?Crist=C3=B3ferson=20Bueno?= , Pablo Cisneros , Jiri Kosina , Sasha Levin , jikos@kernel.org, bentiss@kernel.org, linux-usb@vger.kernel.org, linux-input@vger.kernel.org Subject: [PATCH AUTOSEL 6.12 07/23] HID: pidff: Add PERMISSIVE_CONTROL quirk Date: Mon, 31 Mar 2025 10:54:53 -0400 Message-Id: <20250331145510.1705478-7-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250331145510.1705478-1-sashal@kernel.org> References: <20250331145510.1705478-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.12.21 Content-Transfer-Encoding: 8bit From: Tomasz Pakuła [ Upstream commit a4119108d2530747e61c7cbf52e2affd089cb1f6 ] With this quirk, a PID device isn't required to have a strict logical_minimum of 1 for the the PID_DEVICE_CONTROL usage page. Some devices come with weird values in their device descriptors and this quirk enables their initialization even if the logical minimum of the DEVICE_CONTROL page is not 1. Fixes initialization of VRS Direct Force Pro Changes in v6: - Change quirk name to better reflect it's intention Co-developed-by: Makarenko Oleg Signed-off-by: Makarenko Oleg Signed-off-by: Tomasz Pakuła Reviewed-by: Michał Kopeć Reviewed-by: Paul Dino Jones Tested-by: Paul Dino Jones Tested-by: Cristóferson Bueno Tested-by: Pablo Cisneros Signed-off-by: Jiri Kosina Signed-off-by: Sasha Levin --- drivers/hid/usbhid/hid-pidff.c | 3 ++- include/linux/hid.h | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/hid/usbhid/hid-pidff.c b/drivers/hid/usbhid/hid-pidff.c index 503b22feacdbb..5a57ba0d7026a 100644 --- a/drivers/hid/usbhid/hid-pidff.c +++ b/drivers/hid/usbhid/hid-pidff.c @@ -969,7 +969,8 @@ static int pidff_find_special_fields(struct pidff_device *pidff) 0x57, 0); pidff->device_control = pidff_find_special_field(pidff->reports[PID_DEVICE_CONTROL], - 0x96, 1); + 0x96, !(pidff->quirks & HID_PIDFF_QUIRK_PERMISSIVE_CONTROL)); + pidff->block_load_status = pidff_find_special_field(pidff->reports[PID_BLOCK_LOAD], 0x8b, 1); diff --git a/include/linux/hid.h b/include/linux/hid.h index 088c6688c3f98..cd3fedce48109 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -1228,8 +1228,9 @@ int hid_pidff_init(struct hid_device *hid); #endif /* HID PIDFF quirks */ -#define HID_PIDFF_QUIRK_MISSING_DELAY BIT(0) -#define HID_PIDFF_QUIRK_MISSING_PBO BIT(1) +#define HID_PIDFF_QUIRK_MISSING_DELAY BIT(0) +#define HID_PIDFF_QUIRK_MISSING_PBO BIT(1) +#define HID_PIDFF_QUIRK_PERMISSIVE_CONTROL BIT(2) #define dbg_hid(fmt, ...) pr_debug("%s: " fmt, __FILE__, ##__VA_ARGS__) -- 2.39.5