Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3775734ybz; Mon, 20 Apr 2020 09:13:32 -0700 (PDT) X-Google-Smtp-Source: APiQypJrfukhDVHoFcyDxbMB0ZzoOin6hJpYp+3kHG1gBODjpGVFAUnNOCTlWgEYgdumkc6uy0yJ X-Received: by 2002:a17:906:11c7:: with SMTP id o7mr3117387eja.108.1587399212399; Mon, 20 Apr 2020 09:13:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587399212; cv=none; d=google.com; s=arc-20160816; b=cicxcIoFxgV9Sv+Qi+FnA2e57zF5kkDtyoY/cHTK7NkFsYuUzo0eusXFXU0stv70gB h8zjtnHB89yvKG15eulboY49vAGIhsdr4MtD7uTvCsSN6oCDGajmp6VCcJcsP8E8nTsj hMfCdUnXl81LLgY4om7We/xoXGwMxWV3jDyR75Zi2CypGRBp+TeQH8bMjKdu7jWEd67G TewXKmedJPEfOtSleQ23aJmzlAifltHSE/FeehtywYZ+XzgdZEFhleYAAefsjEiiH61Y m2duS5zVKJD06emDIqbMYv7tBl7oEU6ed9+nKjY4kDaFMJ66FwQttJb//LSi3SCjkWFL Ltyg== 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:in-reply-to:references:mime-version :dkim-signature; bh=qpi0J/WbUvWdEolbQKeQDKkPShB1LtnL6nCqIWc36DY=; b=UWgqwItJ4ycMWK0W1jZ98ZmP9jQJTOgTN13Ac+o+5+dzZg0y+xQCrua56UfG6oTZTn +RUqdiRQvFpPFMueHF3o9lOPoJ8xsI8QY6ATk1HJGj+f5MDd0haZpTz+VMOrGYv4ppsM n6CtjZhEgztIg0YCpiJb1R4hrMTcPeAfIWuASjFyPAc/4ldPcGyCjXRJmNdI0lildY87 PDYjv31uOSPFc0+5+bgOYBOaljnl8MBPUL/USNV6s7nDdEWW1TNyhMfIz5PUD1FyiYaC CtsyZ1UtjzgvhB46za7MSiVyGo42lPVYdONh8gc/LCkxce0uqsMsI2mBoyBB+q0Nuz4h rgEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BW+UrLUt; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oo21si746907ejb.453.2020.04.20.09.12.51; Mon, 20 Apr 2020 09:13:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=BW+UrLUt; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727028AbgDTQKh (ORCPT + 99 others); Mon, 20 Apr 2020 12:10:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726036AbgDTQKh (ORCPT ); Mon, 20 Apr 2020 12:10:37 -0400 Received: from mail-vs1-xe44.google.com (mail-vs1-xe44.google.com [IPv6:2607:f8b0:4864:20::e44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A065C061A0C for ; Mon, 20 Apr 2020 09:10:37 -0700 (PDT) Received: by mail-vs1-xe44.google.com with SMTP id 1so6343831vsl.9 for ; Mon, 20 Apr 2020 09:10:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=qpi0J/WbUvWdEolbQKeQDKkPShB1LtnL6nCqIWc36DY=; b=BW+UrLUtrSDOWpQ96lKroLpJ0GwsHePk7gEl2qvro7DvnBAyWbLfxdYVxN7FfnDeCx uJflNPa99uT59gx0fkK578RAV2OBPkTQPj6JK+HLaXtjY51SSK7Kn8qaxH5CDXKgnC6j IPm+O7QSpNLXbY2QCSjbrdWF1Yu6vCqNvXsTA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=qpi0J/WbUvWdEolbQKeQDKkPShB1LtnL6nCqIWc36DY=; b=aROLlpCAGL9fcb0Uyw28r2mfJFW+ViVJA4+dvlierILnSwbOmC9oWLt5AHqG6nYgCS XAiqEs3VLcdWHTF+uF6MqM1KJaCxJg77taG7PXJF6NwxTgk9i5SUiA1ap+VZs26SS4YO NG9fdtb6Hzb23PecYXMXgk6qlAMJR3wWTeUeVTuFDhIYhWjU0MgmI7lAT2lJZmJ/0Bey jFMXXy6TmxRRTsfCK1QTZhS6diZZU1zSKVIp7r0wUIwx10fNDpoZtmALw1Hbx03HsE7P zfoI7KJ9vcnUXr+y+NHroEmd10mpoR7nnEckmL4GqxgYVbvT0QDdqJiQEt+fc9XbBVSI KPyg== X-Gm-Message-State: AGi0PuaQls2m84rGJiJivU/0ho2uK5Jzu2p3wbQzdcBtOz9yHX3RXQCF 1No2/40MWwo/UV2g3XqGGzxiPSwhZRJdJqC3fZA1IhICHFY= X-Received: by 2002:a67:d998:: with SMTP id u24mr12522181vsj.93.1587399036183; Mon, 20 Apr 2020 09:10:36 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Abhishek Pandit-Subedi Date: Mon, 20 Apr 2020 09:10:22 -0700 Message-ID: Subject: Re: How to handle different operating speed for QCA9377 SDIO BT module? To: Christian Hewitt Cc: Bluez mailing list , linux-amlogic@lists.infradead.org, ath10k@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Christian, Looks like the max-speed setting is inside an if block and that might be why you're not able to set it (https://github.com/torvalds/linux/blame/master/drivers/bluetooth/hci_qca.c= #L1892). I would suggest moving that outside the if block and trying again. Abhishek On Mon, Apr 20, 2020 at 1:51 AM Christian Hewitt wrote: > > Resend to expand the audience and include the linux-amlogic and ath10k li= sts. > > >>>>> > > I=E2=80=99m working with a QCA9337 SDIO device on an Android (now Linux) = set-top box with an Amlogic S905D SoC. > > SDIO WiFi (ath10k) is working since 5.7-rc1, but the BT side of the modul= e is still missing. > > Most Amlogic devices (95%+) use Broadcom SDIO modules with the following = device tree content: > > &uart_A { > bluetooth { > compatible =3D "brcm,bcm43438-bt"; > shutdown-gpios =3D <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>; > max-speed =3D <2000000>; > clocks =3D <&wifi32k>; > clock-names =3D "lpo"; > }; > }; > > I changed the compatible to "qcom,qca9377-bt=E2=80=9D and applied the fol= lowing patch: > > diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c > index 439392b1c043..6f0350fbdcd6 100644 > --- a/drivers/bluetooth/hci_qca.c > +++ b/drivers/bluetooth/hci_qca.c > @@ -2046,6 +2046,7 @@ static SIMPLE_DEV_PM_OPS(qca_pm_ops, qca_suspend, q= ca_resume); > > static const struct of_device_id qca_bluetooth_of_match[] =3D { > { .compatible =3D "qcom,qca6174-bt" }, > + { .compatible =3D "qcom,qca9377-bt" }, > { .compatible =3D "qcom,wcn3990-bt", .data =3D &qca_soc_data_wcn39= 90}, > { .compatible =3D "qcom,wcn3991-bt", .data =3D &qca_soc_data_wcn39= 91}, > { .compatible =3D "qcom,wcn3998-bt", .data =3D &qca_soc_data_wcn39= 98}, > > This results in probing with errors: http://ix.io/2i6P > > I noticed "max-speed =3D <2000000>;=E2=80=9D while hci_qca.c sets 3000000= . I attempted to set "max-speed =3D <3000000>;=E2=80=9D but this made no di= fference, so I patched a lower value in hci_qca: > > diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c > index 6f0350fbdcd6..b7ea1e9f4904 100644 > --- a/drivers/bluetooth/hci_qca.c > +++ b/drivers/bluetooth/hci_qca.c > @@ -1678,7 +1678,7 @@ static const struct hci_uart_proto qca_proto =3D { > .name =3D "QCA", > .manufacturer =3D 29, > .init_speed =3D 115200, > - .oper_speed =3D 3000000, > + .oper_speed =3D 2000000, > .open =3D qca_open, > .close =3D qca_close, > .flush =3D qca_flush, > > This results in an attempt to load firmware, see: http://ix.io/2i6Q and u= sing renamed files from https://github.com/boundarydevices/qca-firmware/tre= e/bd-sdmac-ath10k/qca the module is now otherwise up/working - I can scan/s= ee/pair other BT devices. > > see: http://ix.io/2i6S and: > > SML5442TW:~ # bluetoothctl show > Controller 91:08:00:00:00:00 (public) > Name: SML5442TW > Alias: SML5442TW > Class: 0x000c0000 > Powered: yes > Discoverable: no > DiscoverableTimeout: 0x000000b4 > Pairable: yes > UUID: Audio Source (0000110a-0000-1000-8000-00805f9b= 34fb) > UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b= 34fb) > UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b= 34fb) > UUID: PnP Information (00001200-0000-1000-8000-00805f9b= 34fb) > UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b= 34fb) > UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b= 34fb) > UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b= 34fb) > Modalias: usb:v1D6Bp0246d0536 > Discovering: no > Advertising Features: > ActiveInstances: 0x00 > SupportedInstances: 0x05 > SupportedIncludes: tx-power > SupportedIncludes: appearance > SupportedIncludes: local-name > > So it looks like hci_qca.c needs modification to handle multiple operatin= g speeds, perhaps using the max-speed description from device-tree if avail= able, or defaulting to the current 3000000 value if not. > > I=E2=80=99m not a coding developer so if someone can suggest a patch - I = can test and confirm it works. Or if someone can explain how this should be= implemented I will see if I can find someone to help with the task. > > Christian >