blob: 2643f70f219d8b67edbb3c57b914dfa6159cc07e [file] [log] [blame]
Samantha Tran2d1ed732017-07-31 17:30:14 -07001/*
Ajay Singh Parmar09e6af62018-01-19 17:56:21 -08002 * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
Samantha Tran2d1ed732017-07-31 17:30:14 -07003 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 and
6 * only version 2 as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 */
14
15#ifndef _DP_DEBUG_H_
16#define _DP_DEBUG_H_
17
18#include "dp_panel.h"
19#include "dp_link.h"
20#include "dp_usbpd.h"
Ajay Singh Parmar09e6af62018-01-19 17:56:21 -080021#include "dp_aux.h"
Samantha Tran2d1ed732017-07-31 17:30:14 -070022
23/**
24 * struct dp_debug
25 * @debug_en: specifies whether debug mode enabled
26 * @vdisplay: used to filter out vdisplay value
27 * @hdisplay: used to filter out hdisplay value
28 * @vrefresh: used to filter out vrefresh value
Padmanabhan Komanduru04aa2a72017-11-06 17:59:24 +053029 * @tpg_state: specifies whether tpg feature is enabled
Samantha Tran2d1ed732017-07-31 17:30:14 -070030 */
31struct dp_debug {
32 bool debug_en;
Ajay Singh Parmar09e6af62018-01-19 17:56:21 -080033 bool sim_mode;
Ajay Singh Parmar25e2ee52017-10-20 23:50:53 -070034 bool psm_enabled;
Tatenda Chipeperekwa59510402017-09-28 12:50:58 -070035 int aspect_ratio;
Samantha Tran2d1ed732017-07-31 17:30:14 -070036 int vdisplay;
37 int hdisplay;
38 int vrefresh;
Padmanabhan Komanduru04aa2a72017-11-06 17:59:24 +053039 bool tpg_state;
Samantha Tran2d1ed732017-07-31 17:30:14 -070040};
41
42/**
43 * dp_debug_get() - configure and get the DisplayPlot debug module data
44 *
45 * @dev: device instance of the caller
46 * @panel: instance of panel module
47 * @usbpd: instance of usbpd module
48 * @link: instance of link module
49 * @connector: double pointer to display connector
Samantha Tranb6a5cd82018-02-01 14:47:16 -080050 * @catalog: instance of catalog module
Samantha Tran2d1ed732017-07-31 17:30:14 -070051 * return: pointer to allocated debug module data
52 *
53 * This function sets up the debug module and provides a way
54 * for debugfs input to be communicated with existing modules
55 */
56struct dp_debug *dp_debug_get(struct device *dev, struct dp_panel *panel,
57 struct dp_usbpd *usbpd, struct dp_link *link,
Samantha Tranb6a5cd82018-02-01 14:47:16 -080058 struct dp_aux *aux, struct drm_connector **connector,
59 struct dp_catalog *catalog);
Samantha Tran2d1ed732017-07-31 17:30:14 -070060/**
61 * dp_debug_put()
62 *
63 * Cleans up dp_debug instance
64 *
65 * @dp_debug: instance of dp_debug
66 */
67void dp_debug_put(struct dp_debug *dp_debug);
68#endif /* _DP_DEBUG_H_ */