Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6371132imu; Tue, 13 Nov 2018 23:51:56 -0800 (PST) X-Google-Smtp-Source: AJdET5fVkQH+Tx2qkjJr2yNitKQ0aqmwxCBDZjAB+1WdqXks4cHp1R+x2TSAsd2FmhpBI1bVg5he X-Received: by 2002:a63:81c7:: with SMTP id t190mr776426pgd.393.1542181916611; Tue, 13 Nov 2018 23:51:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542181916; cv=none; d=google.com; s=arc-20160816; b=sdtB1NmaSeZmzuII5N6BLq7UNTAxDqlfG1UjQsrzTD3vFo1puM7bPV1Gz9kdm8LQuu Q1tDcPAB06VViE859xEBRY1/H4Fjp/hEdoQUBBP+HY4znsF78KNILenEhDvt8/c+NrJm 4ald+dNDA3WihlltUgBC27U5+RwRnox7nVALv90WJ4TXeQr8ToSlYCuoy89G4bYiHplk cuXDgLZjngo3cXYBuW4pTrtr9AqY1OqweJqu/jZ7sNJ5jD8oQmWf+CANVy8c7JEmPQUm qZonYXguKSCpKRD9Grm0nFF+KtLntrA/ro+AhBH4IQ2pSmzPfml/rJ8sAJm9TbAs9whf Elyg== 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; bh=D9cm2OSRPQgXyQuTHb6f3o07Ra6H8wCM35zDDoYw6sA=; b=t5IpZX5g1cS6/tfq2CNx5w1uzQcnrFyDB2hzoOrVrxQQijjJe8EdF+m56NyAs2tW3c Kcq9pi8bRhPdnm1RqwKWQXbDgQ0dYeVe33E6FFmx+LSJMS6uGA1wl4puH0SuXoWl8AjF k4/5O9vuMuOBjayCtsDOZiLCvNKs9/FWHCsaC6oQLaDrrk6UaF7GePVaVkdSnoATRrIi ZD/EB1drftRxANirtdR+ixA2ziAQZZbEy9aHXUVR6ZqfP3L4KCNECZaCbiLz7DBskOCV cmsyuSvCKpZbdvm0Eqk5tzT411kYHGTpoZ+zTxAgmVM3LtsdzB0NN/WF9gXVC3gC3H0s kgAQ== 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 u30si22696355pgn.170.2018.11.13.23.51.41; Tue, 13 Nov 2018 23:51:56 -0800 (PST) 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 S1731593AbeKNRxZ convert rfc822-to-8bit (ORCPT + 99 others); Wed, 14 Nov 2018 12:53:25 -0500 Received: from coyote.holtmann.net ([212.227.132.17]:60764 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725907AbeKNRxZ (ORCPT ); Wed, 14 Nov 2018 12:53:25 -0500 Received: from marcel-macbook.fritz.box (p4FF9F655.dip0.t-ipconnect.de [79.249.246.85]) by mail.holtmann.org (Postfix) with ESMTPSA id 6EC98CEEAF; Wed, 14 Nov 2018 08:58:48 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.1 \(3445.101.1\)) Subject: Re: [Letux-kernel] [PATCH RFC] bluetooth: add uart h4 devices via serdev/devicetree From: Marcel Holtmann In-Reply-To: <20181113170128.0f59ef0e@kemnade.info> Date: Wed, 14 Nov 2018 08:51:17 +0100 Cc: Rob Herring , sebastian.reichel@collabora.com, hns@goldelico.com, devicetree@vger.kernel.org, Johan Hedberg , Linux Kernel Mailing List , linux-bluetooth@vger.kernel.org, letux-kernel@openphoenux.org Content-Transfer-Encoding: 8BIT Message-Id: <86A3A2E6-FC89-42FE-8410-9C8273EC9CF7@holtmann.org> References: <20181110232034.17277-1-andreas@kemnade.info> <20181111024648.7rt7rlhaqihtqecv@earth.universe> <20181112215812.18ebca35@aktux> <2C74C837-A6D3-47C9-BE59-CCA594289B94@goldelico.com> <20181112222726.73m2oca7hankvcjs@earth.universe> <20181113170128.0f59ef0e@kemnade.info> To: Andreas Kemnade X-Mailer: Apple Mail (2.3445.101.1) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andreas, >>>>> Am 12.11.2018 um 21:59 schrieb Andreas Kemnade : >>>>> On Sun, 11 Nov 2018 03:46:48 +0100 >>>>> Sebastian Reichel wrote: >>>>>> On Sun, Nov 11, 2018 at 12:20:34AM +0100, Andreas Kemnade wrote: >>>>>>> This is a first try to be able to use h4 devices specified in >>>>>>> the devicetree, so you do not need to call hciattach and >>>>>>> it can be automatically probed. >>>>>>> >>>>>>> Of course, proper devicetree bindings documentation is >>>>>>> missing. And also you would extend that by regulator/ >>>>>>> enable gpio settings. >>>>>>> >>>>>>> But before proceeding further it should be checked if the >>>>>>> general way of doing things is right. >>>>>>> >>>>>>> Signed-off-by: Andreas Kemnade >>>>>>> --- >>>>>> >>>>>> Patch looks good to me, just one note >>>>>> >>>>> I found one thing myself: >>>>> Shouldn't we have a generic compatible string like "generic-h4". >>>>> ehci-platform.c has for example: >>>>> { .compatible = "generic-ehci", }, >>>> >>>> There might be differences in h4 compatible devices (e.g. default >>>> baud rate) so that I would not bet there a "generic-h4" suffices >>>> in the long run. >> >> It will not because that doesn't define clocks, resets, gpios, >> supplies, etc. and the interactions of all those. >> > well, we need a simple supply being on when the device is on. > Nothing more. > >>> My suggestion is to use this in DT: >>> >>> compatible = "wi2wi,w2cbw003-bluetooth", ""; >>> > That would be my slight preference here. > >>> The driver can start with supporting just the generic compatible >>> string. If somebody finds some incompatible differences, the driver >>> can add a custom handler for the wi2wi chip without breaking DT >>> ABI. >> >> Any idea how many H4 devices there are? Somehow I doubt there are that >> many to be unmanageable. >> > Well, many devices are h4 devices with some more or less important > vendor-specific commands. Well, "hciattach any" uses simple h4 protocol. > > those firmware download commands and they have their own drivers. > Most devices I had used bluetooth uart from the command line with, were > simple enough. The other question is whether those devices will run a > modern kernel. > > No strong opinion here. doing the firmware load from user space via some magic tool is no longer going to work smoothly. It will be actually almost impossible with serdev. However I did post btuart.c driver which is pretty much just plain H:4. You would still somehow define the default baudraute since just picking 115200 is not always going to work. Btw. I see nothing standing in the way of merging btuart.c driver and then go from there. Either I dig this out and submit or someone else does. Regards Marcel