1*efeeaefeSPaul Kocialkowski /* SPDX-License-Identifier: GPL-2.0+ */ 2*efeeaefeSPaul Kocialkowski /* 3*efeeaefeSPaul Kocialkowski * Copyright (C) 2019-2022 Bootlin 4*efeeaefeSPaul Kocialkowski * Author: Paul Kocialkowski <paul.kocialkowski@bootlin.com> 5*efeeaefeSPaul Kocialkowski */ 6*efeeaefeSPaul Kocialkowski 7*efeeaefeSPaul Kocialkowski #ifndef _LOGICVC_DRM_H_ 8*efeeaefeSPaul Kocialkowski #define _LOGICVC_DRM_H_ 9*efeeaefeSPaul Kocialkowski 10*efeeaefeSPaul Kocialkowski #include <linux/regmap.h> 11*efeeaefeSPaul Kocialkowski #include <linux/types.h> 12*efeeaefeSPaul Kocialkowski #include <drm/drm_device.h> 13*efeeaefeSPaul Kocialkowski 14*efeeaefeSPaul Kocialkowski #define LOGICVC_DISPLAY_INTERFACE_RGB 0 15*efeeaefeSPaul Kocialkowski #define LOGICVC_DISPLAY_INTERFACE_ITU656 1 16*efeeaefeSPaul Kocialkowski #define LOGICVC_DISPLAY_INTERFACE_LVDS_4BITS 2 17*efeeaefeSPaul Kocialkowski #define LOGICVC_DISPLAY_INTERFACE_LVDS_4BITS_CAMERA 3 18*efeeaefeSPaul Kocialkowski #define LOGICVC_DISPLAY_INTERFACE_LVDS_3BITS 4 19*efeeaefeSPaul Kocialkowski #define LOGICVC_DISPLAY_INTERFACE_DVI 5 20*efeeaefeSPaul Kocialkowski 21*efeeaefeSPaul Kocialkowski #define LOGICVC_DISPLAY_COLORSPACE_RGB 0 22*efeeaefeSPaul Kocialkowski #define LOGICVC_DISPLAY_COLORSPACE_YUV422 1 23*efeeaefeSPaul Kocialkowski #define LOGICVC_DISPLAY_COLORSPACE_YUV444 2 24*efeeaefeSPaul Kocialkowski 25*efeeaefeSPaul Kocialkowski #define logicvc_drm(d) \ 26*efeeaefeSPaul Kocialkowski container_of(d, struct logicvc_drm, drm_dev) 27*efeeaefeSPaul Kocialkowski 28*efeeaefeSPaul Kocialkowski struct logicvc_crtc; 29*efeeaefeSPaul Kocialkowski struct logicvc_interface; 30*efeeaefeSPaul Kocialkowski 31*efeeaefeSPaul Kocialkowski struct logicvc_drm_config { 32*efeeaefeSPaul Kocialkowski u32 display_interface; 33*efeeaefeSPaul Kocialkowski u32 display_colorspace; 34*efeeaefeSPaul Kocialkowski u32 display_depth; 35*efeeaefeSPaul Kocialkowski u32 row_stride; 36*efeeaefeSPaul Kocialkowski bool dithering; 37*efeeaefeSPaul Kocialkowski bool background_layer; 38*efeeaefeSPaul Kocialkowski bool layers_configurable; 39*efeeaefeSPaul Kocialkowski u32 layers_count; 40*efeeaefeSPaul Kocialkowski }; 41*efeeaefeSPaul Kocialkowski 42*efeeaefeSPaul Kocialkowski struct logicvc_drm_caps { 43*efeeaefeSPaul Kocialkowski unsigned int major; 44*efeeaefeSPaul Kocialkowski unsigned int minor; 45*efeeaefeSPaul Kocialkowski char level; 46*efeeaefeSPaul Kocialkowski bool layer_address; 47*efeeaefeSPaul Kocialkowski }; 48*efeeaefeSPaul Kocialkowski 49*efeeaefeSPaul Kocialkowski struct logicvc_drm { 50*efeeaefeSPaul Kocialkowski const struct logicvc_drm_caps *caps; 51*efeeaefeSPaul Kocialkowski struct logicvc_drm_config config; 52*efeeaefeSPaul Kocialkowski 53*efeeaefeSPaul Kocialkowski struct drm_device drm_dev; 54*efeeaefeSPaul Kocialkowski phys_addr_t reserved_mem_base; 55*efeeaefeSPaul Kocialkowski struct regmap *regmap; 56*efeeaefeSPaul Kocialkowski 57*efeeaefeSPaul Kocialkowski struct clk *vclk; 58*efeeaefeSPaul Kocialkowski struct clk *vclk2; 59*efeeaefeSPaul Kocialkowski struct clk *lvdsclk; 60*efeeaefeSPaul Kocialkowski struct clk *lvdsclkn; 61*efeeaefeSPaul Kocialkowski 62*efeeaefeSPaul Kocialkowski struct list_head layers_list; 63*efeeaefeSPaul Kocialkowski struct logicvc_crtc *crtc; 64*efeeaefeSPaul Kocialkowski struct logicvc_interface *interface; 65*efeeaefeSPaul Kocialkowski }; 66*efeeaefeSPaul Kocialkowski 67*efeeaefeSPaul Kocialkowski #endif 68