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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 05D82C433ED for ; Thu, 15 Apr 2021 19:28:24 +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 505716113D for ; Thu, 15 Apr 2021 19:28:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 505716113D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bolhuis.dev 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 1lX7el-0005ko-F3; Thu, 15 Apr 2021 15:28:03 -0400 Received: from mail-wr1-f47.google.com ([209.85.221.47]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1lX7ej-0005jX-F7 for kernelnewbies@kernelnewbies.org; Thu, 15 Apr 2021 15:28:01 -0400 Received: by mail-wr1-f47.google.com with SMTP id h4so15375041wrt.12 for ; Thu, 15 Apr 2021 12:28:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zYmjbqHfhmrFVnTQ3VYkIiAExM310ub0fS2/jpyKjcU=; b=SP2hJD2p64qi+FlCeMq2u7zHV1K6D7Xc0OKQ8Grv31zbrkz+PVWcFc+9mHZB4piKFx nsIwEKo8unDHveWX9E0Fwe+ttzUhMGGLUpXOIAd1R82tJhGXbEXxdcMfCls2yJbptrjM 4WJLm+BRjDU/XIg0re+wjpBA7TOVMW6Q2DH0TNcdduV1noDDGgTizdvIdUp2T3xCr3zF UIX/zSVeHGMdlisqVlRqhW26bade9LmjCG4CZcK06va9b9gGbqvSing3WZuiQ5tw+CIw VfdRTIXHZDRTc29eGethoDExsdMqIv2Vj0Rwq/mmCGlCHHcflMhcDH2iJ0wVIkhIDmkD YOCw== X-Gm-Message-State: AOAM531OpOFtzZjKng4Drv+Sns88l27Q1cxAV0Jnk/6j7jHxveVlfX53 jv6tXfTKhtBC36lBU/hdRGQCdvNzzrRfTA== X-Google-Smtp-Source: ABdhPJw72mIiL9vU6C5ubF+WxWF6yU93A6A36E8861dSRSE2sjdpg8r8ImKDlYEEU15bzVjaImik/Q== X-Received: by 2002:a5d:460b:: with SMTP id t11mr5245735wrq.310.1618514880210; Thu, 15 Apr 2021 12:28:00 -0700 (PDT) Received: from [10.0.2.1] (82-71-24-115.dsl.in-addr.zen.co.uk. [82.71.24.115]) by smtp.gmail.com with ESMTPSA id t19sm4386903wmq.14.2021.04.15.12.27.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 15 Apr 2021 12:27:59 -0700 (PDT) Subject: Re: HID Monitor Driver Advice To: Greg KH References: <43f7b6ac-0fa9-7e36-6d8c-f0fc54d4566d@gmail.com> From: Mark Bolhuis Message-ID: Date: Thu, 15 Apr 2021 20:27:58 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: kernelnewbies-bounces@kernelnewbies.org On 15/04/2021 16:44, Greg KH wrote: > 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? > > 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 A couple reasons. These might be misplaced since I'm very new to kernel programming. I would like to create very simple user space scripts and programs on top of it. I'd like to change settings with nothing more than an `echo 200 > brightness`. Something has to keep track of an internal state, which I'd rather not happen in userspace apps, so I decided on a driver. I'd like to eventually use linux/backlight.h to control brightness which, correct me if I'm wrong, has to be used from a kernel driver. Or is this an unsuitable use case? I assume you are referring to uhid? I've got no issue using it but my initial impressions led me to think it wouldn't have been as elegant. Again I could be wrong. I'll do some more research on it. Thanks Mark _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies