|
164 | 164 | edid->width_cm, edid->height_cm);
|
165 | 165 |
|
166 | 166 | dp->sink_has_audio = drm_detect_monitor_audio(edid);
|
167 |
| -@@ -279,7 +282,8 @@ static int cdn_dp_connector_mode_valid(s |
168 |
| - struct drm_display_mode *mode) |
| 167 | +@@ -280,7 +283,8 @@ cdn_dp_connector_mode_valid(struct drm_c |
| 168 | + struct drm_display_mode *mode) |
169 | 169 | {
|
170 | 170 | struct cdn_dp_device *dp = connector_to_dp(connector);
|
171 | 171 | - struct drm_display_info *display_info = &dp->connector.display_info;
|
|
174 | 174 | u32 requested, actual, rate, sink_max, source_max = 0;
|
175 | 175 | u8 lanes, bpc;
|
176 | 176 |
|
177 |
| -@@ -305,7 +309,7 @@ static int cdn_dp_connector_mode_valid(s |
| 177 | +@@ -306,7 +310,7 @@ cdn_dp_connector_mode_valid(struct drm_c |
178 | 178 | sink_max = drm_dp_max_lane_count(dp->dpcd);
|
179 | 179 | lanes = min(source_max, sink_max);
|
180 | 180 |
|
|
183 | 183 | sink_max = drm_dp_max_link_rate(dp->dpcd);
|
184 | 184 | rate = min(source_max, sink_max);
|
185 | 185 |
|
186 |
| -@@ -315,7 +319,7 @@ static int cdn_dp_connector_mode_valid(s |
| 186 | +@@ -316,7 +320,7 @@ cdn_dp_connector_mode_valid(struct drm_c |
187 | 187 | actual = actual * 8 / 10;
|
188 | 188 |
|
189 | 189 | if (requested > actual) {
|
|
192 | 192 | "requested=%d, actual=%d, clock=%d\n",
|
193 | 193 | requested, actual, mode->clock);
|
194 | 194 | return MODE_CLOCK_HIGH;
|
195 |
| -@@ -335,28 +339,29 @@ static int cdn_dp_firmware_init(struct c |
| 195 | +@@ -336,28 +340,29 @@ static int cdn_dp_firmware_init(struct c |
196 | 196 | const u32 *iram_data, *dram_data;
|
197 | 197 | const struct firmware *fw = dp->fw;
|
198 | 198 | const struct cdn_firmware_header *hdr;
|
|
228 | 228 | }
|
229 | 229 |
|
230 | 230 | static int cdn_dp_get_sink_capability(struct cdn_dp_device *dp)
|
231 |
| -@@ -366,28 +371,29 @@ static int cdn_dp_get_sink_capability(st |
| 231 | +@@ -367,28 +372,29 @@ static int cdn_dp_get_sink_capability(st |
232 | 232 | if (!cdn_dp_check_sink_connection(dp))
|
233 | 233 | return -ENODEV;
|
234 | 234 |
|
|
264 | 264 | ret);
|
265 | 265 | goto err_phy;
|
266 | 266 | }
|
267 |
| -@@ -397,28 +403,28 @@ static int cdn_dp_enable_phy(struct cdn_ |
| 267 | +@@ -398,28 +404,28 @@ static int cdn_dp_enable_phy(struct cdn_ |
268 | 268 | ret = cdn_dp_grf_write(dp, GRF_SOC_CON26,
|
269 | 269 | DPTX_HPD_SEL_MASK | DPTX_HPD_SEL);
|
270 | 270 | if (ret) {
|
|
299 | 299 | ret);
|
300 | 300 | goto err_power_on;
|
301 | 301 | }
|
302 |
| -@@ -428,7 +434,7 @@ static int cdn_dp_enable_phy(struct cdn_ |
| 302 | +@@ -429,7 +435,7 @@ static int cdn_dp_enable_phy(struct cdn_ |
303 | 303 |
|
304 | 304 | err_power_on:
|
305 | 305 | if (phy_power_off(port->phy))
|
|
308 | 308 | else
|
309 | 309 | port->phy_enabled = false;
|
310 | 310 |
|
311 |
| -@@ -446,7 +452,8 @@ static int cdn_dp_disable_phy(struct cdn |
| 311 | +@@ -447,7 +453,8 @@ static int cdn_dp_disable_phy(struct cdn |
312 | 312 | if (port->phy_enabled) {
|
313 | 313 | ret = phy_power_off(port->phy);
|
314 | 314 | if (ret) {
|
|
318 | 318 | return ret;
|
319 | 319 | }
|
320 | 320 | }
|
321 |
| -@@ -470,16 +477,16 @@ static int cdn_dp_disable(struct cdn_dp_ |
| 321 | +@@ -471,16 +478,16 @@ static int cdn_dp_disable(struct cdn_dp_ |
322 | 322 | ret = cdn_dp_grf_write(dp, GRF_SOC_CON26,
|
323 | 323 | DPTX_HPD_SEL_MASK | DPTX_HPD_DEL);
|
324 | 324 | if (ret) {
|
|
339 | 339 | if (!dp->connected) {
|
340 | 340 | kfree(dp->edid);
|
341 | 341 | dp->edid = NULL;
|
342 |
| -@@ -492,11 +499,11 @@ static int cdn_dp_enable(struct cdn_dp_d |
| 342 | +@@ -493,11 +500,11 @@ static int cdn_dp_enable(struct cdn_dp_d |
343 | 343 | {
|
344 | 344 | int ret, i, lanes;
|
345 | 345 | struct cdn_dp_port *port;
|
|
353 | 353 | return -ENODEV;
|
354 | 354 | }
|
355 | 355 |
|
356 |
| -@@ -509,7 +516,7 @@ static int cdn_dp_enable(struct cdn_dp_d |
| 356 | +@@ -510,7 +517,7 @@ static int cdn_dp_enable(struct cdn_dp_d |
357 | 357 |
|
358 | 358 | ret = cdn_dp_firmware_init(dp);
|
359 | 359 | if (ret) {
|
|
362 | 362 | goto err_clk_disable;
|
363 | 363 | }
|
364 | 364 |
|
365 |
| -@@ -543,8 +550,9 @@ static void cdn_dp_encoder_mode_set(stru |
| 365 | +@@ -544,8 +551,9 @@ static void cdn_dp_encoder_mode_set(stru |
366 | 366 | struct drm_display_mode *adjusted)
|
367 | 367 | {
|
368 | 368 | struct cdn_dp_device *dp = encoder_to_dp(encoder);
|
|
374 | 374 |
|
375 | 375 | switch (display_info->bpc) {
|
376 | 376 | case 10:
|
377 |
| -@@ -562,7 +570,7 @@ static void cdn_dp_encoder_mode_set(stru |
| 377 | +@@ -563,7 +571,7 @@ static void cdn_dp_encoder_mode_set(stru |
378 | 378 | video->v_sync_polarity = !!(mode->flags & DRM_MODE_FLAG_NVSYNC);
|
379 | 379 | video->h_sync_polarity = !!(mode->flags & DRM_MODE_FLAG_NHSYNC);
|
380 | 380 |
|
|
383 | 383 | }
|
384 | 384 |
|
385 | 385 | static bool cdn_dp_check_link_status(struct cdn_dp_device *dp)
|
386 |
| -@@ -571,11 +579,11 @@ static bool cdn_dp_check_link_status(str |
| 386 | +@@ -572,11 +580,11 @@ static bool cdn_dp_check_link_status(str |
387 | 387 | struct cdn_dp_port *port = cdn_dp_connected_port(dp);
|
388 | 388 | u8 sink_lanes = drm_dp_max_lane_count(dp->dpcd);
|
389 | 389 |
|
|
398 | 398 | DRM_ERROR("Failed to get link status\n");
|
399 | 399 | return false;
|
400 | 400 | }
|
401 |
| -@@ -587,15 +595,16 @@ static bool cdn_dp_check_link_status(str |
| 401 | +@@ -588,15 +596,16 @@ static bool cdn_dp_check_link_status(str |
402 | 402 | static void cdn_dp_encoder_enable(struct drm_encoder *encoder)
|
403 | 403 | {
|
404 | 404 | struct cdn_dp_device *dp = encoder_to_dp(encoder);
|
|
418 | 418 | (ret) ? "LIT" : "BIG");
|
419 | 419 | if (ret)
|
420 | 420 | val = DP_SEL_VOP_LIT | (DP_SEL_VOP_LIT << 16);
|
421 |
| -@@ -610,33 +619,33 @@ static void cdn_dp_encoder_enable(struct |
| 421 | +@@ -611,33 +620,33 @@ static void cdn_dp_encoder_enable(struct |
422 | 422 |
|
423 | 423 | ret = cdn_dp_enable(dp);
|
424 | 424 | if (ret) {
|
|
461 | 461 | goto out;
|
462 | 462 | }
|
463 | 463 | out:
|
464 |
| -@@ -652,7 +661,8 @@ static void cdn_dp_encoder_disable(struc |
| 464 | +@@ -653,7 +662,8 @@ static void cdn_dp_encoder_disable(struc |
465 | 465 | if (dp->active) {
|
466 | 466 | ret = cdn_dp_disable(dp);
|
467 | 467 | if (ret) {
|
|
471 | 471 | ret);
|
472 | 472 | }
|
473 | 473 | }
|
474 |
| -@@ -696,7 +706,7 @@ static const struct drm_encoder_funcs cd |
| 474 | +@@ -697,7 +707,7 @@ static const struct drm_encoder_funcs cd |
475 | 475 |
|
476 | 476 | static int cdn_dp_parse_dt(struct cdn_dp_device *dp)
|
477 | 477 | {
|
|
480 | 480 | struct device_node *np = dev->of_node;
|
481 | 481 | struct platform_device *pdev = to_platform_device(dev);
|
482 | 482 | struct resource *res;
|
483 |
| -@@ -708,10 +718,10 @@ static int cdn_dp_parse_dt(struct cdn_dp |
| 483 | +@@ -709,10 +719,10 @@ static int cdn_dp_parse_dt(struct cdn_dp |
484 | 484 | }
|
485 | 485 |
|
486 | 486 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
494 | 494 | }
|
495 | 495 |
|
496 | 496 | dp->core_clk = devm_clk_get(dev, "core-clk");
|
497 |
| -@@ -726,10 +736,10 @@ static int cdn_dp_parse_dt(struct cdn_dp |
| 497 | +@@ -727,10 +737,10 @@ static int cdn_dp_parse_dt(struct cdn_dp |
498 | 498 | return PTR_ERR(dp->pclk);
|
499 | 499 | }
|
500 | 500 |
|
|
508 | 508 | }
|
509 | 509 |
|
510 | 510 | dp->grf_clk = devm_clk_get(dev, "grf");
|
511 |
| -@@ -738,10 +748,10 @@ static int cdn_dp_parse_dt(struct cdn_dp |
| 511 | +@@ -739,10 +749,10 @@ static int cdn_dp_parse_dt(struct cdn_dp |
512 | 512 | return PTR_ERR(dp->grf_clk);
|
513 | 513 | }
|
514 | 514 |
|
|
522 | 522 | }
|
523 | 523 |
|
524 | 524 | dp->dptx_rst = devm_reset_control_get(dev, "dptx");
|
525 |
| -@@ -796,7 +806,7 @@ static int cdn_dp_audio_hw_params(struct |
| 525 | +@@ -797,7 +807,7 @@ static int cdn_dp_audio_hw_params(struct |
526 | 526 | goto out;
|
527 | 527 | }
|
528 | 528 |
|
|
531 | 531 | if (!ret)
|
532 | 532 | dp->audio_info = audio;
|
533 | 533 |
|
534 |
| -@@ -814,7 +824,7 @@ static void cdn_dp_audio_shutdown(struct |
| 534 | +@@ -815,7 +825,7 @@ static void cdn_dp_audio_shutdown(struct |
535 | 535 | if (!dp->active)
|
536 | 536 | goto out;
|
537 | 537 |
|
|
540 | 540 | if (!ret)
|
541 | 541 | dp->audio_info.format = AFMT_UNUSED;
|
542 | 542 | out:
|
543 |
| -@@ -833,7 +843,7 @@ static int cdn_dp_audio_digital_mute(str |
| 543 | +@@ -834,7 +844,7 @@ static int cdn_dp_audio_digital_mute(str |
544 | 544 | goto out;
|
545 | 545 | }
|
546 | 546 |
|
|
549 | 549 |
|
550 | 550 | out:
|
551 | 551 | mutex_unlock(&dp->lock);
|
552 |
| -@@ -845,7 +855,8 @@ static int cdn_dp_audio_get_eld(struct d |
| 552 | +@@ -846,7 +856,8 @@ static int cdn_dp_audio_get_eld(struct d |
553 | 553 | {
|
554 | 554 | struct cdn_dp_device *dp = dev_get_drvdata(dev);
|
555 | 555 |
|
|
559 | 559 |
|
560 | 560 | return 0;
|
561 | 561 | }
|
562 |
| -@@ -879,6 +890,7 @@ static int cdn_dp_request_firmware(struc |
| 562 | +@@ -880,6 +891,7 @@ static int cdn_dp_request_firmware(struc |
563 | 563 | int ret;
|
564 | 564 | unsigned long timeout = jiffies + msecs_to_jiffies(CDN_FW_TIMEOUT_MS);
|
565 | 565 | unsigned long sleep = 1000;
|
566 | 566 | + struct device *dev = dp->mhdp.dev;
|
567 | 567 |
|
568 | 568 | WARN_ON(!mutex_is_locked(&dp->lock));
|
569 | 569 |
|
570 |
| -@@ -889,13 +901,13 @@ static int cdn_dp_request_firmware(struc |
| 570 | +@@ -890,13 +902,13 @@ static int cdn_dp_request_firmware(struc |
571 | 571 | mutex_unlock(&dp->lock);
|
572 | 572 |
|
573 | 573 | while (time_before(jiffies, timeout)) {
|
|
583 | 583 | "failed to request firmware: %d\n", ret);
|
584 | 584 | goto out;
|
585 | 585 | }
|
586 |
| -@@ -905,7 +917,7 @@ static int cdn_dp_request_firmware(struc |
| 586 | +@@ -906,7 +918,7 @@ static int cdn_dp_request_firmware(struc |
587 | 587 | goto out;
|
588 | 588 | }
|
589 | 589 |
|
|
592 | 592 | ret = -ETIMEDOUT;
|
593 | 593 | out:
|
594 | 594 | mutex_lock(&dp->lock);
|
595 |
| -@@ -916,8 +928,9 @@ static void cdn_dp_pd_event_work(struct |
| 595 | +@@ -917,8 +929,9 @@ static void cdn_dp_pd_event_work(struct |
596 | 596 | {
|
597 | 597 | struct cdn_dp_device *dp = container_of(work, struct cdn_dp_device,
|
598 | 598 | event_work);
|
|
603 | 603 |
|
604 | 604 | int ret;
|
605 | 605 |
|
606 |
| -@@ -934,44 +947,45 @@ static void cdn_dp_pd_event_work(struct |
| 606 | +@@ -935,44 +948,45 @@ static void cdn_dp_pd_event_work(struct |
607 | 607 |
|
608 | 608 | /* Not connected, notify userspace to disable the block */
|
609 | 609 | if (!cdn_dp_connected_port(dp)) {
|
|
662 | 662 | "Failed to config video %d\n",
|
663 | 663 | ret);
|
664 | 664 | }
|
665 |
| -@@ -1040,7 +1054,7 @@ static int cdn_dp_bind(struct device *de |
| 665 | +@@ -1041,7 +1055,7 @@ static int cdn_dp_bind(struct device *de |
666 | 666 |
|
667 | 667 | drm_encoder_helper_add(encoder, &cdn_dp_encoder_helper_funcs);
|
668 | 668 |
|
|
671 | 671 | connector->polled = DRM_CONNECTOR_POLL_HPD;
|
672 | 672 | connector->dpms = DRM_MODE_DPMS_OFF;
|
673 | 673 |
|
674 |
| -@@ -1064,7 +1078,7 @@ static int cdn_dp_bind(struct device *de |
| 674 | +@@ -1065,7 +1079,7 @@ static int cdn_dp_bind(struct device *de |
675 | 675 | port = dp->port[i];
|
676 | 676 |
|
677 | 677 | port->event_nb.notifier_call = cdn_dp_pd_event;
|
|
680 | 680 | EXTCON_DISP_DP,
|
681 | 681 | &port->event_nb);
|
682 | 682 | if (ret) {
|
683 |
| -@@ -1091,7 +1105,7 @@ static void cdn_dp_unbind(struct device |
| 683 | +@@ -1092,7 +1106,7 @@ static void cdn_dp_unbind(struct device |
684 | 684 | {
|
685 | 685 | struct cdn_dp_device *dp = dev_get_drvdata(dev);
|
686 | 686 | struct drm_encoder *encoder = &dp->encoder;
|
|
689 | 689 |
|
690 | 690 | cancel_work_sync(&dp->event_work);
|
691 | 691 | cdn_dp_encoder_disable(encoder);
|
692 |
| -@@ -1151,7 +1165,7 @@ static int cdn_dp_probe(struct platform_ |
| 692 | +@@ -1152,7 +1166,7 @@ static int cdn_dp_probe(struct platform_ |
693 | 693 | dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL);
|
694 | 694 | if (!dp)
|
695 | 695 | return -ENOMEM;
|
|
698 | 698 |
|
699 | 699 | match = of_match_node(cdn_dp_dt_ids, pdev->dev.of_node);
|
700 | 700 | dp_data = (struct cdn_dp_data *)match->data;
|
701 |
| -@@ -1196,7 +1210,7 @@ static int cdn_dp_remove(struct platform |
| 701 | +@@ -1197,7 +1211,7 @@ static int cdn_dp_remove(struct platform |
702 | 702 | struct cdn_dp_device *dp = platform_get_drvdata(pdev);
|
703 | 703 |
|
704 | 704 | platform_device_unregister(dp->audio_pdev);
|
|
707 | 707 | component_del(&pdev->dev, &cdn_dp_component_ops);
|
708 | 708 |
|
709 | 709 | return 0;
|
710 |
| -@@ -1206,7 +1220,7 @@ static void cdn_dp_shutdown(struct platf |
| 710 | +@@ -1207,7 +1221,7 @@ static void cdn_dp_shutdown(struct platf |
711 | 711 | {
|
712 | 712 | struct cdn_dp_device *dp = platform_get_drvdata(pdev);
|
713 | 713 |
|
|
0 commit comments