summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com>2005-02-03 23:10:01 +0000
committerJean-Philippe Bernardy <jeanphilippe.bernardy@gmail.com>2005-02-03 23:10:01 +0000
commitdd924a522d6e453d7ba7245f1c515088c22517ab (patch)
treed653992f614859126fb93698b83d326449e1cc08
parent2580cdfe731f10f785261edf1632afd7d8ff1160 (diff)
downloadrockbox-dd924a522d6e453d7ba7245f1c515088c22517ab.tar.gz
rockbox-dd924a522d6e453d7ba7245f1c515088c22517ab.zip
Gmini power management basis
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5767 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/drivers/power.c12
-rw-r--r--firmware/export/config-gmini120.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c
index 0d490242b5..7977b8c4fa 100644
--- a/firmware/drivers/power.c
+++ b/firmware/drivers/power.c
@@ -88,6 +88,8 @@ bool charger_inserted(void)
88{ 88{
89#ifdef IRIVER_H100 89#ifdef IRIVER_H100
90 return (GPIO1_READ & 0x00400000)?true:false; 90 return (GPIO1_READ & 0x00400000)?true:false;
91#elif defined(GMINI_ARCH)
92 return (P7 & 0x80) == 0;
91#else 93#else
92#ifdef HAVE_CHARGING 94#ifdef HAVE_CHARGING
93#ifdef HAVE_CHARGE_CTRL 95#ifdef HAVE_CHARGE_CTRL
@@ -137,6 +139,11 @@ void ide_power_enable(bool on)
137 GPIO_OUT &= ~0x80000000; 139 GPIO_OUT &= ~0x80000000;
138 else 140 else
139 GPIO_OUT |= 0x80000000; 141 GPIO_OUT |= 0x80000000;
142#elif defined(GMINI_ARCH)
143 if (on)
144 P1 |= 0x04;
145 else
146 P2 &= ~0x04;
140#else 147#else
141 bool touched = false; 148 bool touched = false;
142#ifdef NEEDS_ATA_POWER_ON 149#ifdef NEEDS_ATA_POWER_ON
@@ -183,6 +190,8 @@ bool ide_powered(void)
183{ 190{
184#ifdef IRIVER_H100 191#ifdef IRIVER_H100
185 return (GPIO_OUT & 0x80000000)?false:true; 192 return (GPIO_OUT & 0x80000000)?false:true;
193#elif defined(GMINI_ARCH)
194 return (P1 & 0x04?true:false);
186#else 195#else
187#if defined(NEEDS_ATA_POWER_ON) || defined(HAVE_ATA_POWER_OFF) 196#if defined(NEEDS_ATA_POWER_ON) || defined(HAVE_ATA_POWER_OFF)
188#ifdef ATA_POWER_PLAYERSTYLE 197#ifdef ATA_POWER_PLAYERSTYLE
@@ -211,6 +220,9 @@ void power_off(void)
211 set_irq_level(HIGHEST_IRQ_LEVEL); 220 set_irq_level(HIGHEST_IRQ_LEVEL);
212#ifdef IRIVER_H100 221#ifdef IRIVER_H100
213 GPIO1_OUT &= ~0x00080000; 222 GPIO1_OUT &= ~0x00080000;
223#elif defined(GMINI_ARCH)
224 P1 &= ~1;
225 P1CON &= ~1;
214#else 226#else
215#ifdef HAVE_POWEROFF_ON_PBDR 227#ifdef HAVE_POWEROFF_ON_PBDR
216 and_b(~0x10, &PBDRL); 228 and_b(~0x10, &PBDRL);
diff --git a/firmware/export/config-gmini120.h b/firmware/export/config-gmini120.h
index 978fe23b50..a1e1f61e82 100644
--- a/firmware/export/config-gmini120.h
+++ b/firmware/export/config-gmini120.h
@@ -48,4 +48,6 @@
48 48
49#define HAVE_GMINI_I2C 49#define HAVE_GMINI_I2C
50 50
51#define GMINI_ARCH
52
51#endif 53#endif