diff options
author | Archit Taneja <archit@ti.com> | 2011-08-22 08:11:57 -0400 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-09-30 09:16:28 -0400 |
commit | 569969d6015f846926267cc40ed5fec936717f68 (patch) | |
tree | 7af8e34a90a5e189291f87bee547846c8063c7cd /drivers/video/omap2/dss/dispc.c | |
parent | b3b89c05cbd9869cfd6d4e352293a2e7e3bffc6e (diff) |
OMAP: DSS2: Clean up stallmode and io pad mode selection
Split the function dispc_set_parallel_interface_mode() into 2 separate
functions called dispc_mgr_set_io_pad_mode() and dispc_mgr_enable_stallmode().
The current function tries to set 2 different modes(io pad mode and stall mode)
based on a parameter omap_parallel_interface_mode which loosely corresponds to
the panel interface type.
This isn't correct because a) these 2 modes are independent to some extent,
b) we are currently configuring gpout0/gpout1 for DSI panels which is
unnecessary, c) a DSI Video mode panel won't get configured correctly.
Splitting the functions allows the interface driver to set these modes
independently and hence allow more flexibility.
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/dispc.c')
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index de209361c2d..b4a16cf9be1 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -2205,46 +2205,41 @@ void dispc_mgr_set_tft_data_lines(enum omap_channel channel, u8 data_lines) | |||
2205 | REG_FLD_MOD(DISPC_CONTROL, code, 9, 8); | 2205 | REG_FLD_MOD(DISPC_CONTROL, code, 9, 8); |
2206 | } | 2206 | } |
2207 | 2207 | ||
2208 | void dispc_mgr_set_parallel_interface_mode(enum omap_channel channel, | 2208 | void dispc_mgr_set_io_pad_mode(enum dss_io_pad_mode mode) |
2209 | enum omap_parallel_interface_mode mode) | ||
2210 | { | 2209 | { |
2211 | u32 l; | 2210 | u32 l; |
2212 | int stallmode; | 2211 | int gpout0, gpout1; |
2213 | int gpout0 = 1; | ||
2214 | int gpout1; | ||
2215 | 2212 | ||
2216 | switch (mode) { | 2213 | switch (mode) { |
2217 | case OMAP_DSS_PARALLELMODE_BYPASS: | 2214 | case DSS_IO_PAD_MODE_RESET: |
2218 | stallmode = 0; | 2215 | gpout0 = 0; |
2219 | gpout1 = 1; | 2216 | gpout1 = 0; |
2220 | break; | 2217 | break; |
2221 | 2218 | case DSS_IO_PAD_MODE_RFBI: | |
2222 | case OMAP_DSS_PARALLELMODE_RFBI: | 2219 | gpout0 = 1; |
2223 | stallmode = 1; | ||
2224 | gpout1 = 0; | 2220 | gpout1 = 0; |
2225 | break; | 2221 | break; |
2226 | 2222 | case DSS_IO_PAD_MODE_BYPASS: | |
2227 | case OMAP_DSS_PARALLELMODE_DSI: | 2223 | gpout0 = 1; |
2228 | stallmode = 1; | ||
2229 | gpout1 = 1; | 2224 | gpout1 = 1; |
2230 | break; | 2225 | break; |
2231 | |||
2232 | default: | 2226 | default: |
2233 | BUG(); | 2227 | BUG(); |
2234 | return; | 2228 | return; |
2235 | } | 2229 | } |
2236 | 2230 | ||
2237 | if (channel == OMAP_DSS_CHANNEL_LCD2) { | 2231 | l = dispc_read_reg(DISPC_CONTROL); |
2238 | l = dispc_read_reg(DISPC_CONTROL2); | 2232 | l = FLD_MOD(l, gpout0, 15, 15); |
2239 | l = FLD_MOD(l, stallmode, 11, 11); | 2233 | l = FLD_MOD(l, gpout1, 16, 16); |
2240 | dispc_write_reg(DISPC_CONTROL2, l); | 2234 | dispc_write_reg(DISPC_CONTROL, l); |
2241 | } else { | 2235 | } |
2242 | l = dispc_read_reg(DISPC_CONTROL); | 2236 | |
2243 | l = FLD_MOD(l, stallmode, 11, 11); | 2237 | void dispc_mgr_enable_stallmode(enum omap_channel channel, bool enable) |
2244 | l = FLD_MOD(l, gpout0, 15, 15); | 2238 | { |
2245 | l = FLD_MOD(l, gpout1, 16, 16); | 2239 | if (channel == OMAP_DSS_CHANNEL_LCD2) |
2246 | dispc_write_reg(DISPC_CONTROL, l); | 2240 | REG_FLD_MOD(DISPC_CONTROL2, enable, 11, 11); |
2247 | } | 2241 | else |
2242 | REG_FLD_MOD(DISPC_CONTROL, enable, 11, 11); | ||
2248 | } | 2243 | } |
2249 | 2244 | ||
2250 | static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp, | 2245 | static bool _dispc_lcd_timings_ok(int hsw, int hfp, int hbp, |