1/* SPDX-License-Identifier: GPL-2.0-only */ 2/* 3 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. 4 */ 5 6#ifndef _DP_DEBUG_H_ 7#define _DP_DEBUG_H_ 8 9#include "dp_panel.h" 10#include "dp_link.h" 11 12/** 13 * struct dp_debug 14 * @debug_en: specifies whether debug mode enabled 15 * @vdisplay: used to filter out vdisplay value 16 * @hdisplay: used to filter out hdisplay value 17 * @vrefresh: used to filter out vrefresh value 18 * @tpg_state: specifies whether tpg feature is enabled 19 */ 20struct dp_debug { 21 bool debug_en; 22 int aspect_ratio; 23 int vdisplay; 24 int hdisplay; 25 int vrefresh; 26}; 27 28#if defined(CONFIG_DEBUG_FS) 29 30/** 31 * dp_debug_get() - configure and get the DisplayPlot debug module data 32 * 33 * @dev: device instance of the caller 34 * @panel: instance of panel module 35 * @link: instance of link module 36 * @connector: double pointer to display connector 37 * @root: connector's debugfs root 38 * @is_edp: set for eDP connectors / panels 39 * return: pointer to allocated debug module data 40 * 41 * This function sets up the debug module and provides a way 42 * for debugfs input to be communicated with existing modules 43 */ 44struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel, 45 struct dp_link *link, 46 struct drm_connector *connector, 47 struct dentry *root, 48 bool is_edp); 49 50#else 51 52static inline 53struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel, 54 struct dp_link *link, 55 struct drm_connector *connector, 56 struct dentry *root, 57 bool is_edp) 58{ 59 return ERR_PTR(-EINVAL); 60} 61 62#endif /* defined(CONFIG_DEBUG_FS) */ 63 64#endif /* _DP_DEBUG_H_ */ 65