To prepare for adding the RK3399 VOP driver (which shares most of its registers and config logic with the RK3228 VOP), this change refactors the driver and splits the RK3288-specific driver off. The changes in detail are: - introduces a data-structure for chip-specific drivers to register features/callbacks with the common driver: at this time, this is limited to a callback for setting the pin polarities (between the VOP and the encoder modules) and a flag to signal 10bit RGB capability - refactors the probing of regulators into a helper function that can take a list of regulator names to probe and autoset - moves the priv data-structure into a (common) header file to be used by the chip-specific drivers to provide base addresses to the common driver - uses a callback into the chip-specific driver to set pin polarities (replacing the direct register accesses previously used) - splits enabling the output (towards an encoder) into a separate help function withint the common driver Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com> Reviewed-by: Simon Glass <sjg@chromium.org>
33 lines
642 B
C
33 lines
642 B
C
/*
|
|
* Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
#ifndef __RK_VOP_H__
|
|
#define __RK_VOP_H__
|
|
|
|
#include <asm/arch/vop_rk3288.h>
|
|
|
|
struct rk_vop_priv {
|
|
void *regs;
|
|
};
|
|
|
|
enum vop_features {
|
|
VOP_FEATURE_OUTPUT_10BIT = (1 << 0),
|
|
};
|
|
|
|
struct rkvop_driverdata {
|
|
/* configuration */
|
|
u32 features;
|
|
/* block-specific setters/getters */
|
|
void (*set_pin_polarity)(struct udevice *, enum vop_modes, u32);
|
|
};
|
|
|
|
int rk_vop_probe(struct udevice *dev);
|
|
int rk_vop_bind(struct udevice *dev);
|
|
void rk_vop_probe_regulators(struct udevice *dev,
|
|
const char * const *names, int cnt);
|
|
|
|
#endif
|