blob: eba68d87c4b2edc5492e0b9b537fc43ed742c3b1 [file] [log] [blame]
Alper Nebi Yasak53f20332020-10-22 22:43:13 +03001/* SPDX-License-Identifier: GPL-2.0 */
Philipp Tomsicha354c2d2017-05-31 17:59:30 +02002/*
3 * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
Philipp Tomsicha354c2d2017-05-31 17:59:30 +02004 */
5
6#ifndef __RK_VOP_H__
7#define __RK_VOP_H__
8
Kever Yang9fbe17c2019-03-28 11:01:23 +08009#include <asm/arch-rockchip/vop_rk3288.h>
Philipp Tomsicha354c2d2017-05-31 17:59:30 +020010
11struct rk_vop_priv {
Philipp Tomsich094f4da2017-06-07 13:13:28 +020012 void *grf;
Philipp Tomsicha354c2d2017-05-31 17:59:30 +020013 void *regs;
Jagan Teki8b8e5b92024-01-17 13:21:44 +053014 int win_offset;
Jagan Teki026c5db2024-01-17 13:21:45 +053015 int dsp_offset;
Philipp Tomsicha354c2d2017-05-31 17:59:30 +020016};
17
18enum vop_features {
19 VOP_FEATURE_OUTPUT_10BIT = (1 << 0),
20};
21
22struct rkvop_driverdata {
Jagan Teki8b8e5b92024-01-17 13:21:44 +053023 int win_offset;
Jagan Teki026c5db2024-01-17 13:21:45 +053024 int dsp_offset;
Philipp Tomsicha354c2d2017-05-31 17:59:30 +020025 /* configuration */
26 u32 features;
27 /* block-specific setters/getters */
28 void (*set_pin_polarity)(struct udevice *, enum vop_modes, u32);
29};
30
Philipp Tomsich604caca2017-06-02 16:06:18 +020031/**
32 * rk_vop_probe() - common probe implementation
33 *
34 * Performs the rk_display_init on each port-subnode until finding a
35 * working port (or returning an error if none of the ports could be
36 * successfully initialised).
37 *
38 * @dev: device
Heinrich Schuchardt47b4c022022-01-19 18:05:50 +010039 * Return: 0 if OK, -ve if something went wrong
Philipp Tomsich604caca2017-06-02 16:06:18 +020040 */
Philipp Tomsicha354c2d2017-05-31 17:59:30 +020041int rk_vop_probe(struct udevice *dev);
Philipp Tomsich604caca2017-06-02 16:06:18 +020042
43/**
44 * rk_vop_bind() - common bind implementation
45 *
46 * Sets the plat->size field to the amount of memory to be reserved for
47 * the framebuffer: this is always
48 * (32 BPP) x VIDEO_ROCKCHIP_MAX_XRES x VIDEO_ROCKCHIP_MAX_YRES
49 *
50 * @dev: device
Heinrich Schuchardt47b4c022022-01-19 18:05:50 +010051 * Return: 0 (always OK)
Philipp Tomsich604caca2017-06-02 16:06:18 +020052 */
Philipp Tomsicha354c2d2017-05-31 17:59:30 +020053int rk_vop_bind(struct udevice *dev);
Philipp Tomsich604caca2017-06-02 16:06:18 +020054
55/**
56 * rk_vop_probe_regulators() - probe (autoset + enable) regulators
57 *
58 * Probes a list of regulators by performing autoset and enable
59 * operations on them. The list of regulators is an array of string
60 * pointers and any individual regulator-probe may fail without
61 * counting as an error.
62 *
63 * @dev: device
64 * @names: array of string-pointers to regulator names to probe
65 * @cnt: number of elements in the 'names' array
66 */
Philipp Tomsicha354c2d2017-05-31 17:59:30 +020067void rk_vop_probe_regulators(struct udevice *dev,
68 const char * const *names, int cnt);
69
70#endif