Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1638525ybk; Thu, 14 May 2020 14:08:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5xD94Kmjh9+euGQQYoM+DQf0AezFUeIKgFAeE6N7mzFMdsc6XGEOSXN07hnL8nZizlhSU X-Received: by 2002:a17:906:eda3:: with SMTP id sa3mr5628570ejb.253.1589490514542; Thu, 14 May 2020 14:08:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589490514; cv=none; d=google.com; s=arc-20160816; b=fE3TDYimWzw04VzdmpUZxwotsKVpOguIqOX8mHREWmLa4/zwO7juHU1HZ3bF1kTj2V iKmYJ4sS+UimY8+7oIxNcx5E7sI0zPCo8VEUveHhceOQMdXzoIdt7U+jGGOHop/OUdxy 3ewf7rIrJoHnO+LT0QFJwWTyTp16yqWW49H8HhbPT+/apyAWTr5LAktoZI+s3LQsVmIt 8bCciNMrco2N2GP3Ai+SSA4VRHrU588f2CV7gko7RuztyAcw93MyXio1EPqsBuShNxZD BCBlf4FFPIkAhCayhvv4Tc7fF8/kQUy5apDFyJ55/lUb8rJ7x3c6newM2KmvtWIU9Yoy RfVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=NykzObPbt09vQkb419M6Erv1hx3UgyLf17JiOqHvK80=; b=FEVqXfl8niGkxTnWBbLTv3CcoNHRrpanlpBt7hwK1UU/jL5EBPxvMAx0YWn/SdQyrE uUWOBiRoiBTX1DS8g6d72ZwR22yC0Zho/y5CG/QVWVQRwcy9ySInw1Prj5QcJuigL4uk tmLCzH3MPXhDruR1V/pUomkL6StxA0KA9AtzfWUyPqWT2ApZ4BqvNrCmcnf3+10qj5uv Dekd6dZGnwLp5WFydWok4/uwb3CyAWnGqkJ1HYjkJyHZ03KKwZvEmkR2AdADIHsGP7k+ 3GV+peZq45CuEKK5Ma42WIxFYX7rPvkojJIAJX+9xppzDh1zAuKBhtbfQSX5FdBZXYj8 Nvmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kXSrc44W; 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 gu17si33754ejb.26.2020.05.14.14.07.56; Thu, 14 May 2020 14:08:34 -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=kXSrc44W; 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 S1727929AbgENVH0 (ORCPT + 99 others); Thu, 14 May 2020 17:07:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727122AbgENVH0 (ORCPT ); Thu, 14 May 2020 17:07:26 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36A60C061A0E for ; Thu, 14 May 2020 14:07:26 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id t16so29129plo.7 for ; Thu, 14 May 2020 14:07:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=NykzObPbt09vQkb419M6Erv1hx3UgyLf17JiOqHvK80=; b=kXSrc44WFSLsjXyR3bgvdMCGXo3k3C3Oij9xGZlXBwp42VEUZCNCMZLCnI9OGne/vC mr0ZoWsu3K9OxnagSQTufjXCYNBsmgnKknQ/+TAAJ4umAqRSc9biOadFDWGedTwyxZNl u25qF/rQIzI3UjGyszM1Ldeb8Z0rLmX5nVR8c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NykzObPbt09vQkb419M6Erv1hx3UgyLf17JiOqHvK80=; b=kp1qoyvRzVop2Y0fcUQgihp1xl0Qy1JKUbXWycQixadtYUu0TeWbiR+KUMp+kE518W fPdba01sIKfBl+wudmZ6T1inWvMjvPpMy2EmU5NWDktJ6k9nPkwTPFXbY/Df8Ejn2w/u ttd1GWz1b3ouh6RAedR3rE3xFVz0sXZTbjRNvQMW9Sj3nURUetYnhiAXo62kR94b6WIl UC151aN2Q4+4UgAofK2w8vJ3IkVb0f0/Oxaa8MfTzUSJCLe8pa1oQoszZBsa+euCEijX f0SmiYImvp4yhKJCHjeSgl6WdbuL/x7A8UYmyZMawNig9XbCjjuj4Gn/USwvRsYcOPqs vKUA== X-Gm-Message-State: AOAM531YW6cbJFFO5dyZMITxpGEQUiOVkLrKVytd8rxLoLx8iAj1fJ1h BvjNd90MZqzpcH3rW6mWNezy9Vbo0OI= X-Received: by 2002:a17:902:bd81:: with SMTP id q1mr501366pls.46.1589490445695; Thu, 14 May 2020 14:07:25 -0700 (PDT) Received: from localhost ([2620:15c:202:1:4fff:7a6b:a335:8fde]) by smtp.gmail.com with ESMTPSA id w192sm104707pff.126.2020.05.14.14.07.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 May 2020 14:07:25 -0700 (PDT) Date: Thu, 14 May 2020 14:07:24 -0700 From: Matthias Kaehlcke To: Abhishek Pandit-Subedi Cc: linux-bluetooth@vger.kernel.org, bgodavar@codeaurora.org, alainm@chromium.org, marcel@holtmann.org, chromeos-bluetooth-upstreaming@chromium.org, Johan Hedberg , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] Bluetooth: hci_qca: Enable WBS support for wcn3991 Message-ID: <20200514210724.GQ4525@google.com> References: <20200514131338.v2.1.I68404fc395a3dbc57c8a89ca02490013e8003a87@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200514131338.v2.1.I68404fc395a3dbc57c8a89ca02490013e8003a87@changeid> Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Abhishek, On Thu, May 14, 2020 at 01:14:04PM -0700, Abhishek Pandit-Subedi wrote: > WCN3991 supports transparent WBS (host encoded mSBC). Add a flag to the > device match data to show WBS is supported. > > This requires the matching firmware for WCN3991 in linux-firmware: > 1a8b0dc00f77 (qca: Enable transparent WBS for WCN3991) > > Signed-off-by: Abhishek Pandit-Subedi > --- > > Changes in v2: > - Rename struct to qca_capabilities and fix enum naming > > drivers/bluetooth/hci_qca.c | 23 +++++++++++++++++------ > 1 file changed, 17 insertions(+), 6 deletions(-) > > diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c > index b3fd07a6f8127..96799644f0933 100644 > --- a/drivers/bluetooth/hci_qca.c > +++ b/drivers/bluetooth/hci_qca.c > @@ -75,6 +75,9 @@ enum qca_flags { > QCA_HW_ERROR_EVENT > }; > > +enum qca_capabilities { > + QCA_CAP_WIDEBAND_SPEECH_SUPPORTED = BIT(0), nit: the '_SUPPORTED' suffix seems somewhat redundant, given that this is a capability (as 'CAP' indicates). Up to you if you want to keep it. > +}; > > /* HCI_IBS transmit side sleep protocol states */ > enum tx_ibs_states { > @@ -187,10 +190,11 @@ struct qca_vreg { > unsigned int load_uA; > }; > > -struct qca_vreg_data { > +struct qca_device_data { > enum qca_btsoc_type soc_type; > struct qca_vreg *vregs; > size_t num_vregs; > + uint32_t capabilities; > }; > > /* > @@ -1691,7 +1695,7 @@ static const struct hci_uart_proto qca_proto = { > .dequeue = qca_dequeue, > }; > > -static const struct qca_vreg_data qca_soc_data_wcn3990 = { > +static const struct qca_device_data qca_soc_data_wcn3990 = { > .soc_type = QCA_WCN3990, > .vregs = (struct qca_vreg []) { > { "vddio", 15000 }, > @@ -1702,7 +1706,7 @@ static const struct qca_vreg_data qca_soc_data_wcn3990 = { > .num_vregs = 4, > }; > > -static const struct qca_vreg_data qca_soc_data_wcn3991 = { > +static const struct qca_device_data qca_soc_data_wcn3991 = { > .soc_type = QCA_WCN3991, > .vregs = (struct qca_vreg []) { > { "vddio", 15000 }, > @@ -1711,9 +1715,10 @@ static const struct qca_vreg_data qca_soc_data_wcn3991 = { > { "vddch0", 450000 }, > }, > .num_vregs = 4, > + .capabilities = QCA_CAP_WIDEBAND_SPEECH_SUPPORTED, > }; > > -static const struct qca_vreg_data qca_soc_data_wcn3998 = { > +static const struct qca_device_data qca_soc_data_wcn3998 = { > .soc_type = QCA_WCN3998, > .vregs = (struct qca_vreg []) { > { "vddio", 10000 }, > @@ -1724,7 +1729,7 @@ static const struct qca_vreg_data qca_soc_data_wcn3998 = { > .num_vregs = 4, > }; > > -static const struct qca_vreg_data qca_soc_data_qca6390 = { > +static const struct qca_device_data qca_soc_data_qca6390 = { > .soc_type = QCA_QCA6390, > .num_vregs = 0, > }; > @@ -1860,7 +1865,7 @@ static int qca_serdev_probe(struct serdev_device *serdev) > { > struct qca_serdev *qcadev; > struct hci_dev *hdev; > - const struct qca_vreg_data *data; > + const struct qca_device_data *data; > int err; > bool power_ctrl_enabled = true; > > @@ -1948,6 +1953,12 @@ static int qca_serdev_probe(struct serdev_device *serdev) > hdev->shutdown = qca_power_off; > } > > + /* Wideband speech support must be set per driver since it can't be > + * queried via hci. > + */ > + if (data && (data->capabilities & QCA_CAP_WIDEBAND_SPEECH_SUPPORTED)) > + set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); > + > return 0; > } Reviewed-by: Matthias Kaehlcke