Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e09070c5 authored by Hans de Goede's avatar Hans de Goede Committed by Marcel Holtmann
Browse files

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: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent a41e0796
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -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)
@@ -989,12 +993,18 @@ static int bcm_acpi_probe(struct bcm_device *dev)
	}
	acpi_dev_free_resource_list(&resources);

	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;
}