Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 247854
b: refs/heads/master
c: b692a63
h: refs/heads/master
v: v3
  • Loading branch information
Florian Tobias Schandinat authored and Florian Tobias Schandinat committed Mar 24, 2011
1 parent 59edac6 commit 9efe691
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 7 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: 2c536f84c19c73ab1e3411bf1596ff85c4a23783
refs/heads/master: b692a63af8b63a7a7e84702a713d0072e336b326
19 changes: 19 additions & 0 deletions trunk/drivers/video/via/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2289,6 +2289,25 @@ int viafb_setmode(struct VideoModeTable *vmode_tbl, int video_bpp,
get_sync(viafbinfo1));
}

clock.set_primary_clock_source(VIA_CLKSRC_X1, true);
clock.set_secondary_clock_source(VIA_CLKSRC_X1, true);

if (viaparinfo->shared->iga1_devices) {
clock.set_primary_pll_state(VIA_STATE_ON);
clock.set_primary_clock_state(VIA_STATE_ON);
} else {
clock.set_primary_pll_state(VIA_STATE_OFF);
clock.set_primary_clock_state(VIA_STATE_OFF);
}

if (viaparinfo->shared->iga2_devices) {
clock.set_secondary_pll_state(VIA_STATE_ON);
clock.set_secondary_clock_state(VIA_STATE_ON);
} else {
clock.set_secondary_pll_state(VIA_STATE_OFF);
clock.set_secondary_clock_state(VIA_STATE_OFF);
}

via_set_state(devices, VIA_STATE_ON);
device_screen_on();
return 1;
Expand Down
30 changes: 24 additions & 6 deletions trunk/drivers/video/via/via_clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
#include "global.h"
#include "debug.h"

const char *via_slap = "Please slap VIA Technologies to motivate them "
"releasing full documentation for your platform!\n";

static inline u32 cle266_encode_pll(struct via_pll_config pll)
{
return (pll.multiplier << 8)
Expand Down Expand Up @@ -229,19 +232,34 @@ static void set_secondary_clock_source(enum via_clksrc source, bool use_pll)
via_write_reg_mask(VIACR, 0x6C, data, 0x0F);
}

static void dummy_set_clock_state(u8 state)
{
printk(KERN_INFO "Using undocumented set clock state.\n%s", via_slap);
}

static void dummy_set_clock_source(enum via_clksrc source, bool use_pll)
{
printk(KERN_INFO "Using undocumented set clock source.\n%s", via_slap);
}

static void dummy_set_pll_state(u8 state)
{
printk(KERN_INFO "Using undocumented set PLL state.\n%s", via_slap);
}

void via_clock_init(struct via_clock *clock, int gfx_chip)
{
switch (gfx_chip) {
case UNICHROME_CLE266:
case UNICHROME_K400:
clock->set_primary_clock_state = NULL;
clock->set_primary_clock_source = NULL;
clock->set_primary_pll_state = NULL;
clock->set_primary_clock_state = dummy_set_clock_state;
clock->set_primary_clock_source = dummy_set_clock_source;
clock->set_primary_pll_state = dummy_set_pll_state;
clock->set_primary_pll = cle266_set_primary_pll;

clock->set_secondary_clock_state = NULL;
clock->set_secondary_clock_source = NULL;
clock->set_secondary_pll_state = NULL;
clock->set_secondary_clock_state = dummy_set_clock_state;
clock->set_secondary_clock_source = dummy_set_clock_source;
clock->set_secondary_pll_state = dummy_set_pll_state;
clock->set_secondary_pll = cle266_set_secondary_pll;
break;
case UNICHROME_K800:
Expand Down

0 comments on commit 9efe691

Please sign in to comment.