Skip to content

Commit

Permalink
Bluetooth: hci_bcm: Fix IRQ polarity for T100
Browse files Browse the repository at this point in the history
ACPI table for BCM2E39 of T100TA is not correct.
Set correct irq_polarity for this device.

Signed-off-by: Frederic Danis <frederic.danis@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Frederic Danis authored and Marcel Holtmann committed Sep 24, 2015
1 parent 594b31e commit 5cebdfe
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions drivers/bluetooth/hci_bcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <linux/gpio/consumer.h>
#include <linux/tty.h>
#include <linux/interrupt.h>
#include <linux/dmi.h>

#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
Expand Down Expand Up @@ -513,6 +514,22 @@ static const struct acpi_gpio_mapping acpi_bcm_default_gpios[] = {
};

#ifdef CONFIG_ACPI
static u8 acpi_active_low = ACPI_ACTIVE_LOW;

/* IRQ polarity of some chipsets are not defined correctly in ACPI table. */
static const struct dmi_system_id bcm_wrong_irq_dmi_table[] = {
{
.ident = "Asus T100TA",
.matches = {
DMI_EXACT_MATCH(DMI_SYS_VENDOR,
"ASUSTeK COMPUTER INC."),
DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T100TA"),
},
.driver_data = &acpi_active_low,
},
{ }
};

static int bcm_resource(struct acpi_resource *ares, void *data)
{
struct bcm_device *dev = data;
Expand Down Expand Up @@ -552,6 +569,7 @@ static int bcm_acpi_probe(struct bcm_device *dev)
const struct acpi_device_id *id;
struct acpi_device *adev;
LIST_HEAD(resources);
const struct dmi_system_id *dmi_id;
int ret;

id = acpi_match_device(pdev->dev.driver->acpi_match_table, &pdev->dev);
Expand Down Expand Up @@ -608,6 +626,13 @@ static int bcm_acpi_probe(struct bcm_device *dev)

acpi_dev_get_resources(adev, &resources, bcm_resource, dev);

dmi_id = dmi_first_match(bcm_wrong_irq_dmi_table);
if (dmi_id) {
bt_dev_warn(dev, "%s: Overwriting IRQ polarity to active low",
dmi_id->ident);
dev->irq_polarity = *(u8 *)dmi_id->driver_data;
}

return 0;
}
#else
Expand Down

0 comments on commit 5cebdfe

Please sign in to comment.