diff options
author | Archit Taneja <archit@ti.com> | 2012-06-29 05:03:18 -0400 |
---|---|---|
committer | Archit Taneja <archit@ti.com> | 2012-06-29 06:32:41 -0400 |
commit | 37a579903efaf25b74fcf1fd645817af94d36152 (patch) | |
tree | 5c63d8757bc702b95c3a5b73498a2538621cfc93 /drivers/video | |
parent | 7d2572f8b3df70c29527e5579b4b67a76ba8477d (diff) |
OMAPDSS: SDI: Configure dss_lcd_mgr_config struct with lcd manager parameters
Create a dss_lcd_mgr_config struct instance in SDI. Fill up all the parameters
of the struct with configurations held by the panel, and the configurations
required by SDI.
Use these to write to the DISPC registers. These direct register writes would be
later replaced by a function which applies the configuration using the shadow
register programming model.
Create function sdi_config_lcd_manager() which fills the mgr_config parameters
and writes to the DISPC registers.
Signed-off-by: Archit Taneja <archit@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/omap2/dss/sdi.c | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c index 73f8357955ae..f102eae6e2af 100644 --- a/drivers/video/omap2/dss/sdi.c +++ b/drivers/video/omap2/dss/sdi.c | |||
@@ -32,18 +32,34 @@ | |||
32 | static struct { | 32 | static struct { |
33 | bool update_enabled; | 33 | bool update_enabled; |
34 | struct regulator *vdds_sdi_reg; | 34 | struct regulator *vdds_sdi_reg; |
35 | } sdi; | ||
36 | 35 | ||
37 | static void sdi_basic_init(struct omap_dss_device *dssdev) | 36 | struct dss_lcd_mgr_config mgr_config; |
37 | } sdi; | ||
38 | 38 | ||
39 | static void sdi_config_lcd_manager(struct omap_dss_device *dssdev) | ||
39 | { | 40 | { |
40 | dispc_mgr_set_io_pad_mode(DSS_IO_PAD_MODE_BYPASS); | 41 | sdi.mgr_config.io_pad_mode = DSS_IO_PAD_MODE_BYPASS; |
41 | dispc_mgr_enable_stallmode(dssdev->manager->id, false); | ||
42 | 42 | ||
43 | dispc_mgr_set_lcd_type_tft(dssdev->manager->id); | 43 | sdi.mgr_config.stallmode = false; |
44 | sdi.mgr_config.fifohandcheck = false; | ||
45 | |||
46 | sdi.mgr_config.video_port_width = 24; | ||
47 | sdi.mgr_config.lcden_sig_polarity = 1; | ||
48 | |||
49 | dispc_mgr_set_io_pad_mode(sdi.mgr_config.io_pad_mode); | ||
50 | dispc_mgr_enable_stallmode(dssdev->manager->id, | ||
51 | sdi.mgr_config.stallmode); | ||
52 | dispc_mgr_enable_fifohandcheck(dssdev->manager->id, | ||
53 | sdi.mgr_config.fifohandcheck); | ||
44 | 54 | ||
45 | dispc_mgr_set_tft_data_lines(dssdev->manager->id, 24); | 55 | dispc_mgr_set_clock_div(dssdev->manager->id, |
46 | dispc_lcd_enable_signal_polarity(1); | 56 | &sdi.mgr_config.clock_info); |
57 | |||
58 | dispc_mgr_set_tft_data_lines(dssdev->manager->id, | ||
59 | sdi.mgr_config.video_port_width); | ||
60 | dispc_lcd_enable_signal_polarity(sdi.mgr_config.lcden_sig_polarity); | ||
61 | |||
62 | dispc_mgr_set_lcd_type_tft(dssdev->manager->id); | ||
47 | } | 63 | } |
48 | 64 | ||
49 | int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) | 65 | int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) |
@@ -51,8 +67,6 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) | |||
51 | struct omap_video_timings *t = &dssdev->panel.timings; | 67 | struct omap_video_timings *t = &dssdev->panel.timings; |
52 | struct dss_clock_info dss_cinfo; | 68 | struct dss_clock_info dss_cinfo; |
53 | struct dispc_clock_info dispc_cinfo; | 69 | struct dispc_clock_info dispc_cinfo; |
54 | u16 lck_div, pck_div; | ||
55 | unsigned long fck; | ||
56 | unsigned long pck; | 70 | unsigned long pck; |
57 | int r; | 71 | int r; |
58 | 72 | ||
@@ -75,8 +89,6 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) | |||
75 | if (r) | 89 | if (r) |
76 | goto err_get_dispc; | 90 | goto err_get_dispc; |
77 | 91 | ||
78 | sdi_basic_init(dssdev); | ||
79 | |||
80 | /* 15.5.9.1.2 */ | 92 | /* 15.5.9.1.2 */ |
81 | dssdev->panel.timings.data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; | 93 | dssdev->panel.timings.data_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; |
82 | dssdev->panel.timings.sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; | 94 | dssdev->panel.timings.sync_pclk_edge = OMAPDSS_DRIVE_SIG_RISING_EDGE; |
@@ -85,11 +97,9 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) | |||
85 | if (r) | 97 | if (r) |
86 | goto err_calc_clock_div; | 98 | goto err_calc_clock_div; |
87 | 99 | ||
88 | fck = dss_cinfo.fck; | 100 | sdi.mgr_config.clock_info = dispc_cinfo; |
89 | lck_div = dispc_cinfo.lck_div; | ||
90 | pck_div = dispc_cinfo.pck_div; | ||
91 | 101 | ||
92 | pck = fck / lck_div / pck_div / 1000; | 102 | pck = dss_cinfo.fck / dispc_cinfo.lck_div / dispc_cinfo.pck_div / 1000; |
93 | 103 | ||
94 | if (pck != t->pixel_clock) { | 104 | if (pck != t->pixel_clock) { |
95 | DSSWARN("Could not find exact pixel clock. Requested %d kHz, " | 105 | DSSWARN("Could not find exact pixel clock. Requested %d kHz, " |
@@ -106,7 +116,7 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev) | |||
106 | if (r) | 116 | if (r) |
107 | goto err_set_dss_clock_div; | 117 | goto err_set_dss_clock_div; |
108 | 118 | ||
109 | dispc_mgr_set_clock_div(dssdev->manager->id, &dispc_cinfo); | 119 | sdi_config_lcd_manager(dssdev); |
110 | 120 | ||
111 | dss_sdi_init(dssdev->phy.sdi.datapairs); | 121 | dss_sdi_init(dssdev->phy.sdi.datapairs); |
112 | r = dss_sdi_enable(); | 122 | r = dss_sdi_enable(); |