Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
0004  */
0005 
0006 #ifndef _DP_DEBUG_H_
0007 #define _DP_DEBUG_H_
0008 
0009 #include "dp_panel.h"
0010 #include "dp_link.h"
0011 
0012 /**
0013  * struct dp_debug
0014  * @debug_en: specifies whether debug mode enabled
0015  * @vdisplay: used to filter out vdisplay value
0016  * @hdisplay: used to filter out hdisplay value
0017  * @vrefresh: used to filter out vrefresh value
0018  * @tpg_state: specifies whether tpg feature is enabled
0019  */
0020 struct dp_debug {
0021     bool debug_en;
0022     int aspect_ratio;
0023     int vdisplay;
0024     int hdisplay;
0025     int vrefresh;
0026 };
0027 
0028 #if defined(CONFIG_DEBUG_FS)
0029 
0030 /**
0031  * dp_debug_get() - configure and get the DisplayPlot debug module data
0032  *
0033  * @dev: device instance of the caller
0034  * @panel: instance of panel module
0035  * @usbpd: instance of usbpd module
0036  * @link: instance of link module
0037  * @connector: double pointer to display connector
0038  * @minor: pointer to drm minor number after device registration
0039  * return: pointer to allocated debug module data
0040  *
0041  * This function sets up the debug module and provides a way
0042  * for debugfs input to be communicated with existing modules
0043  */
0044 struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel,
0045         struct dp_usbpd *usbpd, struct dp_link *link,
0046         struct drm_connector *connector,
0047         struct drm_minor *minor);
0048 
0049 /**
0050  * dp_debug_put()
0051  *
0052  * Cleans up dp_debug instance
0053  *
0054  * @dp_debug: instance of dp_debug
0055  */
0056 void dp_debug_put(struct dp_debug *dp_debug);
0057 
0058 #else
0059 
0060 static inline
0061 struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel,
0062         struct dp_usbpd *usbpd, struct dp_link *link,
0063         struct drm_connector *connector, struct drm_minor *minor)
0064 {
0065     return ERR_PTR(-EINVAL);
0066 }
0067 
0068 static inline void dp_debug_put(struct dp_debug *dp_debug)
0069 {
0070 }
0071 
0072 #endif /* defined(CONFIG_DEBUG_FS) */
0073 
0074 #endif /* _DP_DEBUG_H_ */