aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2018-03-16 16:28:07 -0400
committerMarcel Holtmann <marcel@holtmann.org>2018-04-01 08:25:31 -0400
commite09070c51b280567695022237e57c428e548b355 (patch)
tree44155380d4c8fbbbf4b00e7b5210f42200c02589
parenta41e0796396eeceff673af4a38feaee149c6ff86 (diff)
Bluetooth: hci_bcm: Add irq_polarity module option
Add irq_polarity module option for easier troubleshooting of irq-polarity issues. Cc: stable@vger.kernel.org Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
-rw-r--r--drivers/bluetooth/hci_bcm.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index ff7535e85dea..50c8523f8653 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -126,6 +126,10 @@ struct bcm_data {
126static DEFINE_MUTEX(bcm_device_lock); 126static DEFINE_MUTEX(bcm_device_lock);
127static LIST_HEAD(bcm_device_list); 127static LIST_HEAD(bcm_device_list);
128 128
129static int irq_polarity = -1;
130module_param(irq_polarity, int, 0444);
131MODULE_PARM_DESC(irq_polarity, "IRQ polarity 0: active-high 1: active-low");
132
129static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed) 133static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed)
130{ 134{
131 if (hu->serdev) 135 if (hu->serdev)
@@ -989,11 +993,17 @@ static int bcm_acpi_probe(struct bcm_device *dev)
989 } 993 }
990 acpi_dev_free_resource_list(&resources); 994 acpi_dev_free_resource_list(&resources);
991 995
992 dmi_id = dmi_first_match(bcm_active_low_irq_dmi_table); 996 if (irq_polarity != -1) {
993 if (dmi_id) { 997 dev->irq_active_low = irq_polarity;
994 dev_warn(dev->dev, "%s: Overwriting IRQ polarity to active low", 998 dev_warn(dev->dev, "Overwriting IRQ polarity to active %s by module-param\n",
995 dmi_id->ident); 999 dev->irq_active_low ? "low" : "high");
996 dev->irq_active_low = true; 1000 } else {
1001 dmi_id = dmi_first_match(bcm_active_low_irq_dmi_table);
1002 if (dmi_id) {
1003 dev_warn(dev->dev, "%s: Overwriting IRQ polarity to active low",
1004 dmi_id->ident);
1005 dev->irq_active_low = true;
1006 }
997 } 1007 }
998 1008
999 return 0; 1009 return 0;