Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1674777ybx; Thu, 7 Nov 2019 15:29:37 -0800 (PST) X-Google-Smtp-Source: APXvYqwjGAPVL26tdyZ9QNdyLebpSfiMSv6miJPYvm+xHwBloaeG9i/PJJTDPWLCxJlTA8yNuitN X-Received: by 2002:a50:875e:: with SMTP id 30mr6924101edv.45.1573169377860; Thu, 07 Nov 2019 15:29:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573169377; cv=none; d=google.com; s=arc-20160816; b=e+ARzpID11bv3S27Bu2+hWzvgbDxAjulHCHF9RkzO3IGfEZ5IcR9z2yyBfVYY6zlPz w+ljy5YnEecdOK7+NclzH7P7XGPOBy7xLUgOwUtnUDA5nGTomj3yLP2UQULT4y6rqHzb Epj1/6GA2xwR0mV3kgROep2U4n+WTqmVK6GASMnqvLm5euIUnwDCGObaAjIJUzjptzWd lR6spuHHhzddqc+CjDQn/oVoEODe+TduDs2nkhzi6aBPa6pqsGvispWY+pNx1hVYy80Q dei/x3mNmfPCiCR6lFEa0UE0OfA7gHxDeJs0JXVzAXJtxW6vptlqidG4qWQyb5wuyG6J jZnA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=eeEdv0QtJ307WBwSmqMekG71Dor1PodSsMGowPt5cRw=; b=L3JKNdSd3QtI86wYji+U0nJ5qI+OztqiP/HDNsProuFL6H5DdzqYR45PuMnML7L5dU G5MshIfkVyfVHmq71gzWP8Z8MXIma72DXzDAEO3PwsMe6cZQjKWXVkac89dDPtDjC0PM epVhyWKphpve+sNPY71agANbjHbwab+SNHuYnue9u1SDaRTFFBz4hwhT2ky5DjVocQeE Z8h9KxKIfOf2vuQ0R/Q/Km53NuRgw2NeFF5WgX+9lIacegvnmhGX+rTAa0hgASO9fofj 4WWqaCyoSlUmUyNKYIyuIGZq6gu2juK9i3mvS3qqGcXEWIEBPtmf8/29olPpWOyaAUTf pggg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=oREwbBfw; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id v26si2870255edd.364.2019.11.07.15.29.13; Thu, 07 Nov 2019 15:29:37 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-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=@chromium.org header.s=google header.b=oREwbBfw; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 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 S1728028AbfKGX1v (ORCPT + 99 others); Thu, 7 Nov 2019 18:27:51 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43860 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727984AbfKGX1t (ORCPT ); Thu, 7 Nov 2019 18:27:49 -0500 Received: by mail-pl1-f195.google.com with SMTP id a18so2669219plm.10 for ; Thu, 07 Nov 2019 15:27:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eeEdv0QtJ307WBwSmqMekG71Dor1PodSsMGowPt5cRw=; b=oREwbBfw1sF3vS3Z4ORZRzCXMYwd4LYZu+DoSgbnY5ZMo3Jne4gq5K42JlLgLlQRWj kqGjhNLlbrIZvbix66kBf5o5Va11QRf3LDZx3X/CKcxnPSGB+ZdGkNONb4JpnQUFCNd4 Gg22dFJKACOumz/rQRzTM9z4qwi1cWCeHM9iI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eeEdv0QtJ307WBwSmqMekG71Dor1PodSsMGowPt5cRw=; b=k/aTOA8DQFyPQMI0M+dlHwM49oMDL5amk3KSwMBNcTNq6YI/GHUI/GklAoGIWMDyXz ML3w27IzEocntD3S2Zs0Y3N/awi8RA7BygoY/6srfn86oIVKdbuOpaNi2pHnce2X32Fb GO+nFWwhUD8BSk+8gb+09gzzV5cV00yONiWagDw6gjWtZ35jV0ZNJsdIox2Wq98dAR4e yiyTdT3VDcRkK1ZXdduiOjENnq+wlfzyVhEpheiHv/qlV2wuE+L/XEOXOTMjd+/qsELS clPVqW8kPk5mTddu/c+dVgTGacFnOtmxd5MlnWvp+Ib2ZbzRwG7id87CJdOHAh831SUD 1Utw== X-Gm-Message-State: APjAAAVU28X/VEV1938EChyTwSwE0au7WXGgN2vhQfxF16GEXEnGVzYs 1lY4yAbp6xFbIA6mM7QqcJeyRQ== X-Received: by 2002:a17:90a:326b:: with SMTP id k98mr8926333pjb.50.1573169269037; Thu, 07 Nov 2019 15:27:49 -0800 (PST) Received: from apsdesk.mtv.corp.google.com ([2620:15c:202:1:e09a:8d06:a338:aafb]) by smtp.gmail.com with ESMTPSA id h3sm2857579pji.16.2019.11.07.15.27.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 15:27:48 -0800 (PST) From: Abhishek Pandit-Subedi To: Marcel Holtmann , Johan Hedberg , Rob Herring Cc: linux-bluetooth@vger.kernel.org, dianders@chromium.org, Abhishek Pandit-Subedi , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/4] Bluetooth: btbcm: Support pcm configuration Date: Thu, 7 Nov 2019 15:27:10 -0800 Message-Id: <20191107232713.48577-3-abhishekpandit@chromium.org> X-Mailer: git-send-email 2.24.0.rc1.363.gb1bccd3e3d-goog In-Reply-To: <20191107232713.48577-1-abhishekpandit@chromium.org> References: <20191107232713.48577-1-abhishekpandit@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Add BCM vendor specific commands to configure PCM. Signed-off-by: Abhishek Pandit-Subedi --- Changes in v2: None drivers/bluetooth/btbcm.c | 35 +++++++++++++++++++++++++++++++++++ drivers/bluetooth/btbcm.h | 10 ++++++++++ 2 files changed, 45 insertions(+) diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c index 2d2e6d862068..f052518f7b0c 100644 --- a/drivers/bluetooth/btbcm.c +++ b/drivers/bluetooth/btbcm.c @@ -105,6 +105,41 @@ int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) } EXPORT_SYMBOL_GPL(btbcm_set_bdaddr); +int btbcm_set_pcm_params(struct hci_dev *hdev, + const struct bcm_set_pcm_int_params *int_params, + const struct bcm_set_pcm_format_params *format_params) +{ + struct sk_buff *skb; + int err; + + if (int_params) { + skb = __hci_cmd_sync(hdev, 0xfc1c, 5, int_params, + HCI_INIT_TIMEOUT); + if (IS_ERR(skb)) { + err = PTR_ERR(skb); + bt_dev_err(hdev, "BCM: Set PCM int params failed (%d)", + err); + return err; + } + kfree_skb(skb); + } + + if (format_params) { + skb = __hci_cmd_sync(hdev, 0xfc1e, 5, format_params, + HCI_INIT_TIMEOUT); + if (IS_ERR(skb)) { + err = PTR_ERR(skb); + bt_dev_err(hdev, "BCM: Set PCM data params failed (%d)", + err); + return err; + } + kfree_skb(skb); + } + + return 0; +} +EXPORT_SYMBOL_GPL(btbcm_set_pcm_params); + int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw) { const struct hci_command_hdr *cmd; diff --git a/drivers/bluetooth/btbcm.h b/drivers/bluetooth/btbcm.h index d204be8a84bf..f0a63c65544e 100644 --- a/drivers/bluetooth/btbcm.h +++ b/drivers/bluetooth/btbcm.h @@ -54,6 +54,9 @@ struct bcm_set_pcm_format_params { int btbcm_check_bdaddr(struct hci_dev *hdev); int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr); int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw); +int btbcm_set_pcm_params(struct hci_dev *hdev, + const struct bcm_set_pcm_int_params *int_params, + const struct bcm_set_pcm_format_params *format_params); int btbcm_setup_patchram(struct hci_dev *hdev); int btbcm_setup_apple(struct hci_dev *hdev); @@ -74,6 +77,13 @@ static inline int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr) return -EOPNOTSUPP; } +int btbcm_set_pcm_params(struct hci_dev *hdev, + const struct bcm_set_pcm_int_params *int_params, + const struct bcm_set_pcm_format_params *format_params) +{ + return -EOPNOTSUPP; +} + static inline int btbcm_patchram(struct hci_dev *hdev, const struct firmware *fw) { return -EOPNOTSUPP; -- 2.24.0.rc1.363.gb1bccd3e3d-goog