All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH resend 0/1] Bluetooth: hci_bcm: Add the Asus TF103C to the bcm_broken_irq_dmi_table
@ 2022-02-28 11:38 Hans de Goede
  2022-02-28 11:38 ` [PATCH resend 1/1] " Hans de Goede
  2022-03-18  9:40 ` [PATCH resend 0/1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 5+ messages in thread
From: Hans de Goede @ 2022-02-28 11:38 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz
  Cc: Hans de Goede, linux-bluetooth

Hi All,

This patch seems to have fallen through the cracks, hence this resend.

Regards,

Hans


Hans de Goede (1):
  Bluetooth: hci_bcm: Add the Asus TF103C to the
    bcm_broken_irq_dmi_table

 drivers/bluetooth/hci_bcm.c | 44 ++++++++++++++++++++++++++++++-------
 1 file changed, 36 insertions(+), 8 deletions(-)

-- 
2.35.1


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

* [PATCH resend 1/1] Bluetooth: hci_bcm: Add the Asus TF103C to the bcm_broken_irq_dmi_table
  2022-02-28 11:38 [PATCH resend 0/1] Bluetooth: hci_bcm: Add the Asus TF103C to the bcm_broken_irq_dmi_table Hans de Goede
@ 2022-02-28 11:38 ` Hans de Goede
  2022-02-28 14:03   ` bluez.test.bot
  2022-03-18  9:30   ` [PATCH resend 1/1] " Marcel Holtmann
  2022-03-18  9:40 ` [PATCH resend 0/1] " patchwork-bot+bluetooth
  1 sibling, 2 replies; 5+ messages in thread
From: Hans de Goede @ 2022-02-28 11:38 UTC (permalink / raw)
  To: Marcel Holtmann, Johan Hedberg, Luiz Augusto von Dentz
  Cc: Hans de Goede, linux-bluetooth

The DSDT for the Asus TF103C specifies a IOAPIC IRQ for the HCI -> host IRQ
but this is not correct. Unlike the previous entries in the table, this
time the correct GPIO to use instead is known; and the TF103C is battery
powered making runtime-pm support more important.

Extend the bcm_broken_irq_dmi_table mechanism to allow specifying the right
GPIO instead of just always disabling runtime-pm and add an entry to it for
the Asus TF103C.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/bluetooth/hci_bcm.c | 44 ++++++++++++++++++++++++++++++-------
 1 file changed, 36 insertions(+), 8 deletions(-)

diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index d634a27bc850..d3747e049cb7 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -20,6 +20,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/clk.h>
 #include <linux/gpio/consumer.h>
+#include <linux/gpio/machine.h>
 #include <linux/tty.h>
 #include <linux/interrupt.h>
 #include <linux/dmi.h>
@@ -870,7 +871,23 @@ static int bcm_resume(struct device *dev)
 #endif
 
 /* Some firmware reports an IRQ which does not work (wrong pin in fw table?) */
+static struct gpiod_lookup_table asus_tf103c_irq_gpios = {
+	.dev_id = "serial0-0",
+	.table = {
+		GPIO_LOOKUP("INT33FC:02", 17, "host-wakeup-alt", GPIO_ACTIVE_HIGH),
+		{ }
+	},
+};
+
 static const struct dmi_system_id bcm_broken_irq_dmi_table[] = {
+	{
+		.ident = "Asus TF103C",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),
+			DMI_MATCH(DMI_PRODUCT_NAME, "TF103C"),
+		},
+		.driver_data = &asus_tf103c_irq_gpios,
+	},
 	{
 		.ident = "Meegopad T08",
 		.matches = {
@@ -1027,7 +1044,8 @@ static struct clk *bcm_get_txco(struct device *dev)
 
 static int bcm_get_resources(struct bcm_device *dev)
 {
-	const struct dmi_system_id *dmi_id;
+	const struct dmi_system_id *broken_irq_dmi_id;
+	const char *irq_con_id = "host-wakeup";
 	int err;
 
 	dev->name = dev_name(dev->dev);
@@ -1083,23 +1101,33 @@ static int bcm_get_resources(struct bcm_device *dev)
 	if (err)
 		return err;
 
+	broken_irq_dmi_id = dmi_first_match(bcm_broken_irq_dmi_table);
+	if (broken_irq_dmi_id && broken_irq_dmi_id->driver_data) {
+		gpiod_add_lookup_table(broken_irq_dmi_id->driver_data);
+		irq_con_id = "host-wakeup-alt";
+		dev->irq_active_low = false;
+		dev->irq = 0;
+	}
+
 	/* IRQ can be declared in ACPI table as Interrupt or GpioInt */
 	if (dev->irq <= 0) {
 		struct gpio_desc *gpio;
 
-		gpio = devm_gpiod_get_optional(dev->dev, "host-wakeup",
-					       GPIOD_IN);
+		gpio = devm_gpiod_get_optional(dev->dev, irq_con_id, GPIOD_IN);
 		if (IS_ERR(gpio))
 			return PTR_ERR(gpio);
 
 		dev->irq = gpiod_to_irq(gpio);
 	}
 
-	dmi_id = dmi_first_match(bcm_broken_irq_dmi_table);
-	if (dmi_id) {
-		dev_info(dev->dev, "%s: Has a broken IRQ config, disabling IRQ support / runtime-pm\n",
-			 dmi_id->ident);
-		dev->irq = 0;
+	if (broken_irq_dmi_id) {
+		if (broken_irq_dmi_id->driver_data) {
+			gpiod_remove_lookup_table(broken_irq_dmi_id->driver_data);
+		} else {
+			dev_info(dev->dev, "%s: Has a broken IRQ config, disabling IRQ support / runtime-pm\n",
+				 broken_irq_dmi_id->ident);
+			dev->irq = 0;
+		}
 	}
 
 	dev_dbg(dev->dev, "BCM irq: %d\n", dev->irq);
-- 
2.35.1


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

* RE: Bluetooth: hci_bcm: Add the Asus TF103C to the bcm_broken_irq_dmi_table
  2022-02-28 11:38 ` [PATCH resend 1/1] " Hans de Goede
@ 2022-02-28 14:03   ` bluez.test.bot
  2022-03-18  9:30   ` [PATCH resend 1/1] " Marcel Holtmann
  1 sibling, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2022-02-28 14:03 UTC (permalink / raw)
  To: linux-bluetooth, hdegoede

[-- Attachment #1: Type: text/plain, Size: 1420 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=618701

---Test result---

Test Summary:
CheckPatch                    PASS      1.64 seconds
GitLint                       FAIL      1.09 seconds
SubjectPrefix                 PASS      0.81 seconds
BuildKernel                   PASS      29.88 seconds
BuildKernel32                 PASS      26.63 seconds
Incremental Build with patchesPASS      36.71 seconds
TestRunner: Setup             PASS      475.23 seconds
TestRunner: l2cap-tester      PASS      13.80 seconds
TestRunner: bnep-tester       PASS      6.17 seconds
TestRunner: mgmt-tester       PASS      105.19 seconds
TestRunner: rfcomm-tester     PASS      8.00 seconds
TestRunner: sco-tester        PASS      7.81 seconds
TestRunner: smp-tester        PASS      7.68 seconds
TestRunner: userchan-tester   PASS      6.42 seconds

Details
##############################
Test: GitLint - FAIL - 1.09 seconds
Run gitlint with rule in .gitlint
[resend,1/1] Bluetooth: hci_bcm: Add the Asus TF103C to the bcm_broken_irq_dmi_table
1: T1 Title exceeds max length (84>80): "[resend,1/1] Bluetooth: hci_bcm: Add the Asus TF103C to the bcm_broken_irq_dmi_table"




---
Regards,
Linux Bluetooth


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

* Re: [PATCH resend 1/1] Bluetooth: hci_bcm: Add the Asus TF103C to the bcm_broken_irq_dmi_table
  2022-02-28 11:38 ` [PATCH resend 1/1] " Hans de Goede
  2022-02-28 14:03   ` bluez.test.bot
@ 2022-03-18  9:30   ` Marcel Holtmann
  1 sibling, 0 replies; 5+ messages in thread
From: Marcel Holtmann @ 2022-03-18  9:30 UTC (permalink / raw)
  To: Hans de Goede; +Cc: Johan Hedberg, Luiz Augusto von Dentz, linux-bluetooth

Hi Hans,

> The DSDT for the Asus TF103C specifies a IOAPIC IRQ for the HCI -> host IRQ
> but this is not correct. Unlike the previous entries in the table, this
> time the correct GPIO to use instead is known; and the TF103C is battery
> powered making runtime-pm support more important.
> 
> Extend the bcm_broken_irq_dmi_table mechanism to allow specifying the right
> GPIO instead of just always disabling runtime-pm and add an entry to it for
> the Asus TF103C.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> drivers/bluetooth/hci_bcm.c | 44 ++++++++++++++++++++++++++++++-------
> 1 file changed, 36 insertions(+), 8 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


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

* Re: [PATCH resend 0/1] Bluetooth: hci_bcm: Add the Asus TF103C to the bcm_broken_irq_dmi_table
  2022-02-28 11:38 [PATCH resend 0/1] Bluetooth: hci_bcm: Add the Asus TF103C to the bcm_broken_irq_dmi_table Hans de Goede
  2022-02-28 11:38 ` [PATCH resend 1/1] " Hans de Goede
@ 2022-03-18  9:40 ` patchwork-bot+bluetooth
  1 sibling, 0 replies; 5+ messages in thread
From: patchwork-bot+bluetooth @ 2022-03-18  9:40 UTC (permalink / raw)
  To: Hans de Goede; +Cc: marcel, johan.hedberg, luiz.dentz, linux-bluetooth

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Marcel Holtmann <marcel@holtmann.org>:

On Mon, 28 Feb 2022 12:38:40 +0100 you wrote:
> Hi All,
> 
> This patch seems to have fallen through the cracks, hence this resend.
> 
> Regards,
> 
> Hans
> 
> [...]

Here is the summary with links:
  - [resend,1/1] Bluetooth: hci_bcm: Add the Asus TF103C to the bcm_broken_irq_dmi_table
    https://git.kernel.org/bluetooth/bluetooth-next/c/cdd7d32d639c

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-03-18  9:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-28 11:38 [PATCH resend 0/1] Bluetooth: hci_bcm: Add the Asus TF103C to the bcm_broken_irq_dmi_table Hans de Goede
2022-02-28 11:38 ` [PATCH resend 1/1] " Hans de Goede
2022-02-28 14:03   ` bluez.test.bot
2022-03-18  9:30   ` [PATCH resend 1/1] " Marcel Holtmann
2022-03-18  9:40 ` [PATCH resend 0/1] " patchwork-bot+bluetooth

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.