Received: by 10.192.165.148 with SMTP id m20csp4001332imm; Tue, 8 May 2018 00:53:28 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrm2tzl1sdOWWPWzuoZmPBR6HN6GZaP2ALwbQiRV+wk9y5yqfS+pPoW9HJLZMpEA++AMxuL X-Received: by 10.98.224.76 with SMTP id f73mr39209153pfh.88.1525766008096; Tue, 08 May 2018 00:53:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525766008; cv=none; d=google.com; s=arc-20160816; b=hEE7zvRJjkU+qCdQHpVDg/gJd/S2z+rHX16V0YPNC9I7OjT4Z4M+3rcYolBYkQZkhX cmpkufYm9lVgSBxcxJViKxxgMaIrUDQ0agHsDa89qTMxOUeeuH/VZXpVu+Xkvwgc8TyT I8pMdTlwdzKAqOpPqsUATAj+BfL5EnFPNzLCWVpcVZFu7Pt9jMCFpEMq2mRxqozkXVLA L38ZnJ7weRia236AWFrDNgvNRHg36np824AU+1cJbuZuAXTkwBfS3ePLkiKB1IE83QVu JG4dumScFW0nvxUflh9J41GWZqjM1fuHFErFS9qTz3LLG24qxTgFoGCMnCJV8ymefZL/ TrTw== 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=8BF1tVfgcFQnYoqw/i2cFKMq51Q+hQ6HzPsv3rhKIS4=; b=qZM52j+AJ/70O6pf4WZqHmSJy2qz0efA7XrvS3yh4uqEYuJmZZx4uWVZKFLS9rbnld zVbng6II1AmKIQgo50kap/XnTIfNjIWeYjKjSYUFaFSLGZBzPBL8Mk3pD7sWw1j7YVY6 UoBdJL2qycERKRUMQ9D+YX7mB6u/OxJYcfQENxdRZFbVB5rxFXqpXokZXZ/ThV+CD3sf +7mSkSDeMi/8zdb5fRYmhFiPoHbEiVv2RHqm6onTBB/SfA2Boi2gDski3vrJF/MP84Hn JrcBJPFbSxhFrymMV6hIC/2NBfhwIU9xVklNkGx2ea1zIkfjAAbE/2GihadDj5o6ImsA 3DhQ== 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 k70-v6si561706pgc.493.2018.05.08.00.53.13; Tue, 08 May 2018 00:53:28 -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 S1754450AbeEHHtk convert rfc822-to-8bit (ORCPT + 99 others); Tue, 8 May 2018 03:49:40 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:58125 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754179AbeEHHtj (ORCPT ); Tue, 8 May 2018 03:49:39 -0400 Received: from marcel-macpro.fritz.box (p5B3D2CDF.dip0.t-ipconnect.de [91.61.44.223]) by mail.holtmann.org (Postfix) with ESMTPSA id CB703CEE9C; Tue, 8 May 2018 09:56:06 +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: <20180508070153.GX2285@localhost> Date: Tue, 8 May 2018 09:49:36 +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> <20180508070153.GX2285@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, >>>> 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. 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. Regards Marcel