forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/gpu/drm/msm/hdmi/hdmi.h
....@@ -1,18 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2013 Red Hat
34 * Author: Rob Clark <robdclark@gmail.com>
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms of the GNU General Public License version 2 as published by
7
- * the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope that it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
13
- *
14
- * You should have received a copy of the GNU General Public License along with
15
- * this program. If not, see <http://www.gnu.org/licenses/>.
165 */
176
187 #ifndef __HDMI_CONNECTOR_H__
....@@ -22,22 +11,16 @@
2211 #include <linux/clk.h>
2312 #include <linux/platform_device.h>
2413 #include <linux/regulator/consumer.h>
14
+#include <linux/gpio/consumer.h>
2515 #include <linux/hdmi.h>
16
+
17
+#include <drm/drm_bridge.h>
2618
2719 #include "msm_drv.h"
2820 #include "hdmi.xml.h"
2921
30
-#define HDMI_MAX_NUM_GPIO 6
31
-
3222 struct hdmi_phy;
3323 struct hdmi_platform_config;
34
-
35
-struct hdmi_gpio_data {
36
- int num;
37
- bool output;
38
- int value;
39
- const char *label;
40
-};
4124
4225 struct hdmi_audio {
4326 bool enabled;
....@@ -69,6 +52,8 @@
6952 struct regulator **pwr_regs;
7053 struct clk **hpd_clks;
7154 struct clk **pwr_clks;
55
+
56
+ struct gpio_desc *hpd_gpiod;
7257
7358 struct hdmi_phy *phy;
7459 struct device *phy_dev;
....@@ -118,10 +103,14 @@
118103 /* clks that need to be on for screen pwr (ie pixel clk): */
119104 const char **pwr_clk_names;
120105 int pwr_clk_cnt;
121
-
122
- /* gpio's: */
123
- struct hdmi_gpio_data gpios[HDMI_MAX_NUM_GPIO];
124106 };
107
+
108
+struct hdmi_bridge {
109
+ struct drm_bridge base;
110
+ struct hdmi *hdmi;
111
+ struct work_struct hpd_work;
112
+};
113
+#define to_hdmi_bridge(x) container_of(x, struct hdmi_bridge, base)
125114
126115 void msm_hdmi_set_mode(struct hdmi *hdmi, bool power_on);
127116
....@@ -239,13 +228,11 @@
239228 struct drm_bridge *msm_hdmi_bridge_init(struct hdmi *hdmi);
240229 void msm_hdmi_bridge_destroy(struct drm_bridge *bridge);
241230
242
-/*
243
- * hdmi connector:
244
- */
245
-
246
-void msm_hdmi_connector_irq(struct drm_connector *connector);
247
-struct drm_connector *msm_hdmi_connector_init(struct hdmi *hdmi);
248
-int msm_hdmi_hpd_enable(struct drm_connector *connector);
231
+void msm_hdmi_hpd_irq(struct drm_bridge *bridge);
232
+enum drm_connector_status msm_hdmi_bridge_detect(
233
+ struct drm_bridge *bridge);
234
+int msm_hdmi_hpd_enable(struct drm_bridge *bridge);
235
+void msm_hdmi_hpd_disable(struct hdmi_bridge *hdmi_bridge);
249236
250237 /*
251238 * i2c adapter for ddc: