From patchwork Wed Jan 24 16:10:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "sandeep.cs" X-Patchwork-Id: 766200 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (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 D3D197CF11 for ; Wed, 24 Jan 2024 16:11:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706112674; cv=none; b=ROWnrA85TcdxsgWUJYxtVrfs1aukPI5erxO2BwfaEfB/MZyWNX5T0glAPyQn2X3vnvNS2MshwAdtp02A6Z8Wy5S/iAT+edHQUh7zAdPkySzYgLHbebeECWoQrO+g6AN+lEd2vwyY+uNHMDbdGLYb4NINtEe2Ffc9AN4vz8Re8Bg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706112674; c=relaxed/simple; bh=xfsQLJ/2vU+01sZsEX/6QiGDSwmC4PQVvgtOhSVA27M=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=apDEp/y/PJALUe3TwcJq25u4sDS4G4Z6SBsBx8Z761CIJ94DO27bc43alDIkA+d0BonaTivo8/A5HDP4LWxUgB58zXtThnWAo6qKNw3D36A0SVbTh/P8TJUUIx1gXH+fv0uQEapDzNbuVdBOyzXeKojIQm6/UvfnpklNaI2SSVw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=HLPHKUNq; arc=none smtp.client-ip=203.254.224.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="HLPHKUNq" Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20240124161108epoutp0358ad5b5da35cb43fdd8c131c8ad414e8~tVG7CHQRg2027520275epoutp031 for ; Wed, 24 Jan 2024 16:11:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20240124161108epoutp0358ad5b5da35cb43fdd8c131c8ad414e8~tVG7CHQRg2027520275epoutp031 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1706112668; bh=FxRt1IQQ9RC5YoH6B7ssFdDYXaY2b2Jj8AIgAplcqlw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HLPHKUNqcOeK/qon2a+VP2TsyWxBCyBCDoWtKMOCJ51qKvQAWvNz3vYBD+dhCK27I JBOHP85nc9NgFzSgWSjClNFFjRQivJsrbm7Bop/HScFA1USeF+qrXlQIk4VtwJy2O7 MFmrEHi32LEySt+R2aCFVdHGkfMdBx6oKxsrFylk= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20240124161107epcas5p2108f973d053b8339a151d2c5e078493d~tVG6dKweF0409204092epcas5p2n; Wed, 24 Jan 2024 16:11:07 +0000 (GMT) Received: from epsmgec5p1new.samsung.com (unknown [182.195.38.182]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4TKppy19PMz4x9Pr; Wed, 24 Jan 2024 16:11:06 +0000 (GMT) Received: from epcas5p4.samsung.com ( [182.195.41.42]) by epsmgec5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 5D.8A.08567.99631B56; Thu, 25 Jan 2024 01:11:06 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20240124161105epcas5p2d1ba581f56e7c0a401a68790202f663b~tVG4N_HCq0408404084epcas5p2o; Wed, 24 Jan 2024 16:11:05 +0000 (GMT) Received: from epsmgmc1p1new.samsung.com (unknown [182.195.42.40]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20240124161105epsmtrp201b5a3a3c70eeeaca80295120925d3c1~tVG4NB6Xn1827518275epsmtrp2O; Wed, 24 Jan 2024 16:11:05 +0000 (GMT) X-AuditID: b6c32a44-617fd70000002177-50-65b13699244a Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgmc1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id A9.B9.07368.99631B56; Thu, 25 Jan 2024 01:11:05 +0900 (KST) Received: from ws2030077324.sa.corp.samsungelectronics.net (unknown [107.99.237.91]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240124161103epsmtip1f2e8dd42a52f89bcb4b9d8eb3efa7597~tVG2v_SPy1251112511epsmtip1g; Wed, 24 Jan 2024 16:11:03 +0000 (GMT) From: Sandeep C S To: Jiri Kosina , Benjamin Tissoires Cc: gaudium.lee@samsung.com, ih0923.kim@samsung.com, suhyun_.kim@samsung.com, jitender.s21@samsung.com, junwan.cho@samsung.com, sandeep.cs@samsung.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [HID Patchsets for Samsung driver v3 1/6] HID Samsung : Broaden device compatibility in samsung driver. Date: Wed, 24 Jan 2024 21:40:23 +0530 Message-Id: <20240124161029.3756075-2-sandeep.cs@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240124161029.3756075-1-sandeep.cs@samsung.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnk+LIzCtJLcpLzFFi42LZdlhTS3eW2cZUg1PbmS2uT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ib3jNAw+3BK5/5XBkpnSErxJLcUaioRZz UXEiAF8UCVPjAgAA X-CMS-MailID: 20240124161105epcas5p2d1ba581f56e7c0a401a68790202f663b X-Msg-Generator: CA CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240124161105epcas5p2d1ba581f56e7c0a401a68790202f663b References: <20240124161029.3756075-1-sandeep.cs@samsung.com> The USB validation check has been moved wherever its required. Earlier Samsung driver only handles USB HID devices and returns an error if it encounters a Bluetooth type of HID device. This changes improves driver compatibility and extends its support for a wide range of devices. Signed-off-by: Sandeep C S Signed-off-by: Junwan Cho Signed-off-by: Jitender Sajwan --- drivers/hid/hid-samsung.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/hid/hid-samsung.c b/drivers/hid/hid-samsung.c index cf5992e97094..3a8756232731 100644 --- a/drivers/hid/hid-samsung.c +++ b/drivers/hid/hid-samsung.c @@ -128,7 +128,7 @@ static int samsung_kbd_mouse_input_mapping(struct hid_device *hdev, static __u8 *samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { - if (USB_DEVICE_ID_SAMSUNG_IR_REMOTE == hdev->product) + if (USB_DEVICE_ID_SAMSUNG_IR_REMOTE == hdev->product && hid_is_usb(hdev)) rdesc = samsung_irda_report_fixup(hdev, rdesc, rsize); return rdesc; } @@ -139,7 +139,7 @@ static int samsung_input_mapping(struct hid_device *hdev, struct hid_input *hi, { int ret = 0; - if (USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE == hdev->product) + if (USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE == hdev->product && hid_is_usb(hdev)) ret = samsung_kbd_mouse_input_mapping(hdev, hi, field, usage, bit, max); @@ -152,9 +152,6 @@ static int samsung_probe(struct hid_device *hdev, int ret; unsigned int cmask = HID_CONNECT_DEFAULT; - if (!hid_is_usb(hdev)) - return -EINVAL; - ret = hid_parse(hdev); if (ret) { hid_err(hdev, "parse failed\n"); @@ -162,6 +159,10 @@ static int samsung_probe(struct hid_device *hdev, } if (USB_DEVICE_ID_SAMSUNG_IR_REMOTE == hdev->product) { + if (!hid_is_usb(hdev)) { + ret = -EINVAL; + goto err_free; + } if (hdev->rsize == 184) { /* disable hidinput, force hiddev */ cmask = (cmask & ~HID_CONNECT_HIDINPUT) | From patchwork Wed Jan 24 16:10:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "sandeep.cs" X-Patchwork-Id: 766199 Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) (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 255D77E584 for ; Wed, 24 Jan 2024 16:11:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.34 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706112688; cv=none; b=knd9sTbxgcFRMbWXNgl5k9yMZxDNQu3zXHWRH5qcQoblknc8jQW0YSEvCpYpftvBczCwy3b5fVTGxN9FDf0+PQkvUl0LlZguIFk1/OqjeN62lheqnhQLnEuIkYPc/A98V25jaTv0dAvjHy7Qw92LWOpe6BOPz/fahZUi4wKeoRA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706112688; c=relaxed/simple; bh=gjb6UzmphU1fLW4iK3dWmvcJQoG7enxLnp+wvNbqm3o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=Lkq38QwdDrGYNSgzHAa+iRzdhn9m0dZZDeXjz7AkEqjpygLqVi/OSys4g52MVZZ5fo12R6aHQYgoR9YbH2eSJph0itcDpwkWnZ3nRqomkhccFB67TH7c4LoShKxdZui521q2ehiyJ0R4v1rEZdxZfYxZ+f0FvujfgeKeuw96AhQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=sS979LcI; arc=none smtp.client-ip=203.254.224.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="sS979LcI" Received: from epcas5p1.samsung.com (unknown [182.195.41.39]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20240124161123epoutp044d3932dcf5557db11ee349c92acc3a7f~tVHJa06q52638126381epoutp04E for ; Wed, 24 Jan 2024 16:11:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20240124161123epoutp044d3932dcf5557db11ee349c92acc3a7f~tVHJa06q52638126381epoutp04E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1706112684; bh=YYocl0PZ0LFHH8dX+SfcttbxYw4fewhczxNV2KWMvIc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sS979LcIU8h4haHdcEZOSICVFbisg3Q75qZzIF7TIXepvyPaxZaLCucrO62qZziXp 5LwjriPjN8FHlCIkWCFCZP5epLhans4Z+bXUqhSeQbgBr0iMUMNS/HLGrS/XZg/9fF MbxVA8KRDBBkwr88LHz3wIx/36jhn9i2HwNjfAB4= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p2.samsung.com (KnoxPortal) with ESMTP id 20240124161123epcas5p23f0817e17010ca8d48bb9799ffb31283~tVHJKcrUx0408404084epcas5p2A; Wed, 24 Jan 2024 16:11:23 +0000 (GMT) Received: from epsmgec5p1new.samsung.com (unknown [182.195.38.178]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4TKpqF6v3rz4x9Pt; Wed, 24 Jan 2024 16:11:21 +0000 (GMT) Received: from epcas5p3.samsung.com ( [182.195.41.41]) by epsmgec5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id DE.8A.08567.9A631B56; Thu, 25 Jan 2024 01:11:21 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p1.samsung.com (KnoxPortal) with ESMTPA id 20240124161121epcas5p1fef1a14624b26cc436b899d9f6cde164~tVHHA8l6K2559125591epcas5p1a; Wed, 24 Jan 2024 16:11:21 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240124161121epsmtrp18e1a76e1639d887a9cb297145dd58c22~tVHHASwZ41601516015epsmtrp1o; Wed, 24 Jan 2024 16:11:21 +0000 (GMT) X-AuditID: b6c32a44-617fd70000002177-64-65b136a9a4da Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id C0.34.08755.9A631B56; Thu, 25 Jan 2024 01:11:21 +0900 (KST) Received: from ws2030077324.sa.corp.samsungelectronics.net (unknown [107.99.237.91]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240124161119epsmtip1f679da7e4d53e86adf1237a5da5ed17a~tVHFlh_P71251112511epsmtip1j; Wed, 24 Jan 2024 16:11:19 +0000 (GMT) From: Sandeep C S To: Jiri Kosina , Benjamin Tissoires Cc: gaudium.lee@samsung.com, ih0923.kim@samsung.com, suhyun_.kim@samsung.com, jitender.s21@samsung.com, junwan.cho@samsung.com, sandeep.cs@samsung.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [HID Patchsets for Samsung driver v3 3/6] HID: Samsung : Add Samsung wireless keyboard support. Date: Wed, 24 Jan 2024 21:40:25 +0530 Message-Id: <20240124161029.3756075-4-sandeep.cs@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240124161029.3756075-1-sandeep.cs@samsung.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphk+LIzCtJLcpLzFFi42LZdlhTU3el2cZUg4szTSyuT9nManF7gafF 1iVzWS1uHW9ltHj5YAO7xebJj1gsbn76xmpxedccNov22c8YLR6t2MTkwOWxaVUnm8f7fVfZ PPq2rGL0+LxJLoAlKtsmIzUxJbVIITUvOT8lMy/dVsk7ON453tTMwFDX0NLCXEkhLzE31VbJ xSdA1y0zB+geJYWyxJxSoFBAYnGxkr6dTVF+aUmqQkZ+cYmtUmpBSk6BSYFecWJucWleul5e aomVoYGBkSlQYUJ2Ru+eJ2wFf9Qqvl/YyNbAOEehi5GDQ0LARGLKbcEuRi4OIYHdjBJv9y5g gXA+MUpsXvuXHcL5xihx5s97pi5GTrCOidd6oRJ7GSUm925ihXA6mSQ+zpjLAlLFJqAl0Xfk O1iHiECExLsFmxhBbGaB64wSDx4GgtjCAlkSP5bfZgOxWQRUJbZtXQJm8wrYShzfsJ8RYpu8 xP6DZ5lBbE4BO4n+vntQNYISJ2c+YYGYKS/RvHU2M0T9R3aJ30e5IWwXiXVHT7NC2MISr45v YYewpSRe9reBfSAh0M0osfT2MShnBqNEy86rUJPsJX6+nsAGCiVmAU2J9bv0IZbxSfT+fsIE CTxeiY42IYhqFYmnXbtZYeZ/P7ERGloeEmtnHgCbKCQwkVHi8n2LCYzys5C8MAvJC7MQli1g ZF7FKJlaUJybnppsWmCYl1oOj9jk/NxNjOBkqeWyg/HG/H96hxiZOBgPMUpwMCuJ8JqYbkwV 4k1JrKxKLcqPLyrNSS0+xGgKDOOJzFKiyfnAdJ1XEm9oYmlgYmZmZmJpbGaoJM77unVuipBA emJJanZqakFqEUwfEwenVAPToeVKNStmTPLr4zE8cuuq9cWPz4/4luXsPWTZxRHRkGQZzNu8 8WnG7uwzKcqrxAurEspWiTzIi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v1XqSdrfvyLw57S2Sq7x4PqE63yl09//USfe/Uy/y/05dy xGTffZqz65dPhsmW6sgZByeozuLniXpm1birxNQj+bf5z0uM06NY9t9c+ed8nMlzqbq9nxUn V75zWpZf9eo0n9Y0j99JAXvmOka+vFS51DfjrZH7z2/a5s7ru7vfvn0WqcRSnJFoqMVcVJwI AM9Bp+vkAgAA X-CMS-MailID: 20240124161121epcas5p1fef1a14624b26cc436b899d9f6cde164 X-Msg-Generator: CA CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240124161121epcas5p1fef1a14624b26cc436b899d9f6cde164 References: <20240124161029.3756075-1-sandeep.cs@samsung.com> Add Support for samsung wireless keyboard with input mapping events. Device 7021 (Samsung wireless keyboard) Signed-off-by: Sandeep C S Signed-off-by: Junwan Cho Signed-off-by: Jitender Sajwan --- drivers/hid/hid-ids.h | 2 + drivers/hid/hid-samsung.c | 108 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index fb30e228d35f..c4a2490a6496 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -1143,8 +1143,10 @@ #define USB_DEVICE_ID_SAITEK_X65 0x0b6a #define USB_VENDOR_ID_SAMSUNG 0x0419 +#define USB_VENDOR_ID_SAMSUNG_ELECTRONICS 0x04e8 #define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001 #define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE 0x0600 +#define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD 0x7021 #define USB_VENDOR_ID_SEMICO 0x1a2c #define USB_DEVICE_ID_SEMICO_USB_KEYKOARD 0x0023 diff --git a/drivers/hid/hid-samsung.c b/drivers/hid/hid-samsung.c index 97d0bf7d4d7e..cec532be987a 100644 --- a/drivers/hid/hid-samsung.c +++ b/drivers/hid/hid-samsung.c @@ -139,6 +139,110 @@ static int samsung_kbd_mouse_input_mapping(struct hid_device *hdev, return 1; } +static int samsung_kbd_input_mapping(struct hid_device *hdev, + struct hid_input *hi, struct hid_field *field, struct hid_usage *usage, + unsigned long **bit, int *max) +{ + if (!(HID_UP_CONSUMER == (usage->hid & HID_USAGE_PAGE) || + HID_UP_KEYBOARD == (usage->hid & HID_USAGE_PAGE))) + return 0; + + dbg_hid("samsung wireless keyboard input mapping event [0x%x]\n", + usage->hid & HID_USAGE); + + if (HID_UP_KEYBOARD == (usage->hid & HID_USAGE_PAGE)) { + set_bit(EV_REP, hi->input->evbit); + switch (usage->hid & HID_USAGE) { + /* Only for UK keyboard */ + /* key found */ +#ifdef CONFIG_HID_KK_UPGRADE + case 0x32: + samsung_kbd_mouse_map_key_clear(KEY_KBDILLUMTOGGLE); + break; + case 0x64: + samsung_kbd_mouse_map_key_clear(KEY_BACKSLASH); + break; +#else + case 0x32: + samsung_kbd_mouse_map_key_clear(KEY_BACKSLASH); + break; + case 0x64: + samsung_kbd_mouse_map_key_clear(KEY_102ND); + break; +#endif + /* Only for BR keyboard */ + case 0x87: + samsung_kbd_mouse_map_key_clear(KEY_RO); + break; + default: + return 0; + } + } + + if (HID_UP_CONSUMER == (usage->hid & HID_USAGE_PAGE)) { + switch (usage->hid & HID_USAGE) { + /* report 2 */ + /* MENU */ + case 0x040: + samsung_kbd_mouse_map_key_clear(KEY_MENU); + break; + case 0x18a: + samsung_kbd_mouse_map_key_clear(KEY_MAIL); + break; + case 0x196: + samsung_kbd_mouse_map_key_clear(KEY_WWW); + break; + case 0x19e: + samsung_kbd_mouse_map_key_clear(KEY_SCREENLOCK); + break; + case 0x221: + samsung_kbd_mouse_map_key_clear(KEY_SEARCH); + break; + case 0x223: + samsung_kbd_mouse_map_key_clear(KEY_HOMEPAGE); + break; + /* Smtart Voice Key */ + case 0x300: + samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY13); + break; + /* RECENTAPPS */ + case 0x301: + samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY1); + break; + /* APPLICATION */ + case 0x302: + samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY2); + break; + /* Voice search */ + case 0x305: + samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY4); + break; + /* QPANEL on/off */ + case 0x306: + samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY5); + break; + /* SIP on/off */ + case 0x307: + samsung_kbd_mouse_map_key_clear(BTN_TRIGGER_HAPPY3); + break; + /* LANG */ + case 0x308: + samsung_kbd_mouse_map_key_clear(KEY_LANGUAGE); + break; + case 0x30a: + samsung_kbd_mouse_map_key_clear(KEY_BRIGHTNESSDOWN); + break; + case 0x30b: + samsung_kbd_mouse_map_key_clear(KEY_BRIGHTNESSUP); + break; + default: + return 0; + } + } + + return 1; +} + static __u8 *samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { @@ -156,6 +260,9 @@ static int samsung_input_mapping(struct hid_device *hdev, struct hid_input *hi, if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE && hid_is_usb(hdev)) ret = samsung_kbd_mouse_input_mapping(hdev, hi, field, usage, bit, max); + else if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD) + ret = samsung_kbd_input_mapping(hdev, + hi, field, usage, bit, max); return ret; } @@ -198,6 +305,7 @@ static int samsung_probe(struct hid_device *hdev, static const struct hid_device_id samsung_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) }, { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD) }, { } }; MODULE_DEVICE_TABLE(hid, samsung_devices); From patchwork Wed Jan 24 16:10:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "sandeep.cs" X-Patchwork-Id: 766198 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (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 B1B537E786 for ; Wed, 24 Jan 2024 16:11:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706112701; cv=none; b=qqmbBwvoNYZirADzEYISiwwRz9m04etqMmPnwfI3vlwk8poE+ZU9q+RhZShKphy5Sc+A6CD8/lBFgDG6AvxcCgTTwh6eBy6C94YoGRCFZ5MVWcWXIe8UfyJ7826mQk8OapalkftNwHP9N+7WV48ZEo6FNGBAwGEa+Dl6Ma/VTz8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706112701; c=relaxed/simple; bh=zmxwR3tFriZfm4Dig7g39jI6oSlOl2huvgOi+JZztTQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:MIME-Version: Content-Type:References; b=MnZ1oLZ4XzLcxOJ3HA9WCkTmXnfIm679lGvewUSfaNsRHmy2a/VQ/xelERFilpvT4xc8Rn/gIj0S4KrBgo+Uj3WbVCQnQzAVGoWO5kG5KF4ErNVUARv101sm/pO9OCFFGApqUiUtQh/Z6MN3NfhGvOjivGWdn5pJPMpIJLMo7IA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=XthGBVfE; arc=none smtp.client-ip=203.254.224.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="XthGBVfE" Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20240124161137epoutp031c1c816aad248fdd1f0d3a7500244078~tVHWO_Yde1940319403epoutp03Z for ; Wed, 24 Jan 2024 16:11:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20240124161137epoutp031c1c816aad248fdd1f0d3a7500244078~tVHWO_Yde1940319403epoutp03Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1706112697; bh=bX84pGQ3NKqRyrB/DSbccXAMgFgpL5V0Zu280XLcWUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XthGBVfEJde09MRcORMzkLXapweoM5koyfaIokcz+nvusEtNeY05LED90HbOhoa36 ldJzRxjudI9pGMig5aUAag0KPdCTcu6aRDl1TTQUnZuVa2oeD7E0CAD2QYeozk9QwA x78w0za6VNQGpi+MUbuxJZMZvDQhATN2VGSHj8M8= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas5p1.samsung.com (KnoxPortal) with ESMTP id 20240124161137epcas5p1ade37693ecdfd5bd9e428b116c6b7fce~tVHVxQuUX2559125591epcas5p1f; Wed, 24 Jan 2024 16:11:37 +0000 (GMT) Received: from epsmges5p1new.samsung.com (unknown [182.195.38.183]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4TKpqW3zjmz4x9Pt; Wed, 24 Jan 2024 16:11:35 +0000 (GMT) Received: from epcas5p1.samsung.com ( [182.195.41.39]) by epsmges5p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 3A.D8.09634.7B631B56; Thu, 25 Jan 2024 01:11:35 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20240124161134epcas5p3f9f50330015d1d80d31087dac09d26da~tVHTh90KT0932009320epcas5p3-; Wed, 24 Jan 2024 16:11:34 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20240124161134epsmtrp1866e03d88b3055b69f5da26c4f0036e2~tVHThPi0l1601516015epsmtrp1r; Wed, 24 Jan 2024 16:11:34 +0000 (GMT) X-AuditID: b6c32a49-eebff700000025a2-74-65b136b70d2b Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 16.E7.08817.6B631B56; Thu, 25 Jan 2024 01:11:34 +0900 (KST) Received: from ws2030077324.sa.corp.samsungelectronics.net (unknown [107.99.237.91]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20240124161133epsmtip1b9c19d68ca44d373901d3c653af16b30~tVHSAqKl31266312663epsmtip1n; Wed, 24 Jan 2024 16:11:33 +0000 (GMT) From: Sandeep C S To: Jiri Kosina , Benjamin Tissoires Cc: gaudium.lee@samsung.com, ih0923.kim@samsung.com, suhyun_.kim@samsung.com, jitender.s21@samsung.com, junwan.cho@samsung.com, sandeep.cs@samsung.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [HID Patchsets for Samsung driver v3 5/6] HID: Samsung : Add Samsung wireless action mouse support. Date: Wed, 24 Jan 2024 21:40:27 +0530 Message-Id: <20240124161029.3756075-6-sandeep.cs@samsung.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240124161029.3756075-1-sandeep.cs@samsung.com> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplk+LIzCtJLcpLzFFi42LZdlhTXXe72cZUg+NfJSyuT9nManF7gafF 1iVzWS1uHW9ltHj5YAO7xebJj1gsb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5p3f9f50330015d1d80d31087dac09d26da X-Msg-Generator: CA CMS-TYPE: 105P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20240124161134epcas5p3f9f50330015d1d80d31087dac09d26da References: <20240124161029.3756075-1-sandeep.cs@samsung.com> Add support for samsung wireless action mouse with input mapping events. Device a004 (Samsung wireless action mouse) Signed-off-by: Sandeep C S Signed-off-by: Junwan Cho Signed-off-by: Jitender Sajwan --- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-samsung.c | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 621853b21923..43a990086225 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h @@ -1148,6 +1148,7 @@ #define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE 0x0600 #define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD 0x7021 #define USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD 0xa000 +#define USB_DEVICE_ID_SAMSUNG_WIRELESS_ACTIONMOUSE 0xa004 #define USB_VENDOR_ID_SEMICO 0x1a2c #define USB_DEVICE_ID_SEMICO_USB_KEYKOARD 0x0023 diff --git a/drivers/hid/hid-samsung.c b/drivers/hid/hid-samsung.c index b786888ec077..df0de72062b7 100644 --- a/drivers/hid/hid-samsung.c +++ b/drivers/hid/hid-samsung.c @@ -334,6 +334,29 @@ static int samsung_gamepad_input_mapping(struct hid_device *hdev, return 1; } +static int samsung_actionmouse_input_mapping(struct hid_device *hdev, + struct hid_input *hi, struct hid_field *field, struct hid_usage *usage, + unsigned long **bit, int *max) +{ + + dbg_hid("samsung wireless actionmouse input mapping event [0x%x], [0x%x], %ld, %ld, [0x%x]\n", + usage->hid, usage->hid & HID_USAGE, hi->input->evbit[0], hi->input->absbit[0], + usage->hid & HID_USAGE_PAGE); + + if (((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) && ((usage->hid & HID_USAGE_PAGE) != HID_UP_BUTTON)) + return 0; + + switch (usage->hid & HID_USAGE) { + case 0x301: + samsung_kbd_mouse_map_key_clear(254); + break; + default: + return 0; + } + + return 1; +} + static __u8 *samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, unsigned int *rsize) { @@ -357,6 +380,9 @@ static int samsung_input_mapping(struct hid_device *hdev, struct hid_input *hi, else if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD) ret = samsung_gamepad_input_mapping(hdev, hi, field, usage, bit, max); + else if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_ACTIONMOUSE) + ret = samsung_actionmouse_input_mapping(hdev, + hi, field, usage, bit, max); return ret; } @@ -401,6 +427,7 @@ static const struct hid_device_id samsung_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD) }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_ACTIONMOUSE) }, { } }; MODULE_DEVICE_TABLE(hid, samsung_devices);