linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option
@ 2018-03-16 20:28 Hans de Goede
  2018-03-16 20:28 ` [PATCH 2/5] Bluetooth: hci_bcm: Treat Interrupt ACPI resources as always being active-low Hans de Goede
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Hans de Goede @ 2018-03-16 20:28 UTC (permalink / raw)
  To: Marcel Holtmann, Gustavo Padovan, Johan Hedberg
  Cc: Hans de Goede, linux-bluetooth, linux-serial, linux-acpi, stable

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>
---
 drivers/bluetooth/hci_bcm.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index 5e3aba3c3185..bb6cd1623132 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -126,6 +126,10 @@ struct bcm_data {
 static DEFINE_MUTEX(bcm_device_lock);
 static LIST_HEAD(bcm_device_list);
 
+static int irq_polarity = -1;
+module_param(irq_polarity, int, 0444);
+MODULE_PARM_DESC(irq_polarity, "IRQ polarity 0: active-high 1: active-low");
+
 static inline void host_set_baudrate(struct hci_uart *hu, unsigned int speed)
 {
 	if (hu->serdev)
@@ -988,11 +992,17 @@ static int bcm_acpi_probe(struct bcm_device *dev)
 	}
 	acpi_dev_free_resource_list(&resources);
 
-	dmi_id = dmi_first_match(bcm_active_low_irq_dmi_table);
-	if (dmi_id) {
-		dev_warn(dev->dev, "%s: Overwriting IRQ polarity to active low",
-			    dmi_id->ident);
-		dev->irq_active_low = true;
+	if (irq_polarity != -1) {
+		dev->irq_active_low = irq_polarity;
+		dev_warn(dev->dev, "Overwriting IRQ polarity to active %s by module-param\n",
+			 dev->irq_active_low ? "low" : "high");
+	} else {
+		dmi_id = dmi_first_match(bcm_active_low_irq_dmi_table);
+		if (dmi_id) {
+			dev_warn(dev->dev, "%s: Overwriting IRQ polarity to active low",
+				 dmi_id->ident);
+			dev->irq_active_low = true;
+		}
 	}
 
 	return 0;
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-03-23 20:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-16 20:28 [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option Hans de Goede
2018-03-16 20:28 ` [PATCH 2/5] Bluetooth: hci_bcm: Treat Interrupt ACPI resources as always being active-low Hans de Goede
2018-03-16 20:28 ` [PATCH 3/5] Bluetooth: hci_bcm: Add 6 new ACPI HIDs Hans de Goede
2018-03-23 10:56 ` [PATCH 1/5] Bluetooth: hci_bcm: Add irq_polarity module option Hans de Goede
2018-03-23 11:16   ` Marcel Holtmann
2018-03-23 11:17     ` Hans de Goede
2018-03-23 11:23       ` Marcel Holtmann
2018-03-23 11:30         ` Hans de Goede
2018-03-23 20:51 ` Marcel Holtmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).