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

Commit 03c75362 authored by Anisse Astier's avatar Anisse Astier Committed by Greg Kroah-Hartman
Browse files

ehci: refactor pci quirk to use standard dmi_check_system method



In commit 3610ea53 (ehci: workaround for pci
quirk timeout on ExoPC), a workaround was added to skip the negociation for
the handoff of the EHCI controller.

Refactor the DMI detection code to use standard dmi_check_system function.

Signed-off-by: default avatarAnisse Astier <anisse@astier.eu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent cc62a7eb
Loading
Loading
Loading
Loading
+14 −7
Original line number Original line Diff line number Diff line
@@ -507,20 +507,27 @@ static void __devinit quirk_usb_handoff_ohci(struct pci_dev *pdev)
	iounmap(base);
	iounmap(base);
}
}


static const struct dmi_system_id __initconst ehci_dmi_nohandoff_table[] = {
	{
		/*  Pegatron Lucid (ExoPC) */
		.matches = {
			DMI_MATCH(DMI_BOARD_NAME, "EXOPG06411"),
			DMI_MATCH(DMI_BIOS_VERSION, "Lucid-CE-133"),
		},
	},
	{ }
};

static void __devinit ehci_bios_handoff(struct pci_dev *pdev,
static void __devinit ehci_bios_handoff(struct pci_dev *pdev,
					void __iomem *op_reg_base,
					void __iomem *op_reg_base,
					u32 cap, u8 offset)
					u32 cap, u8 offset)
{
{
	int try_handoff = 1, tried_handoff = 0;
	int try_handoff = 1, tried_handoff = 0;


	/* The Pegatron Lucid (ExoPC) tablet sporadically waits for 90
	/* The Pegatron Lucid tablet sporadically waits for 98 seconds trying
	 * seconds trying the handoff on its unused controller.  Skip
	 * the handoff on its unused controller.  Skip it. */
	 * it. */
	if (pdev->vendor == 0x8086 && pdev->device == 0x283a) {
	if (pdev->vendor == 0x8086 && pdev->device == 0x283a) {
		const char *dmi_bn = dmi_get_system_info(DMI_BOARD_NAME);
		if (dmi_check_system(ehci_dmi_nohandoff_table))
		const char *dmi_bv = dmi_get_system_info(DMI_BIOS_VERSION);
		if (dmi_bn && !strcmp(dmi_bn, "EXOPG06411") &&
		    dmi_bv && !strcmp(dmi_bv, "Lucid-CE-133"))
			try_handoff = 0;
			try_handoff = 0;
	}
	}