aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2013-10-08 04:52:03 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-10-09 05:42:19 -0400
commit275cfa1a9d43f00d1ae59f36fa0c3ed7f941b369 (patch)
tree5b79d69eb3aa1f46745173bd065cba3254884ec8
parent425f02fdee32ec0b6ae36067abe9586149120163 (diff)
omapdss: HDMI: remove hdmi_ip_data struct
The struct hdmi_ip_data contains information related to HDMI wrapper, PLL, PHY and core sub-blocks. Now that each of these sub blocks has it's own struct, hdmi_ip_data serves no purpose. The mutex lock in the struct was also never used. Remove this struct to make things cleaner. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
-rw-r--r--drivers/video/omap2/dss/hdmi.c91
-rw-r--r--drivers/video/omap2/dss/ti_hdmi.h14
2 files changed, 47 insertions, 58 deletions
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 0e9ecd691c5c..f03d6c7530e4 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -53,7 +53,12 @@ static struct {
53 struct mutex lock; 53 struct mutex lock;
54 struct platform_device *pdev; 54 struct platform_device *pdev;
55 55
56 struct hdmi_ip_data ip_data; 56 struct hdmi_wp_data wp;
57 struct hdmi_pll_data pll;
58 struct hdmi_phy_data phy;
59 struct hdmi_core_data core;
60
61 struct hdmi_config cfg;
57 62
58 struct clk *sys_clk; 63 struct clk *sys_clk;
59 struct regulator *vdda_hdmi_dac_reg; 64 struct regulator *vdda_hdmi_dac_reg;
@@ -348,7 +353,7 @@ static const struct hdmi_config *hdmi_find_timing(
348 int i; 353 int i;
349 354
350 for (i = 0; i < len; i++) { 355 for (i = 0; i < len; i++) {
351 if (timings_arr[i].cm.code == hdmi.ip_data.cfg.cm.code) 356 if (timings_arr[i].cm.code == hdmi.cfg.cm.code)
352 return &timings_arr[i]; 357 return &timings_arr[i];
353 } 358 }
354 return NULL; 359 return NULL;
@@ -359,15 +364,15 @@ static const struct hdmi_config *hdmi_get_timings(void)
359 const struct hdmi_config *arr; 364 const struct hdmi_config *arr;
360 int len; 365 int len;
361 366
362 if (hdmi.ip_data.cfg.cm.mode == HDMI_DVI) { 367 if (hdmi.cfg.cm.mode == HDMI_DVI) {
363 arr = vesa_timings; 368 arr = vesa_timings;
364 len = ARRAY_SIZE(vesa_timings); 369 len = ARRAY_SIZE(vesa_timings);
365 } else { 370 } else {
366 arr = cea_timings; 371 arr = cea_timings;
367 len = ARRAY_SIZE(cea_timings); 372 len = ARRAY_SIZE(cea_timings);
368 } 373 }
369 374
370 return hdmi_find_timing(arr, len); 375 return hdmi_find_timing(arr, len);
371} 376}
372 377
373static bool hdmi_timings_compare(struct omap_video_timings *timing1, 378static bool hdmi_timings_compare(struct omap_video_timings *timing1,
@@ -467,32 +472,30 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)
467 472
468 dss_mgr_disable(mgr); 473 dss_mgr_disable(mgr);
469 474
470 p = &hdmi.ip_data.cfg.timings; 475 p = &hdmi.cfg.timings;
471 476
472 DSSDBG("hdmi_power_on x_res= %d y_res = %d\n", p->x_res, p->y_res); 477 DSSDBG("hdmi_power_on x_res= %d y_res = %d\n", p->x_res, p->y_res);
473 478
474 phy = p->pixel_clock; 479 phy = p->pixel_clock;
475 480
476 hdmi_pll_compute(&hdmi.ip_data.pll, clk_get_rate(hdmi.sys_clk), phy); 481 hdmi_pll_compute(&hdmi.pll, clk_get_rate(hdmi.sys_clk), phy);
477 482
478 hdmi_wp_video_stop(&hdmi.ip_data.wp); 483 hdmi_wp_video_stop(&hdmi.wp);
479 484
480 /* config the PLL and PHY hdmi_set_pll_pwrfirst */ 485 /* config the PLL and PHY hdmi_set_pll_pwrfirst */
481 r = hdmi_pll_enable(&hdmi.ip_data.pll, &hdmi.ip_data.wp); 486 r = hdmi_pll_enable(&hdmi.pll, &hdmi.wp);
482 if (r) { 487 if (r) {
483 DSSDBG("Failed to lock PLL\n"); 488 DSSDBG("Failed to lock PLL\n");
484 goto err_pll_enable; 489 goto err_pll_enable;
485 } 490 }
486 491
487 r = hdmi_phy_enable(&hdmi.ip_data.phy, &hdmi.ip_data.wp, 492 r = hdmi_phy_enable(&hdmi.phy, &hdmi.wp, &hdmi.cfg);
488 &hdmi.ip_data.cfg);
489 if (r) { 493 if (r) {
490 DSSDBG("Failed to start PHY\n"); 494 DSSDBG("Failed to start PHY\n");
491 goto err_phy_enable; 495 goto err_phy_enable;
492 } 496 }
493 497
494 hdmi4_configure(&hdmi.ip_data.core, &hdmi.ip_data.wp, 498 hdmi4_configure(&hdmi.core, &hdmi.wp, &hdmi.cfg);
495 &hdmi.ip_data.cfg);
496 499
497 /* bypass TV gamma table */ 500 /* bypass TV gamma table */
498 dispc_enable_gamma_table(0); 501 dispc_enable_gamma_table(0);
@@ -500,7 +503,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)
500 /* tv size */ 503 /* tv size */
501 dss_mgr_set_timings(mgr, p); 504 dss_mgr_set_timings(mgr, p);
502 505
503 r = hdmi_wp_video_start(&hdmi.ip_data.wp); 506 r = hdmi_wp_video_start(&hdmi.wp);
504 if (r) 507 if (r)
505 goto err_vid_enable; 508 goto err_vid_enable;
506 509
@@ -511,11 +514,11 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)
511 return 0; 514 return 0;
512 515
513err_mgr_enable: 516err_mgr_enable:
514 hdmi_wp_video_stop(&hdmi.ip_data.wp); 517 hdmi_wp_video_stop(&hdmi.wp);
515err_vid_enable: 518err_vid_enable:
516 hdmi_phy_disable(&hdmi.ip_data.phy, &hdmi.ip_data.wp); 519 hdmi_phy_disable(&hdmi.phy, &hdmi.wp);
517err_phy_enable: 520err_phy_enable:
518 hdmi_pll_disable(&hdmi.ip_data.pll, &hdmi.ip_data.wp); 521 hdmi_pll_disable(&hdmi.pll, &hdmi.wp);
519err_pll_enable: 522err_pll_enable:
520 hdmi_power_off_core(dssdev); 523 hdmi_power_off_core(dssdev);
521 return -EIO; 524 return -EIO;
@@ -527,9 +530,9 @@ static void hdmi_power_off_full(struct omap_dss_device *dssdev)
527 530
528 dss_mgr_disable(mgr); 531 dss_mgr_disable(mgr);
529 532
530 hdmi_wp_video_stop(&hdmi.ip_data.wp); 533 hdmi_wp_video_stop(&hdmi.wp);
531 hdmi_phy_disable(&hdmi.ip_data.phy, &hdmi.ip_data.wp); 534 hdmi_phy_disable(&hdmi.phy, &hdmi.wp);
532 hdmi_pll_disable(&hdmi.ip_data.pll, &hdmi.ip_data.wp); 535 hdmi_pll_disable(&hdmi.pll, &hdmi.wp);
533 536
534 hdmi_power_off_core(dssdev); 537 hdmi_power_off_core(dssdev);
535} 538}
@@ -557,11 +560,11 @@ static void hdmi_display_set_timing(struct omap_dss_device *dssdev,
557 mutex_lock(&hdmi.lock); 560 mutex_lock(&hdmi.lock);
558 561
559 cm = hdmi_get_code(timings); 562 cm = hdmi_get_code(timings);
560 hdmi.ip_data.cfg.cm = cm; 563 hdmi.cfg.cm = cm;
561 564
562 t = hdmi_get_timings(); 565 t = hdmi_get_timings();
563 if (t != NULL) { 566 if (t != NULL) {
564 hdmi.ip_data.cfg = *t; 567 hdmi.cfg = *t;
565 568
566 dispc_set_tv_pclk(t->timings.pixel_clock * 1000); 569 dispc_set_tv_pclk(t->timings.pixel_clock * 1000);
567 } 570 }
@@ -590,10 +593,10 @@ static void hdmi_dump_regs(struct seq_file *s)
590 return; 593 return;
591 } 594 }
592 595
593 hdmi_wp_dump(&hdmi.ip_data.wp, s); 596 hdmi_wp_dump(&hdmi.wp, s);
594 hdmi_pll_dump(&hdmi.ip_data.pll, s); 597 hdmi_pll_dump(&hdmi.pll, s);
595 hdmi_phy_dump(&hdmi.ip_data.phy, s); 598 hdmi_phy_dump(&hdmi.phy, s);
596 hdmi4_core_dump(&hdmi.ip_data.core, s); 599 hdmi4_core_dump(&hdmi.core, s);
597 600
598 hdmi_runtime_put(); 601 hdmi_runtime_put();
599 mutex_unlock(&hdmi.lock); 602 mutex_unlock(&hdmi.lock);
@@ -608,7 +611,7 @@ static int read_edid(u8 *buf, int len)
608 r = hdmi_runtime_get(); 611 r = hdmi_runtime_get();
609 BUG_ON(r); 612 BUG_ON(r);
610 613
611 r = hdmi4_read_edid(&hdmi.ip_data.core, buf, len); 614 r = hdmi4_read_edid(&hdmi.core, buf, len);
612 615
613 hdmi_runtime_put(); 616 hdmi_runtime_put();
614 mutex_unlock(&hdmi.lock); 617 mutex_unlock(&hdmi.lock);
@@ -709,7 +712,7 @@ int hdmi_compute_acr(u32 sample_freq, u32 *n, u32 *cts)
709{ 712{
710 u32 deep_color; 713 u32 deep_color;
711 bool deep_color_correct = false; 714 bool deep_color_correct = false;
712 u32 pclk = hdmi.ip_data.cfg.timings.pixel_clock; 715 u32 pclk = hdmi.cfg.timings.pixel_clock;
713 716
714 if (n == NULL || cts == NULL) 717 if (n == NULL || cts == NULL)
715 return -EINVAL; 718 return -EINVAL;
@@ -807,11 +810,12 @@ int hdmi_compute_acr(u32 sample_freq, u32 *n, u32 *cts)
807 810
808static bool hdmi_mode_has_audio(void) 811static bool hdmi_mode_has_audio(void)
809{ 812{
810 if (hdmi.ip_data.cfg.cm.mode == HDMI_HDMI) 813 if (hdmi.cfg.cm.mode == HDMI_HDMI)
811 return true; 814 return true;
812 else 815 else
813 return false; 816 return false;
814} 817}
818
815#endif 819#endif
816 820
817static int hdmi_connect(struct omap_dss_device *dssdev, 821static int hdmi_connect(struct omap_dss_device *dssdev,
@@ -891,7 +895,7 @@ static int hdmi_audio_enable(struct omap_dss_device *dssdev)
891 goto err; 895 goto err;
892 } 896 }
893 897
894 r = hdmi_wp_audio_enable(&hdmi.ip_data.wp, true); 898 r = hdmi_wp_audio_enable(&hdmi.wp, true);
895 if (r) 899 if (r)
896 goto err; 900 goto err;
897 901
@@ -905,17 +909,17 @@ err:
905 909
906static void hdmi_audio_disable(struct omap_dss_device *dssdev) 910static void hdmi_audio_disable(struct omap_dss_device *dssdev)
907{ 911{
908 hdmi_wp_audio_enable(&hdmi.ip_data.wp, false); 912 hdmi_wp_audio_enable(&hdmi.wp, false);
909} 913}
910 914
911static int hdmi_audio_start(struct omap_dss_device *dssdev) 915static int hdmi_audio_start(struct omap_dss_device *dssdev)
912{ 916{
913 return hdmi4_audio_start(&hdmi.ip_data.core, &hdmi.ip_data.wp); 917 return hdmi4_audio_start(&hdmi.core, &hdmi.wp);
914} 918}
915 919
916static void hdmi_audio_stop(struct omap_dss_device *dssdev) 920static void hdmi_audio_stop(struct omap_dss_device *dssdev)
917{ 921{
918 hdmi4_audio_stop(&hdmi.ip_data.core, &hdmi.ip_data.wp); 922 hdmi4_audio_stop(&hdmi.core, &hdmi.wp);
919} 923}
920 924
921static bool hdmi_audio_supported(struct omap_dss_device *dssdev) 925static bool hdmi_audio_supported(struct omap_dss_device *dssdev)
@@ -942,7 +946,7 @@ static int hdmi_audio_config(struct omap_dss_device *dssdev,
942 goto err; 946 goto err;
943 } 947 }
944 948
945 r = hdmi4_audio_config(&hdmi.ip_data.core, &hdmi.ip_data.wp, audio); 949 r = hdmi4_audio_config(&hdmi.core, &hdmi.wp, audio);
946 if (r) 950 if (r)
947 goto err; 951 goto err;
948 952
@@ -1035,21 +1039,20 @@ static int omapdss_hdmihw_probe(struct platform_device *pdev)
1035 hdmi.pdev = pdev; 1039 hdmi.pdev = pdev;
1036 1040
1037 mutex_init(&hdmi.lock); 1041 mutex_init(&hdmi.lock);
1038 mutex_init(&hdmi.ip_data.lock);
1039 1042
1040 r = hdmi_wp_init(pdev, &hdmi.ip_data.wp); 1043 r = hdmi_wp_init(pdev, &hdmi.wp);
1041 if (r) 1044 if (r)
1042 return r; 1045 return r;
1043 1046
1044 r = hdmi_pll_init(pdev, &hdmi.ip_data.pll); 1047 r = hdmi_pll_init(pdev, &hdmi.pll);
1045 if (r) 1048 if (r)
1046 return r; 1049 return r;
1047 1050
1048 r = hdmi_phy_init(pdev, &hdmi.ip_data.phy); 1051 r = hdmi_phy_init(pdev, &hdmi.phy);
1049 if (r) 1052 if (r)
1050 return r; 1053 return r;
1051 1054
1052 r = hdmi4_core_init(pdev, &hdmi.ip_data.core); 1055 r = hdmi4_core_init(pdev, &hdmi.core);
1053 if (r) 1056 if (r)
1054 return r; 1057 return r;
1055 1058
diff --git a/drivers/video/omap2/dss/ti_hdmi.h b/drivers/video/omap2/dss/ti_hdmi.h
index 9eb9b321314d..107a6061a800 100644
--- a/drivers/video/omap2/dss/ti_hdmi.h
+++ b/drivers/video/omap2/dss/ti_hdmi.h
@@ -23,8 +23,6 @@
23 23
24#include <linux/platform_device.h> 24#include <linux/platform_device.h>
25 25
26struct hdmi_ip_data;
27
28enum hdmi_pll_pwr { 26enum hdmi_pll_pwr {
29 HDMI_PLLPWRCMD_ALLOFF = 0, 27 HDMI_PLLPWRCMD_ALLOFF = 0,
30 HDMI_PLLPWRCMD_PLLONLY = 1, 28 HDMI_PLLPWRCMD_PLLONLY = 1,
@@ -208,18 +206,6 @@ struct hdmi_core_data {
208 struct hdmi_core_infoframe_avi avi_cfg; 206 struct hdmi_core_infoframe_avi avi_cfg;
209}; 207};
210 208
211struct hdmi_ip_data {
212 struct hdmi_wp_data wp;
213 struct hdmi_pll_data pll;
214 struct hdmi_phy_data phy;
215 struct hdmi_core_data core;
216
217 struct hdmi_config cfg;
218
219 /* ti_hdmi_4xxx_ip private data. These should be in a separate struct */
220 struct mutex lock;
221};
222
223/* HDMI wrapper funcs */ 209/* HDMI wrapper funcs */
224int hdmi_wp_video_start(struct hdmi_wp_data *wp); 210int hdmi_wp_video_start(struct hdmi_wp_data *wp);
225void hdmi_wp_video_stop(struct hdmi_wp_data *wp); 211void hdmi_wp_video_stop(struct hdmi_wp_data *wp);