.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * 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. |
---|
16 | 4 | * |
---|
17 | 5 | * Authors: |
---|
18 | 6 | * Eric Anholt <eric@anholt.net> |
---|
.. | .. |
---|
21 | 9 | */ |
---|
22 | 10 | |
---|
23 | 11 | #include <linux/i2c.h> |
---|
24 | | -#include <drm/drmP.h> |
---|
| 12 | +#include <linux/pm_runtime.h> |
---|
| 13 | + |
---|
25 | 14 | #include <asm/intel-mid.h> |
---|
26 | 15 | |
---|
| 16 | +#include <drm/drm_simple_kms_helper.h> |
---|
| 17 | + |
---|
27 | 18 | #include "intel_bios.h" |
---|
| 19 | +#include "power.h" |
---|
28 | 20 | #include "psb_drv.h" |
---|
29 | 21 | #include "psb_intel_drv.h" |
---|
30 | 22 | #include "psb_intel_reg.h" |
---|
31 | | -#include "power.h" |
---|
32 | | -#include <linux/pm_runtime.h> |
---|
33 | 23 | |
---|
34 | 24 | /* The max/min PWM frequency in BPCR[31:17] - */ |
---|
35 | 25 | /* The smallest number is 1 (not 0) that can fit in the |
---|
.. | .. |
---|
127 | 117 | continue; |
---|
128 | 118 | } |
---|
129 | 119 | |
---|
130 | | - if (!connector) { |
---|
| 120 | + if (list_entry_is_head(connector, &mode_config->connector_list, head)) { |
---|
131 | 121 | DRM_ERROR("Couldn't find connector when setting mode"); |
---|
| 122 | + gma_power_end(dev); |
---|
132 | 123 | return; |
---|
133 | 124 | } |
---|
134 | 125 | |
---|
.. | .. |
---|
322 | 313 | &psb_intel_lvds_connector_funcs, |
---|
323 | 314 | DRM_MODE_CONNECTOR_LVDS); |
---|
324 | 315 | |
---|
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); |
---|
327 | 317 | |
---|
328 | 318 | gma_connector_attach_encoder(gma_connector, gma_encoder); |
---|
329 | 319 | gma_encoder->type = INTEL_OUTPUT_LVDS; |
---|