summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/verisilicon/vs_drv.h
blob: 9a88cf9a7362629e104039f590f5bc7ffe27718d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (C) 2023 VeriSilicon Holdings Co., Ltd.
 */

#ifndef __VS_DRV_H__
#define __VS_DRV_H__

#include <linux/module.h>
#include <linux/platform_device.h>
#include <drm/drm_drv.h>
#include <drm/drm_gem.h>
#include <drm/drm_managed.h>
#include <linux/clk.h>
#include <linux/reset.h>

enum rst_vout {
	RST_VOUT_AXI = 0,
	RST_VOUT_AHB,
	RST_VOUT_CORE,
	RST_VOUT_NUM
};

/*@pitch_alignment: buffer pitch alignment required by sub-devices.*/
struct vs_drm_device {
	struct drm_device base;
	unsigned int pitch_alignment;
	/* clocks */
	unsigned int clk_count;
	struct clk **clks;

	struct reset_control_bulk_data rst_vout[RST_VOUT_NUM];
	int	nrsts;
};

static inline struct vs_drm_device *
to_vs_drm_private(const struct drm_device *dev)
{
	return container_of(dev, struct vs_drm_device, base);
}

#ifdef CONFIG_DRM_VERISILICON_STARFIVE_HDMI
extern struct platform_driver starfive_hdmi_driver;
#endif

#endif /* __VS_DRV_H__ */