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=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 E2DCBC433ED for ; Thu, 15 Apr 2021 15:44:37 +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 686B76115B for ; Thu, 15 Apr 2021 15:44:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 686B76115B 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.94) (envelope-from ) id 1lX4AR-0007Xu-Gp; Thu, 15 Apr 2021 11:44:31 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lX4AP-0007Xl-8l for kernelnewbies@kernelnewbies.org; Thu, 15 Apr 2021 11:44:29 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id C99C55C00E9; Thu, 15 Apr 2021 11:44:26 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 15 Apr 2021 11:44:26 -0400 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=dF6OM7VrNAqAied1c9D9ZnYvliy FGM6Di0Jh3Cbqd0s=; b=gM2oqLkmi0D8IXpFhgcjxlxenkSxZmrMXxWapcEJE4i EgHWvIqUmmO2QRIRT71dAVEnc7aVnyaBf5TEVsQwlMaurxgI1gR5GuHHhqls/3HF bgtPvCiMjKcKO8qxRGesoX3q+j1qo3FaYmCXHqJboQ96w5kuc70dHjWGqfItpxBr bGs1k3Wx4FSBuwWo2j/4EnfRhQh/3BL4g1S+jgrNF82ir8x/ugRtFUqwErrW2ekQ cBWkwHGFSIQfDfqfreyDIMAklLNTqBgPsR+YgHlEj3RwW1QoZYqrqCKY8BI36orK 3ro+8zzrKuUUpn/lSYP2np8jeuQBUk2yKfINYE9NBew== 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=fm2; bh=dF6OM7 VrNAqAied1c9D9ZnYvliyFGM6Di0Jh3Cbqd0s=; b=outHsE3xGix40WmwkdewTG CVo7kBx6oj0dJKfIdge/75Ea7E2aS613o+jXVE5JW6Pw9HT35r1CgdRGBM16FVSK tEXtEPkTUDfVmZBpemR2jwvKbhfTMPmcBD6TEKDv1GovYciWkmzaSD8ggmU06Ygg iKcp2hVFccrKcELzI1Mf5AfaIkenwGvnpNBkQtbqPq8KSBOWAZ1NQqKA3nmDJFdw Y90wXJ98Oa/voh22EiNJ6QhWBf1IM4LM0yGpzfWhPWVCCYnY+tJ8Z/vVb7pfmDCA rai3nXpiqX8Viaa5VD7QIbBbD5XiIb8I8kWcTcWAuQd0ESQe9WDTxeYUSSvZs/iA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudelfedgleejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujgesthdtre dttddtvdenucfhrhhomhepifhrvghgucfmjfcuoehgrhgvgheskhhrohgrhhdrtghomheq necuggftrfgrthhtvghrnhepgfetfefftedvffeltdegudduteffuddtudevfeevtdeuge eugefgieetheefteefnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepkeef rdekiedrjeegrdeigeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomh X-ME-Proxy: Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) by mail.messagingengine.com (Postfix) with ESMTPA id 5AC02108005B; Thu, 15 Apr 2021 11:44:25 -0400 (EDT) Date: Thu, 15 Apr 2021 17:44:22 +0200 From: Greg KH To: mark@bolhuis.dev Subject: Re: HID Monitor Driver Advice Message-ID: References: <43f7b6ac-0fa9-7e36-6d8c-f0fc54d4566d@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <43f7b6ac-0fa9-7e36-6d8c-f0fc54d4566d@gmail.com> Cc: kernelnewbies@kernelnewbies.org 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 Thu, Apr 15, 2021 at 04:35:45PM +0100, mark@bolhuis.dev wrote: > Hi all > > My name is Mark and I'm currently writing a device driver for Eizo EV > FlexScan monitors, so that I can control them over usb. This driver is built > by reverse engineering the hid reports sent by the propriety and windows > only software. > It can be found here: https://github.com/markbolhuis/openeizo > > I have some questions about this that hopefully somebody can answer. > > 1) What would be the recommended way to interface this with userspace? My > plan is to expose a device file for each unique setting that the monitor has > such as brightness control, input selection and so on... However I'm not > sure this is a suitable way of doing this since the monitors have many > options that are very similar. For example contiguous numerical values only > differ by their usage and value min and max, meaning that if I have a file > per setting there will be a lot of repetition. There are already 40+ unique > attributes/settings that may need a file. Why do you need a kernel driver at all? Why not just use the userspace hid access and control stuff that way from an application? > 2) To properly initialize the driver I will have to fetch a second report > descriptor from the monitor. This isn't a standard hid report descriptor. It > seems that Eizo are simply using the format instead of inventing their own. > Is there a way for the hid subsystem to parse arbitrary report descriptors > and expose them as a structure for generic use? I couldn't find much that > would help with this. hid_parse_report @ inlcude/linux/hid.h:895 seems to be > the closest to what I need but it's tied to a device. If you write your own driver, you can do that from within the driver I think. But again, what's wrong with userspace? thanks, greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies