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