linux/drivers/gpu/drm/rockchip/rockchip_drm_drv.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) Fuzhou Rockchip Electronics Co.Ltd
 * Author:Mark Yao <[email protected]>
 *
 * based on exynos_drm_drv.c
 */

#include <linux/dma-mapping.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/module.h>
#include <linux/of_graph.h>
#include <linux/of_platform.h>
#include <linux/component.h>
#include <linux/console.h>
#include <linux/iommu.h>

#include <drm/drm_aperture.h>
#include <drm/drm_drv.h>
#include <drm/drm_fbdev_dma.h>
#include <drm/drm_gem_dma_helper.h>
#include <drm/drm_of.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_vblank.h>

#if defined(CONFIG_ARM_DMA_USE_IOMMU)
#include <asm/dma-iommu.h>
#else
#define arm_iommu_detach_device(...)
#define arm_iommu_release_mapping(...)
#define to_dma_iommu_mapping(dev)
#endif

#include "rockchip_drm_drv.h"
#include "rockchip_drm_fb.h"
#include "rockchip_drm_gem.h"

#define DRIVER_NAME
#define DRIVER_DESC
#define DRIVER_DATE
#define DRIVER_MAJOR
#define DRIVER_MINOR

static const struct drm_driver rockchip_drm_driver;

/*
 * Attach a (component) device to the shared drm dma mapping from master drm
 * device.  This is used by the VOPs to map GEM buffers to a common DMA
 * mapping.
 */
int rockchip_drm_dma_attach_device(struct drm_device *drm_dev,
				   struct device *dev)
{}

void rockchip_drm_dma_detach_device(struct drm_device *drm_dev,
				    struct device *dev)
{}

void rockchip_drm_dma_init_device(struct drm_device *drm_dev,
				  struct device *dev)
{}

static int rockchip_drm_init_iommu(struct drm_device *drm_dev)
{}

static void rockchip_iommu_cleanup(struct drm_device *drm_dev)
{}

static int rockchip_drm_bind(struct device *dev)
{}

static void rockchip_drm_unbind(struct device *dev)
{}

DEFINE_DRM_GEM_FOPS(rockchip_drm_driver_fops);

static const struct drm_driver rockchip_drm_driver =;

#ifdef CONFIG_PM_SLEEP
static int rockchip_drm_sys_suspend(struct device *dev)
{}

static int rockchip_drm_sys_resume(struct device *dev)
{}
#endif

static const struct dev_pm_ops rockchip_drm_pm_ops =;

#define MAX_ROCKCHIP_SUB_DRIVERS
static struct platform_driver *rockchip_sub_drivers[MAX_ROCKCHIP_SUB_DRIVERS];
static int num_rockchip_sub_drivers;

/*
 * Get the endpoint id of the remote endpoint of the given encoder. This
 * information is used by the VOP2 driver to identify the encoder.
 *
 * @rkencoder: The encoder to get the remote endpoint id from
 * @np: The encoder device node
 * @port: The number of the port leading to the VOP2
 * @reg: The endpoint number leading to the VOP2
 */
int rockchip_drm_encoder_set_crtc_endpoint_id(struct rockchip_encoder *rkencoder,
					      struct device_node *np, int port, int reg)
{}

/*
 * Check if a vop endpoint is leading to a rockchip subdriver or bridge.
 * Should be called from the component bind stage of the drivers
 * to ensure that all subdrivers are probed.
 *
 * @ep: endpoint of a rockchip vop
 *
 * returns true if subdriver, false if external bridge and -ENODEV
 * if remote port does not contain a device.
 */
int rockchip_drm_endpoint_is_subdriver(struct device_node *ep)
{}

static void rockchip_drm_match_remove(struct device *dev)
{}

static struct component_match *rockchip_drm_match_add(struct device *dev)
{}

static const struct component_master_ops rockchip_drm_ops =;

static int rockchip_drm_platform_of_probe(struct device *dev)
{}

static int rockchip_drm_platform_probe(struct platform_device *pdev)
{}

static void rockchip_drm_platform_remove(struct platform_device *pdev)
{}

static void rockchip_drm_platform_shutdown(struct platform_device *pdev)
{}

static const struct of_device_id rockchip_drm_dt_ids[] =;
MODULE_DEVICE_TABLE(of, rockchip_drm_dt_ids);

static struct platform_driver rockchip_drm_platform_driver =;

#define ADD_ROCKCHIP_SUB_DRIVER(drv, cond)

static int __init rockchip_drm_init(void)
{}

static void __exit rockchip_drm_fini(void)
{}

module_init();
module_exit(rockchip_drm_fini);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();