Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp240759pxf; Wed, 10 Mar 2021 05:27:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzyeucZNrcLseWSAn3iGYm2okZcN7S+XGRlyckEmdmnbWOJ5IotCSbJJ0HKf4jcvUM2Gp3q X-Received: by 2002:aa7:c903:: with SMTP id b3mr3273710edt.156.1615382823513; Wed, 10 Mar 2021 05:27:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615382823; cv=none; d=google.com; s=arc-20160816; b=lF5UZxR+GZCNAaqnNopnXyq7tZxMVHxS4MBDgX2ZOaQ4SvdFPSkB4QITStAo5uPIAP CgqbEuEo+f6u8pYVRGOPPkdPhc0z7bSa4UnEqYsjck1f6vIEsPRb14QzV4IlcmICBGTK hjBQBONOQaO20UXOr7EkvH5J4jdSz/G4yK38vMrGqRve45Noiu94MzyDSHL23ZtDBewO QiLaayDXqdzNzFB4nRVRvZS73ZJGfLkdbhbicE2uDe82e8eTLJk/28SunwqpcpLRgBSs rswm1zs0s/tVkB+hjloRa90gNN9CjTbgP/Hf/y/Y4r4hOuxeYok5ZPNrX32J3PlqJLxy IcgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=fczDd5qQBUbRwftCJice3WMsaromBDfxX/WdgJPGdkY=; b=mRhvunrJ/2/5F1Av+d2hnoj/6PwuqYUcVarEFGqMHyQeK6nIjE7EmQ975HnhQu85em QOSgYzD5o6iUWl530l+oDZS2LWG57GZePms40iM5EfZgMcnykYN6u5KPxIzaOZKQsGnw Y5CLGVXaI4Ln0XuFW7ERyt4aRELQD1WwMccW1SyABb7cAVC16+UjbLIxifb+rnfY8wcN qVp7OWwGDM17oQGLMxwuG5BIC5sj5BgzPB1Llfh7A9HocV784PF73R8HB85WsGHG+mae wnO/vHeshJ7hIBVodR+rmR2BTPIGCiQhK6/wR1cggoNeT2Bzgg8nW3xg2SDgFYTeIkdT c9VA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GvPkjeII; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k16si11177864eje.579.2021.03.10.05.26.40; Wed, 10 Mar 2021 05:27:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=GvPkjeII; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233002AbhCJNZM (ORCPT + 99 others); Wed, 10 Mar 2021 08:25:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:45578 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232815AbhCJNYZ (ORCPT ); Wed, 10 Mar 2021 08:24:25 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id BD51864FDA; Wed, 10 Mar 2021 13:24:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615382665; bh=UxmEYKfC122h6ZT5+Wks9ZNXBZyNwDx3a5vHmRPyK4M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GvPkjeIITf6m25Mai+vM2ZNJmMbsatEXPALImk8gsEblq7B+2D9nBJIas5yCynlMl uxWrsO4RVy1IXFgMTKDm5w12o1J0ynaTLcKngr7BVKSZ9apCv7+O+jkBKmYU7T9apB XPhkDUPqnoQ+XHqx0QsqrWQTVahPvKjWhmdYSXh8= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Abhishek Pandit-Subedi , Marcel Holtmann , Sasha Levin Subject: [PATCH 5.10 10/49] Bluetooth: btqca: Add valid le states quirk Date: Wed, 10 Mar 2021 14:23:21 +0100 Message-Id: <20210310132322.284338281@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210310132321.948258062@linuxfoundation.org> References: <20210310132321.948258062@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Abhishek Pandit-Subedi [ Upstream commit 547801380ec7e6104ea679f599d03c342b4b39a0 ] WCN3991 supports connectable advertisements so we need to add the valid le states quirk so the 'central-peripheral' role is exposed in userspace. Signed-off-by: Abhishek Pandit-Subedi Signed-off-by: Marcel Holtmann Signed-off-by: Sasha Levin --- drivers/bluetooth/hci_qca.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 5c26c7d94173..ad47ff0d55c2 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -78,6 +78,7 @@ enum qca_flags { enum qca_capabilities { QCA_CAP_WIDEBAND_SPEECH = BIT(0), + QCA_CAP_VALID_LE_STATES = BIT(1), }; /* HCI_IBS transmit side sleep protocol states */ @@ -1782,7 +1783,7 @@ static const struct qca_device_data qca_soc_data_wcn3991 = { { "vddch0", 450000 }, }, .num_vregs = 4, - .capabilities = QCA_CAP_WIDEBAND_SPEECH, + .capabilities = QCA_CAP_WIDEBAND_SPEECH | QCA_CAP_VALID_LE_STATES, }; static const struct qca_device_data qca_soc_data_wcn3998 = { @@ -2019,11 +2020,17 @@ 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)) - set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, &hdev->quirks); + if (data) { + /* Wideband speech support must be set per driver since it can't + * be queried via hci. Same with the valid le states quirk. + */ + if (data->capabilities & QCA_CAP_WIDEBAND_SPEECH) + set_bit(HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, + &hdev->quirks); + + if (data->capabilities & QCA_CAP_VALID_LE_STATES) + set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks); + } return 0; } -- 2.30.1