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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS 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 3D3A1C43381 for ; Fri, 29 Mar 2019 03:23:22 +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 E802621850 for ; Fri, 29 Mar 2019 03:23:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E802621850 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=vt.edu Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.91) (envelope-from ) id 1h9i6M-00088H-SF; Thu, 28 Mar 2019 23:22:42 -0400 Received: from omr1.cc.ipv6.vt.edu ([2607:b400:92:8300:0:c6:2117:b0e] helo=omr1.cc.vt.edu) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1h9i6J-00088B-GC for kernelnewbies@kernelnewbies.org; Thu, 28 Mar 2019 23:22:39 -0400 Received: from mr4.cc.vt.edu (smtp.ipv6.vt.edu [IPv6:2607:b400:92:9:0:9d:8fcb:4116]) by omr1.cc.vt.edu (8.14.4/8.14.4) with ESMTP id x2T3MXBV011247 for ; Thu, 28 Mar 2019 23:22:33 -0400 Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by mr4.cc.vt.edu (8.14.7/8.14.7) with ESMTP id x2T3MSN1019429 for ; Thu, 28 Mar 2019 23:22:33 -0400 Received: by mail-qk1-f199.google.com with SMTP id w124so635271qkb.12 for ; Thu, 28 Mar 2019 20:22:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:date:message-id; bh=neJ9E31xszXagycz7L1EkvlNo7imMXHHlqaBVzbVBTI=; b=EBQg2nQ0RddHylPWtXFn+1vYg9E90VVFZtEHyJxN7+ryc02WXmXSO0bDuOkVvvZTdD 40NDHATt3IJ2EEeS8vI4sbg71LF7p8lfDKjFRsDlX1U0UFLSaxUYuKaPJR8OfPumUd0h Wt4Cb5Sx3zHYmXbbLyz2h7+c0Fq/hqPdmIXnTfXPdZ/+vfBsqJ9UFH6/gycBhVtqxp9o KlvjDNPdvb3oJoRfsUmbGg0ZQx0LeIYZ2+ddtcuSua9xE+LN+mdI0zKzJKsQojnLwQCO 2lxZ3VeUrOjKOEkpxMbXfiLGGZrTUmiao1mEjJX8bI3TmWHlwdVRLDR4Dhxdt3ObCfHo KVkw== X-Gm-Message-State: APjAAAXuJ3jPooFOyr/TCp+OPYV/YjFJMD85mjZT9RM2L481D3w761V/ KkmK14LjtSCmMy70H+NROxHcHU+40ZtjQjHVoze4vKfG9PQY7mwRROMntoSte6VvoZInyzv9Tsj xDKp/tZAPYW/7d0/cXx+i+fO46XNM2LTrn2MSwC4= X-Received: by 2002:ac8:348d:: with SMTP id w13mr37857484qtb.329.1553829748291; Thu, 28 Mar 2019 20:22:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOFV5S44fwRx5y5IPYx+SSZNINRN2z5jbZtF9P8sLEUcq2m/Z/UdDZuM4N69oZMTjkIlQrZQ== X-Received: by 2002:ac8:348d:: with SMTP id w13mr37857476qtb.329.1553829748128; Thu, 28 Mar 2019 20:22:28 -0700 (PDT) Received: from turing-police ([2601:5c0:c001:4341::208]) by smtp.gmail.com with ESMTPSA id u18sm512840qka.25.2019.03.28.20.22.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Mar 2019 20:22:26 -0700 (PDT) From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Google-Original-From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev To: Dave Stevens Subject: Re: maintainer for this update? In-reply-to: <20190328145328.61fa7f95@dave-900X1B> References: <20190328145328.61fa7f95@dave-900X1B> Mime-Version: 1.0 Date: Thu, 28 Mar 2019 23:22:26 -0400 Message-ID: <14034.1553829746@turing-police> 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, 28 Mar 2019 14:53:28 -0700, Dave Stevens said: > In the article below about kernel updates is a reference to a driver for > a Plantower PMS7003 particulate matter sensor. I'm using this series in > air pollution monitoring and its usual interface to the computer > is over a serial line. I consequently am very curious about how and why > it would need a specific kernel module. A quick look at the driver shows that it apparently does at least a little bit of the heavy lifting for you - rather than you have to do all the serial I/O interpretation yourself in userspace, it will handle checksums and channels and so on for you. +enum pms7003_cmd { + CMD_WAKEUP, + CMD_ENTER_PASSIVE_MODE, + CMD_READ_PASSIVE, + CMD_SLEEP, +}; + +/* + * commands have following format: + * + * +------+------+-----+------+-----+-----------+-----------+ + * | 0x42 | 0x4d | cmd | 0x00 | arg | cksum msb | cksum lsb | + * +------+------+-----+------+-----+-----------+-----------+ + */ +static const u8 pms7003_cmd_tbl[][PMS7003_CMD_LENGTH] = { + [CMD_WAKEUP] = { 0x42, 0x4d, 0xe4, 0x00, 0x01, 0x01, 0x74 }, + [CMD_ENTER_PASSIVE_MODE] = { 0x42, 0x4d, 0xe1, 0x00, 0x00, 0x01, 0x70 }, + [CMD_READ_PASSIVE] = { 0x42, 0x4d, 0xe2, 0x00, 0x00, 0x01, 0x71 }, + [CMD_SLEEP] = { 0x42, 0x4d, 0xe4, 0x00, 0x00, 0x01, 0x73 }, +}; So you can send 'wakeup' or 'read' and it will send the strings, and then read back data and complete the I/O when enough bytes have arrived. There's also some probing in there to deal with device tree etc. _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies