diff options
author | Sumit Semwal <sumit.semwal@ti.com> | 2010-12-02 06:27:10 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@nokia.com> | 2011-01-10 04:35:59 -0500 |
commit | 64ba4f748a005a44c03c98e082d8ee157f4ee66f (patch) | |
tree | e06800604171e7067c197514cbdec323bccbbae8 /drivers/video/omap2/dss/dispc.c | |
parent | 8613b0005d315582a988bbeb2249d69df343eb3a (diff) |
OMAP: DSS2: Introduce omap_channel argument to DISPC functions used by interface drivers
The interface drivers (dsi.c, sdi.c etc) need to call dispc functions with
dssdev->manager->id as a parameter to specify the DISPC channel which they want
to configure/use, this is required as the same functions are now used to configure
dispc registers of different channels.
The following dispc functions are changed to incorporate channel as an argument:
-dispc_enable_fifohandcheck()
-dispc_set_lcd_size()
-dispc_set_parallel_interface_mode()
-dispc_set_tft_data_lines()
-dispc_set_lcd_display_type()
-dispc_set_lcd_timings()
Signed-off-by: Sumit Semwal <sumit.semwal@ti.com>
Signed-off-by: Mukund Mittal <mmittal@ti.com>
Signed-off-by: Samreen <samreen@ti.com>
Signed-off-by: Archit Taneja <archit@ti.com>
[tomi.valkeinen@nokia.com: fixed trivial compile error]
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
Diffstat (limited to 'drivers/video/omap2/dss/dispc.c')
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 38 |
1 files changed, 22 insertions, 16 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 36fadb8e49c3..7ca53c100419 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -941,13 +941,13 @@ void dispc_enable_replication(enum omap_plane plane, bool enable) | |||
941 | enable_clocks(0); | 941 | enable_clocks(0); |
942 | } | 942 | } |
943 | 943 | ||
944 | void dispc_set_lcd_size(u16 width, u16 height) | 944 | void dispc_set_lcd_size(enum omap_channel channel, u16 width, u16 height) |
945 | { | 945 | { |
946 | u32 val; | 946 | u32 val; |
947 | BUG_ON((width > (1 << 11)) || (height > (1 << 11))); | 947 | BUG_ON((width > (1 << 11)) || (height > (1 << 11))); |
948 | val = FLD_VAL(height - 1, 26, 16) | FLD_VAL(width - 1, 10, 0); | 948 | val = FLD_VAL(height - 1, 26, 16) | FLD_VAL(width - 1, 10, 0); |
949 | enable_clocks(1); | 949 | enable_clocks(1); |
950 | dispc_write_reg(DISPC_SIZE_LCD(OMAP_DSS_CHANNEL_LCD), val); | 950 | dispc_write_reg(DISPC_SIZE_LCD(channel), val); |
951 | enable_clocks(0); | 951 | enable_clocks(0); |
952 | } | 952 | } |
953 | 953 | ||
@@ -1843,7 +1843,7 @@ void dispc_pck_free_enable(bool enable) | |||
1843 | enable_clocks(0); | 1843 | enable_clocks(0); |
1844 | } | 1844 | } |
1845 | 1845 | ||
1846 | void dispc_enable_fifohandcheck(bool enable) | 1846 | void dispc_enable_fifohandcheck(enum omap_channel channel, bool enable) |
1847 | { | 1847 | { |
1848 | enable_clocks(1); | 1848 | enable_clocks(1); |
1849 | REG_FLD_MOD(DISPC_CONFIG, enable ? 1 : 0, 16, 16); | 1849 | REG_FLD_MOD(DISPC_CONFIG, enable ? 1 : 0, 16, 16); |
@@ -1851,7 +1851,8 @@ void dispc_enable_fifohandcheck(bool enable) | |||
1851 | } | 1851 | } |
1852 | 1852 | ||
1853 | 1853 | ||
1854 | void dispc_set_lcd_display_type(enum omap_lcd_display_type type) | 1854 | void dispc_set_lcd_display_type(enum omap_channel channel, |
1855 | enum omap_lcd_display_type type) | ||
1855 | { | 1856 | { |
1856 | int mode; | 1857 | int mode; |
1857 | 1858 | ||
@@ -1994,7 +1995,7 @@ bool dispc_trans_key_enabled(enum omap_channel ch) | |||
1994 | } | 1995 | } |
1995 | 1996 | ||
1996 | 1997 | ||
1997 | void dispc_set_tft_data_lines(u8 data_lines) | 1998 | void dispc_set_tft_data_lines(enum omap_channel channel, u8 data_lines) |
1998 | { | 1999 | { |
1999 | int code; | 2000 | int code; |
2000 | 2001 | ||
@@ -2021,7 +2022,8 @@ void dispc_set_tft_data_lines(u8 data_lines) | |||
2021 | enable_clocks(0); | 2022 | enable_clocks(0); |
2022 | } | 2023 | } |
2023 | 2024 | ||
2024 | void dispc_set_parallel_interface_mode(enum omap_parallel_interface_mode mode) | 2025 | void dispc_set_parallel_interface_mode(enum omap_channel channel, |
2026 | enum omap_parallel_interface_mode mode) | ||
2025 | { | 2027 | { |
2026 | u32 l; | 2028 | u32 l; |
2027 | int stallmode; | 2029 | int stallmode; |
@@ -2054,9 +2056,11 @@ void dispc_set_parallel_interface_mode(enum omap_parallel_interface_mode mode) | |||
2054 | l = dispc_read_reg(DISPC_CONTROL); | 2056 | l = dispc_read_reg(DISPC_CONTROL); |
2055 | 2057 | ||
2056 | l = FLD_MOD(l, stallmode, 11, 11); | 2058 | l = FLD_MOD(l, stallmode, 11, 11); |
2057 | l = FLD_MOD(l, gpout0, 15, 15); | ||
2058 | l = FLD_MOD(l, gpout1, 16, 16); | ||
2059 | 2059 | ||
2060 | if (channel == OMAP_DSS_CHANNEL_LCD) { | ||
2061 | l = FLD_MOD(l, gpout0, 15, 15); | ||
2062 | l = FLD_MOD(l, gpout1, 16, 16); | ||
2063 | } | ||
2060 | dispc_write_reg(DISPC_CONTROL, l); | 2064 | dispc_write_reg(DISPC_CONTROL, l); |
2061 | 2065 | ||
2062 | enable_clocks(0); | 2066 | enable_clocks(0); |
@@ -2093,8 +2097,8 @@ bool dispc_lcd_timings_ok(struct omap_video_timings *timings) | |||
2093 | timings->vfp, timings->vbp); | 2097 | timings->vfp, timings->vbp); |
2094 | } | 2098 | } |
2095 | 2099 | ||
2096 | static void _dispc_set_lcd_timings(int hsw, int hfp, int hbp, | 2100 | static void _dispc_set_lcd_timings(enum omap_channel channel, int hsw, |
2097 | int vsw, int vfp, int vbp) | 2101 | int hfp, int hbp, int vsw, int vfp, int vbp) |
2098 | { | 2102 | { |
2099 | u32 timing_h, timing_v; | 2103 | u32 timing_h, timing_v; |
2100 | 2104 | ||
@@ -2113,13 +2117,14 @@ static void _dispc_set_lcd_timings(int hsw, int hfp, int hbp, | |||
2113 | } | 2117 | } |
2114 | 2118 | ||
2115 | enable_clocks(1); | 2119 | enable_clocks(1); |
2116 | dispc_write_reg(DISPC_TIMING_H(OMAP_DSS_CHANNEL_LCD), timing_h); | 2120 | dispc_write_reg(DISPC_TIMING_H(channel), timing_h); |
2117 | dispc_write_reg(DISPC_TIMING_V(OMAP_DSS_CHANNEL_LCD), timing_v); | 2121 | dispc_write_reg(DISPC_TIMING_V(channel), timing_v); |
2118 | enable_clocks(0); | 2122 | enable_clocks(0); |
2119 | } | 2123 | } |
2120 | 2124 | ||
2121 | /* change name to mode? */ | 2125 | /* change name to mode? */ |
2122 | void dispc_set_lcd_timings(struct omap_video_timings *timings) | 2126 | void dispc_set_lcd_timings(enum omap_channel channel, |
2127 | struct omap_video_timings *timings) | ||
2123 | { | 2128 | { |
2124 | unsigned xtot, ytot; | 2129 | unsigned xtot, ytot; |
2125 | unsigned long ht, vt; | 2130 | unsigned long ht, vt; |
@@ -2129,10 +2134,11 @@ void dispc_set_lcd_timings(struct omap_video_timings *timings) | |||
2129 | timings->vfp, timings->vbp)) | 2134 | timings->vfp, timings->vbp)) |
2130 | BUG(); | 2135 | BUG(); |
2131 | 2136 | ||
2132 | _dispc_set_lcd_timings(timings->hsw, timings->hfp, timings->hbp, | 2137 | _dispc_set_lcd_timings(channel, timings->hsw, timings->hfp, |
2133 | timings->vsw, timings->vfp, timings->vbp); | 2138 | timings->hbp, timings->vsw, timings->vfp, |
2139 | timings->vbp); | ||
2134 | 2140 | ||
2135 | dispc_set_lcd_size(timings->x_res, timings->y_res); | 2141 | dispc_set_lcd_size(channel, timings->x_res, timings->y_res); |
2136 | 2142 | ||
2137 | xtot = timings->x_res + timings->hfp + timings->hsw + timings->hbp; | 2143 | xtot = timings->x_res + timings->hfp + timings->hsw + timings->hbp; |
2138 | ytot = timings->y_res + timings->vfp + timings->vsw + timings->vbp; | 2144 | ytot = timings->y_res + timings->vfp + timings->vsw + timings->vbp; |