Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4475513imm; Mon, 11 Jun 2018 13:00:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLVkX+7MyPhmUaYXwzqqTrNfwpKRPJE7Bbpew+ALJ1j28Hn3tQKFUtB6zWeSMcvoTTMtNhs X-Received: by 2002:a65:6047:: with SMTP id b7-v6mr474436pgv.241.1528747240200; Mon, 11 Jun 2018 13:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528747240; cv=none; d=google.com; s=arc-20160816; b=VqxfDCwBT98AbUab3cvUKs7+pQhD3Ezut58/mGTop90rqqtY3ZIrje1xR/Tv69vqiC nEf2XYrzguo3S7tnPY4dus8nffExYrzm90hJklWZSTnXBiKXkRwlz81rpc9hGm3gFFJv ErTskeczgmu5YgNjO5gODUwjKzk65I87PS+BQmoHW71zuO50YHf5OXtD3JdAZwg0Z8Ch V+IsrnxZHMpvQPSxmqhyBNi39jDCkDT4AksxCHR4lpNKSdnfEtQDROvjn+XtnMjICHOH 9n0m1dXDW/y2h5+11GVW++tuVBBOjd9Z0E8nNvmR8bvLcSh7QLtXlWsnEXfHZDB1t0mb PDvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=UO5VerwBItA/qAn6MpXnZqvo7IkUozr+9ClT+9NVgV4=; b=Fim7tXg5Dg3wIRA8cq+o2ok56O/vQb4A4U3JfBitYM3+oaoZ69M/fv9pRRiZgEhQcj MolU8wLC/vPxoV1GdAwAdT0FNWSlWzxuP+5143Ko1si8fOLNiqBdGHyZTrT9ND+X6zPX GfVYUtxIUFUPegjyqIcL6hHcns3/9k1BX54dpOEiDoHw0XvrIHhwYXJ0bD3Pb50yJpUS RMv3pAcC4mFIP8aCsKNGEGaHo4YvnkR0OoyPdGMaP9NQu6bntK/J3iXZNJO/xGxTkilL SPxKF0a99De6e6ndB+9J2xTTrgjqJ5Ho4XG+9Nbe9lyH6teyTBbgYkeHu21cgvqCJ/AY cpBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ugSZIHyD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d2-v6si20125005pgv.562.2018.06.11.13.00.25; Mon, 11 Jun 2018 13:00:40 -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; dkim=pass header.i=@kernel.org header.s=default header.b=ugSZIHyD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934589AbeFKTFw (ORCPT + 99 others); Mon, 11 Jun 2018 15:05:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:58788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934324AbeFKTFu (ORCPT ); Mon, 11 Jun 2018 15:05:50 -0400 Received: from mail-it0-f51.google.com (mail-it0-f51.google.com [209.85.214.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A0012087E; Mon, 11 Jun 2018 19:05:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528743950; bh=6Tvf+T1OUSJ9Lt68XpdzTSeeYGPneK16guRRD0XHFOw=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=ugSZIHyDIlPYIhi8iNY4gRpuWdEkTkqe72Lv+9psdgoo+WckxoDL/1BZtA/SO23xf FdvK7KM3iI0RnkKj4AFWobpubQL2wB2uuruB7EYxr+SYwqHtI0Zp2t3nc4aFtlPjj6 x2N+ux2Op8pAmx+1SW5dLrrINO5KX5JMj7ayNsk4= Received: by mail-it0-f51.google.com with SMTP id n7-v6so11672864itn.1; Mon, 11 Jun 2018 12:05:50 -0700 (PDT) X-Gm-Message-State: APt69E0ScsqgCuaj+mrmMinZgHs2M/UnqkldbhChohQiZnEfJk6HYLl8 SHDFNJ5Q5W7kcs3Ex+tVDhyMcc+gn0bTrS6ijw== X-Received: by 2002:a24:798f:: with SMTP id z137-v6mr223305itc.19.1528743949677; Mon, 11 Jun 2018 12:05:49 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:6403:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 12:05:29 -0700 (PDT) In-Reply-To: References: <280FCB2C-6DF1-4790-A89F-AF5BE3513AE5@holtmann.org> <20180608162009.22762-1-attitokes@gmail.com> <4F0D6729-AE77-47D4-9765-FBC44181D4DE@holtmann.org> From: Rob Herring Date: Mon, 11 Jun 2018 13:05:29 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] Bluetooth: hci_bcm: Configure SCO routing automatically To: Marcel Holtmann Cc: =?UTF-8?B?QXR0aWxhIFTFkWvDqXM=?= , "David S. Miller" , Mark Rutland , Johan Hedberg , Artiom Vaskov , netdev , devicetree , "linux-kernel@vger.kernel.org" , "open list:BLUETOOTH DRIVERS" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 11, 2018 at 12:19 PM, Marcel Holtmann wro= te: > Hi Rob, > >>>>>>> Added support to automatically configure the SCO packet routing at = the >>>>>>> device setup. The SCO packets are used with the HSP / HFP profiles,= but in >>>>>>> some devices (ex. CYW43438) they are routed to a PCM output by defa= ult. This >>>>>>> change allows sending the vendor specific HCI command to configure = the SCO >>>>>>> routing. The parameters of the command are loaded from the device t= ree. >>>>>> >>>>>> Please wrap your commit msg. >>>>> >>>>> >>>>> Sure. >>>>>> >>>>>> >>>>>>> >>>>>>> Signed-off-by: Attila T=C5=91k=C3=A9s >>>>>>> --- >>>>>>> .../bindings/net/broadcom-bluetooth.txt | 7 ++ >>>>>> >>>>>> Please split bindings to separate patch. >>>>> >>>>> >>>>> Ok, I will split this in two. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> drivers/bluetooth/hci_bcm.c | 72 ++++++++++++++++= +++ >>>>>>> 2 files changed, 79 insertions(+) >>>>>>> >>>>>>> diff --git >>>>>>> a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt >>>>>>> b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt >>>>>>> index 4194ff7e..aea3a094 100644 >>>>>>> --- a/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt >>>>>>> +++ b/Documentation/devicetree/bindings/net/broadcom-bluetooth.txt >>>>>>> @@ -21,6 +21,12 @@ Optional properties: >>>>>>> - clocks: clock specifier if external clock provided to the control= ler >>>>>>> - clock-names: should be "extclk" >>>>>>> >>>>>>> + SCO routing parameters: >>>>>>> + - sco-routing: 0-3 (PCM, Transport, Codec, I2S) >>>>>>> + - pcm-interface-rate: 0-4 (128 Kbps - 2048 Kbps) >>>>>>> + - pcm-frame-type: 0 (short), 1 (long) >>>>>>> + - pcm-sync-mode: 0 (slave), 1 (master) >>>>>>> + - pcm-clock-mode: 0 (slave), 1 (master) >>>>>> >>>>>> Are these Broadcom specific? Properties need either vendor prefix or >>>>>> to be documented in a common location. I think these look like the >>>>>> latter. >>>>> >>>>> >>>>> These will be used as parameters of a vendor specific (Broadcom/Cypre= ss) >>>>> command configuring the SCO packet routing. See the Write_SCO_PCM_Int= _Param >>>>> command from: http://www.cypress.com/file/298311/download. >>>> >>>> The DT should just describe how the h/w is hooked-up. What the s/w has >>>> to do based on that is the driver's problem which is certainly >>>> vendor/chip specific, but that is all irrelevant to the binding. >>>> >>>>> What would be the property names with a Broadcom / Cypress vendor pre= fix? >>>>> >>>>> brcm,sco-routing >>>>> brcm,pcm-interface-rate >>>>> brcm,pcm-frame-type >>>>> brcm,pcm-sync-mode >>>>> brcm,pcm-clock-mode >>>>> >>>>> ? >>>> >>>> Yes. >>> >>> we can do this. However all pcm-* are optional if you switch the HCI tr= ansport. And sco-routing should default to HCI if that is not present. Mean= ing a driver should actively trying to change this. Nevertheless, it would = be good if a driver reads the current settings. >>> >>> In theory we could make sco-routing generic, but so many vendors have d= ifferent modes, that we better keep this vendor specific. >> >> Even if vendor specific, the properties for not HCI transport case are >> still incomplete IMO. >> >> By modes, you mean PCM vs. I2S and all the flavors of timings you can >> have within those or something else? For the former, that's often >> going to be a process of solving what each end support and if that >> doesn't work, then IIRC we already have properties for setting >> modes/timing. All the same issues exist with audio codecs and this is >> really not any different. > > this is what Broadcom uses to configure their PCM transport. So I think f= or now, we make them brcm, specific and see how that goes. We can always ge= neralize them later if enough chip manufactures provide support for it. We already have properties doing the same thing defined in Documentation/devicetree/bindings/sound/simple-card.txt. Use and extend that. We don't need new properties especially for something that is not complete. For example If I have 2 host ports (every SoC has at least 2), how do I indicate which one is connected to BT. Rob