blob: 93b7102dd008931ee0fbceb1f59e7f60fc292923 [file] [log] [blame]
Yakir Yang9e32e162016-03-29 09:57:30 +08001/*
2 * Rockchip SoC DP (Display Port) interface driver.
3 *
4 * Copyright (C) Fuzhou Rockchip Electronics Co., Ltd.
5 * Author: Andy Yan <andy.yan@rock-chips.com>
6 * Yakir Yang <ykk@rock-chips.com>
7 * Jeff Chen <jeff.chen@rock-chips.com>
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation; either version 2 of the License, or (at your
12 * option) any later version.
13 */
14
15#include <linux/component.h>
16#include <linux/mfd/syscon.h>
Yakir Yangd9c900b2016-06-29 17:15:01 +080017#include <linux/of_device.h>
Yakir Yang9e32e162016-03-29 09:57:30 +080018#include <linux/of_graph.h>
19#include <linux/regmap.h>
20#include <linux/reset.h>
21#include <linux/clk.h>
22
23#include <drm/drmP.h>
24#include <drm/drm_crtc_helper.h>
25#include <drm/drm_dp_helper.h>
26#include <drm/drm_of.h>
27#include <drm/drm_panel.h>
28
29#include <video/of_videomode.h>
30#include <video/videomode.h>
31
32#include <drm/bridge/analogix_dp.h>
33
34#include "rockchip_drm_drv.h"
Yakir Yang8f0ac5c2016-07-24 14:57:52 +080035#include "rockchip_drm_psr.h"
Yakir Yang9e32e162016-03-29 09:57:30 +080036#include "rockchip_drm_vop.h"
37
Yakir Yangd9c900b2016-06-29 17:15:01 +080038#define RK3288_GRF_SOC_CON6 0x25c
39#define RK3288_EDP_LCDC_SEL BIT(5)
Yakir Yang82872e42016-06-29 17:15:26 +080040#define RK3399_GRF_SOC_CON20 0x6250
41#define RK3399_EDP_LCDC_SEL BIT(5)
Yakir Yangd9c900b2016-06-29 17:15:01 +080042
43#define HIWORD_UPDATE(val, mask) (val | (mask) << 16)
44
Yakir Yang8f0ac5c2016-07-24 14:57:52 +080045#define PSR_WAIT_LINE_FLAG_TIMEOUT_MS 100
46
Yakir Yang9e32e162016-03-29 09:57:30 +080047#define to_dp(nm) container_of(nm, struct rockchip_dp_device, nm)
48
Yakir Yangd9c900b2016-06-29 17:15:01 +080049/**
50 * struct rockchip_dp_chip_data - splite the grf setting of kind of chips
51 * @lcdsel_grf_reg: grf register offset of lcdc select
52 * @lcdsel_big: reg value of selecting vop big for eDP
53 * @lcdsel_lit: reg value of selecting vop little for eDP
54 * @chip_type: specific chip type
55 */
56struct rockchip_dp_chip_data {
57 u32 lcdsel_grf_reg;
58 u32 lcdsel_big;
59 u32 lcdsel_lit;
60 u32 chip_type;
61};
Yakir Yang9e32e162016-03-29 09:57:30 +080062
63struct rockchip_dp_device {
64 struct drm_device *drm_dev;
65 struct device *dev;
66 struct drm_encoder encoder;
67 struct drm_display_mode mode;
68
69 struct clk *pclk;
Yakir Yangdc1c93b2016-06-29 17:16:05 +080070 struct clk *grfclk;
Yakir Yang9e32e162016-03-29 09:57:30 +080071 struct regmap *grf;
72 struct reset_control *rst;
73
Sean Pauld761b2d2016-08-16 17:12:45 -070074 struct work_struct psr_work;
Emil Renner Berthing44419ce2017-10-04 19:53:46 +020075 struct mutex psr_lock;
Yakir Yang8f0ac5c2016-07-24 14:57:52 +080076 unsigned int psr_state;
77
Yakir Yangd9c900b2016-06-29 17:15:01 +080078 const struct rockchip_dp_chip_data *data;
79
Yakir Yang9e32e162016-03-29 09:57:30 +080080 struct analogix_dp_plat_data plat_data;
81};
82
Yakir Yang8f0ac5c2016-07-24 14:57:52 +080083static void analogix_dp_psr_set(struct drm_encoder *encoder, bool enabled)
84{
85 struct rockchip_dp_device *dp = to_dp(encoder);
86
Tomeu Vizoso0546d682016-09-23 16:06:40 +020087 if (!analogix_dp_psr_supported(dp->dev))
88 return;
89
Haneen Mohammedd8dd6802017-09-15 02:36:03 -060090 DRM_DEV_DEBUG(dp->dev, "%s PSR...\n", enabled ? "Entry" : "Exit");
Yakir Yang8f0ac5c2016-07-24 14:57:52 +080091
Emil Renner Berthing44419ce2017-10-04 19:53:46 +020092 mutex_lock(&dp->psr_lock);
Yakir Yang8f0ac5c2016-07-24 14:57:52 +080093 if (enabled)
94 dp->psr_state = EDP_VSC_PSR_STATE_ACTIVE;
95 else
96 dp->psr_state = ~EDP_VSC_PSR_STATE_ACTIVE;
97
Sean Pauld761b2d2016-08-16 17:12:45 -070098 schedule_work(&dp->psr_work);
Emil Renner Berthing44419ce2017-10-04 19:53:46 +020099 mutex_unlock(&dp->psr_lock);
Yakir Yang8f0ac5c2016-07-24 14:57:52 +0800100}
101
102static void analogix_dp_psr_work(struct work_struct *work)
103{
104 struct rockchip_dp_device *dp =
Sean Pauld761b2d2016-08-16 17:12:45 -0700105 container_of(work, typeof(*dp), psr_work);
Yakir Yang8f0ac5c2016-07-24 14:57:52 +0800106 int ret;
107
Jeffy Chen459b0862017-04-27 14:54:17 +0800108 ret = rockchip_drm_wait_vact_end(dp->encoder.crtc,
109 PSR_WAIT_LINE_FLAG_TIMEOUT_MS);
Yakir Yang8f0ac5c2016-07-24 14:57:52 +0800110 if (ret) {
Haneen Mohammedd8dd6802017-09-15 02:36:03 -0600111 DRM_DEV_ERROR(dp->dev, "line flag interrupt did not arrive\n");
Yakir Yang8f0ac5c2016-07-24 14:57:52 +0800112 return;
113 }
114
Emil Renner Berthing44419ce2017-10-04 19:53:46 +0200115 mutex_lock(&dp->psr_lock);
Jeffy Chenaa5bfa42017-04-29 20:39:07 +0800116 if (dp->psr_state == EDP_VSC_PSR_STATE_ACTIVE)
Yakir Yang8f0ac5c2016-07-24 14:57:52 +0800117 analogix_dp_enable_psr(dp->dev);
118 else
119 analogix_dp_disable_psr(dp->dev);
Emil Renner Berthing44419ce2017-10-04 19:53:46 +0200120 mutex_unlock(&dp->psr_lock);
Yakir Yang8f0ac5c2016-07-24 14:57:52 +0800121}
122
Yakir Yang9e32e162016-03-29 09:57:30 +0800123static int rockchip_dp_pre_init(struct rockchip_dp_device *dp)
124{
125 reset_control_assert(dp->rst);
126 usleep_range(10, 20);
127 reset_control_deassert(dp->rst);
128
129 return 0;
130}
131
132static int rockchip_dp_poweron(struct analogix_dp_plat_data *plat_data)
133{
134 struct rockchip_dp_device *dp = to_dp(plat_data);
135 int ret;
136
Sean Pauld761b2d2016-08-16 17:12:45 -0700137 cancel_work_sync(&dp->psr_work);
138
Yakir Yang9e32e162016-03-29 09:57:30 +0800139 ret = clk_prepare_enable(dp->pclk);
140 if (ret < 0) {
Haneen Mohammedd8dd6802017-09-15 02:36:03 -0600141 DRM_DEV_ERROR(dp->dev, "failed to enable pclk %d\n", ret);
Yakir Yang9e32e162016-03-29 09:57:30 +0800142 return ret;
143 }
144
145 ret = rockchip_dp_pre_init(dp);
146 if (ret < 0) {
Haneen Mohammedd8dd6802017-09-15 02:36:03 -0600147 DRM_DEV_ERROR(dp->dev, "failed to dp pre init %d\n", ret);
Wei Yongjun3694c5c2016-07-19 11:32:43 +0000148 clk_disable_unprepare(dp->pclk);
Yakir Yang9e32e162016-03-29 09:57:30 +0800149 return ret;
150 }
151
152 return 0;
153}
154
155static int rockchip_dp_powerdown(struct analogix_dp_plat_data *plat_data)
156{
157 struct rockchip_dp_device *dp = to_dp(plat_data);
158
159 clk_disable_unprepare(dp->pclk);
160
161 return 0;
162}
163
Yakir Yangdb8a9ae2016-06-29 17:15:39 +0800164static int rockchip_dp_get_modes(struct analogix_dp_plat_data *plat_data,
165 struct drm_connector *connector)
166{
167 struct drm_display_info *di = &connector->display_info;
168 /* VOP couldn't output YUV video format for eDP rightly */
169 u32 mask = DRM_COLOR_FORMAT_YCRCB444 | DRM_COLOR_FORMAT_YCRCB422;
170
171 if ((di->color_formats & mask)) {
172 DRM_DEBUG_KMS("Swapping display color format from YUV to RGB\n");
173 di->color_formats &= ~mask;
174 di->color_formats |= DRM_COLOR_FORMAT_RGB444;
175 di->bpc = 8;
176 }
177
178 return 0;
179}
180
Yakir Yang9e32e162016-03-29 09:57:30 +0800181static bool
182rockchip_dp_drm_encoder_mode_fixup(struct drm_encoder *encoder,
183 const struct drm_display_mode *mode,
184 struct drm_display_mode *adjusted_mode)
185{
186 /* do nothing */
187 return true;
188}
189
190static void rockchip_dp_drm_encoder_mode_set(struct drm_encoder *encoder,
191 struct drm_display_mode *mode,
192 struct drm_display_mode *adjusted)
193{
194 /* do nothing */
195}
196
197static void rockchip_dp_drm_encoder_enable(struct drm_encoder *encoder)
198{
199 struct rockchip_dp_device *dp = to_dp(encoder);
200 int ret;
201 u32 val;
202
Yakir Yang9e32e162016-03-29 09:57:30 +0800203 ret = drm_of_encoder_active_endpoint_id(dp->dev->of_node, encoder);
204 if (ret < 0)
205 return;
206
207 if (ret)
Yakir Yangd9c900b2016-06-29 17:15:01 +0800208 val = dp->data->lcdsel_lit;
Yakir Yang9e32e162016-03-29 09:57:30 +0800209 else
Yakir Yangd9c900b2016-06-29 17:15:01 +0800210 val = dp->data->lcdsel_big;
Yakir Yang9e32e162016-03-29 09:57:30 +0800211
Haneen Mohammedd8dd6802017-09-15 02:36:03 -0600212 DRM_DEV_DEBUG(dp->dev, "vop %s output to dp\n", (ret) ? "LIT" : "BIG");
Yakir Yang9e32e162016-03-29 09:57:30 +0800213
Yakir Yangdc1c93b2016-06-29 17:16:05 +0800214 ret = clk_prepare_enable(dp->grfclk);
215 if (ret < 0) {
Haneen Mohammedd8dd6802017-09-15 02:36:03 -0600216 DRM_DEV_ERROR(dp->dev, "failed to enable grfclk %d\n", ret);
Yakir Yang9e32e162016-03-29 09:57:30 +0800217 return;
218 }
Yakir Yangdc1c93b2016-06-29 17:16:05 +0800219
220 ret = regmap_write(dp->grf, dp->data->lcdsel_grf_reg, val);
221 if (ret != 0)
Haneen Mohammedd8dd6802017-09-15 02:36:03 -0600222 DRM_DEV_ERROR(dp->dev, "Could not write to GRF: %d\n", ret);
Yakir Yangdc1c93b2016-06-29 17:16:05 +0800223
224 clk_disable_unprepare(dp->grfclk);
Yakir Yang9e32e162016-03-29 09:57:30 +0800225}
226
227static void rockchip_dp_drm_encoder_nop(struct drm_encoder *encoder)
228{
229 /* do nothing */
230}
231
Mark Yao4e257d92016-04-20 10:41:42 +0800232static int
233rockchip_dp_drm_encoder_atomic_check(struct drm_encoder *encoder,
234 struct drm_crtc_state *crtc_state,
235 struct drm_connector_state *conn_state)
236{
237 struct rockchip_crtc_state *s = to_rockchip_crtc_state(crtc_state);
238
239 /*
Yakir Yangd698f0e2016-06-29 17:15:44 +0800240 * The hardware IC designed that VOP must output the RGB10 video
241 * format to eDP controller, and if eDP panel only support RGB8,
242 * then eDP controller should cut down the video data, not via VOP
243 * controller, that's why we need to hardcode the VOP output mode
244 * to RGA10 here.
Mark Yao4e257d92016-04-20 10:41:42 +0800245 */
Yakir Yang82872e42016-06-29 17:15:26 +0800246
Mark Yao4e257d92016-04-20 10:41:42 +0800247 s->output_mode = ROCKCHIP_OUT_MODE_AAAA;
248 s->output_type = DRM_MODE_CONNECTOR_eDP;
249
250 return 0;
251}
252
Yakir Yang9e32e162016-03-29 09:57:30 +0800253static struct drm_encoder_helper_funcs rockchip_dp_encoder_helper_funcs = {
254 .mode_fixup = rockchip_dp_drm_encoder_mode_fixup,
255 .mode_set = rockchip_dp_drm_encoder_mode_set,
256 .enable = rockchip_dp_drm_encoder_enable,
257 .disable = rockchip_dp_drm_encoder_nop,
Mark Yao4e257d92016-04-20 10:41:42 +0800258 .atomic_check = rockchip_dp_drm_encoder_atomic_check,
Yakir Yang9e32e162016-03-29 09:57:30 +0800259};
260
261static void rockchip_dp_drm_encoder_destroy(struct drm_encoder *encoder)
262{
263 drm_encoder_cleanup(encoder);
264}
265
266static struct drm_encoder_funcs rockchip_dp_encoder_funcs = {
267 .destroy = rockchip_dp_drm_encoder_destroy,
268};
269
270static int rockchip_dp_init(struct rockchip_dp_device *dp)
271{
272 struct device *dev = dp->dev;
273 struct device_node *np = dev->of_node;
274 int ret;
275
276 dp->grf = syscon_regmap_lookup_by_phandle(np, "rockchip,grf");
277 if (IS_ERR(dp->grf)) {
Haneen Mohammedd8dd6802017-09-15 02:36:03 -0600278 DRM_DEV_ERROR(dev, "failed to get rockchip,grf property\n");
Yakir Yang9e32e162016-03-29 09:57:30 +0800279 return PTR_ERR(dp->grf);
280 }
281
Yakir Yangdc1c93b2016-06-29 17:16:05 +0800282 dp->grfclk = devm_clk_get(dev, "grf");
283 if (PTR_ERR(dp->grfclk) == -ENOENT) {
284 dp->grfclk = NULL;
285 } else if (PTR_ERR(dp->grfclk) == -EPROBE_DEFER) {
286 return -EPROBE_DEFER;
287 } else if (IS_ERR(dp->grfclk)) {
Haneen Mohammedd8dd6802017-09-15 02:36:03 -0600288 DRM_DEV_ERROR(dev, "failed to get grf clock\n");
Yakir Yangdc1c93b2016-06-29 17:16:05 +0800289 return PTR_ERR(dp->grfclk);
290 }
291
Yakir Yang9e32e162016-03-29 09:57:30 +0800292 dp->pclk = devm_clk_get(dev, "pclk");
293 if (IS_ERR(dp->pclk)) {
Haneen Mohammedd8dd6802017-09-15 02:36:03 -0600294 DRM_DEV_ERROR(dev, "failed to get pclk property\n");
Yakir Yang9e32e162016-03-29 09:57:30 +0800295 return PTR_ERR(dp->pclk);
296 }
297
298 dp->rst = devm_reset_control_get(dev, "dp");
299 if (IS_ERR(dp->rst)) {
Haneen Mohammedd8dd6802017-09-15 02:36:03 -0600300 DRM_DEV_ERROR(dev, "failed to get dp reset control\n");
Yakir Yang9e32e162016-03-29 09:57:30 +0800301 return PTR_ERR(dp->rst);
302 }
303
304 ret = clk_prepare_enable(dp->pclk);
305 if (ret < 0) {
Haneen Mohammedd8dd6802017-09-15 02:36:03 -0600306 DRM_DEV_ERROR(dp->dev, "failed to enable pclk %d\n", ret);
Yakir Yang9e32e162016-03-29 09:57:30 +0800307 return ret;
308 }
309
310 ret = rockchip_dp_pre_init(dp);
311 if (ret < 0) {
Haneen Mohammedd8dd6802017-09-15 02:36:03 -0600312 DRM_DEV_ERROR(dp->dev, "failed to pre init %d\n", ret);
Wei Yongjun3694c5c2016-07-19 11:32:43 +0000313 clk_disable_unprepare(dp->pclk);
Yakir Yang9e32e162016-03-29 09:57:30 +0800314 return ret;
315 }
316
317 return 0;
318}
319
320static int rockchip_dp_drm_create_encoder(struct rockchip_dp_device *dp)
321{
322 struct drm_encoder *encoder = &dp->encoder;
323 struct drm_device *drm_dev = dp->drm_dev;
324 struct device *dev = dp->dev;
325 int ret;
326
327 encoder->possible_crtcs = drm_of_find_possible_crtcs(drm_dev,
328 dev->of_node);
329 DRM_DEBUG_KMS("possible_crtcs = 0x%x\n", encoder->possible_crtcs);
330
331 ret = drm_encoder_init(drm_dev, encoder, &rockchip_dp_encoder_funcs,
332 DRM_MODE_ENCODER_TMDS, NULL);
333 if (ret) {
334 DRM_ERROR("failed to initialize encoder with drm\n");
335 return ret;
336 }
337
338 drm_encoder_helper_add(encoder, &rockchip_dp_encoder_helper_funcs);
339
340 return 0;
341}
342
343static int rockchip_dp_bind(struct device *dev, struct device *master,
344 void *data)
345{
346 struct rockchip_dp_device *dp = dev_get_drvdata(dev);
Yakir Yangd9c900b2016-06-29 17:15:01 +0800347 const struct rockchip_dp_chip_data *dp_data;
Yakir Yang9e32e162016-03-29 09:57:30 +0800348 struct drm_device *drm_dev = data;
349 int ret;
350
351 /*
352 * Just like the probe function said, we don't need the
353 * device drvrate anymore, we should leave the charge to
354 * analogix dp driver, set the device drvdata to NULL.
355 */
356 dev_set_drvdata(dev, NULL);
357
Yakir Yangd9c900b2016-06-29 17:15:01 +0800358 dp_data = of_device_get_match_data(dev);
359 if (!dp_data)
360 return -ENODEV;
361
Yakir Yang9e32e162016-03-29 09:57:30 +0800362 ret = rockchip_dp_init(dp);
363 if (ret < 0)
364 return ret;
365
Yakir Yangd9c900b2016-06-29 17:15:01 +0800366 dp->data = dp_data;
Yakir Yang9e32e162016-03-29 09:57:30 +0800367 dp->drm_dev = drm_dev;
368
369 ret = rockchip_dp_drm_create_encoder(dp);
370 if (ret) {
371 DRM_ERROR("failed to create drm encoder\n");
372 return ret;
373 }
374
375 dp->plat_data.encoder = &dp->encoder;
376
Yakir Yangd9c900b2016-06-29 17:15:01 +0800377 dp->plat_data.dev_type = dp->data->chip_type;
Yakir Yang9e32e162016-03-29 09:57:30 +0800378 dp->plat_data.power_on = rockchip_dp_poweron;
379 dp->plat_data.power_off = rockchip_dp_powerdown;
Yakir Yangdb8a9ae2016-06-29 17:15:39 +0800380 dp->plat_data.get_modes = rockchip_dp_get_modes;
Yakir Yang9e32e162016-03-29 09:57:30 +0800381
Emil Renner Berthing44419ce2017-10-04 19:53:46 +0200382 mutex_init(&dp->psr_lock);
Yakir Yang8f0ac5c2016-07-24 14:57:52 +0800383 dp->psr_state = ~EDP_VSC_PSR_STATE_ACTIVE;
Sean Pauld761b2d2016-08-16 17:12:45 -0700384 INIT_WORK(&dp->psr_work, analogix_dp_psr_work);
Yakir Yang8f0ac5c2016-07-24 14:57:52 +0800385
386 rockchip_drm_psr_register(&dp->encoder, analogix_dp_psr_set);
387
Yakir Yang9e32e162016-03-29 09:57:30 +0800388 return analogix_dp_bind(dev, dp->drm_dev, &dp->plat_data);
389}
390
391static void rockchip_dp_unbind(struct device *dev, struct device *master,
392 void *data)
393{
Yakir Yang8f0ac5c2016-07-24 14:57:52 +0800394 struct rockchip_dp_device *dp = dev_get_drvdata(dev);
395
396 rockchip_drm_psr_unregister(&dp->encoder);
397
Jeffy Chenb7ac7b52017-04-06 20:31:22 +0800398 analogix_dp_unbind(dev, master, data);
399 clk_disable_unprepare(dp->pclk);
Yakir Yang9e32e162016-03-29 09:57:30 +0800400}
401
402static const struct component_ops rockchip_dp_component_ops = {
403 .bind = rockchip_dp_bind,
404 .unbind = rockchip_dp_unbind,
405};
406
407static int rockchip_dp_probe(struct platform_device *pdev)
408{
409 struct device *dev = &pdev->dev;
Yakir Yangeb87c912016-06-29 17:15:30 +0800410 struct drm_panel *panel = NULL;
Yakir Yang9e32e162016-03-29 09:57:30 +0800411 struct rockchip_dp_device *dp;
Rob Herringebc94462017-03-29 13:55:46 -0500412 int ret;
Yakir Yang9e32e162016-03-29 09:57:30 +0800413
Rob Herringebc94462017-03-29 13:55:46 -0500414 ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &panel, NULL);
415 if (ret)
416 return ret;
Yakir Yang9e32e162016-03-29 09:57:30 +0800417
Yakir Yang9e32e162016-03-29 09:57:30 +0800418 dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL);
419 if (!dp)
420 return -ENOMEM;
421
422 dp->dev = dev;
423
424 dp->plat_data.panel = panel;
425
426 /*
427 * We just use the drvdata until driver run into component
428 * add function, and then we would set drvdata to null, so
429 * that analogix dp driver could take charge of the drvdata.
430 */
431 platform_set_drvdata(pdev, dp);
432
433 return component_add(dev, &rockchip_dp_component_ops);
434}
435
436static int rockchip_dp_remove(struct platform_device *pdev)
437{
438 component_del(&pdev->dev, &rockchip_dp_component_ops);
439
440 return 0;
441}
442
Yakir Yang9e32e162016-03-29 09:57:30 +0800443static const struct dev_pm_ops rockchip_dp_pm_ops = {
Tomeu Vizosofe64ba52016-06-06 16:53:33 +0200444#ifdef CONFIG_PM_SLEEP
445 .suspend = analogix_dp_suspend,
446 .resume_early = analogix_dp_resume,
447#endif
Yakir Yang9e32e162016-03-29 09:57:30 +0800448};
449
Yakir Yang82872e42016-06-29 17:15:26 +0800450static const struct rockchip_dp_chip_data rk3399_edp = {
451 .lcdsel_grf_reg = RK3399_GRF_SOC_CON20,
452 .lcdsel_big = HIWORD_UPDATE(0, RK3399_EDP_LCDC_SEL),
453 .lcdsel_lit = HIWORD_UPDATE(RK3399_EDP_LCDC_SEL, RK3399_EDP_LCDC_SEL),
454 .chip_type = RK3399_EDP,
455};
456
Yakir Yangd9c900b2016-06-29 17:15:01 +0800457static const struct rockchip_dp_chip_data rk3288_dp = {
458 .lcdsel_grf_reg = RK3288_GRF_SOC_CON6,
459 .lcdsel_big = HIWORD_UPDATE(0, RK3288_EDP_LCDC_SEL),
460 .lcdsel_lit = HIWORD_UPDATE(RK3288_EDP_LCDC_SEL, RK3288_EDP_LCDC_SEL),
461 .chip_type = RK3288_DP,
462};
463
Yakir Yang9e32e162016-03-29 09:57:30 +0800464static const struct of_device_id rockchip_dp_dt_ids[] = {
Yakir Yangd9c900b2016-06-29 17:15:01 +0800465 {.compatible = "rockchip,rk3288-dp", .data = &rk3288_dp },
Yakir Yang82872e42016-06-29 17:15:26 +0800466 {.compatible = "rockchip,rk3399-edp", .data = &rk3399_edp },
Yakir Yang9e32e162016-03-29 09:57:30 +0800467 {}
468};
469MODULE_DEVICE_TABLE(of, rockchip_dp_dt_ids);
470
Jeffy Chen8820b682017-03-22 11:21:20 +0800471struct platform_driver rockchip_dp_driver = {
Yakir Yang9e32e162016-03-29 09:57:30 +0800472 .probe = rockchip_dp_probe,
473 .remove = rockchip_dp_remove,
474 .driver = {
475 .name = "rockchip-dp",
Yakir Yang9e32e162016-03-29 09:57:30 +0800476 .pm = &rockchip_dp_pm_ops,
477 .of_match_table = of_match_ptr(rockchip_dp_dt_ids),
478 },
479};