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