1*dbf21777SIcenowy Zheng /* SPDX-License-Identifier: GPL-2.0-only */ 2*dbf21777SIcenowy Zheng /* 3*dbf21777SIcenowy Zheng * Copyright (C) 2025 Icenowy Zheng <uwu@icenowy.me> 4*dbf21777SIcenowy Zheng */ 5*dbf21777SIcenowy Zheng 6*dbf21777SIcenowy Zheng #ifndef _VS_BRIDGE_H_ 7*dbf21777SIcenowy Zheng #define _VS_BRIDGE_H_ 8*dbf21777SIcenowy Zheng 9*dbf21777SIcenowy Zheng #include <linux/types.h> 10*dbf21777SIcenowy Zheng 11*dbf21777SIcenowy Zheng #include <drm/drm_bridge.h> 12*dbf21777SIcenowy Zheng #include <drm/drm_connector.h> 13*dbf21777SIcenowy Zheng #include <drm/drm_encoder.h> 14*dbf21777SIcenowy Zheng 15*dbf21777SIcenowy Zheng struct vs_crtc; 16*dbf21777SIcenowy Zheng 17*dbf21777SIcenowy Zheng enum vs_bridge_output_interface { 18*dbf21777SIcenowy Zheng VSDC_OUTPUT_INTERFACE_DPI = 0, 19*dbf21777SIcenowy Zheng VSDC_OUTPUT_INTERFACE_DP = 1 20*dbf21777SIcenowy Zheng }; 21*dbf21777SIcenowy Zheng 22*dbf21777SIcenowy Zheng struct vs_bridge { 23*dbf21777SIcenowy Zheng struct drm_bridge base; 24*dbf21777SIcenowy Zheng struct drm_encoder *enc; 25*dbf21777SIcenowy Zheng struct drm_connector *conn; 26*dbf21777SIcenowy Zheng 27*dbf21777SIcenowy Zheng struct vs_crtc *crtc; 28*dbf21777SIcenowy Zheng struct drm_bridge *next_bridge; 29*dbf21777SIcenowy Zheng enum vs_bridge_output_interface intf; 30*dbf21777SIcenowy Zheng }; 31*dbf21777SIcenowy Zheng 32*dbf21777SIcenowy Zheng static inline struct vs_bridge *drm_bridge_to_vs_bridge(struct drm_bridge *bridge) 33*dbf21777SIcenowy Zheng { 34*dbf21777SIcenowy Zheng return container_of(bridge, struct vs_bridge, base); 35*dbf21777SIcenowy Zheng } 36*dbf21777SIcenowy Zheng 37*dbf21777SIcenowy Zheng struct vs_bridge *vs_bridge_init(struct drm_device *drm_dev, 38*dbf21777SIcenowy Zheng struct vs_crtc *crtc); 39*dbf21777SIcenowy Zheng #endif /* _VS_BRIDGE_H_ */ 40