Commit eb762b94 authored by Abhishek Pandit-Subedi's avatar Abhishek Pandit-Subedi Committed by Johan Hedberg

Bluetooth: hci_bcm: Support pcm params in dts

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: default avatarAbhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarJohan Hedberg <johan.hedberg@intel.com>
parent 6fc0e190
...@@ -122,6 +122,7 @@ struct bcm_device { ...@@ -122,6 +122,7 @@ struct bcm_device {
bool is_suspended; bool is_suspended;
#endif #endif
bool no_early_set_baudrate; bool no_early_set_baudrate;
u8 pcm_int_params[5];
}; };
/* generic bcm uart resources */ /* generic bcm uart resources */
...@@ -594,6 +595,16 @@ static int bcm_setup(struct hci_uart *hu) ...@@ -594,6 +595,16 @@ static int bcm_setup(struct hci_uart *hu)
host_set_baudrate(hu, speed); 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, &params);
memcpy(&params, bcm->dev->pcm_int_params, 5);
btbcm_write_pcm_int_params(hu->hdev, &params);
}
finalize: finalize:
release_firmware(fw); release_firmware(fw);
...@@ -1131,6 +1142,8 @@ static int bcm_acpi_probe(struct bcm_device *dev) ...@@ -1131,6 +1142,8 @@ static int bcm_acpi_probe(struct bcm_device *dev)
static int bcm_of_probe(struct bcm_device *bdev) static int bcm_of_probe(struct bcm_device *bdev)
{ {
device_property_read_u32(bdev->dev, "max-speed", &bdev->oper_speed); 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; return 0;
} }
...@@ -1146,6 +1159,9 @@ static int bcm_probe(struct platform_device *pdev) ...@@ -1146,6 +1159,9 @@ static int bcm_probe(struct platform_device *pdev)
dev->dev = &pdev->dev; dev->dev = &pdev->dev;
dev->irq = platform_get_irq(pdev, 0); dev->irq = platform_get_irq(pdev, 0);
/* Initialize routing field to an unused value */
dev->pcm_int_params[0] = 0xff;
if (has_acpi_companion(&pdev->dev)) { if (has_acpi_companion(&pdev->dev)) {
ret = bcm_acpi_probe(dev); ret = bcm_acpi_probe(dev);
if (ret) if (ret)
...@@ -1406,6 +1422,9 @@ static int bcm_serdev_probe(struct serdev_device *serdev) ...@@ -1406,6 +1422,9 @@ static int bcm_serdev_probe(struct serdev_device *serdev)
bcmdev->serdev_hu.serdev = serdev; bcmdev->serdev_hu.serdev = serdev;
serdev_device_set_drvdata(serdev, bcmdev); serdev_device_set_drvdata(serdev, bcmdev);
/* Initialize routing field to an unused value */
bcmdev->pcm_int_params[0] = 0xff;
if (has_acpi_companion(&serdev->dev)) if (has_acpi_companion(&serdev->dev))
err = bcm_acpi_probe(bcmdev); err = bcm_acpi_probe(bcmdev);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment