From patchwork Thu Apr 21 17:50:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= X-Patchwork-Id: 12822137 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2845DC433EF for ; Thu, 21 Apr 2022 17:51:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390925AbiDURx6 (ORCPT ); Thu, 21 Apr 2022 13:53:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1390937AbiDURx4 (ORCPT ); Thu, 21 Apr 2022 13:53:56 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 528F24A3E6; Thu, 21 Apr 2022 10:51:06 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id h25so1699470wrc.13; Thu, 21 Apr 2022 10:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=f92MKRrT0L1P4tPjgNwMxIl4Ha1qwGqzWtpfrFCwgyM=; b=peEQlIDQSf7XxoSaP590zUrldJ/7GeAEaQd4MUJsvP+D8zqxdae/crnwtEz4tgbDBR RIG7gzVZBj/Re256H6eLkFxDST0kJXGer+/LbxYU0QoY7q9OdnbQsePXnbnmazgiSZLy XFz+4KkNTkErt8c/1PjvtZQbBhHIz4PfAA2f+KnNUxDV6L8CicIIo7u6nDv4/D41IcGI M/2HkOqDYMi2e0zo5GHDDll+wn9vWmxqZp7pqPrXqIM0qRqPNp0WMfdlWhUioOJ3Vn3/ XkZzlUCo/ETreuh+KFLjkHAMVBPPu4MH0fofWZyaJBJ3Gix5IjRGV/j1XUESr5QeU039 nvBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=f92MKRrT0L1P4tPjgNwMxIl4Ha1qwGqzWtpfrFCwgyM=; b=phVcO0fSRbNt5tCVhpg2qEtCtwNP1/y87MuGTXROUXcUPySKa11LpwKpyrSjFn3pjw vlHQZzYYYQ7Si2G0mrTcsbKyLvZZaMm6YBRORAURnfy99WWeISI8MHH+99aLE+72SypJ kpoYgMd0jOixM2m3KAKCeQMm08IzCohB040qJ5T4VAcRT2a2szyyiTUoyISTJANOs3Lm 4E1xLemfHYkQzIKw8cezU0HfIHyUqpAw3jcXgemC6c66ab/N+YX3C59CqcUCacGkja8T l9OVA1Cn4ndZM2UyDzh+Em1FXHqWsgFdHPfMQj36QHMq79wyEZrkWUTV3hZeakXA3kOw chQA== X-Gm-Message-State: AOAM533Fgz+yuuO29m8kVjHfCdv4T3ukkTxZu6glD5HnMVNGu3cHxVcB KINCNMc5S+XiKdzEIrsC3hI= X-Google-Smtp-Source: ABdhPJwgp5JJZxP5dhvcjxtD7Q4ChmeukcW5sOLr/Hc1cZIGMXlFv/ADkgz6vxvtkK8z0/K/JPO/JA== X-Received: by 2002:a05:6000:156a:b0:20a:9c1b:6b1b with SMTP id 10-20020a056000156a00b0020a9c1b6b1bmr620255wrz.683.1650563464855; Thu, 21 Apr 2022 10:51:04 -0700 (PDT) Received: from localhost.localdomain ([94.73.37.128]) by smtp.gmail.com with ESMTPSA id l28-20020a05600c1d1c00b0038ece66f1b0sm2685634wms.8.2022.04.21.10.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 10:51:04 -0700 (PDT) From: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= To: jikos@kernel.org Cc: benjamin.tissoires@redhat.com, spbnick@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?Sm9z?= =?utf-8?b?w6kgRXhww7NzaXRv?= Subject: [PATCH for-5.19/uclogic 1/5] HID: uclogic: Clarify params desc_size description Date: Thu, 21 Apr 2022 19:50:48 +0200 Message-Id: <20220421175052.911446-2-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220421175052.911446-1-jose.exposito89@gmail.com> References: <20220421175052.911446-1-jose.exposito89@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Nikolai Kondrashov Documentation improvements. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito --- drivers/hid/hid-uclogic-params.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hid-uclogic-params.h b/drivers/hid/hid-uclogic-params.h index e5ccc558abc3..a489c92cee43 100644 --- a/drivers/hid/hid-uclogic-params.h +++ b/drivers/hid/hid-uclogic-params.h @@ -189,7 +189,7 @@ struct uclogic_params { __u8 *desc_ptr; /* * Size of the common part of the replacement report descriptor. - * Only valid, if "desc_ptr" is not NULL. + * Only valid, if "desc_ptr" is valid and not NULL. */ unsigned int desc_size; /* From patchwork Thu Apr 21 17:50:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= X-Patchwork-Id: 12822138 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 96118C433EF for ; Thu, 21 Apr 2022 17:51:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390937AbiDURyD (ORCPT ); Thu, 21 Apr 2022 13:54:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1390947AbiDURyC (ORCPT ); Thu, 21 Apr 2022 13:54:02 -0400 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D67149CAE; Thu, 21 Apr 2022 10:51:12 -0700 (PDT) Received: by mail-wm1-x32b.google.com with SMTP id q20so3660655wmq.1; Thu, 21 Apr 2022 10:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z9GPD6F+i42nYYTtaO9dbnr7cCMMcY8a2hQOSNdFpjY=; b=J/DVEUpYNkREy8qfWg1OWPB/6EZY7LP+YLW+2V3WIjhwnNwZq/mt2MD7LZ2WzUfVF6 zXo3k49TPGOSmVmKDJlBPS/lfbxLWylvRJNqFv/zBthfh4P/58XhqywlHpjwz1VnOoQI y1p+GG5zjAtz5XaUgBHrfVC7uwPq17DeIcpmcIvPutuaJO1mUvhWgw64Qn58UjXxZKUS LpiO04kRQTFbVHnQ/xWVBZRjQ3tgGI1gyGNOyAqt0JlkZG2ZNRobZNbuBESLaZZuuzvk yStJ1pueHtmU9Hj2R8dywIuBnMGbnHm+ed4LLqGP5KfdAfijTtn1IhI7vkk803LciUL4 3iTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z9GPD6F+i42nYYTtaO9dbnr7cCMMcY8a2hQOSNdFpjY=; b=KdUz3v/HJGQZSH1gKxngjkSdZDDo6Nb5VuHlEDWp/aKfNCJjE/nMjmul7um7qpn128 51ky/VjG1+CuK+hQ2uxez9T6Iiv84TOuOGxxySAMAjL5qruDqps5kjZTSgIPj8+4Twlf +CVNojV5VU5mPT4+2ksxF8elwMFitVi7Vyg1Rs1AovSgAmrF+Nl0JeY2ghkS/vXwORkn pkS5iccbJoOVVWadgrxb/hjoz0IfUq88kZSLg38rOLLoSSBfq3vreKdjQnbDfAmnRYrx hitRMx6Mxa9lH5l/PKuxsxuTjwaIeMSGeizqUZhFTYkc6iGe4EtIMNrYYVF3Cuty8HUR wYmQ== X-Gm-Message-State: AOAM532drdPW7i/lAasmtb3k7c7Bbj/5TyEQ0+BjWnI9o/Wu03clDs7n AuTSANRRSwVvVwCRNF7zLt0zk5f/CI4= X-Google-Smtp-Source: ABdhPJwvgqEiypssd+RliqH52FtCpkOJfC4NqtaaXxYnl3tFg9ove0Gx3PmwEsCpH3FC2CjoB0WCvQ== X-Received: by 2002:a05:600c:4044:b0:38e:d2bc:1bc6 with SMTP id j4-20020a05600c404400b0038ed2bc1bc6mr9949186wmm.10.1650563470647; Thu, 21 Apr 2022 10:51:10 -0700 (PDT) Received: from localhost.localdomain ([94.73.37.128]) by smtp.gmail.com with ESMTPSA id l28-20020a05600c1d1c00b0038ece66f1b0sm2685634wms.8.2022.04.21.10.51.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 10:51:10 -0700 (PDT) From: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= To: jikos@kernel.org Cc: benjamin.tissoires@redhat.com, spbnick@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?Sm9z?= =?utf-8?b?w6kgRXhww7NzaXRv?= Subject: [PATCH for-5.19/uclogic 2/5] HID: uclogic: Clarify pen/frame desc_ptr description Date: Thu, 21 Apr 2022 19:50:49 +0200 Message-Id: <20220421175052.911446-3-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220421175052.911446-1-jose.exposito89@gmail.com> References: <20220421175052.911446-1-jose.exposito89@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Nikolai Kondrashov Documentation improvements. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito --- drivers/hid/hid-uclogic-params.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/hid/hid-uclogic-params.h b/drivers/hid/hid-uclogic-params.h index a489c92cee43..fa75efba3130 100644 --- a/drivers/hid/hid-uclogic-params.h +++ b/drivers/hid/hid-uclogic-params.h @@ -62,8 +62,8 @@ struct uclogic_params_pen_subreport { */ struct uclogic_params_pen { /* - * Pointer to report descriptor describing the inputs. - * Allocated with kmalloc. + * Pointer to report descriptor part describing the pen inputs. + * Allocated with kmalloc. NULL if the part is not specified. */ __u8 *desc_ptr; /* @@ -101,8 +101,8 @@ struct uclogic_params_pen { */ struct uclogic_params_frame { /* - * Pointer to report descriptor describing the inputs. - * Allocated with kmalloc. + * Pointer to report descriptor part describing the frame inputs. + * Allocated with kmalloc. NULL if the part is not specified. */ __u8 *desc_ptr; /* From patchwork Thu Apr 21 17:50:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= X-Patchwork-Id: 12822140 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59822C433EF for ; Thu, 21 Apr 2022 17:51:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242353AbiDURyM (ORCPT ); Thu, 21 Apr 2022 13:54:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377741AbiDURyH (ORCPT ); Thu, 21 Apr 2022 13:54:07 -0400 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0C384A3FA; Thu, 21 Apr 2022 10:51:16 -0700 (PDT) Received: by mail-wr1-x42f.google.com with SMTP id s25so2851823wrb.8; Thu, 21 Apr 2022 10:51:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JIOQLVETTpe3oazXPSLlxXYuEyunaEzJOFdoVd+MyTU=; b=GeduT2DIEMlZp0eQUJ/PLGQNyME6DfR+H9MwaQ/0gagJgPccM3LV8a8M10pRXRuFxa 3K8fq3j3dnEmWSCyP/+qBzBN2RX0mhNn4NhuSUKk5EPeIrmUjj0AsA2lkLsSVjy3St8K pIUWoWo+Rb37aL/w6395IOATaSFqkfFbOr1rFMCPrgsoNxHBbkiq4UVkMoDSkjAXKLqM TrKnvjNR+zhp/7T97u1Rr6wmooqdQYk5EnCJqGbZvUZtrhqWqy0n6ER4YazDDFI1Mibk JbIQzZCLnofCYqLtCH6sFGtWc/QR/obzwtPiexkHoth3cCUQKX0PbUwcN1CKcQgpPV5p Xvyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JIOQLVETTpe3oazXPSLlxXYuEyunaEzJOFdoVd+MyTU=; b=PNp1Lqm6yP9HVYuqT1h14bdKnuh93bk8fKXFcIH1KGxZjwoj4AnmuUOxH8yke8bwH/ v8+HnrzgWdGfGgfoZDLDsXtimmHdw08pLFGmruEY/zGO7kCjl4UCXmuYmaU9WUDBykAT psATrIVyoPZLGgm4/jd2pJmQdFKRMZhWeCLDZFoKqGPfqupVdBCa3JANvHeNUGKqdHgl +qIUyqDUbOnqfYKOVF1FWf5Azjhr4TC6K66Mo2hjDVsaTN6+JBZkqPeEmrQ9s1nn7UYz uhB7vxtTDgNpuQ/96LAV+ESyd77AhIsvoPgPb5ASd+YLXztD+30FJiu4J3rXX6ltwmbm fMPw== X-Gm-Message-State: AOAM532XajJWfG9odrFvteiZssD7N6/y16mKPdbSP54CsOd2rRF27fUO aEapBNCcJiEpMzFXOT+mV8o= X-Google-Smtp-Source: ABdhPJwSF1Xqo5hPAr/p9AVte7wvpvxqEDyiL2pF8X3B69/9ajN0efTQksgtrHB6tijw8xJfECcp3w== X-Received: by 2002:a5d:6211:0:b0:1ef:85dd:c96b with SMTP id y17-20020a5d6211000000b001ef85ddc96bmr642720wru.456.1650563475181; Thu, 21 Apr 2022 10:51:15 -0700 (PDT) Received: from localhost.localdomain ([94.73.37.128]) by smtp.gmail.com with ESMTPSA id l28-20020a05600c1d1c00b0038ece66f1b0sm2685634wms.8.2022.04.21.10.51.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 10:51:14 -0700 (PDT) From: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= To: jikos@kernel.org Cc: benjamin.tissoires@redhat.com, spbnick@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?Sm9z?= =?utf-8?b?w6kgRXhww7NzaXRv?= Subject: [PATCH for-5.19/uclogic 3/5] HID: uclogic: Pass keyboard reports as is Date: Thu, 21 Apr 2022 19:50:50 +0200 Message-Id: <20220421175052.911446-4-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220421175052.911446-1-jose.exposito89@gmail.com> References: <20220421175052.911446-1-jose.exposito89@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Nikolai Kondrashov Allow keyboard reports from interface #1 of Huion tablets to pass unmodified, and stop the Wacom X.org driver from handling them. The method for the latter is rather crude and also take the Dial reports from the Wacom driver, but it's expected that libinput will be able to handle them (still to be tested). This enables Huion HS611 media and desktop keys. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito --- drivers/hid/hid-uclogic-params.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c index 09c332c6a412..b85585ac3372 100644 --- a/drivers/hid/hid-uclogic-params.c +++ b/drivers/hid/hid-uclogic-params.c @@ -711,8 +711,12 @@ static int uclogic_params_huion_init(struct uclogic_params *params, iface = to_usb_interface(hdev->dev.parent); bInterfaceNumber = iface->cur_altsetting->desc.bInterfaceNumber; - /* If it's not a pen interface */ - if (bInterfaceNumber != 0) { + /* If it's a custom keyboard interface */ + if (bInterfaceNumber == 1) { + /* Keep everything intact */ + goto output; + /* Else, if it's not a pen interface */ + } else if (bInterfaceNumber != 0) { uclogic_params_init_invalid(&p); goto output; } From patchwork Thu Apr 21 17:50:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= X-Patchwork-Id: 12822139 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10A80C433FE for ; Thu, 21 Apr 2022 17:51:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390953AbiDURyN (ORCPT ); Thu, 21 Apr 2022 13:54:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1390965AbiDURyM (ORCPT ); Thu, 21 Apr 2022 13:54:12 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 538D54A904; Thu, 21 Apr 2022 10:51:21 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id t6so4302252wra.4; Thu, 21 Apr 2022 10:51:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=NnKTYAQUZr5DnHBpkPnAbHzcE3MCWYtWF2UJUHFWyxQ=; b=VJ7iMjDIwKUDSmu5jtn0bgREE+NeydrVY33vOVfNoLZy8un/T1zfZz41o3dXkH/NM0 UKl6a9h6BmYy/fxpxGIeDRhF0iXvu7s5bZuXMO2tw+4WodgoNzxjM3xirzzNf2oCBPH/ 3bJoibJywJMJnkjmiRkV/n/V2kWNGSCZ/kr4Y5dunlmk7rhvPBvMkLl9K+S2PNZGpRyP wngLpb36rcZ9Va0X9Jjc/QTVH7id5BlxFOCnSASgcL6aNia+P4LQmqDwXoFKWk+YlyQK XaIyVUioajIBVspyd4vE+FT7cLqPg7dnpkUNuZ2tgoG3/NvZyn3pkOdWG96EsFn+3j6x AGOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NnKTYAQUZr5DnHBpkPnAbHzcE3MCWYtWF2UJUHFWyxQ=; b=7J40LpOcBhYV0fkc6S/9P4VM2t0OOvD4/p8/4jvsWytGqTsI8DjBalCoyuaPOOmDiq Bhkmr6YcP6m7GQrcql12xMCq7w5CnIZWk0rdyl0z+YdddFQeIb8wH8GUMM+jvnlLEkBD sTRXM4+YDhWbCZ/YMqDMSHxYqWMO5sHZhqGFoLF3PTZ0+Mbks1eLlr1LTPgAlB+rcUrG HqOlazpLVI9gXY69aKeLPdmG3iQDQEPuc6XRQk38kOjf3jbm6NvQRBSFD2zm98IoRKqM HmHTugkyAcLM+tY/nWKkE89uTcIPwyqu9EItenCq4bE0OSuVeQtzd8gdeJSOjUmhqrbc xPuQ== X-Gm-Message-State: AOAM531wiSsw94aoAl3BGMIxIB2LAoMR/wmfM11ejv51/40hgqMOnLTR KqFVwrUs+5g4J0HgLPn3TmU= X-Google-Smtp-Source: ABdhPJw1gsL05rPREYUvgnhGe+dtF9jed8GmeBPgrCvm3V2+sxnE5WYK5ecNyTtxNiEdMOdFFXqmFA== X-Received: by 2002:a05:6000:1e0a:b0:20a:be24:3de7 with SMTP id bj10-20020a0560001e0a00b0020abe243de7mr644866wrb.109.1650563479861; Thu, 21 Apr 2022 10:51:19 -0700 (PDT) Received: from localhost.localdomain ([94.73.37.128]) by smtp.gmail.com with ESMTPSA id l28-20020a05600c1d1c00b0038ece66f1b0sm2685634wms.8.2022.04.21.10.51.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 10:51:19 -0700 (PDT) From: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= To: jikos@kernel.org Cc: benjamin.tissoires@redhat.com, spbnick@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?Sm9z?= =?utf-8?b?w6kgRXhww7NzaXRv?= Subject: [PATCH for-5.19/uclogic 4/5] HID: uclogic: Support disabling pen usage Date: Thu, 21 Apr 2022 19:50:51 +0200 Message-Id: <20220421175052.911446-5-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220421175052.911446-1-jose.exposito89@gmail.com> References: <20220421175052.911446-1-jose.exposito89@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Nikolai Kondrashov Restore the ability to disable pen usage in hid-uclogic to support e.g. keyboard interfaces which also have pen usages for some reason, but which we don't want to rewrite report descriptors for. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito --- drivers/hid/hid-uclogic-core.c | 19 +++++++++++++++++++ drivers/hid/hid-uclogic-params.h | 7 +++++++ 2 files changed, 26 insertions(+) diff --git a/drivers/hid/hid-uclogic-core.c b/drivers/hid/hid-uclogic-core.c index 627f1d0c52f2..8ef3d1830052 100644 --- a/drivers/hid/hid-uclogic-core.c +++ b/drivers/hid/hid-uclogic-core.c @@ -81,6 +81,24 @@ static __u8 *uclogic_report_fixup(struct hid_device *hdev, __u8 *rdesc, return rdesc; } +static int uclogic_input_mapping(struct hid_device *hdev, + struct hid_input *hi, + struct hid_field *field, + struct hid_usage *usage, + unsigned long **bit, + int *max) +{ + struct uclogic_drvdata *drvdata = hid_get_drvdata(hdev); + struct uclogic_params *params = &drvdata->params; + + /* Discard invalid pen usages */ + if (params->pen.usage_invalid && (field->application == HID_DG_PEN)) + return -1; + + /* Let hid-core decide what to do */ + return 0; +} + static int uclogic_input_configured(struct hid_device *hdev, struct hid_input *hi) { @@ -515,6 +533,7 @@ static struct hid_driver uclogic_driver = { .remove = uclogic_remove, .report_fixup = uclogic_report_fixup, .raw_event = uclogic_raw_event, + .input_mapping = uclogic_input_mapping, .input_configured = uclogic_input_configured, #ifdef CONFIG_PM .resume = uclogic_resume, diff --git a/drivers/hid/hid-uclogic-params.h b/drivers/hid/hid-uclogic-params.h index fa75efba3130..fb2001018c46 100644 --- a/drivers/hid/hid-uclogic-params.h +++ b/drivers/hid/hid-uclogic-params.h @@ -61,6 +61,11 @@ struct uclogic_params_pen_subreport { * Noop (preserving functionality) when filled with zeroes. */ struct uclogic_params_pen { + /* + * True if pen usage is invalid for this interface and should be + * ignored, false otherwise. + */ + bool usage_invalid; /* * Pointer to report descriptor part describing the pen inputs. * Allocated with kmalloc. NULL if the part is not specified. @@ -214,6 +219,7 @@ extern int uclogic_params_init(struct uclogic_params *params, ".desc_ptr = %p\n" \ ".desc_size = %u\n" \ ".pen = {\n" \ + "\t.usage_invalid = %s\n" \ "\t.desc_ptr = %p\n" \ "\t.desc_size = %u\n" \ "\t.id = %u\n" \ @@ -270,6 +276,7 @@ extern int uclogic_params_init(struct uclogic_params *params, ((_params)->invalid ? "true" : "false"), \ (_params)->desc_ptr, \ (_params)->desc_size, \ + ((_params)->pen.usage_invalid ? "true" : "false"), \ (_params)->pen.desc_ptr, \ (_params)->pen.desc_size, \ (_params)->pen.id, \ From patchwork Thu Apr 21 17:50:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= X-Patchwork-Id: 12822141 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCFC8C433F5 for ; Thu, 21 Apr 2022 17:51:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390963AbiDURyO (ORCPT ); Thu, 21 Apr 2022 13:54:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1390955AbiDURyN (ORCPT ); Thu, 21 Apr 2022 13:54:13 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6786D49CAE; Thu, 21 Apr 2022 10:51:23 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id e2so1460496wrh.7; Thu, 21 Apr 2022 10:51:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=swQTkiKjFD5ptp4W3Ja/W8eTKagq0ceNN+OGlm4hQ/4=; b=NoPiKXW+7QpOjDKp7ziLUhiCsVn1X8FjKO8AO+JWtvK9ZEZrXXM28kWkJnfsWXH6MW 5cY40nKZbGmAJRZulx5OrFs49VpNkpJ6uRKSP27CxctLa2/P6R1528Iv/tfYWr7/xF2E TF6d2AR4AVOWEtAJDTY6Khvw4JAMmo4QwwT1XcYTmZp0+ac1x67pns3W1J/+EUJAdxDh YTARN/nII2+baMOH3JIPs+z8ysYsqCLmRGUzAm4IzHwBNUqF1jSaWogUuF/HyAGid0zr tTjwFWrI2J0EJ6qhkBa+DiU1BVh12rNnu8e0iHYivIjip9J96ZzKyFXSFYka/uWZcImt xraw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=swQTkiKjFD5ptp4W3Ja/W8eTKagq0ceNN+OGlm4hQ/4=; b=rNyzQQGjitSfbvom9Csl8hCTbBOlA6KFvL5TJDPyicQH/f+8ibAQZjPGMX4xkt7Czy GOvsJrMh3p1/Tgtc9jmwguFBWr1gZYZtG9P8jj+Zrmc+YV6ZDyI5FcuxkhHv0cNqa4VH tx/FcN5Zy2ajBg5KbY9c1xAPTlgCWSdEAW6kExifOkqd6vAM51Q999Ovy9yPcPUTmxic I2WswVXDh3BGV4yHkg/zP3cHBh/WggI6GD4ScogVroDN7QrpxHuOr+hAV2wP7V4OuW09 gjBuplLN1nNmRLgKZF7u7Xk6puajgHmC1b/8xu2jN/dcJZnwAd2FyhsXv4Yd4/OC/5QA xnIQ== X-Gm-Message-State: AOAM531N8qgGhqiWaA90VtKGElYQlpYsqoYnNSJvesRWWvW80hC6x8dP H1/vcZ2OIQbZf9T6rIwMQ4QnaEo9A+U= X-Google-Smtp-Source: ABdhPJxPMncNG1jRjthRoVskLKjXa+e9urIccixdabrPtknrvZC5BkR+Y0mVLOuytrGVWUqzrrVCjg== X-Received: by 2002:adf:b64b:0:b0:207:f20d:23f0 with SMTP id i11-20020adfb64b000000b00207f20d23f0mr643640wre.11.1650563482009; Thu, 21 Apr 2022 10:51:22 -0700 (PDT) Received: from localhost.localdomain ([94.73.37.128]) by smtp.gmail.com with ESMTPSA id l28-20020a05600c1d1c00b0038ece66f1b0sm2685634wms.8.2022.04.21.10.51.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Apr 2022 10:51:21 -0700 (PDT) From: =?utf-8?b?Sm9zw6kgRXhww7NzaXRv?= To: jikos@kernel.org Cc: benjamin.tissoires@redhat.com, spbnick@gmail.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?b?Sm9z?= =?utf-8?b?w6kgRXhww7NzaXRv?= Subject: [PATCH for-5.19/uclogic 5/5] HID: uclogic: Disable pen usage for Huion keyboard interfaces Date: Thu, 21 Apr 2022 19:50:52 +0200 Message-Id: <20220421175052.911446-6-jose.exposito89@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220421175052.911446-1-jose.exposito89@gmail.com> References: <20220421175052.911446-1-jose.exposito89@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Nikolai Kondrashov Disable pen usage inputs for Huion interfaces reporting on-the-frame buttons. We don't want to change those, as they mostly work, but we want to avoid creation of a mute pen interface, confusing to users. Signed-off-by: Nikolai Kondrashov Signed-off-by: José Expósito --- drivers/hid/hid-uclogic-params.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-uclogic-params.c b/drivers/hid/hid-uclogic-params.c index b85585ac3372..22f9c4f9da8a 100644 --- a/drivers/hid/hid-uclogic-params.c +++ b/drivers/hid/hid-uclogic-params.c @@ -713,7 +713,8 @@ static int uclogic_params_huion_init(struct uclogic_params *params, /* If it's a custom keyboard interface */ if (bInterfaceNumber == 1) { - /* Keep everything intact */ + /* Keep everything intact, but mark pen usage invalid */ + p.pen.usage_invalid = true; goto output; /* Else, if it's not a pen interface */ } else if (bInterfaceNumber != 0) {