summaryrefslogtreecommitdiffstats
path: root/drivers/misc/mei/hdcp
diff options
context:
space:
mode:
authorAlexander Usyskin <alexander.usyskin@intel.com>2024-01-23 11:16:22 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-31 01:19:59 +0100
commit6244a8b6e3fc39f6d78911b4e8e0f595be1101b4 (patch)
treeb4df98ccc200d4b42dc8f495b50cceb41857b80c /drivers/misc/mei/hdcp
parentmei: gsc: add support for auxiliary device created by Xe driver (diff)
downloadlinux-6244a8b6e3fc39f6d78911b4e8e0f595be1101b4.tar.xz
linux-6244a8b6e3fc39f6d78911b4e8e0f595be1101b4.zip
mei: hdcp: match without driver name
Xe driver uses this component too, but current match function matches by i915 driver name. Remove dependency on i915 driver name in component_match function. Use PCI header information to match Intel graphics device. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Link: https://lore.kernel.org/r/20240123101625.220365-2-tomas.winkler@intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/hdcp')
-rw-r--r--drivers/misc/mei/hdcp/mei_hdcp.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c
index 51359cc5ece9..f8759a6c9ed3 100644
--- a/drivers/misc/mei/hdcp/mei_hdcp.c
+++ b/drivers/misc/mei/hdcp/mei_hdcp.c
@@ -17,6 +17,7 @@
*/
#include <linux/module.h>
+#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/mei.h>
#include <linux/mei_cl_bus.h>
@@ -781,9 +782,18 @@ static int mei_hdcp_component_match(struct device *dev, int subcomponent,
void *data)
{
struct device *base = data;
+ struct pci_dev *pdev;
- if (!dev->driver || strcmp(dev->driver->name, "i915") ||
- subcomponent != I915_COMPONENT_HDCP)
+ if (!dev_is_pci(dev))
+ return 0;
+
+ pdev = to_pci_dev(dev);
+
+ if (pdev->class != (PCI_CLASS_DISPLAY_VGA << 8) ||
+ pdev->vendor != PCI_VENDOR_ID_INTEL)
+ return 0;
+
+ if (subcomponent != I915_COMPONENT_HDCP)
return 0;
base = base->parent;