From dd924a522d6e453d7ba7245f1c515088c22517ab Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bernardy Date: Thu, 3 Feb 2005 23:10:01 +0000 Subject: [PATCH] Gmini power management basis git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5767 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/power.c | 12 ++++++++++++ firmware/export/config-gmini120.h | 2 ++ 2 files changed, 14 insertions(+) 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) { #ifdef IRIVER_H100 return (GPIO1_READ & 0x00400000)?true:false; +#elif defined(GMINI_ARCH) + return (P7 & 0x80) == 0; #else #ifdef HAVE_CHARGING #ifdef HAVE_CHARGE_CTRL @@ -137,6 +139,11 @@ void ide_power_enable(bool on) GPIO_OUT &= ~0x80000000; else GPIO_OUT |= 0x80000000; +#elif defined(GMINI_ARCH) + if (on) + P1 |= 0x04; + else + P2 &= ~0x04; #else bool touched = false; #ifdef NEEDS_ATA_POWER_ON @@ -183,6 +190,8 @@ bool ide_powered(void) { #ifdef IRIVER_H100 return (GPIO_OUT & 0x80000000)?false:true; +#elif defined(GMINI_ARCH) + return (P1 & 0x04?true:false); #else #if defined(NEEDS_ATA_POWER_ON) || defined(HAVE_ATA_POWER_OFF) #ifdef ATA_POWER_PLAYERSTYLE @@ -211,6 +220,9 @@ void power_off(void) set_irq_level(HIGHEST_IRQ_LEVEL); #ifdef IRIVER_H100 GPIO1_OUT &= ~0x00080000; +#elif defined(GMINI_ARCH) + P1 &= ~1; + P1CON &= ~1; #else #ifdef HAVE_POWEROFF_ON_PBDR 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 @@ #define HAVE_GMINI_I2C +#define GMINI_ARCH + #endif