Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4358922imm; Mon, 11 Jun 2018 10:58:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI2LcZjo+QlNNn+xWRNYkAini/yaJWE3u5/FrS77Z5u/w4/q9T5AhuJb1g2DRjqDIq5G+J4 X-Received: by 2002:a17:902:4203:: with SMTP id g3-v6mr157501pld.315.1528739911327; Mon, 11 Jun 2018 10:58:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528739911; cv=none; d=google.com; s=arc-20160816; b=vliruakOHSi/3GLqXn2I7uh0i7t+FHdbKkCkC0JPlHipk2LgFbwLDIMO/XJCUwiDXO Eqa8U5jUbHuCcAinajaRJR1Df4WffeaRwcS66L6K9wtXUH/XuQoMxFkpxzBjWC3CV4K0 acYJWeDjxuzNe7FrNig0dI62Wzp6CwQQjcpCW5zXDuk6KsQj8Tz3JjuxSIdiKQixGdar T+0NGKTbWyT5h+3qBEh2f1+ZGrXcNyzD5VAmys7u3CUQ5Njaeo0+TnaRdz1avCEIDHjn lqaoRzfQ4KyUbH986DvHYhx6ufQkysNzN56bBRS1VpwzdOC3kXxvHQU7NBlS4IRs1cqO euZQ== 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=Yp5ikcmL/SzEvob0L5wgu7G8fIZeblfj7zTKIG3kMdQ=; b=qxV6+K7FrvzVRfCz8ko9ShuIJ6nZPg+Lg9NGCA3XLDGdpsvuiRWJ5WP0khosfIiLZw OwDNVIJMmkkMQFHyz/QSPpa/kPhUOxuaeTilTowJWB+LMUzlOhKXHA2RQOTdp98D/R5Q hQtBtyCmwINhu6N/4viO2phFh4uRedyvKwiOm0nKNFgLvlp0JAfi9ltpUzjRx4u6EKvA sKKvJa4Hf8zAl9Gg1r9uAi2QMvAIIVDUnFEVsISp5lZ1XKsqIgFpK6GURO+Ky+juQaoE ju0adamkS0zE/h8gqkzTAnMnN2PSlnzoEVNVpP3NlRngFj7RM8Q1HmynWG2AZlZKIATN yCRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=T1yiHRBy; 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 j6-v6si24372392pll.54.2018.06.11.10.57.46; Mon, 11 Jun 2018 10:58:31 -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=T1yiHRBy; 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 S933673AbeFKRyl (ORCPT + 99 others); Mon, 11 Jun 2018 13:54:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:38784 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932647AbeFKRyj (ORCPT ); Mon, 11 Jun 2018 13:54:39 -0400 Received: from mail-io0-f182.google.com (mail-io0-f182.google.com [209.85.223.182]) (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 DFFC3208B1; Mon, 11 Jun 2018 17:54:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1528739679; bh=2TzgZey581hTt3zu4wrjplG0yy0ADveDkPVQzG6HT+w=; h=In-Reply-To:References:From:Date:Subject:To:Cc:From; b=T1yiHRByV33Zs8/x0TKjHwFKyKY0ozXmglIBTEFcITAXRvIGCmWtAIhd7xPr0WwR6 kVLSY/62dSIKCoVp9V+IifphjAktJay6rbNt/HNgXE8uWhtywcCx4bcYnJMNNKD3iU SnX23bBf6Cu+4hCxfsLeq9NyrU57fpmiLn2ewOZ8= Received: by mail-io0-f182.google.com with SMTP id d185-v6so24929535ioe.0; Mon, 11 Jun 2018 10:54:38 -0700 (PDT) X-Gm-Message-State: APt69E17uzRLd1ucld30wIpI24SW1iWusO1ulF1zEiPmnSh7hvWBfFEx FpOfcrEjGhbiFaEw6eaSOaqJahXduO2nVu2gVA== X-Received: by 2002:a5e:9407:: with SMTP id q7-v6mr186551ioj.268.1528739678311; Mon, 11 Jun 2018 10:54:38 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a4f:6403:0:0:0:0:0 with HTTP; Mon, 11 Jun 2018 10:54:17 -0700 (PDT) In-Reply-To: <4F0D6729-AE77-47D4-9765-FBC44181D4DE@holtmann.org> 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 11:54:17 -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@vger.kernel.org, "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 9:47 AM, Marcel Holtmann wrot= e: > Hi Rob, > >>>>> Added support to automatically configure the SCO packet routing at th= e >>>>> device setup. The SCO packets are used with the HSP / HFP profiles, b= ut in >>>>> some devices (ex. CYW43438) they are routed to a PCM output by defaul= t. This >>>>> change allows sending the vendor specific HCI command to configure th= e SCO >>>>> routing. The parameters of the command are loaded from the device tre= e. >>>> >>>> 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 controll= er >>>>> - 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/Cypress= ) >>> command configuring the SCO packet routing. See the Write_SCO_PCM_Int_P= aram >>> 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 prefi= x? >>> >>> 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 tran= sport. And sco-routing should default to HCI if that is not present. Meanin= g 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 dif= ferent 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. Rob