Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1056168ybz; Sat, 25 Apr 2020 10:00:30 -0700 (PDT) X-Google-Smtp-Source: APiQypKUBx3GrtXAS9gv1gwqJjeCx91A7A8qmEtJJSTx+hcRpl3wLpHTzhfi6/RGSKh+9VrYcAue X-Received: by 2002:a05:6402:310b:: with SMTP id dc11mr11935391edb.143.1587834030499; Sat, 25 Apr 2020 10:00:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587834030; cv=none; d=google.com; s=arc-20160816; b=qkCZPGfNSn2WcQkXfaH7SqbrjjRzVZ5oO6jAFcTOEcee396jbYSQ9fHeAiIiHrRenC n/Rlr+CiPE5sD5hljoAhy1PZd5JTr0pUXvVzMsK8vZXVZFBWbGtXwRfgi3YhyTVVVvz6 Nlb+J0jvJ3N3w301FU169D9nhNHNTJJGj4CuwvGkA5cfl0ATmLw1bKI59nJPeJuUlCde FzkED2eLqxOxFRIfSzywTnvvf6Sht+J4NAQvC2vmM9e65nprFa//1IYGan/5W3dSc0lk J4j/Y9SY/ijKLtGQp0KwAcoW4GeQkSdaz2A/NFjFPqiv4ju4/Pu61qEOgTtcgjubvxeH iJwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=s7lLQ+mn93i4ZfNeG3oM29Q5pa3XT2/2PJzaLyj35ek=; b=D+4XOX7NxSnkv6REynjRTncjvWh9Ad4yPX/vIEQlFtCMUW5uChyz5zrL8KrgFhZUsR YmtmYOWdNKGtopXkvIU7ZAq1uKTP3vlvXc9tFfh+SxN62eka/rywfQEE/89BK6+1VK5W 4bN/o0YXcpTj/oEwgGkgJV4/QzTse0Y/X3ZYfnsHiRzz/EVyMZ8c5oDPjSyA311JAZMQ Oqh+P9fMg+vna85MPugoXdSEQXqSgezIoso8KUYIDrYcVcR5EzzeS40Cd3icmyd8DneW 0Bdo9tQPy6vsULuj51rpfuo8vGnpcf9bCcbqhkOL4j9SJ5wlIf/bihtRftlOzoeCkyaU IYtQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 40si5419851edr.556.2020.04.25.10.00.06; Sat, 25 Apr 2020 10:00:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726208AbgDYQ62 (ORCPT + 99 others); Sat, 25 Apr 2020 12:58:28 -0400 Received: from muru.com ([72.249.23.125]:51424 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726155AbgDYQ62 (ORCPT ); Sat, 25 Apr 2020 12:58:28 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 7877F8108; Sat, 25 Apr 2020 16:59:14 +0000 (UTC) Date: Sat, 25 Apr 2020 09:58:23 -0700 From: Tony Lindgren To: Johan Hovold Cc: Greg Kroah-Hartman , Rob Herring , Alan Cox , Lee Jones , Jiri Slaby , Merlijn Wajer , Pavel Machek , Peter Hurley , Sebastian Reichel , linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: Re: [PATCHv6 0/4] n_gsm serdev support and protocol driver for droid4 modem Message-ID: <20200425165823.GO37466@atomide.com> References: <20200421232752.3070-1-tony@atomide.com> <20200423114326.GQ18608@localhost> <20200423153756.GE37466@atomide.com> <20200423232722.GG37466@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200423232722.GG37466@atomide.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Tony Lindgren [200423 23:28]: > * Tony Lindgren [200423 15:38]: > > * Johan Hovold [200423 11:44]: > > > I'd rather see a generic implementation which can be used with other > > > modems and that continues to expose a /dev/gsmttyN interface to which we > > > could attach serdev clients instead (and not create a motmdm serdev > > > replica of sorts). > > > > Yeah this should be doable quite easily actually without really any of > > the motorola driver code. It's a separate driver though, and not > > usable for this case because of the custom layer. > > Well here's a first take at the such a generic serdev-ngsm driver > that depends on patch 1/4 of this series. All this does is configure > a serial port for TS 27.010 adaption1, and brings up 16 /dev/gsmtty* > devices. So no custom options for the binding so far, and no support > for adding channel specific device drivers. But all that can be added > naturally later on. Just to clarify the difference between the generic serdev-ngsm case and this modem.. In the generic case, channel specific Linux device drivers can just use gsm_serdev_write() directly for things like GNSS driver, SIM file system, audio and whatever the modems might have on separate channels. This Motorola modem needs custom read and write functions because of the custom Motorola packet format on top of TS 27.010. So for example, the motmdm_write() function stuffs the packet header, and then just calls gsm_serdev_write(). So for the generic channel specific drivers, the driver just needs to be able to do something like: Configure devicetree for the drivers/tty/serdev/serdev-ngsm.c to bring up the TS 27.010 port based on the compatible and whatever port specific properties we may want use. And then have the channel specific device drivers do something like this: gsm_serdev_ngsm_register(); /* TBD to add to serdev-ngsm.c */ gsm_serdev_register_dlci(); /* Already patched for n_gsm.c */ gsm_serdev_write(); /* Already patched for n_gsm.c */ ... gsm_serdev_unregister_dlci(); /* Already patched for n_gsm.c */ gsm_serdev_ngsm_unregister(); /* TBD to add to serdev-ngsm.c */ So I think we can limit the code in the generic serdev-ngsm.c to bring up the TS 27.010, and then allow whatever channel specific device drivers to register with it. I guess that should do for the generic API. Anybody got better suggestions? Regards, Tony