Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3224151ybc; Mon, 25 Nov 2019 10:56:35 -0800 (PST) X-Google-Smtp-Source: APXvYqwUnk8CsSka/l6uulREzKThKVcI/cWj0NGFEgJjCjvt0ahLzBEDdhENLvQGebyLmJg4t78F X-Received: by 2002:a05:6402:17e7:: with SMTP id t7mr13876066edy.114.1574708195075; Mon, 25 Nov 2019 10:56:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574708195; cv=none; d=google.com; s=arc-20160816; b=NfBrNjHB1BV3zrJuBf9+4j0Xw4RvyhwZJSzikznOqp72/lM4QRAgc0MFHchBIrViwl qiJBZli3VLmyOK/Ts+Gh3OsG8oBHqjdoWuKuCtbDvVdTEVr3L/YfZ68RWNAtGTOvCh9S UrlxD/hhjz/3boB4iFcS0maaVVzLAfgNby6e9xl4hJrbixV2CUiUsovmWDhLjawgD1QX oKqSuA2+rE5x8g1sRKEtbY2o8smBpM8Z9gvFO6Z846K5GI6YSGhZ5ZuZ8JBP5+oklXS6 wcxtybqfOz+cOpqUbSMdAAJg5+eAwzu8hbq3dG7EVvfnLv2lHjZd5Y2rb05LYvvWYHOC CzVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Pkkdhb+/Z2QWGsdN+hFDKjr9JHaHTnQp4dHTiLqkWCs=; b=d5jmxXTYPE9ShDxPtGxvH5viVhNVZ5L+5qwNmUq+Gln7pz/5LykIzAU83eojVfRUWq 3Pn5PheUxN+X12RBA9GiG6mw0YGvJJvULH9R85s001Q48UddzjTaFZEB9ccrkQDlUl7N t0TBU5nl+NMtKZFyOUYTW9vqix2sOBQ4FTq/B/EX0S1h90Xpo5St9JgaN9ieqBcPDaSO 4On4t2qD+77XGzxPG5dipVTffY3IDC+3xbWBIuySzGHxypPAqcdZhg3D+RXlaidc6wYh AWgFEsHGl3/XoV04azCB4lwR8J8tGHHEhLaUDvbjdUYhxSRVfUWd/KoB4WsMk+AFHZ0N 5mOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JxDiWV9k; 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 w54si6258516eda.214.2019.11.25.10.56.10; Mon, 25 Nov 2019 10:56:35 -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=JxDiWV9k; 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 S1727176AbfKYSTZ (ORCPT + 99 others); Mon, 25 Nov 2019 13:19:25 -0500 Received: from mail-qv1-f67.google.com ([209.85.219.67]:33487 "EHLO mail-qv1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727130AbfKYSTZ (ORCPT ); Mon, 25 Nov 2019 13:19:25 -0500 Received: by mail-qv1-f67.google.com with SMTP id x14so6161601qvu.0 for ; Mon, 25 Nov 2019 10:19:23 -0800 (PST) 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; bh=Pkkdhb+/Z2QWGsdN+hFDKjr9JHaHTnQp4dHTiLqkWCs=; b=JxDiWV9kUkV0x0caXAQLBYv8HAHTaDaSDVzUUfjVgLeqzLZVD10aQACqu3SpISL3mv CYJhD8g4TLv5ZsxxPj+DSYQoDovH9LgaPoNYjAkbDG7sEpVkVT2RcZaGGlTd2ecqFvQe UkJ54kb7+LQutUvWFnvV4tErVsSRDS4b5dPsw= 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; bh=Pkkdhb+/Z2QWGsdN+hFDKjr9JHaHTnQp4dHTiLqkWCs=; b=k9v5nwcAp2dt9+jL2GkIWzrxkYJ5S9XlpD0R8beWiZU5lNa+i83FuhUx6+c3sZBJ0e 3FLp9n8fSyslFWl6lZwqJLUdkcpjWunpi3yVW82dRuOdnlKpct2tzrtyyMyrEWZAncuQ EwvjLU3xO7R0XlozMarwGppgWsJeXDi1jhJgOSLfgdoSWEsWIzvdDYkqQB3i6IJeYTew Vf+smUuF748wVy9ptnJSTMf5hkrwXHiQzF7CBASgTx0jBUYVIUcuQGFmaVbBaW85J3dX iZkcHUGDVYiiL93PSPE7ZotcvgQLUQDYCbuv5NP+kdkyK8QvhlfOkUTOs+3P0iFjFLKF 6pGw== X-Gm-Message-State: APjAAAXMfEonkaVbnLAADxkxF0MAYCo6AmN0YYFZQfrDVBB5fmPttabi btaPHTDFrfxFfHxshrJxDFffgqY6ktPy24WRmzY8TtW+ X-Received: by 2002:a05:6214:547:: with SMTP id ci7mr28977858qvb.32.1574705962934; Mon, 25 Nov 2019 10:19:22 -0800 (PST) MIME-Version: 1.0 References: <20191123100111.219190-4-marcel@holtmann.org> In-Reply-To: <20191123100111.219190-4-marcel@holtmann.org> From: Abhishek Pandit-Subedi Date: Mon, 25 Nov 2019 10:19:11 -0800 Message-ID: Subject: Re: [PATCH 4/4] Bluetooth: hci_bcm: Support pcm params in dts To: Marcel Holtmann Cc: linux-bluetooth@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Sat, Nov 23, 2019 at 2:01 AM Marcel Holtmann wrote: > > 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); This seems redundant since we just overwrite it anyway. > + > + 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 */ unused > + 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 */ unused > + bcmdev->pcm_int_params[0] = 0xff; > + > if (has_acpi_companion(&serdev->dev)) > err = bcm_acpi_probe(bcmdev); > else > -- > 2.23.0 >