Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4219830imm; Mon, 11 Jun 2018 08:48:58 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKEuH2ertvWKqj/NE0snxQzS6XmOiFsnX0qfpQDamoyqkeH4+LKPpJQRBsY8pl8PVxjw2tQ X-Received: by 2002:a62:808f:: with SMTP id j137-v6mr18268710pfd.91.1528732138398; Mon, 11 Jun 2018 08:48:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528732138; cv=none; d=google.com; s=arc-20160816; b=dEvpp9G8pb+V2oIHEfH5OUcvbb1ckovG8Kqr1m4mjnhIMkOF8nfUPKPVz6QJPMlZL3 zFaKoA772DZq427LZXIMwO3SdEf1f+x5mrE806p6913+6/6FzkBMAZfZuX33XoDOmA8L XaYpT8hqMAgyu17iX/g6vhp8POtEv7YbTn23fD4go6p5m8wymexhBO2GqDoabV8F5Y1R l1x6elzcCktEaYn1DlSt0o7+tQe4Tfal04gkrIWX+EBhXl/a1VeAf9CBgA5YfFiqVQ9B T1Rgu+3u8h3wZ8DQuHPJv/1fpENX/pICjHV4LfREHWRAjJthVRTCfKTyIf0xf7JAU1O4 113g== 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:arc-authentication-results; bh=l2eahRMrRElKHYcH5xe48hfvty6SEkG3yHqaUhWaGiI=; b=gQxa3CE8qvNslu0JvXRpquPTqLWErjerQmLgZLFHdDwXBAk74ud9uvcxaxq5o4VgKV /S+1RXY1XAKV06kUmAuHKKldSgoXcyJLUlT1cliFxQSMaHlgbACrD+rY/XJXysqa9c1L dy6xGJ9Iyo+VCcdHgRegCnpf/B/loA5bsuSy6VChCC5xyM7vxH9FQReIqa6y1M2axLyr XzQ00b9pgbs4mSiSYglDjXBDNOx5AWms9LtAKmOBcBXbWSvYRTDNXR4JXkKV81VpnWNv m7voQAyxRw20+ou+Oi7gmnswLRPnwidIZeLMQZdF6fegyN3M2lRtfPLykb7/dHODKSep sFiw== 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 f2-v6si12821212pgu.457.2018.06.11.08.48.44; Mon, 11 Jun 2018 08:48:58 -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; 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 S933029AbeFKPrU convert rfc822-to-8bit (ORCPT + 99 others); Mon, 11 Jun 2018 11:47:20 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:43311 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932399AbeFKPrR (ORCPT ); Mon, 11 Jun 2018 11:47:17 -0400 Received: from marcel-macpro.fritz.box (p5B3D24B5.dip0.t-ipconnect.de [91.61.36.181]) by mail.holtmann.org (Postfix) with ESMTPSA id 0D537CF186; Mon, 11 Jun 2018 17:53:58 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Subject: Re: [PATCH] Bluetooth: hci_bcm: Configure SCO routing automatically From: Marcel Holtmann In-Reply-To: Date: Mon, 11 Jun 2018 17:47:14 +0200 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-Transfer-Encoding: 8BIT Message-Id: <4F0D6729-AE77-47D4-9765-FBC44181D4DE@holtmann.org> References: <280FCB2C-6DF1-4790-A89F-AF5BE3513AE5@holtmann.org> <20180608162009.22762-1-attitokes@gmail.com> To: Rob Herring X-Mailer: Apple Mail (2.3445.8.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 default. This >>>> change allows sending the vendor specific HCI command to configure the SCO >>>> routing. The parameters of the command are loaded from the device tree. >>> >>> Please wrap your commit msg. >> >> >> Sure. >>> >>> >>>> >>>> Signed-off-by: Attila Tőkés >>>> --- >>>> .../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 controller >>>> - 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_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 prefix? >> >> 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 transport. And sco-routing should default to HCI if that is not present. Meaning 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 different modes, that we better keep this vendor specific. Regards Marcel