mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-27 12:32:50 +00:00
Remove static for intel_vsec_add_aux() and export this interface so that it can be used by other vsec related modules. This driver creates aux devices by parsing PCI-VSEC, which allows individual drivers to load on those devices. Those driver may further create more devices on aux bus by parsing the PCI MMIO region. For example, TPMI (Topology Aware Register and PM Capsule Interface) creates device nodes for power management features by parsing MMIO region. When TPMI driver creates devices, it can reuse existing function intel_vsec_add_aux() to create aux devices with TPMI device as the parent. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Acked-by: David E. Box <david.e.box@linux.intel.com> Link: https://lore.kernel.org/r/20230202010738.2186174-3-srinivas.pandruvada@linux.intel.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
57 lines
1.4 KiB
C
57 lines
1.4 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _VSEC_H
|
|
#define _VSEC_H
|
|
|
|
#include <linux/auxiliary_bus.h>
|
|
#include <linux/bits.h>
|
|
|
|
struct pci_dev;
|
|
struct resource;
|
|
|
|
enum intel_vsec_quirks {
|
|
/* Watcher feature not supported */
|
|
VSEC_QUIRK_NO_WATCHER = BIT(0),
|
|
|
|
/* Crashlog feature not supported */
|
|
VSEC_QUIRK_NO_CRASHLOG = BIT(1),
|
|
|
|
/* Use shift instead of mask to read discovery table offset */
|
|
VSEC_QUIRK_TABLE_SHIFT = BIT(2),
|
|
|
|
/* DVSEC not present (provided in driver data) */
|
|
VSEC_QUIRK_NO_DVSEC = BIT(3),
|
|
|
|
/* Platforms requiring quirk in the auxiliary driver */
|
|
VSEC_QUIRK_EARLY_HW = BIT(4),
|
|
};
|
|
|
|
/* Platform specific data */
|
|
struct intel_vsec_platform_info {
|
|
struct intel_vsec_header **capabilities;
|
|
unsigned long quirks;
|
|
};
|
|
|
|
struct intel_vsec_device {
|
|
struct auxiliary_device auxdev;
|
|
struct pci_dev *pcidev;
|
|
struct resource *resource;
|
|
struct ida *ida;
|
|
struct intel_vsec_platform_info *info;
|
|
int num_resources;
|
|
};
|
|
|
|
int intel_vsec_add_aux(struct pci_dev *pdev, struct device *parent,
|
|
struct intel_vsec_device *intel_vsec_dev,
|
|
const char *name);
|
|
|
|
static inline struct intel_vsec_device *dev_to_ivdev(struct device *dev)
|
|
{
|
|
return container_of(dev, struct intel_vsec_device, auxdev.dev);
|
|
}
|
|
|
|
static inline struct intel_vsec_device *auxdev_to_ivdev(struct auxiliary_device *auxdev)
|
|
{
|
|
return container_of(auxdev, struct intel_vsec_device, auxdev);
|
|
}
|
|
#endif
|