Received: by 10.192.165.148 with SMTP id m20csp1819056imm; Sat, 5 May 2018 23:48:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp0ZhtFDTQ/NcO7mU6a5OAMqFVTlJ6UgXaolsTE0JKyR7yXMgqO4KjPt1cWAXUWH+TjL/h4 X-Received: by 2002:a63:6f0f:: with SMTP id k15-v6mr26590216pgc.91.1525589293140; Sat, 05 May 2018 23:48:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525589293; cv=none; d=google.com; s=arc-20160816; b=nsqmSimgtrsa29KsoN32VKIxUTkvAXS5oQZSf3/lZIAD7Qmglv4CC0OFlV/8jms/I3 ztj6QV1DsEi55c68g2MgUG24MY/Q6FdSchuKkgwCsSQQYHYsgR5k/BsP0XHbQVXtz0T4 gQjFUd4oyZPu63jdV6zYLNtIStAF3QtlV7iFv5eLbKsyYyQ50YuylUsCyRML0nZekpzq MAZXfjzS0xIK1l/R3VSfMstNyOhmRd2Pty5l+KFhCJGsm1+Ec5JZG3fZ98VHPSLPpV4v AvIzLHY/2wozLCeJCFmoFf8GdSVzRz+2yFibNvX0Sbunb7hhRLoBEz3ZPn/7l5NfaKw0 5t0w== 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=9pD7UfcYy0gHEbGlBfiW6gsk3cSnrAigmU+X98tP2tE=; b=tY2wABfn4UuYWlwvQqdg+paFwMdVTs3WZ32M8KxSpIUqPZrAQHCi9ffxmyZFqpTsmg wQ1CRF32+yhDtmBCoX0Yoycwdj6SMXQZ7eoYmzo79ub80BNX2TtdzbRTNcYnVYm3xHsW 49+x5mIV7NWOCVoCSc/cMVOTdYDVsGcs0WPhDwbHnCwh6Kzf8PSERoshC5l2PvZ9NjYl vd6pJDALOw6LXcDhMutPT7Pk2NkpVOsTu7W7bQW9GWlCRt03fQERDrTY87mseAT6lHlG CmC4z5YtIb0e/w0W0+1lMGjsKS6dYpDRNtXWhOeaNg0n4DLg+U158pdU9cNhkDRVnNm4 Tovw== 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 g2si197820pfh.346.2018.05.05.23.47.46; Sat, 05 May 2018 23:48:13 -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 S1751232AbeEFGrj convert rfc822-to-8bit (ORCPT + 99 others); Sun, 6 May 2018 02:47:39 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:37685 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750961AbeEFGrh (ORCPT ); Sun, 6 May 2018 02:47:37 -0400 Received: from marcel-macpro.fritz.box (p5B3D2CDF.dip0.t-ipconnect.de [91.61.44.223]) by mail.holtmann.org (Postfix) with ESMTPSA id E3731CF351; Sun, 6 May 2018 08:54:03 +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: <20180505211129.GA762@amd> Date: Sun, 6 May 2018 08:47:34 +0200 Cc: Sebastian Reichel , Johan Hovold , Greg Kroah-Hartman , Rob Herring , Mark Rutland , Andreas Kemnade , Arnd Bergmann , "H . Nikolaus Schaller" , LKML , devicetree@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <31DFBFE6-5E04-4C1E-863A-33DC9EFA1219@holtmann.org> References: <20180424163458.11947-1-johan@kernel.org> <20180504132741.brn5jqv5ufjhp7ky@earth.universe> <20180504200315.GA22519@amd> <20180505172847.qqpqkrfspak53sc6@earth.universe> <20180505211129.GA762@amd> To: Pavel Machek 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 Pavel, >>>> (*) I have those in mind: >>>> >>>> Nokia N900: The phone has GPS integrated into the modem and uses >>>> ISI encapsulated data. The protocol has been reverse engineered >>>> and it should be possible to write a kernel driver for handling >>>> the GPS packets and dumping the raw data to /dev/gnss0. I don't >>>> think this is particularly useful without a non-raw interface, >>>> though. It would still require a custom userspace implementation. >>> >>> Actually... in this case it would be nice to do the protocol >>> processing in kernel and just present reasonable interface to >>> userland... or maybe NMEA. >> >> Converting a binary protocol to NMEA, which needs to be string >> parsed is not very nice. I think first step would be to write a >> simple driver, which exposes the binary location protocol without >> ISI header. Then in a second step we can think about a reasonable >> interface, that should be supported by all GNSS devices. > > Well, most of the userspace expects NMEA. So yes, its an ugly > protocol, but .. it is not really a high-performance device. > > I'd suggest modeling this over input subsystem. We could use similar > tag/value/sync protocol (evdev). In similar way /dev/input/mice was > used for running legacy apps during transition, we'd have /dev/...//nmea. I would _not_ model it after the input system. And /dev/input/mice was a really bad design choice. It was there because userspace was too stupid. >>>> Droid 4: GPS is similar to N900, but different protocol and QMI >>>> encapsulated. This one also has known protocol with userspace >>>> implementation. I did not yet have a detailed look, if its possible >>>> to (un)wrap this in the kernel. >>> >>> So, this is actually NMEA over QMI. I do have patches libqmi that >>> provides NMEA on stdout. >> >> Ok. So raw data is NMEA for this one. Should be reasonably easy to >> write a driver exposing this via /dev/gnss device. > > If we have qmi implementation somewhere in kernel. Do we? Not in a way that it can easily be hooked up, but essentially the QMUX part and everything around it needs to be done in the kernel. Like Phonet and CAIF have been done before that. >>> But there seems to be another possibile interface (yes, that modem is >>> crazy, and you can talk to it over few different interfaces), and >>> that's NMEA over GSM07.10. That one should be feasible to decode in >>> kernel and just provide NMEA to userland. >> >> I think both should be feasible. I suggest to wait a bit more >> until you and Tony figured out some more details. You've got >> the libqmi patch as workaround for now and we want a stable API >> later. > > I do have the gsm07.10 one now, too. That one is certainly simple > enough (and should eat less power -- no need to keep USB running). Someone also needs to make the GSM 07.10 multiplexer code serdev aware. Since currently it is a line discipline and that is not really needed. In case this is a USB serial, it might be better to be hooked up directly into GSM 07.10 without even going through serdev. Regards Marcel