forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/gpu/drm/gma500/oaktrail_lvds.c
....@@ -1,18 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright © 2006-2009 Intel Corporation
3
- *
4
- * This program is free software; you can redistribute it and/or modify it
5
- * under the terms and conditions of the GNU General Public License,
6
- * version 2, as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope it will be useful, but WITHOUT
9
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11
- * more details.
12
- *
13
- * You should have received a copy of the GNU General Public License along with
14
- * this program; if not, write to the Free Software Foundation, Inc.,
15
- * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
164 *
175 * Authors:
186 * Eric Anholt <eric@anholt.net>
....@@ -21,15 +9,17 @@
219 */
2210
2311 #include <linux/i2c.h>
24
-#include <drm/drmP.h>
12
+#include <linux/pm_runtime.h>
13
+
2514 #include <asm/intel-mid.h>
2615
16
+#include <drm/drm_simple_kms_helper.h>
17
+
2718 #include "intel_bios.h"
19
+#include "power.h"
2820 #include "psb_drv.h"
2921 #include "psb_intel_drv.h"
3022 #include "psb_intel_reg.h"
31
-#include "power.h"
32
-#include <linux/pm_runtime.h>
3323
3424 /* The max/min PWM frequency in BPCR[31:17] - */
3525 /* The smallest number is 1 (not 0) that can fit in the
....@@ -127,8 +117,9 @@
127117 continue;
128118 }
129119
130
- if (!connector) {
120
+ if (list_entry_is_head(connector, &mode_config->connector_list, head)) {
131121 DRM_ERROR("Couldn't find connector when setting mode");
122
+ gma_power_end(dev);
132123 return;
133124 }
134125
....@@ -322,8 +313,7 @@
322313 &psb_intel_lvds_connector_funcs,
323314 DRM_MODE_CONNECTOR_LVDS);
324315
325
- drm_encoder_init(dev, encoder, &psb_intel_lvds_enc_funcs,
326
- DRM_MODE_ENCODER_LVDS, NULL);
316
+ drm_simple_encoder_init(dev, encoder, DRM_MODE_ENCODER_LVDS);
327317
328318 gma_connector_attach_encoder(gma_connector, gma_encoder);
329319 gma_encoder->type = INTEL_OUTPUT_LVDS;