blob: 8fa2f3893900979b7c94711c79a27030ec6f45b8 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Philipp Tomsichd46d4042017-05-31 17:59:30 +02002/*
3 * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
Philipp Tomsichd46d4042017-05-31 17:59:30 +02004 */
5
6#ifndef __RK_VOP_H__
7#define __RK_VOP_H__
8
Kever Yang15f09a12019-03-28 11:01:23 +08009#include <asm/arch-rockchip/vop_rk3288.h>
Philipp Tomsichd46d4042017-05-31 17:59:30 +020010
11struct rk_vop_priv {
Philipp Tomsich64199d42017-06-07 13:13:28 +020012 void *grf;
Philipp Tomsichd46d4042017-05-31 17:59:30 +020013 void *regs;
14};
15
16enum vop_features {
17 VOP_FEATURE_OUTPUT_10BIT = (1 << 0),
18};
19
20struct 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
Philipp Tomsich76a5e1b2017-06-02 16:06:18 +020027/**
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 */
Philipp Tomsichd46d4042017-05-31 17:59:30 +020037int rk_vop_probe(struct udevice *dev);
Philipp Tomsich76a5e1b2017-06-02 16:06:18 +020038
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 */
Philipp Tomsichd46d4042017-05-31 17:59:30 +020049int rk_vop_bind(struct udevice *dev);
Philipp Tomsich76a5e1b2017-06-02 16:06:18 +020050
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 */
Philipp Tomsichd46d4042017-05-31 17:59:30 +020063void rk_vop_probe_regulators(struct udevice *dev,
64 const char * const *names, int cnt);
65
66#endif