* [PATCH] Add PCI ID and quirk for Intersil/Techwell TW686[4589] AV capture cards.
@ 2015-06-19 8:00 Krzysztof Hałasa
2015-06-19 22:13 ` Bjorn Helgaas
0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Hałasa @ 2015-06-19 8:00 UTC (permalink / raw)
To: Bjorn Helgaas, linux-pci, linux-kernel
Intersil/Techwell TW686[4589]-based video capture cards have an empty
(zero) class code. Fix it.
Signed-off-by: Krzysztof Hałasa <khalasa@piap.pl>
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3662,6 +3662,26 @@ DECLARE_PCI_FIXUP_HEADER(0x1283, 0x8892, quirk_use_pcie_bridge_dma_alias);
DECLARE_PCI_FIXUP_HEADER(0x8086, 0x244e, quirk_use_pcie_bridge_dma_alias);
/*
+ * Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero)
+ * class code. Fix it.
+ */
+
+static void quirk_tw686x_class(struct pci_dev *pdev)
+{
+ /* Use "Multimedia controller" class */
+ pdev->class = 0x048001;
+ dev_info(&pdev->dev, "TW686x PCI class workaround enabled\n");
+}
+DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6864, PCI_CLASS_NOT_DEFINED, 0,
+ quirk_tw686x_class);
+DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6865, PCI_CLASS_NOT_DEFINED, 0,
+ quirk_tw686x_class);
+DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6868, PCI_CLASS_NOT_DEFINED, 0,
+ quirk_tw686x_class);
+DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6869, PCI_CLASS_NOT_DEFINED, 0,
+ quirk_tw686x_class);
+
+/*
* AMD has indicated that the devices below do not support peer-to-peer
* in any system where they are found in the southbridge with an AMD
* IOMMU in the system. Multifunction devices that do not support
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Add PCI ID and quirk for Intersil/Techwell TW686[4589] AV capture cards.
2015-06-19 8:00 [PATCH] Add PCI ID and quirk for Intersil/Techwell TW686[4589] AV capture cards Krzysztof Hałasa
@ 2015-06-19 22:13 ` Bjorn Helgaas
2015-06-22 5:35 ` Krzysztof Hałasa
0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2015-06-19 22:13 UTC (permalink / raw)
To: Krzysztof Hałasa; +Cc: linux-pci, linux-kernel
On Fri, Jun 19, 2015 at 10:00:15AM +0200, Krzysztof Hałasa wrote:
> Intersil/Techwell TW686[4589]-based video capture cards have an empty
> (zero) class code. Fix it.
>
> Signed-off-by: Krzysztof Hałasa <khalasa@piap.pl>
Applied to pci/misc for v4.2, with minor tweak as below to use
PCI_CLASS_MULTIMEDIA_OTHER instead of a bare number. Let me know
if you see any issues with this. Thanks!
commit c1aa4f19cb8f7974126f2da74a35ae4ca1e60017
Author: Krzysztof =?utf-8?Q?Ha=C5=82asa?= <khalasa@piap.pl>
Date: Fri Jun 19 10:00:15 2015 +0200
PCI: Add quirk for Intersil/Techwell TW686[4589] AV capture cards
Intersil/Techwell TW686[4589]-based video capture cards have an empty
(zero) class code. Fix it.
Signed-off-by: Krzysztof Hałasa <khalasa@piap.pl>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 54fa458..cbe0351 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -3671,6 +3671,28 @@ DECLARE_PCI_FIXUP_HEADER(0x1283, 0x8892, quirk_use_pcie_bridge_dma_alias);
DECLARE_PCI_FIXUP_HEADER(0x8086, 0x244e, quirk_use_pcie_bridge_dma_alias);
/*
+ * Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero)
+ * class code. Fix it.
+ */
+static void quirk_tw686x_class(struct pci_dev *pdev)
+{
+ u32 class = pdev->class;
+
+ /* Use "Multimedia controller" class */
+ pdev->class = (PCI_CLASS_MULTIMEDIA_OTHER << 8) | 0x01;
+ dev_info(&pdev->dev, "TW686x PCI class overridden (%#08x -> %#08x)\n",
+ class, pdev->class);
+}
+DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6864, PCI_CLASS_NOT_DEFINED, 0,
+ quirk_tw686x_class);
+DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6865, PCI_CLASS_NOT_DEFINED, 0,
+ quirk_tw686x_class);
+DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6868, PCI_CLASS_NOT_DEFINED, 0,
+ quirk_tw686x_class);
+DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6869, PCI_CLASS_NOT_DEFINED, 0,
+ quirk_tw686x_class);
+
+/*
* AMD has indicated that the devices below do not support peer-to-peer
* in any system where they are found in the southbridge with an AMD
* IOMMU in the system. Multifunction devices that do not support
>
> --- a/drivers/pci/quirks.c
> +++ b/drivers/pci/quirks.c
> @@ -3662,6 +3662,26 @@ DECLARE_PCI_FIXUP_HEADER(0x1283, 0x8892, quirk_use_pcie_bridge_dma_alias);
> DECLARE_PCI_FIXUP_HEADER(0x8086, 0x244e, quirk_use_pcie_bridge_dma_alias);
>
> /*
> + * Intersil/Techwell TW686[4589]-based video capture cards have an empty (zero)
> + * class code. Fix it.
> + */
> +
> +static void quirk_tw686x_class(struct pci_dev *pdev)
> +{
> + /* Use "Multimedia controller" class */
> + pdev->class = 0x048001;
> + dev_info(&pdev->dev, "TW686x PCI class workaround enabled\n");
> +}
> +DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6864, PCI_CLASS_NOT_DEFINED, 0,
> + quirk_tw686x_class);
> +DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6865, PCI_CLASS_NOT_DEFINED, 0,
> + quirk_tw686x_class);
> +DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6868, PCI_CLASS_NOT_DEFINED, 0,
> + quirk_tw686x_class);
> +DECLARE_PCI_FIXUP_CLASS_EARLY(0x1797, 0x6869, PCI_CLASS_NOT_DEFINED, 0,
> + quirk_tw686x_class);
> +
> +/*
> * AMD has indicated that the devices below do not support peer-to-peer
> * in any system where they are found in the southbridge with an AMD
> * IOMMU in the system. Multifunction devices that do not support
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Add PCI ID and quirk for Intersil/Techwell TW686[4589] AV capture cards.
2015-06-19 22:13 ` Bjorn Helgaas
@ 2015-06-22 5:35 ` Krzysztof Hałasa
0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Hałasa @ 2015-06-22 5:35 UTC (permalink / raw)
To: Bjorn Helgaas; +Cc: linux-pci, linux-kernel
Bjorn Helgaas <bhelgaas@google.com> writes:
>> Intersil/Techwell TW686[4589]-based video capture cards have an empty
>> (zero) class code. Fix it.
>>
> Applied to pci/misc for v4.2, with minor tweak as below to use
> PCI_CLASS_MULTIMEDIA_OTHER instead of a bare number. Let me know
> if you see any issues with this. Thanks!
Can't see any, thanks a lot.
--
Krzysztof Halasa
Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-06-22 5:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-19 8:00 [PATCH] Add PCI ID and quirk for Intersil/Techwell TW686[4589] AV capture cards Krzysztof Hałasa
2015-06-19 22:13 ` Bjorn Helgaas
2015-06-22 5:35 ` Krzysztof Hałasa
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).