Received: by 10.192.165.148 with SMTP id m20csp3430278imm; Mon, 7 May 2018 12:08:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoZa5UylULIbVw71uZT4wY1ztKqbwD6c6V9XKv4nfMLZPl/3l3ZEkSZj7wzr6E1uRnruiSl X-Received: by 2002:a65:5807:: with SMTP id g7-v6mr30400173pgr.409.1525720135920; Mon, 07 May 2018 12:08:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525720135; cv=none; d=google.com; s=arc-20160816; b=putZaRGyKEroBILr84FmKlk/+B9m+cvn6hzbww5AkiNQyvc7U0uGBK+d6pNvpupmrO XWga8GNzc8H+UjnNw7fkByuR0+WXeSjW2TEM48z6lGw47xTNLuOYgyWT7G22LriA/5Rj ZTb4ZqBwOlqfxMPO7RSSsu0r3KflPgNgG+4rjGnWlhdsXaUnodwtAO2Di8HHTgVwCmNy YNPIjDCsSo24uwMFV7AXGMtgSHzdWucrsEyb7xAty8hdilQTZYwf9NLKszPJSQFi+px3 S0N1fKfMNiHD/sDaHdntNF9wzMICt8EDuea+jAbX6hhSOCEP/CMOk5hv+kE5NreEnIDM K0uQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:arc-authentication-results; bh=I09PplxQseWIoWTK0QZs5ZLpTeKfvXJXVblu2NE7feg=; b=m9BJB9Y9yX7IKTGsNpaEr8KhyyMNmHrOS7VKFAw4vSj+fOKfiWblAkym+mncytqtGI inPPo25e9yyTu/RIt+Wiutju+o6G2GzspjasqlgeDqc748n3TN7D15foZvAlkdLjFZPV zhnjGUVjmYXEWQYHthPtNYatMoXrV+6aF4OIwFDWcVuMsSrPdtLaWb9RsehhP9q9jblT CZ1wE6UdixAKZXSVwKUS+2qxWAe3HoaYnBbtytnYrpRmIgiKbf6c8AEqdBrII38EGqxm RJsABo4qiC8uw/8x9Ir6h1NjgKSGZANAtNAj23dDsXfV7KgMETsF7GpY+TQjYMdWGXuM sbhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10-v6si16385571plq.547.2018.05.07.12.08.40; Mon, 07 May 2018 12:08:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752706AbeEGTGs convert rfc822-to-8bit (ORCPT + 99 others); Mon, 7 May 2018 15:06:48 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:46461 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752335AbeEGTGr (ORCPT ); Mon, 7 May 2018 15:06:47 -0400 Received: from marcel-macpro.fritz.box (p5B3D2CDF.dip0.t-ipconnect.de [91.61.44.223]) by mail.holtmann.org (Postfix) with ESMTPSA id 2E823CEE02; Mon, 7 May 2018 21:13:14 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: [PATCH 0/7] gnss: add new GNSS subsystem From: Marcel Holtmann In-Reply-To: <20180507102056.GU2285@localhost> Date: Mon, 7 May 2018 21:06:44 +0200 Cc: Sebastian Reichel , Greg Kroah-Hartman , Rob Herring , Mark Rutland , Andreas Kemnade , Arnd Bergmann , "H . Nikolaus Schaller" , Pavel Machek , LKML , devicetree@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: References: <20180424163458.11947-1-johan@kernel.org> <20180504132741.brn5jqv5ufjhp7ky@earth.universe> <20180507102056.GU2285@localhost> To: Johan Hovold X-Mailer: Apple Mail (2.3445.6.18) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Johan, >>> This series adds a new subsystem for GNSS receivers (e.g. GPS >>> receivers). >>> >>> While GNSS receivers are typically accessed using a UART interface they >>> often also support other I/O interfaces such as I2C, SPI and USB, while >>> yet other devices use iomem or even some form of remote-processor >>> messaging (rpmsg). >>> >>> The new GNSS subsystem abstracts the underlying interface and provides a >>> new "gnss" class type, which exposes a character-device interface (e.g. >>> /dev/gnss0) to user space. This allows GNSS receivers to have a >>> representation in the Linux device model, something which is important >>> not least for power management purposes and which also allows for easy >>> detection and (eventually) identification of GNSS devices. >>> >>> Note that the character-device interface provides raw access to whatever >>> protocol the receiver is (currently) using, such as NMEA 0183, UBX or >>> SiRF Binary. These protocols are expected to be continued to be handled >>> by user space for the time being, even if some hybrid solutions are also >>> conceivable (e.g. to have kernel drivers issue management commands). > >> Great work. I like your design decisions. I have quite a few devices >> with have non-serial based GPS peripherals using binary protocols (*). >> As far as I can see it should be possible to add support for those. > > Thanks! Yeah, the aim here was to abstract the actual I/O interface > used. > >> I have one concern, though. While providing raw data by >> default is fine generally, it is a problem with device >> auto-discovery. I think there should be some IOCTL from >> the start, that can be used to inform userspace about >> the raw protocol being used (i.e. "NMEA"). I fear, that >> userspace may start to just assume raw = NMEA without >> having this (especially since all initial drivers provide >> NMEA). > > One problem I see here would be that the driver does not necessarily > know either what protocol is currently being used. Some devices have > boot-pins which can be used to configure the initial protocol used (and > this could perhaps be reflected in DT), but this can often later be > changed (by user space) and even be made persistent using battery-backed > ram or eeproms. > > Also note that at least u-blox devices supports having more than one > protocol active on the same port... as long as userspace can determine that it is GNSS hardware and what hardware it is, then you deal with the rest in userspace. Regards Marcel