Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2305453rwi; Thu, 3 Nov 2022 15:32:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6b3nWT4dxVi1FOqT5xn1PMvDkFW2BGozDH8yJsreGpfGp2VA8LGCWAr85uL9KM62w3EZ8a X-Received: by 2002:a05:6a00:429a:b0:56b:a4f8:8f2d with SMTP id bx26-20020a056a00429a00b0056ba4f88f2dmr32363045pfb.24.1667514776935; Thu, 03 Nov 2022 15:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667514776; cv=none; d=google.com; s=arc-20160816; b=c0/41VSViwbu0HZczI70v3usvmUrUlNDepBsha9x3vlx3ZNYVRvLtxR18aeUiM6/0R ncnPnUH6vAt6IfRcOQUprqY0bwq9OMgFO5Lg/zygWN/olvLPebv6beoFp/3GjW0IQl+X QQdlBW/r+VUun/BiqgwtrFUiaVCEALgQse9Sy7MQN531v7uvCX5xURn5ggrJr/28NwKJ SwyPZxzfSjD8oBMj+Kv6OzU4AgvUB6P7DzT/FVWD6IryYZtwBV2reLN3rUXnJ7cugnc0 ou+slWzsE91jZklZSHxAtjxsZWD7TDLdbfsRvGPjOVDM5ZaQCZ1rfh85H+i4DiqryUx3 M0hA== 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=2V9i7oQTNHUJPEiwVERmKoGE2858xzC1NoyImBvZTpE=; b=JrzQvorOkhYaNFjXSgBsgurl3nK2303gYqVMbNFEbTAZwcI95xFpziVlfYmzey6tyJ Ccpja1SCv1fQQZXuOPMUFqMdPQoykqJUlcL0tsV21TnkM7WEu1c/2KmyqhDPRQz0moYo EOBFUVIeDewCe4bbRQkYuxfwWxg8a9IvIah2Yy7XNT+xRZ2Al++gyFoiyRyabOFVZSUJ OLelA2hAwlb6dlJfbViAPh06FGWh1PA38Xh3aQ/5vTc7piHJzqqtGVkkQGcg2S5AAjzr 4mf6CROmHTHr+OYp1cPeR33QKIFHTqGjKWVASDEAlgBOxbyBq7v49yTHsO8vMvve6fTb vDZA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n5-20020a63f805000000b0043946964302si2277265pgh.173.2022.11.03.15.32.43; Thu, 03 Nov 2022 15:32:56 -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 S231725AbiKCW1e (ORCPT + 98 others); Thu, 3 Nov 2022 18:27:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231349AbiKCW13 (ORCPT ); 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 1BEFC21274; Thu, 3 Nov 2022 15:27:27 -0700 (PDT) Received: from mail3.berkhan-weisser.de ([2a03:4000:54:b9a::4]) by mail.inka.de with esmtpsa id 1oqigH-005aIe-ST; Thu, 03 Nov 2022 23:27:25 +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 ) id 1oqigH-005Ggn-FY; Thu, 03 Nov 2022 23:27:25 +0100 From: Enrik Berkhan To: linux-input@vger.kernel.org Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Rishi Gupta , Enrik Berkhan Subject: [PATCH v2 1/3] HID: mcp2221: don't connect hidraw Date: Thu, 3 Nov 2022 23:27:12 +0100 Message-Id: <20221103222714.21566-2-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: X-Mailing-List: linux-kernel@vger.kernel.org The MCP2221 driver should not connect to the hidraw userspace interface, as it needs exclusive access to the chip. If you want to use /dev/hidrawX with the MCP2221, you need to avoid binding this driver to the device and use the hid generic driver instead (e.g. using udev rules). Signed-off-by: Enrik Berkhan --- drivers/hid/hid-mcp2221.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-mcp2221.c b/drivers/hid/hid-mcp2221.c index 5886543b17f3..e61dd039354b 100644 --- a/drivers/hid/hid-mcp2221.c +++ b/drivers/hid/hid-mcp2221.c @@ -1110,12 +1110,19 @@ static int mcp2221_probe(struct hid_device *hdev, return ret; } - ret = hid_hw_start(hdev, HID_CONNECT_HIDRAW); + /* + * This driver uses the .raw_event callback and therefore does not need any + * HID_CONNECT_xxx flags. + */ + ret = hid_hw_start(hdev, 0); if (ret) { hid_err(hdev, "can't start hardware\n"); return ret; } + hid_info(hdev, "USB HID v%x.%02x Device [%s] on %s\n", hdev->version >> 8, + hdev->version & 0xff, hdev->name, hdev->phys); + ret = hid_hw_open(hdev); if (ret) { hid_err(hdev, "can't open device\n"); @@ -1145,8 +1152,7 @@ static int mcp2221_probe(struct hid_device *hdev, mcp->adapter.retries = 1; mcp->adapter.dev.parent = &hdev->dev; snprintf(mcp->adapter.name, sizeof(mcp->adapter.name), - "MCP2221 usb-i2c bridge on hidraw%d", - ((struct hidraw *)hdev->hidraw)->minor); + "MCP2221 usb-i2c bridge"); ret = devm_i2c_add_adapter(&hdev->dev, &mcp->adapter); if (ret) { -- 2.34.1