diff options
author | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2011-03-23 22:03:42 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2011-03-23 22:03:42 -0400 |
commit | c5593d26aea3aba2a7703a0b5d74b4ea8b726889 (patch) | |
tree | 47c0a0129777696d05780fa724d073464d6cccf1 /drivers/video/via | |
parent | 6c1093af5833d4c69634711d9453287ab9e0cb77 (diff) |
viafb: add primary/secondary clock on/off switches
This patch adds functions to enable/disable the display clocks.
It also fixes a tiny bug that slipped in with a previous commit but
could not yet have caused any problems.
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/via')
-rw-r--r-- | drivers/video/via/hw.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/drivers/video/via/hw.c b/drivers/video/via/hw.c index b38d3b40de95..712348df0f84 100644 --- a/drivers/video/via/hw.c +++ b/drivers/video/via/hw.c | |||
@@ -1409,6 +1409,42 @@ void viafb_load_FIFO_reg(int set_iga, int hor_active, int ver_active) | |||
1409 | 1409 | ||
1410 | } | 1410 | } |
1411 | 1411 | ||
1412 | static void set_primary_clock_state(u8 state) | ||
1413 | { | ||
1414 | u8 value; | ||
1415 | |||
1416 | switch (state) { | ||
1417 | case VIA_STATE_ON: | ||
1418 | value = 0x20; | ||
1419 | break; | ||
1420 | case VIA_STATE_OFF: | ||
1421 | value = 0x00; | ||
1422 | break; | ||
1423 | default: | ||
1424 | return; | ||
1425 | } | ||
1426 | |||
1427 | via_write_reg_mask(VIASR, 0x1B, value, 0x30); | ||
1428 | } | ||
1429 | |||
1430 | static void set_secondary_clock_state(u8 state) | ||
1431 | { | ||
1432 | u8 value; | ||
1433 | |||
1434 | switch (state) { | ||
1435 | case VIA_STATE_ON: | ||
1436 | value = 0x80; | ||
1437 | break; | ||
1438 | case VIA_STATE_OFF: | ||
1439 | value = 0x00; | ||
1440 | break; | ||
1441 | default: | ||
1442 | return; | ||
1443 | } | ||
1444 | |||
1445 | via_write_reg_mask(VIASR, 0x1B, value, 0xC0); | ||
1446 | } | ||
1447 | |||
1412 | static void set_primary_pll_state(u8 state) | 1448 | static void set_primary_pll_state(u8 state) |
1413 | { | 1449 | { |
1414 | u8 value; | 1450 | u8 value; |
@@ -1442,7 +1478,7 @@ static void set_secondary_pll_state(u8 state) | |||
1442 | return; | 1478 | return; |
1443 | } | 1479 | } |
1444 | 1480 | ||
1445 | via_write_reg_mask(VIASR, 0x2D, value, 0x08); | 1481 | via_write_reg_mask(VIASR, 0x2D, value, 0x0C); |
1446 | } | 1482 | } |
1447 | 1483 | ||
1448 | static u32 cle266_encode_pll(struct pll_config pll) | 1484 | static u32 cle266_encode_pll(struct pll_config pll) |