From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C1C4C4BA0E for ; Wed, 26 Feb 2020 11:55:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6122724688 for ; Wed, 26 Feb 2020 11:55:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Jd4SW1ME" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726811AbgBZLzT (ORCPT ); Wed, 26 Feb 2020 06:55:19 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:42699 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726476AbgBZLzS (ORCPT ); Wed, 26 Feb 2020 06:55:18 -0500 Received: by mail-wr1-f68.google.com with SMTP id p18so2620491wre.9 for ; Wed, 26 Feb 2020 03:55:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=N/HLqG1dDlxTZQOlF1kclM4FtV82gw6thx5C0eMWXL8=; b=Jd4SW1MEdw3BSr+tOW0A+g5GDh/5NIN6p8HFxfdQD0AG53vvR26K+JTeoHXcVpncYU a8ox8IpPTfE458plItqoaoD3it0krStsnGcVmXcAklK5U6tbeyxghsAfi+0JQds6MRF/ 2M2uvLQC1wDniPmj7PvaeskE8u3HmsBuwWKViakuKMA9X3mHlF0GybGYFWvaPTp+RFiJ GWMujk4YauLTNAMp6OaNsAaS6uVegu0B12PlP2CqTUh1pyeYiIT8NwP7ubtvFXjjZSht Vz8kK1NRahOs3HqSl3LBnVDdoMtetjDvR8Z8trL0j5PY/mvwR07KlLeIxKKjyh08uD/F qf5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=N/HLqG1dDlxTZQOlF1kclM4FtV82gw6thx5C0eMWXL8=; b=JbBLEsxWylbGecCFbzdjVODL1Amiw3zKi/XeGj5TbGeTic3dNvsdalIPSmt6AJ43e5 AUyQiWa+Jd1ei+VSLO3VV8kjJRhS1Uk2H+SG80B9udbVTkZaE3c0M7Ej/9vW87XV76Sn 0EybZN1WeCcxWXH7MKBpwTKHtS+QtqENQ8a3QK6TdNqReMnO1KXVh3Cn1KAvM62u2k7H hHGpcP5X6XheXE4tSOEYEOSGcXnh+WD07PUFUkYVftBjoS1TjC8SGqYslsAp9i35+GrI ylh4v0UN6F8KsEcq4MircbFO+MqgBco1n3WsvtqSHkuhgijz5RiVpdIPJ9LWvj6KnQVn /VqQ== X-Gm-Message-State: APjAAAW3DqRKxlShCLDt7C4ZdqzPTQXfLp5y35boSdEl+JwKmDqZkvd3 ECses9ZCA4hlX5CQyrNuad7nFQ== X-Google-Smtp-Source: APXvYqyOyu7h7SWranUtz1CxDuJHk1JwDhHHx449iyciKg+Pc/m9qo1aavmL3kb/JkZa8Oq7/4G7iA== X-Received: by 2002:adf:df0c:: with SMTP id y12mr5159445wrl.257.1582718117234; Wed, 26 Feb 2020 03:55:17 -0800 (PST) Received: from dell ([2.31.163.122]) by smtp.gmail.com with ESMTPSA id a13sm2820475wrt.55.2020.02.26.03.55.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Feb 2020 03:55:16 -0800 (PST) Date: Wed, 26 Feb 2020 11:55:48 +0000 From: Lee Jones To: Tony Lindgren Cc: Greg Kroah-Hartman , Alan Cox , Jiri Slaby , Johan Hovold , Merlijn Wajer , Pavel Machek , Peter Hurley , Rob Herring , Sebastian Reichel , linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] mfd: motmdm: Add Motorola TS 27.010 serdev modem driver for droid4 Message-ID: <20200226115548.GO3494@dell> References: <20200220195943.15314-1-tony@atomide.com> <20200220195943.15314-3-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200220195943.15314-3-tony@atomide.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Thu, 20 Feb 2020, Tony Lindgren wrote: > Many Motorola phones are controlling the modem using a custom variant > of TS 27.010 serial line discipline. Devices on these modems have a > dedicated TS 27.010 channel for features like audio mixer, GNSS, voice > modem, SIM card reader and so on. > > This driver allows using various devices on the modem. In order to do > that, we need to take care of the following three things: > > 1. Provide /dev/motmdm* character devices for apps to use for talking > to the various devices on the modem > > 2. Handle Motorola custom protocol over TS 27.010 to make the channels > usable for userspace > > 3. Coordinate PM runtime with the USB PHY because of shared GPIO pins > with the USB PHY > > With this patch, folks with droid4 can place a voice call with just: > > $ printf "ATD%s,0\r" "${phone_number}" > /dev/motmdm1 > D:OK > ~+CIEV=1,1,0 > ... > $ printf "ATH\r" > /dev/motmdm1 > H:OK > > Also SMS can be sent with this patch using /dev/motmdm3 for sending, > and /dev/motmdm9 for receiving messages. > > Note that the audio mixer needs additional patches though. I will be > sending those as a separate series of patches. > > Signed-off-by: Tony Lindgren > --- > drivers/mfd/Kconfig | 9 + > drivers/mfd/Makefile | 1 + > drivers/mfd/motorola-mdm.c | 1200 ++++++++++++++++++++++++++++++++++++ I'm not even going to start reviewing this as I can see, without even looking at the code, that this has too much functionality (stuff that does stuff) contained. Please move as much functionality out into the subsystems as possible. Ideally, MFDs should be responsible for obtaining and registering shared resources and registering child devices. Anything else should be shifted out to an appropriate subsystem. MFD is not Misc. > 3 files changed, 1210 insertions(+) > create mode 100644 drivers/mfd/motorola-mdm.c -- Lee Jones [李琼斯] Linaro Services Technical Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog