Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218760
b: refs/heads/master
c: 7f0e153
h: refs/heads/master
v: v3
  • Loading branch information
Florian Tobias Schandinat authored and Florian Tobias Schandinat committed Sep 24, 2010
1 parent 7cf4fe8 commit d6bb9f6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e029ab0d02b94d633d8e82a46dfdb7fd94a62216
refs/heads/master: 7f0e153e2c0b15aa7427ad4ac550640e1e2e9c33
24 changes: 21 additions & 3 deletions trunk/drivers/video/via/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,24 @@ void via_set_state(u32 devices, u8 state)
set_lvds2_state(state);
}

void via_set_sync_polarity(u32 devices, u8 polarity)
{
if (polarity & ~(VIA_HSYNC_NEGATIVE | VIA_VSYNC_NEGATIVE)) {
printk(KERN_WARNING "viafb: Unsupported polarity: %d\n",
polarity);
return;
}

if (devices & VIA_CRT)
via_write_misc_reg_mask(polarity << 6, 0xC0);
if (devices & VIA_DVP1)
via_write_reg_mask(VIACR, 0x9B, polarity << 5, 0x60);
if (devices & VIA_LVDS1)
via_write_reg_mask(VIACR, 0x99, polarity << 5, 0x60);
if (devices & VIA_LVDS2)
via_write_reg_mask(VIACR, 0x97, polarity << 5, 0x60);
}

u32 via_parse_odev(char *input, char **end)
{
char *ptr = input;
Expand Down Expand Up @@ -2026,10 +2044,10 @@ void viafb_fill_crtc_timing(struct crt_mode_table *crt_table,

/* update polarity for CRT timing */
if (crt_table[index].h_sync_polarity == NEGATIVE)
polarity |= BIT6;
polarity |= VIA_HSYNC_NEGATIVE;
if (crt_table[index].v_sync_polarity == NEGATIVE)
polarity |= BIT7;
via_write_misc_reg_mask(polarity, BIT6 | BIT7);
polarity |= VIA_VSYNC_NEGATIVE;
via_set_sync_polarity(VIA_CRT, polarity);

if (set_iga == IGA1) {
viafb_unlock_crt();
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/video/via/hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
#define VIA_STATE_SUSPEND 2
#define VIA_STATE_OFF 3

/* VIA output device sync polarity */
#define VIA_HSYNC_NEGATIVE 0x01
#define VIA_VSYNC_NEGATIVE 0x02

/***************************************************
* Definition IGA1 Design Method of CRTC Registers *
****************************************************/
Expand Down Expand Up @@ -912,6 +916,7 @@ void viafb_load_reg(int timing_value, int viafb_load_reg_num,
int io_type);
void via_set_source(u32 devices, u8 iga);
void via_set_state(u32 devices, u8 state);
void via_set_sync_polarity(u32 devices, u8 polarity);
u32 via_parse_odev(char *input, char **end);
void via_odev_to_seq(struct seq_file *m, u32 odev);
void init_ad9389(void);
Expand Down

0 comments on commit d6bb9f6

Please sign in to comment.