Received: by 10.192.165.148 with SMTP id m20csp4261580imm; Tue, 8 May 2018 05:48:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrIybdUNXOFPZRKo7lgPmmuUTMDEvMukwN+Jsfox6a657SY/hTqXjojflEb3EoD5wKHbmn0 X-Received: by 2002:a65:4d8f:: with SMTP id p15-v6mr28781803pgq.305.1525783736359; Tue, 08 May 2018 05:48:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525783736; cv=none; d=google.com; s=arc-20160816; b=sDa4lrATkonw9CBWXADleTZnRDtM4hEyK1/Jhf0ccDiNl+GzCkyxGgza3xUjsEc0YP sbt272MSFd24Bf70WGNwos8y0r6I/W09nC+KzOOCJEgysh3m/kwApFGLJLq6vYWK+G9t P7r/H0QiKgVwhqbMxkPq3yu8OWmZIk7iew0QjKfjCi4OlV2nPz+oG0OHkQIEkxvUq8T7 ILs7ORqkpz2C6f2II830818j5ijFdRndVRmGPiIX9sFQGYTuYnSyf3o6r8+YTyTOtMRY ToF6yUAd/8of4pBP+6kxZYNbo1Fq/2QU9/MJAOyvUTC5gJGv1SsIx8DolFzUIG/zyV7r E8ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=lOUdg38FdZpP/EvBnayExlUjPHkqeEW+gKj6rCm26WE=; b=LcXcui7dpMhmTHiEjmrLu3FeNv38wSAJHnr9OwpQccy9xhMtxpTG4LOPEi064Cwqqm yNITH6jF6/xfUtLGWz6dvkKsDjpjBfa3M13mtKwAmrXgKSwWcCI5uyS6+U/tzp4WtqJm DDUdfPdlb8eGH6hojzU3EzjTnxP8QVVqu7yAWXaKpt6uKF4N6sZ1qPYxahNTfRyptVCQ f0tsSBMB0MYk2m7caDTG9hC90AUicWcPp1qB2Q4uPnqp+huYQlukouTpmFsBzU72WlfA 1mhDqWJRM1SERhGDNsWy4mL4iKIFY5T2TLm7C1Z+OFG5zNY9vHRFA5631wH/gdvUx1ug vCVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=uqYPoNRm; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bi12-v6si4090836plb.555.2018.05.08.05.48.42; Tue, 08 May 2018 05:48:56 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=uqYPoNRm; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755014AbeEHMsX (ORCPT + 99 others); Tue, 8 May 2018 08:48:23 -0400 Received: from mail-lf0-f44.google.com ([209.85.215.44]:44010 "EHLO mail-lf0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754297AbeEHMsV (ORCPT ); Tue, 8 May 2018 08:48:21 -0400 Received: by mail-lf0-f44.google.com with SMTP id g12-v6so45653323lfb.10; Tue, 08 May 2018 05:48:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lOUdg38FdZpP/EvBnayExlUjPHkqeEW+gKj6rCm26WE=; b=uqYPoNRmricLAtBNLRcR/HHduYfaZE1dibFm5gV3dHVk4K6Q/KH/KOVhykX5oeDdL9 7UAmtGOHZOKPi37jyV2zRwdySptLyOPJlzb/yKywydpLMriBEvANtZLYWomPl5nJjXM5 BLxv59Nyd6VvMBjvQY1A7Sfhy8bYDAlXKd3aoj3fbgUF4KObxHZlKqK3rE6ghA9vU0ty 46P93AsnZn8Sn7XrRAatWVEbwwXi4HXsulfHaFwkuZItQCWLALRJLtmCOgh9NxZS2O7C NTzbGdZOFMK1toNsiAYoVCFakkybB4mP/44n+yF4wJX5MmZ5SJKauzTxoVInogCge2GR QPmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=lOUdg38FdZpP/EvBnayExlUjPHkqeEW+gKj6rCm26WE=; b=cr11kSwnzZs7uUlMwtrh7/1tRe9sUZ0QDN0Lef94p/zOd+GL5bfAt6pbaR+wiIbddw 943ZLBshovegJ6rft81G3IA5Ka6ZEDmEFYnP/e8UXF1uE31dGd8msCEs99exklckLv/E GY8FNF9GwZTR5VKKdGE0q1GHyyQPLl4g9MR0kNOlEXdwtBA98NPnutnxlp1ETWEzYSzi sJSh0bb9ou0oC6dx0K1J1DNnMAFS5UnqLEliYZszSqUtiFvMaO86zXN5h2cg+Sc1AK6b 3wrJKPuGd9fFglpLMdboaLspMr9wsGNiCfndWoi6gWTxJ7Zt93H+g+cvxpEDYfkFthN4 l0bQ== X-Gm-Message-State: ALKqPwcNC4JCExtvsFXgDSLMfqyeTSlzt/hnjzvYCuz73ZQf5i3VifJ2 xaUe6tC+34o35RNpS72lbtY= X-Received: by 2002:a19:9a10:: with SMTP id c16-v6mr1176083lfe.60.1525783699690; Tue, 08 May 2018 05:48:19 -0700 (PDT) Received: from xi.terra (c-8bb2e655.07-184-6d6c6d4.cust.bredbandsbolaget.se. [85.230.178.139]) by smtp.gmail.com with ESMTPSA id d85-v6sm154490lfl.93.2018.05.08.05.48.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 May 2018 05:48:18 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.90_1) (envelope-from ) id 1fG22T-0004LY-OD; Tue, 08 May 2018 14:48:18 +0200 Date: Tue, 8 May 2018 14:48:17 +0200 From: Johan Hovold To: Marcel Holtmann Cc: Johan Hovold , Sebastian Reichel , Greg Kroah-Hartman , Rob Herring , Mark Rutland , Andreas Kemnade , Arnd Bergmann , "H . Nikolaus Schaller" , Pavel Machek , LKML , devicetree@vger.kernel.org Subject: Re: [PATCH 0/7] gnss: add new GNSS subsystem Message-ID: <20180508124817.GZ2285@localhost> References: <20180424163458.11947-1-johan@kernel.org> <20180504132741.brn5jqv5ufjhp7ky@earth.universe> <20180507102056.GU2285@localhost> <20180508070153.GX2285@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 08, 2018 at 09:49:36AM +0200, Marcel Holtmann wrote: > Hi Johan, > > >>>> 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. > > > > Yeah, I think that will do for now. > > I forgot to mention that this part should be simple. So providing a > DEVTYPE attribute that can be easily associated to the /dev/gnssX > nodes is a must have here. Doing complex mapping of USB or DT layouts > to figure out this is NMEA vs some vendor vs I need extra code to > change the mode etc. Yes, as I mentioned in the cover letter some kind of generic interface for identifying the device type (and its features) should be defined eventually. Note that this is not necessarily something that is needed from the start however as, for example, gpsd implements protocol detection. > So a proper GNSS daemon will require some hardware abstraction anyway. > There will be still a few GNSS devices that are part of the cellular > modem, where you have to go via the telephony daemon to get access to > it. We have done this within oFono since there would be otherwise no > access to it. So only extra pieces that could be done here is to > provide a /dev/ugnss (like /dev/uinput, /dev/uhid) so that you can > emulate GNSS hardware from userspace as well. In oFono, we could then > just hook this up with /dev/ugnss and the GNSS daemon would not have > to have to know how to talk to oFono. Interesting idea, could be useful for testing purposes as well. But just so I understand your use case better, why do you need to go through oFono rather than implement, say, a serdev driver for the GNSS port of the modem? To enable the receiver using AT commands on a different port? Or what kind of interface did you have in mind here? Thanks, Johan