Message ID | 20221103222714.21566-3-Enrik.Berkhan@inka.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp30366wru; Thu, 3 Nov 2022 15:32:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4wMAaRyMHIz+iZL3YP8ByS81lkpQ7+uFXfRAn3oHs3CFWDV66VxM618BeOlVObXTVAaLlB X-Received: by 2002:a17:902:f54c:b0:187:1974:2298 with SMTP id h12-20020a170902f54c00b0018719742298mr25191936plf.50.1667514748311; Thu, 03 Nov 2022 15:32:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667514748; cv=none; d=google.com; s=arc-20160816; b=00B2YNz7mCRYdiMP3k197o7qUgHoVemhlcFVLC/QhbaIQ3WmiwGs5WTBiAhfzwahNP 99J9SsXQVxmCAXm9c4+uwyxhiVj+KPIJYnlkd19jeFCU6dojMHVi75LrCH29f8D1LZyU d8TzYXZH35aGA7wh2JkH7kguLcA1OJX060Z/1Gf/L0v+OKzvvHAwSNTKkZjMg04F2SJB O7hESRkMqfj0te3eVgDo8E293YCoah8qeVV0fh2Ma02IVvrHIcBLqgxPvbXSDcWBoCw7 u/KOE5g351FNOWTm7B+OeAubFhAltGY1qMDwVL9xncIjPN7TSTCA8YjsfBP05piPaxsK fjNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=59FBwAeroTKaIV20DkKsMcitTiSHpuFKo/q1qhLyBe8=; b=AIwNLQsx4T4YyZ/4NQIcSI2E7OByk8M3UzyaCNLrF5obVWW98yESc3NiMQZGxLsT07 zFs9vVR2pa/YJ+Uc7p/dRIZ8bmNK0/I9XuhZxsDhB1FygbjxrRsfmCr6AsVh8l4vgdfs 3i24Xy5UdAlqaT1ck60sBa1pyW0ngqdOqa/4xTnZJ2OJaLUv2Jqf7RTaofj9in7DfBcE Sh5Z0hgkh/xsZqJUQgzTS6IFKqNXk9T0YIEn1J4MGRqjn/AmYqvLU4t1YBNpLqvpaKUa yYEfoa8yO1mxfQGqrAQ4b+fBfC7OsK1at/+0wFEqLnHAUC82/eIukodV8yPnpiRmaWtT 17dg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 14-20020a63060e000000b00438854c876esi2371212pgg.419.2022.11.03.15.32.09; Thu, 03 Nov 2022 15:32:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229567AbiKCW1j (ORCPT <rfc822;yves.mi.zy@gmail.com> + 99 others); Thu, 3 Nov 2022 18:27:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231708AbiKCW13 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 3 Nov 2022 18:27:29 -0400 Received: from mail.inka.de (mail.inka.de [IPv6:2a04:c9c7:0:1073:217:a4ff:fe3b:e77c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7453120358; Thu, 3 Nov 2022 15:27:28 -0700 (PDT) Received: from mail3.berkhan-weisser.de ([2a03:4000:54:b9a::4]) by mail.inka.de with esmtpsa id 1oqigI-005aIq-38; Thu, 03 Nov 2022 23:27:26 +0100 Received: from 127.0.0.1 (helo=localhost.localdomain) by mail3.berkhan-weisser.de with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.94.2) (envelope-from <Enrik.Berkhan@inka.de>) id 1oqigH-005Ggn-MS; Thu, 03 Nov 2022 23:27:25 +0100 From: Enrik Berkhan <Enrik.Berkhan@inka.de> To: linux-input@vger.kernel.org Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Rishi Gupta <gupt21@gmail.com>, Enrik Berkhan <Enrik.Berkhan@inka.de>, Tobias Junghans <tobias.junghans@inhub.de> Subject: [PATCH v2 2/3] HID: mcp2221: enable HID I/O during GPIO probe Date: Thu, 3 Nov 2022 23:27:13 +0100 Message-Id: <20221103222714.21566-3-Enrik.Berkhan@inka.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221103222714.21566-1-Enrik.Berkhan@inka.de> References: <20220926202239.16379-1-Enrik.Berkhan@inka.de> <20221103222714.21566-1-Enrik.Berkhan@inka.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748515944486099271?= X-GMAIL-MSGID: =?utf-8?q?1748515944486099271?= |
Series |
Fixes for the mcp2221 HID-to-I2C-bridge driver
|
|
Commit Message
Enrik Berkhan
Nov. 3, 2022, 10:27 p.m. UTC
As soon as the GPIO driver part will be enabled in mcp2221_probe(), the
first HID reports will be exchanged with the chip because the GPIO
driver immediately calls mcp_gpio_get_direction(). HID I/O has to be
enabled explicitly during mcp2221_probe() to receive response reports.
Otherwise, all four mcp_gpio_get_direction() calls will run into the
four second timeout of mcp_send_report(), which will block the driver
for about 16s during startup.
A very similar patch appeared some time ago in
https://lore.kernel.org/r/20210818152743.163929-1-tobias.junghans@inhub.de
which obviously got lost somehow.
CC: Tobias Junghans <tobias.junghans@inhub.de>
Signed-off-by: Enrik Berkhan <Enrik.Berkhan@inka.de>
---
drivers/hid/hid-mcp2221.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/hid/hid-mcp2221.c b/drivers/hid/hid-mcp2221.c index e61dd039354b..0705526231ec 100644 --- a/drivers/hid/hid-mcp2221.c +++ b/drivers/hid/hid-mcp2221.c @@ -1178,6 +1178,9 @@ static int mcp2221_probe(struct hid_device *hdev, mcp->gc->can_sleep = 1; mcp->gc->parent = &hdev->dev; + /* Enable reception of HID reports during GPIO initialization */ + hid_device_io_start(hdev); + ret = devm_gpiochip_add_data(&hdev->dev, mcp->gc, mcp); if (ret) return ret;