xref: /openbmc/u-boot/drivers/video/rockchip/rk_vop.h (revision b9553986)
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
4  */
5 
6 #ifndef __RK_VOP_H__
7 #define __RK_VOP_H__
8 
9 #include <asm/arch/vop_rk3288.h>
10 
11 struct rk_vop_priv {
12 	void *grf;
13 	void *regs;
14 };
15 
16 enum vop_features {
17 	VOP_FEATURE_OUTPUT_10BIT = (1 << 0),
18 };
19 
20 struct rkvop_driverdata {
21 	/* configuration */
22 	u32 features;
23 	/* block-specific setters/getters */
24 	void (*set_pin_polarity)(struct udevice *, enum vop_modes, u32);
25 };
26 
27 /**
28  * rk_vop_probe() - common probe implementation
29  *
30  * Performs the rk_display_init on each port-subnode until finding a
31  * working port (or returning an error if none of the ports could be
32  * successfully initialised).
33  *
34  * @dev:	device
35  * @return 0 if OK, -ve if something went wrong
36  */
37 int rk_vop_probe(struct udevice *dev);
38 
39 /**
40  * rk_vop_bind() - common bind implementation
41  *
42  * Sets the plat->size field to the amount of memory to be reserved for
43  * the framebuffer: this is always
44  *     (32 BPP) x VIDEO_ROCKCHIP_MAX_XRES x VIDEO_ROCKCHIP_MAX_YRES
45  *
46  * @dev:	device
47  * @return 0 (always OK)
48  */
49 int rk_vop_bind(struct udevice *dev);
50 
51 /**
52  * rk_vop_probe_regulators() - probe (autoset + enable) regulators
53  *
54  * Probes a list of regulators by performing autoset and enable
55  * operations on them.  The list of regulators is an array of string
56  * pointers and any individual regulator-probe may fail without
57  * counting as an error.
58  *
59  * @dev:	device
60  * @names:	array of string-pointers to regulator names to probe
61  * @cnt:	number of elements in the 'names' array
62  */
63 void rk_vop_probe_regulators(struct udevice *dev,
64 			     const char * const *names, int cnt);
65 
66 #endif
67