aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2017-03-10 14:28:20 +0200
committerMarcel Holtmann <marcel@holtmann.org>2017-04-12 22:02:38 +0200
commit212d71833315c65644efc46223db61dee7b3c68e (patch)
tree836ba08b888be4b523080ed1579b54743cf14a6f /drivers/bluetooth
parentBluetooth: btmrvl: wake system up when receives a wake irq (diff)
downloadlinux-dev-212d71833315c65644efc46223db61dee7b3c68e.tar.xz
linux-dev-212d71833315c65644efc46223db61dee7b3c68e.zip
Bluetooth: hci_bcm: Support platform enumeration
Until now the driver supports only ACPI enumeration. Nevertheless Intel Edison SoM has Broadcom Wi-Fi + BT chip and neither ACPI nor DT enumeration mechanism. Enable pure platform driver in order to support Intel Edison SoM. Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/hci_bcm.c50
1 files changed, 33 insertions, 17 deletions
diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index c7d3c6842bcf..04fe5535a153 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -697,28 +697,14 @@ static int bcm_resource(struct acpi_resource *ares, void *data)
/* Always tell the ACPI core to skip this resource */
return 1;
}
+#endif /* CONFIG_ACPI */
-static int bcm_acpi_probe(struct bcm_device *dev)
+static int bcm_platform_probe(struct bcm_device *dev)
{
struct platform_device *pdev = dev->pdev;
- LIST_HEAD(resources);
- const struct dmi_system_id *dmi_id;
- const struct acpi_gpio_mapping *gpio_mapping = acpi_bcm_int_last_gpios;
- const struct acpi_device_id *id;
- int ret;
dev->name = dev_name(&pdev->dev);
- /* Retrieve GPIO data */
- id = acpi_match_device(pdev->dev.driver->acpi_match_table, &pdev->dev);
- if (id)
- gpio_mapping = (const struct acpi_gpio_mapping *) id->driver_data;
-
- ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(&pdev->dev),
- gpio_mapping);
- if (ret)
- return ret;
-
dev->clk = devm_clk_get(&pdev->dev, NULL);
dev->device_wakeup = devm_gpiod_get_optional(&pdev->dev,
@@ -755,6 +741,33 @@ static int bcm_acpi_probe(struct bcm_device *dev)
return -EINVAL;
}
+ return 0;
+}
+
+#ifdef CONFIG_ACPI
+static int bcm_acpi_probe(struct bcm_device *dev)
+{
+ struct platform_device *pdev = dev->pdev;
+ LIST_HEAD(resources);
+ const struct dmi_system_id *dmi_id;
+ const struct acpi_gpio_mapping *gpio_mapping = acpi_bcm_int_last_gpios;
+ const struct acpi_device_id *id;
+ int ret;
+
+ /* Retrieve GPIO data */
+ id = acpi_match_device(pdev->dev.driver->acpi_match_table, &pdev->dev);
+ if (id)
+ gpio_mapping = (const struct acpi_gpio_mapping *) id->driver_data;
+
+ ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(&pdev->dev),
+ gpio_mapping);
+ if (ret)
+ return ret;
+
+ ret = bcm_platform_probe(dev);
+ if (ret)
+ return ret;
+
/* Retrieve UART ACPI info */
ret = acpi_dev_get_resources(ACPI_COMPANION(&dev->pdev->dev),
&resources, bcm_resource, dev);
@@ -789,7 +802,10 @@ static int bcm_probe(struct platform_device *pdev)
dev->pdev = pdev;
- ret = bcm_acpi_probe(dev);
+ if (has_acpi_companion(&pdev->dev))
+ ret = bcm_acpi_probe(dev);
+ else
+ ret = bcm_platform_probe(dev);
if (ret)
return ret;