Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [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; |
| 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 | |
Philipp Tomsich | 604caca | 2017-06-02 16:06:18 +0200 | [diff] [blame] | 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 | */ |
Philipp Tomsich | a354c2d | 2017-05-31 17:59:30 +0200 | [diff] [blame] | 37 | int rk_vop_probe(struct udevice *dev); |
Philipp Tomsich | 604caca | 2017-06-02 16:06:18 +0200 | [diff] [blame] | 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 | */ |
Philipp Tomsich | a354c2d | 2017-05-31 17:59:30 +0200 | [diff] [blame] | 49 | int rk_vop_bind(struct udevice *dev); |
Philipp Tomsich | 604caca | 2017-06-02 16:06:18 +0200 | [diff] [blame] | 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 | */ |
Philipp Tomsich | a354c2d | 2017-05-31 17:59:30 +0200 | [diff] [blame] | 63 | void rk_vop_probe_regulators(struct udevice *dev, |
| 64 | const char * const *names, int cnt); |
| 65 | |
| 66 | #endif |