JFIF$        dd7 

Viewing File: /usr/src/kernels/5.14.0-570.32.1.el9_6.x86_64/include/drm/drm_module.h

/* SPDX-License-Identifier: MIT */

#ifndef DRM_MODULE_H
#define DRM_MODULE_H

#include <linux/pci.h>
#include <linux/platform_device.h>

#include <drm/drm_drv.h>

/**
 * DOC: overview
 *
 * This library provides helpers registering DRM drivers during module
 * initialization and shutdown. The provided helpers act like bus-specific
 * module helpers, such as module_pci_driver(), but respect additional
 * parameters that control DRM driver registration.
 *
 * Below is an example of initializing a DRM driver for a device on the
 * PCI bus.
 *
 * .. code-block:: c
 *
 *	struct pci_driver my_pci_drv = {
 *	};
 *
 *	drm_module_pci_driver(my_pci_drv);
 *
 * The generated code will test if DRM drivers are enabled and register
 * the PCI driver my_pci_drv. For more complex module initialization, you
 * can still use module_init() and module_exit() in your driver.
 */

/*
 * PCI drivers
 */

static inline int __init drm_pci_register_driver(struct pci_driver *pci_drv)
{
	if (drm_firmware_drivers_only())
		return -ENODEV;

	return pci_register_driver(pci_drv);
}

/**
 * drm_module_pci_driver - Register a DRM driver for PCI-based devices
 * @__pci_drv: the PCI driver structure
 *
 * Registers a DRM driver for devices on the PCI bus. The helper
 * macro behaves like module_pci_driver() but tests the state of
 * drm_firmware_drivers_only(). For more complex module initialization,
 * use module_init() and module_exit() directly.
 *
 * Each module may only use this macro once. Calling it replaces
 * module_init() and module_exit().
 */
#define drm_module_pci_driver(__pci_drv) \
	module_driver(__pci_drv, drm_pci_register_driver, pci_unregister_driver)

static inline int __init
drm_pci_register_driver_if_modeset(struct pci_driver *pci_drv, int modeset)
{
	if (drm_firmware_drivers_only() && modeset == -1)
		return -ENODEV;
	if (modeset == 0)
		return -ENODEV;

	return pci_register_driver(pci_drv);
}

static inline void __exit
drm_pci_unregister_driver_if_modeset(struct pci_driver *pci_drv, int modeset)
{
	pci_unregister_driver(pci_drv);
}

/**
 * drm_module_pci_driver_if_modeset - Register a DRM driver for PCI-based devices
 * @__pci_drv: the PCI driver structure
 * @__modeset: an additional parameter that disables the driver
 *
 * This macro is deprecated and only provided for existing drivers. For
 * new drivers, use drm_module_pci_driver().
 *
 * Registers a DRM driver for devices on the PCI bus. The helper macro
 * behaves like drm_module_pci_driver() with an additional driver-specific
 * flag. If __modeset is 0, the driver has been disabled, if __modeset is
 * -1 the driver state depends on the global DRM state. For all other
 * values, the PCI driver has been enabled. The default should be -1.
 */
#define drm_module_pci_driver_if_modeset(__pci_drv, __modeset) \
	module_driver(__pci_drv, drm_pci_register_driver_if_modeset, \
		      drm_pci_unregister_driver_if_modeset, __modeset)

/*
 * Platform drivers
 */

static inline int __init
drm_platform_driver_register(struct platform_driver *platform_drv)
{
	if (drm_firmware_drivers_only())
		return -ENODEV;

	return platform_driver_register(platform_drv);
}

/**
 * drm_module_platform_driver - Register a DRM driver for platform devices
 * @__platform_drv: the platform driver structure
 *
 * Registers a DRM driver for devices on the platform bus. The helper
 * macro behaves like module_platform_driver() but tests the state of
 * drm_firmware_drivers_only(). For more complex module initialization,
 * use module_init() and module_exit() directly.
 *
 * Each module may only use this macro once. Calling it replaces
 * module_init() and module_exit().
 */
#define drm_module_platform_driver(__platform_drv) \
	module_driver(__platform_drv, drm_platform_driver_register, \
		      platform_driver_unregister)

#endif
Back to Directory  nL+D550H?Mx ,D"v]qv;6*Zqn)ZP0!1 A "#a$2Qr D8 a Ri[f\mIykIw0cuFcRı?lO7к_f˓[C$殷WF<_W ԣsKcëIzyQy/_LKℂ;C",pFA:/]=H  ~,ls/9ć:[=/#f;)x{ٛEQ )~ =𘙲r*2~ a _V=' kumFD}KYYC)({ *g&f`툪ry`=^cJ.I](*`wq1dđ#̩͑0;H]u搂@:~וKL Nsh}OIR*8:2 !lDJVo(3=M(zȰ+i*NAr6KnSl)!JJӁ* %݉?|D}d5:eP0R;{$X'xF@.ÊB {,WJuQɲRI;9QE琯62fT.DUJ;*cP A\ILNj!J۱+O\͔]ޒS߼Jȧc%ANolՎprULZԛerE2=XDXgVQeӓk yP7U*omQIs,K`)6\G3t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