Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp76223rwb; Mon, 26 Sep 2022 15:03:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5XcSnw+pItlAYMU+W26g2bR3FxyRitzc07DeiLXjcnSY0Ucwx7Ao6SsQp5vQtmJ8LSZmti X-Received: by 2002:a65:6944:0:b0:43c:da07:5421 with SMTP id w4-20020a656944000000b0043cda075421mr3100247pgq.72.1664229788281; Mon, 26 Sep 2022 15:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664229788; cv=none; d=google.com; s=arc-20160816; b=njwFT4f8Dge9B6Vixtf7XdR9yAcbxr7LndEajpPRqfXrJvedvOo/a+WniBi/R8xqUz MzHj/yvyYtcRRp0IQQpLKGGNq3rywClzy+pSck3xZbjGbSvkw8y7t7HWPBbNhhENREp3 V3yMJ0pHfxqhTpGWfdn+LmBg3t0Yc58EyX7chPMmnFGRGUv4aNKHu5MORXQO9W8s4cjd p1wDRB/GXdCwucM7iRTu5Ha8HgpYKjh5nmmsEwcbrrPEqYZ/EgzbVoioSCO6NJKqFE2t Z2qWQpY7rd4ly/BCl/zjDu/IFDuKqOmjLgz3zcR3jBINEE95v8ARylj2tvkanhgB6abD 4VWA== 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=XNWvFxWhlrgWWeMy9e3xMUv0UDvHP6ifP1f9Uz7oZr0=; b=yRjyFQJWwyoOLKesSDtz1/Q11Wl58KWPP1hbgdY2UkzCm22IfHzWPrWP8D1GJZ9PR9 44ZMbJThQjnnmmXJvAldQtYbn2mdYzzJjAiomZuBJzHU46SA0rwrX/WVUupVNBfP76hh Yy2O/Gu2UVqoaume1tbMAZKoAFqIaB6n9mUWklaAI7QOzb2KUPYXHco4gTQrNunynzE5 Nc1M9BM0tT7niKht7xHQ9RNMwheif07cao9/e5Zpbx7YvzU0EWL2MGkVmkmF9ecZtIDE PkNFkuWeRG0JKm8a2tn1td8/napE8k468w2REBUGq9y7c34GQiqlfiRILBI1rcUtzk4U TPoQ== 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 b8-20020a170902e94800b00179cfba6f86si7791283pll.84.2022.09.26.15.02.54; Mon, 26 Sep 2022 15:03:08 -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 S230518AbiIZVUo (ORCPT + 99 others); Mon, 26 Sep 2022 17:20:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230356AbiIZVUi (ORCPT ); Mon, 26 Sep 2022 17:20:38 -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 54E2F72B73; Mon, 26 Sep 2022 14:20:37 -0700 (PDT) Received: from mail3.berkhan-weisser.de ([2a03:4000:54:b9a::4]) by mail.inka.de with esmtpsa id 1ocudK-003t0f-VS; Mon, 26 Sep 2022 22:23:19 +0200 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 1ocudK-007Trr-J6; Mon, 26 Sep 2022 22:23:18 +0200 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 v1 1/4] HID: mcp2221: don't connect hidraw Date: Mon, 26 Sep 2022 22:22:36 +0200 Message-Id: <20220926202239.16379-2-Enrik.Berkhan@inka.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220926202239.16379-1-Enrik.Berkhan@inka.de> References: <20220926202239.16379-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=unavailable 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 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/hid/hid-mcp2221.c b/drivers/hid/hid-mcp2221.c index de52e9f7bb8c..0ca2a7b96825 100644 --- a/drivers/hid/hid-mcp2221.c +++ b/drivers/hid/hid-mcp2221.c @@ -840,12 +840,17 @@ 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"); @@ -870,8 +875,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 = i2c_add_adapter(&mcp->adapter); if (ret) { -- 2.34.1