summaryrefslogtreecommitdiff
path: root/firmware/target/arm/philips/sa9200/power-sa9200.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/philips/sa9200/power-sa9200.c')
-rw-r--r--firmware/target/arm/philips/sa9200/power-sa9200.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/firmware/target/arm/philips/sa9200/power-sa9200.c b/firmware/target/arm/philips/sa9200/power-sa9200.c
index cf9468cb1d..5da1fc5fc4 100644
--- a/firmware/target/arm/philips/sa9200/power-sa9200.c
+++ b/firmware/target/arm/philips/sa9200/power-sa9200.c
@@ -22,14 +22,50 @@
22#include <stdbool.h> 22#include <stdbool.h>
23#include "system.h" 23#include "system.h"
24#include "cpu.h" 24#include "cpu.h"
25#include "i2c-pp.h"
26#include "tuner.h"
27#include "ascodec.h" 25#include "ascodec.h"
28#include "as3514.h" 26#include "as3514.h"
29#include "power.h" 27#include "power.h"
28#include "synaptics-mep.h"
29#include "logf.h"
30 30
31void power_init(void) 31void power_init(void)
32{ 32{
33#ifndef BOOTLOADER
34 /* Power on and initialize the touchpad here because we need it for
35 both buttons and button lights */
36 DEV_INIT2 &= ~0x800;
37
38 char byte = ascodec_read(AS3514_CVDD_DCDC3);
39 byte = (byte & ~0x18) | 0x08;
40 ascodec_write(AS3514_CVDD_DCDC3, byte);
41
42 /* LEDs for REW, FFWD, MENU */
43 GPIOD_ENABLE |= (0x40 | 0x20 | 0x04);
44 GPIOD_OUTPUT_VAL |= (0x40 | 0x20 | 0x04);
45 GPIOD_OUTPUT_EN |= (0x40 | 0x20 | 0x04);
46 udelay(20000);
47
48 GPIOL_ENABLE |= 0x10;
49 GPIOL_OUTPUT_VAL &= ~0x10;
50 GPIOL_OUTPUT_EN |= 0x10;
51 udelay(100000);
52
53 /* enable DATA, ACK, CLK lines */
54 GPIOD_ENABLE |= (0x10 | 0x08 | 0x02);
55
56 GPIOD_OUTPUT_EN |= 0x08; /* ACK */
57 GPIOD_OUTPUT_VAL |= 0x08; /* high */
58
59 GPIOD_OUTPUT_EN &= ~0x02; /* CLK */
60
61 GPIOD_OUTPUT_EN |= 0x10; /* DATA */
62 GPIOD_OUTPUT_VAL |= 0x10; /* high */
63
64 if (!touchpad_init())
65 {
66 logf("touchpad not ready");
67 }
68#endif
33} 69}
34 70
35void power_off(void) 71void power_off(void)