Skip to content

Commit 212d718

Browse files
andy-shevholtmann
authored andcommitted
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>
1 parent 17e41ea commit 212d718

File tree

1 file changed

+33
-17
lines changed

1 file changed

+33
-17
lines changed

drivers/bluetooth/hci_bcm.c

Lines changed: 33 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -697,28 +697,14 @@ static int bcm_resource(struct acpi_resource *ares, void *data)
697697
/* Always tell the ACPI core to skip this resource */
698698
return 1;
699699
}
700+
#endif /* CONFIG_ACPI */
700701

701-
static int bcm_acpi_probe(struct bcm_device *dev)
702+
static int bcm_platform_probe(struct bcm_device *dev)
702703
{
703704
struct platform_device *pdev = dev->pdev;
704-
LIST_HEAD(resources);
705-
const struct dmi_system_id *dmi_id;
706-
const struct acpi_gpio_mapping *gpio_mapping = acpi_bcm_int_last_gpios;
707-
const struct acpi_device_id *id;
708-
int ret;
709705

710706
dev->name = dev_name(&pdev->dev);
711707

712-
/* Retrieve GPIO data */
713-
id = acpi_match_device(pdev->dev.driver->acpi_match_table, &pdev->dev);
714-
if (id)
715-
gpio_mapping = (const struct acpi_gpio_mapping *) id->driver_data;
716-
717-
ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(&pdev->dev),
718-
gpio_mapping);
719-
if (ret)
720-
return ret;
721-
722708
dev->clk = devm_clk_get(&pdev->dev, NULL);
723709

724710
dev->device_wakeup = devm_gpiod_get_optional(&pdev->dev,
@@ -755,6 +741,33 @@ static int bcm_acpi_probe(struct bcm_device *dev)
755741
return -EINVAL;
756742
}
757743

744+
return 0;
745+
}
746+
747+
#ifdef CONFIG_ACPI
748+
static int bcm_acpi_probe(struct bcm_device *dev)
749+
{
750+
struct platform_device *pdev = dev->pdev;
751+
LIST_HEAD(resources);
752+
const struct dmi_system_id *dmi_id;
753+
const struct acpi_gpio_mapping *gpio_mapping = acpi_bcm_int_last_gpios;
754+
const struct acpi_device_id *id;
755+
int ret;
756+
757+
/* Retrieve GPIO data */
758+
id = acpi_match_device(pdev->dev.driver->acpi_match_table, &pdev->dev);
759+
if (id)
760+
gpio_mapping = (const struct acpi_gpio_mapping *) id->driver_data;
761+
762+
ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(&pdev->dev),
763+
gpio_mapping);
764+
if (ret)
765+
return ret;
766+
767+
ret = bcm_platform_probe(dev);
768+
if (ret)
769+
return ret;
770+
758771
/* Retrieve UART ACPI info */
759772
ret = acpi_dev_get_resources(ACPI_COMPANION(&dev->pdev->dev),
760773
&resources, bcm_resource, dev);
@@ -789,7 +802,10 @@ static int bcm_probe(struct platform_device *pdev)
789802

790803
dev->pdev = pdev;
791804

792-
ret = bcm_acpi_probe(dev);
805+
if (has_acpi_companion(&pdev->dev))
806+
ret = bcm_acpi_probe(dev);
807+
else
808+
ret = bcm_platform_probe(dev);
793809
if (ret)
794810
return ret;
795811

0 commit comments

Comments
 (0)