summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSzymon Dziok <b0hoon@o2.pl>2010-03-01 22:24:17 +0000
committerSzymon Dziok <b0hoon@o2.pl>2010-03-01 22:24:17 +0000
commitf67e3559c62ba21d6085793a2bb5513050590ef7 (patch)
treea34118c5aa3f36e4e3161e0c4ea7102f862d33ce
parentafeacb048f4ca0aed300531fcb90da969724f803 (diff)
downloadrockbox-f67e3559c62ba21d6085793a2bb5513050590ef7.tar.gz
rockbox-f67e3559c62ba21d6085793a2bb5513050590ef7.zip
Packard Bell Vibe 500: clean up the power off, enable poweroff while charging.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24987 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/export/config/vibe500.h3
-rw-r--r--firmware/target/arm/pbell/vibe500/power-vibe500.c27
2 files changed, 14 insertions, 16 deletions
diff --git a/firmware/export/config/vibe500.h b/firmware/export/config/vibe500.h
index 7ae1f4fc2a..f8ce86b24f 100644
--- a/firmware/export/config/vibe500.h
+++ b/firmware/export/config/vibe500.h
@@ -136,8 +136,7 @@
136#define CONFIG_I2C I2C_PP5020 136#define CONFIG_I2C I2C_PP5020
137 137
138/* define this if the hardware can be powered off while charging */ 138/* define this if the hardware can be powered off while charging */
139/* It is possible to do it (OF seems to do that) but the method is unknown yet */ 139#define HAVE_POWEROFF_WHILE_CHARGING
140/* #define HAVE_POWEROFF_WHILE_CHARGING */
141 140
142/* The start address index for ROM builds */ 141/* The start address index for ROM builds */
143#define ROM_START 0x00000000 142#define ROM_START 0x00000000
diff --git a/firmware/target/arm/pbell/vibe500/power-vibe500.c b/firmware/target/arm/pbell/vibe500/power-vibe500.c
index 45ab7fb1fd..b345a9b5d0 100644
--- a/firmware/target/arm/pbell/vibe500/power-vibe500.c
+++ b/firmware/target/arm/pbell/vibe500/power-vibe500.c
@@ -55,7 +55,7 @@ void power_init(void)
55 ClipZifnoFinger=0,DisableDeceleration=0,Dribble=0. 55 ClipZifnoFinger=0,DisableDeceleration=0,Dribble=0.
56 MEP parameter 0x21 - Enhanced Operating Configuration */ 56 MEP parameter 0x21 - Enhanced Operating Configuration */
57 touchpad_set_parameter(0x21,0x0008); 57 touchpad_set_parameter(0x21,0x0008);
58 /* Set the GPO_LEVEL = 0 - for the button lights */ 58 /* Set the GPO_LEVELS = 0 - for the button lights */
59 touchpad_set_parameter(0x23,0x0000); 59 touchpad_set_parameter(0x23,0x0000);
60 60
61 /* Sound unmute (on) */ 61 /* Sound unmute (on) */
@@ -94,22 +94,21 @@ bool ide_powered(void)
94 94
95void power_off(void) 95void power_off(void)
96{ 96{
97 /* from the OF */
98/*
99 DEV_INIT2 |= DEV_I2S;
100 GPIO_SET_BITWISE(GPIOL_OUTPUT_VAL, 0x10);
101 sleep(HZ/100);
102 GPIO_SET_BITWISE(GPIOL_OUTPUT_VAL, 0x10);
103 sleep(HZ);
104 GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x80);
105 sleep(HZ);
106 GPIO_CLEAR_BITWISE(GPIOC_OUTPUT_VAL, 0x08);
107 GPO32_VAL |= 0x40000000;
108 GPO32_ENABLE |= 0x40000000;
109*/
110 /* Sound mute (off) */ 97 /* Sound mute (off) */
111 DEV_INIT2 |= DEV_I2S; 98 DEV_INIT2 |= DEV_I2S;
112 GPIO_SET_BITWISE(GPIOL_OUTPUT_VAL, 0x10); 99 GPIO_SET_BITWISE(GPIOL_OUTPUT_VAL, 0x10);
113 /* shutdown bit */ 100 /* shutdown bit */
114 GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x80); 101 GPIO_CLEAR_BITWISE(GPIOB_OUTPUT_VAL, 0x80);
102 /* button lights off */
103 touchpad_set_parameter(0x22,0x0000);
104 /* ATA power off */
105 ide_power_enable(false);
106 /* ? - in the OF */
107 GPO32_VAL |= 0x40000000;
108 GPO32_ENABLE |= 0x40000000;
109 /* lcd controller off ? - makes lcd white until power on */
110 GPIO_CLEAR_BITWISE(GPIOJ_OUTPUT_VAL, 0x04);
111 /* a way to poweroff while charging = system_reset */
112 if (power_input_status())
113 system_reboot();
115} 114}