Alper Nebi Yasak | 53f2033 | 2020-10-22 22:43:13 +0300 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Philipp Tomsich | a354c2d | 2017-05-31 17:59:30 +0200 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH |
Philipp Tomsich | a354c2d | 2017-05-31 17:59:30 +0200 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef __RK_VOP_H__ |
| 7 | #define __RK_VOP_H__ |
| 8 | |
Kever Yang | 9fbe17c | 2019-03-28 11:01:23 +0800 | [diff] [blame] | 9 | #include <asm/arch-rockchip/vop_rk3288.h> |
Philipp Tomsich | a354c2d | 2017-05-31 17:59:30 +0200 | [diff] [blame] | 10 | |
| 11 | struct rk_vop_priv { |
Philipp Tomsich | 094f4da | 2017-06-07 13:13:28 +0200 | [diff] [blame] | 12 | void *grf; |
Philipp Tomsich | a354c2d | 2017-05-31 17:59:30 +0200 | [diff] [blame] | 13 | void *regs; |
Jagan Teki | 8b8e5b9 | 2024-01-17 13:21:44 +0530 | [diff] [blame] | 14 | int win_offset; |
Jagan Teki | 026c5db | 2024-01-17 13:21:45 +0530 | [diff] [blame] | 15 | int dsp_offset; |
Philipp Tomsich | a354c2d | 2017-05-31 17:59:30 +0200 | [diff] [blame] | 16 | }; |
| 17 | |
| 18 | enum vop_features { |
| 19 | VOP_FEATURE_OUTPUT_10BIT = (1 << 0), |
| 20 | }; |
| 21 | |
| 22 | struct rkvop_driverdata { |
Jagan Teki | 8b8e5b9 | 2024-01-17 13:21:44 +0530 | [diff] [blame] | 23 | int win_offset; |
Jagan Teki | 026c5db | 2024-01-17 13:21:45 +0530 | [diff] [blame] | 24 | int dsp_offset; |
Philipp Tomsich | a354c2d | 2017-05-31 17:59:30 +0200 | [diff] [blame] | 25 | /* configuration */ |
| 26 | u32 features; |
| 27 | /* block-specific setters/getters */ |
| 28 | void (*set_pin_polarity)(struct udevice *, enum vop_modes, u32); |
| 29 | }; |
| 30 | |
Philipp Tomsich | 604caca | 2017-06-02 16:06:18 +0200 | [diff] [blame] | 31 | /** |
| 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 Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 39 | * Return: 0 if OK, -ve if something went wrong |
Philipp Tomsich | 604caca | 2017-06-02 16:06:18 +0200 | [diff] [blame] | 40 | */ |
Philipp Tomsich | a354c2d | 2017-05-31 17:59:30 +0200 | [diff] [blame] | 41 | int rk_vop_probe(struct udevice *dev); |
Philipp Tomsich | 604caca | 2017-06-02 16:06:18 +0200 | [diff] [blame] | 42 | |
| 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 Schuchardt | 47b4c02 | 2022-01-19 18:05:50 +0100 | [diff] [blame] | 51 | * Return: 0 (always OK) |
Philipp Tomsich | 604caca | 2017-06-02 16:06:18 +0200 | [diff] [blame] | 52 | */ |
Philipp Tomsich | a354c2d | 2017-05-31 17:59:30 +0200 | [diff] [blame] | 53 | int rk_vop_bind(struct udevice *dev); |
Philipp Tomsich | 604caca | 2017-06-02 16:06:18 +0200 | [diff] [blame] | 54 | |
| 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 Tomsich | a354c2d | 2017-05-31 17:59:30 +0200 | [diff] [blame] | 67 | void rk_vop_probe_regulators(struct udevice *dev, |
| 68 | const char * const *names, int cnt); |
| 69 | |
| 70 | #endif |