diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2010-09-18 19:47:28 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2010-09-23 22:15:16 -0400 |
commit | 7f0e153e2c0b15aa7427ad4ac550640e1e2e9c33 (patch) | |
tree | 98f82deced910e6dcc9cc9bde3fb139d699261f8 /drivers/video/via/hw.c | |
parent | e029ab0d02b94d633d8e82a46dfdb7fd94a62216 (diff) |
viafb: add function to change sync polarity per device
At the moment only the sync polarity for CRT is handled but there are
also bits for controlling the sync polarity for other output devices.
Add a function to change those similar to the other output device
functions.
There is no runtime change yet as the code still handles only CRT.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Joseph Chan <JosephChan@via.com.tw>
Diffstat (limited to 'drivers/video/via/hw.c')
-rw-r--r-- | drivers/video/via/hw.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c index 132d811525ed..d6bbb0a05c3e 100644 --- a/drivers/video/via/hw.c +++ b/drivers/video/via/hw.c | |||
@@ -1151,6 +1151,24 @@ void via_set_state(u32 devices, u8 state) | |||
1151 | set_lvds2_state(state); | 1151 | set_lvds2_state(state); |
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | void via_set_sync_polarity(u32 devices, u8 polarity) | ||
1155 | { | ||
1156 | if (polarity & ~(VIA_HSYNC_NEGATIVE | VIA_VSYNC_NEGATIVE)) { | ||
1157 | printk(KERN_WARNING "viafb: Unsupported polarity: %d\n", | ||
1158 | polarity); | ||
1159 | return; | ||
1160 | } | ||
1161 | |||
1162 | if (devices & VIA_CRT) | ||
1163 | via_write_misc_reg_mask(polarity << 6, 0xC0); | ||
1164 | if (devices & VIA_DVP1) | ||
1165 | via_write_reg_mask(VIACR, 0x9B, polarity << 5, 0x60); | ||
1166 | if (devices & VIA_LVDS1) | ||
1167 | via_write_reg_mask(VIACR, 0x99, polarity << 5, 0x60); | ||
1168 | if (devices & VIA_LVDS2) | ||
1169 | via_write_reg_mask(VIACR, 0x97, polarity << 5, 0x60); | ||
1170 | } | ||
1171 | |||
1154 | u32 via_parse_odev(char *input, char **end) | 1172 | u32 via_parse_odev(char *input, char **end) |
1155 | { | 1173 | { |
1156 | char *ptr = input; | 1174 | char *ptr = input; |
@@ -2026,10 +2044,10 @@ void viafb_fill_crtc_timing(struct crt_mode_table *crt_table, | |||
2026 | 2044 | ||
2027 | /* update polarity for CRT timing */ | 2045 | /* update polarity for CRT timing */ |
2028 | if (crt_table[index].h_sync_polarity == NEGATIVE) | 2046 | if (crt_table[index].h_sync_polarity == NEGATIVE) |
2029 | polarity |= BIT6; | 2047 | polarity |= VIA_HSYNC_NEGATIVE; |
2030 | if (crt_table[index].v_sync_polarity == NEGATIVE) | 2048 | if (crt_table[index].v_sync_polarity == NEGATIVE) |
2031 | polarity |= BIT7; | 2049 | polarity |= VIA_VSYNC_NEGATIVE; |
2032 | via_write_misc_reg_mask(polarity, BIT6 | BIT7); | 2050 | via_set_sync_polarity(VIA_CRT, polarity); |
2033 | 2051 | ||
2034 | if (set_iga == IGA1) { | 2052 | if (set_iga == IGA1) { |
2035 | viafb_unlock_crt(); | 2053 | viafb_unlock_crt(); |