Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp469554ybc; Sat, 23 Nov 2019 02:05:33 -0800 (PST) X-Google-Smtp-Source: APXvYqzQsvyt1GGo2UUYFOyEl0dTa8oIoI1yuyZJ7/8/p/F2tOCI7/Bl3yHrBK/tBOGAT4Fs4pKq X-Received: by 2002:a05:6402:791:: with SMTP id d17mr6444365edy.12.1574503533146; Sat, 23 Nov 2019 02:05:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574503533; cv=none; d=google.com; s=arc-20160816; b=ZFtKgQg9OfwNHRF5Gq0NZvzbN4bbfYSbJ3nmAJwwNjviaHheojXMjAXfNBUCeYuMbJ V0LO/2py3mCEJMIE+K4s1MNkfBnIH1rGKtZGHC+gS84yCWuqec+MdP2zoSEkhxG7hL9F qSKUin5nMDCjcOnsUmagRoEpnGktNASyzZkgfCZ7xijjubUCi0vSy10C/c03VRnfz0Cx o2OH1z0FyzQg5yydQoiDxelrouZt9eN/nojFF67TSlo84/9Og7a5ui+CGTqSIonlaSqx lDaXlJgm8vOgxEW8ZHEl8+x2vBA87TbciOA3AdUNOo9kX47cGvhCoQYfl6cYrYvBVZFL qwEw== 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 :message-id:date:subject:to:from; bh=aZk54oS28C18vyZ0MTv88akd2x0y/V6z5wSdulQuFkw=; b=fkoQ+E8a95fKEv6KDDo2fvtYXKP+UpZWLUtkk7pfhamgtjZCY1eEWhkHuQxQguB4lG +dFTb+zdE6PJlqqPdrsHLVVkYf+fo1D4U9p7Afp29lAiD27+o0f1C1a8mdUjQViM5G8s xqwHzYoHczKZ7A6nsVn86LMjymOA3trn7eFxHbrr6KHSOv48tCNrOhvhGsRWBxazuwV5 clegrMkb0sFiRQCmoHGzQX5zWp22bhibbq38L8PTnPc6GxrrSx9Z0znSjxXfNV8nz3jx 8ehb9Ag2pLbzNk63x5wC78Cvhzb+oIzppjXACu/yIZ/MxnzHigbWATETmglZR9Kl1Fzf Rjeg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v11si480315edc.410.2019.11.23.02.05.07; Sat, 23 Nov 2019 02:05:33 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726141AbfKWKBS (ORCPT + 99 others); Sat, 23 Nov 2019 05:01:18 -0500 Received: from coyote.holtmann.net ([212.227.132.17]:44844 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726487AbfKWKBS (ORCPT ); Sat, 23 Nov 2019 05:01:18 -0500 Received: from localhost.localdomain (p4FF9F0D1.dip0.t-ipconnect.de [79.249.240.209]) by mail.holtmann.org (Postfix) with ESMTPSA id 7D86BCECC5 for ; Sat, 23 Nov 2019 11:10:23 +0100 (CET) From: Marcel Holtmann To: linux-bluetooth@vger.kernel.org Subject: [PATCH 4/4] Bluetooth: hci_bcm: Support pcm params in dts Date: Sat, 23 Nov 2019 11:01:11 +0100 Message-Id: <20191123100111.219190-4-marcel@holtmann.org> X-Mailer: git-send-email 2.23.0 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 From: Abhishek Pandit-Subedi BCM chips may require configuration of PCM to operate correctly and there is a vendor specific HCI command to do this. Add support in the hci_bcm driver to parse this from devicetree and configure the chip. Signed-off-by: Abhishek Pandit-Subedi Signed-off-by: Marcel Holtmann --- drivers/bluetooth/hci_bcm.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c index d48044276895..9cfb202bbeca 100644 --- a/drivers/bluetooth/hci_bcm.c +++ b/drivers/bluetooth/hci_bcm.c @@ -122,6 +122,7 @@ struct bcm_device { bool is_suspended; #endif bool no_early_set_baudrate; + u8 pcm_int_params[5]; }; /* generic bcm uart resources */ @@ -594,6 +595,16 @@ static int bcm_setup(struct hci_uart *hu) host_set_baudrate(hu, speed); } + /* PCM parameters if provided */ + if (bcm->dev && bcm->dev->pcm_int_params[0] != 0xff) { + struct bcm_set_pcm_int_params params; + + btbcm_read_pcm_int_params(hu->hdev, ¶ms); + + memcpy(¶ms, bcm->dev->pcm_int_params, 5); + btbcm_write_pcm_int_params(hu->hdev, ¶ms); + } + finalize: release_firmware(fw); @@ -1131,6 +1142,8 @@ static int bcm_acpi_probe(struct bcm_device *dev) static int bcm_of_probe(struct bcm_device *bdev) { device_property_read_u32(bdev->dev, "max-speed", &bdev->oper_speed); + device_property_read_u8_array(bdev->dev, "brcm,bt-pcm-int-params", + bdev->pcm_int_params, 5); return 0; } @@ -1146,6 +1159,9 @@ static int bcm_probe(struct platform_device *pdev) dev->dev = &pdev->dev; dev->irq = platform_get_irq(pdev, 0); + /* Initialize routing field to an unsued value */ + dev->pcm_int_params[0] = 0xff; + if (has_acpi_companion(&pdev->dev)) { ret = bcm_acpi_probe(dev); if (ret) @@ -1406,6 +1422,9 @@ static int bcm_serdev_probe(struct serdev_device *serdev) bcmdev->serdev_hu.serdev = serdev; serdev_device_set_drvdata(serdev, bcmdev); + /* Initialize routing field to an unsued value */ + bcmdev->pcm_int_params[0] = 0xff; + if (has_acpi_companion(&serdev->dev)) err = bcm_acpi_probe(bcmdev); else -- 2.23.0