From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE1A5C35247 for ; Mon, 3 Feb 2020 20:11:30 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A2A5020658 for ; Mon, 3 Feb 2020 20:11:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="Qv674iz3"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="k05LhfQR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A2A5020658 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1iyi3y-000179-QL; Mon, 03 Feb 2020 15:11:18 -0500 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1iyi3v-000133-7p for Kernelnewbies@kernelnewbies.org; Mon, 03 Feb 2020 15:11:15 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 9FA78620; Mon, 3 Feb 2020 15:11:09 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 03 Feb 2020 15:11:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=eXexG+w6L+PM0op3BGlAQkmxCaW k7+H6cHWmkLVOCoE=; b=Qv674iz3pibLi4H8rPS3ei76CmF8gFrFImfFh+m0b5o wHEr/iieG/m3/vl3Jp+1s+42xVCjvm5btf8E3BV7HKR0fTZlPYgOboQp/oOfCPHs Z8PnGfh/jCR22vngTmO4e5L+Rw7/UCuu73GzgXMvcGjQ7cnsJasjM+NWeImt69XE Fuu4bNQfTl3KF4CLH2tvOTd81rBp82kFIFgMl0cI54SnqUb2ZSyX/aNJ8COo+/Hz eWM0pL9uNqUlNanZsfdyqepTYV2oP8EZKLgyeeS4LVH37gH1Hu/qsodIrfxKl5R9 Mz40TeWaBuEJCG4PAKkhKYM5GRYkMwwyyWjklMCnu2A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=eXexG+ w6L+PM0op3BGlAQkmxCaWk7+H6cHWmkLVOCoE=; b=k05LhfQRBIbW443ydF5sQS EuaMn+rqxV15fXf6fDJiKvI+6y/XrHdi9MGCYrPjNDUCO0AXxGMKP4pOoErzZlns 8w2vGhKDLIZEQLrTqZW1FPS21yQXu9J8k8cpjI67K3rpecfsx34uWM+nuti8jhnI rbpdXpLrMmHEZszv6uhZQedkpR71GhZzLLufFvjsvUxg8DOi8CCiRnzA356rdsZu YXLYWg5H7BFHe5gx0UD5GB6M36969w828CFWmjMG+L69KXQWYUYzIK2no1z6kUR8 FRVq54sJ2JN19OZvPbGyg/IeXJ0Lx3SAxEg93l9J1blcLCoSLe0nWxt1ynxVz7SQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrgeejgddufeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefirhgvghcu mffjuceoghhrvghgsehkrhhorghhrdgtohhmqeenucfkphepudekhedruddtgedrudefie drvdelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhep ghhrvghgsehkrhhorghhrdgtohhm X-ME-Proxy: Received: from localhost (unknown [185.104.136.29]) by mail.messagingengine.com (Postfix) with ESMTPA id 7581430605C8; Mon, 3 Feb 2020 15:11:05 -0500 (EST) Date: Mon, 3 Feb 2020 20:11:02 +0000 From: Greg KH To: Lucas Tanure Subject: Re: USB Hid driver Help Message-ID: <20200203201102.GA3888053@kroah.com> References: <9c5082fe870a01cac0b1a7861c0c5a74e794963f.camel@surriel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Cc: kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Mon, Feb 03, 2020 at 04:32:46PM +0000, Lucas Tanure wrote: > Hi, > > I'm trying to write a Hid driver for MCP2210. What type of device is this? > But the USB Hid specification is quite complicated. The kernel should do it "all for you" already, why do you need to create a custom HID driver for this device? What type of HID reports does the device export and why doesn't the existing kernel drivers work for you? > I would like to know how to send and receive data to the device. Any > links to a good tutorial ? HID has the idea of "reports" and data comes in and out in that specific format, all depending on how the device describes itself. There's isn't usually a normal "send/receive" type of thing, but it all depends on the type of device. > This is my current driver is attached. > > Thanks > Lucas > #define DEBUG > #include > #include > #include > > static int mcp2210_probe(struct hid_device *hdev, > const struct hid_device_id *id) > { > struct usb_interface *intf = to_usb_interface(hdev->dev.parent); > int ret = 0; > > hid_dbg(hdev, "%s\n", __FUNCTION__); > > ret = hid_parse(hdev); > if (ret) { > hid_err(hdev, "parse failed\n"); > return ret; > } else { > hid_dbg(hdev, "parse success\n"); > } > > ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT); > if (ret) { > hid_err(hdev, "hw start failed\n"); > return ret; > } else { > hid_dbg(hdev, "start success\n"); > } Does this all work? What fails? thanks, greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies