diff options
-rw-r--r-- | firmware/drivers/power.c | 23 | ||||
-rw-r--r-- | firmware/export/config-h100.h | 3 | ||||
-rw-r--r-- | firmware/export/power.h | 4 |
3 files changed, 30 insertions, 0 deletions
diff --git a/firmware/drivers/power.c b/firmware/drivers/power.c index 3a4ae466bc..de62c7aa96 100644 --- a/firmware/drivers/power.c +++ b/firmware/drivers/power.c @@ -70,6 +70,9 @@ void power_init(void) GPIO_ENABLE |= 0x80000000; GPIO_FUNCTION |= 0x80000000; +#ifdef HAVE_SPDIF_POWER + spdif_power_enable(false); +#endif #else #ifdef HAVE_CHARGE_CTRL or_b(0x20, &PBIORL); /* Set charging control bit to output */ @@ -128,6 +131,19 @@ void charger_enable(bool on) #endif } +#ifdef HAVE_SPDIF_POWER +void spdif_power_enable(bool on) +{ + GPIO1_FUNCTION |= 0x01000000; + GPIO1_ENABLE |= 0x01000000; + + if(on) + GPIO1_OUT &= ~0x01000000; + else + GPIO1_OUT |= 0x01000000; +} +#endif + #ifndef HAVE_MMC void ide_power_enable(bool on) { @@ -261,4 +277,11 @@ void ide_power_enable(bool on) (void)on; } +#ifdef HAVE_SPDIF_POWER +void spdif_power_enable(bool on) +{ + (void)on; +} +#endif + #endif /* SIMULATOR */ diff --git a/firmware/export/config-h100.h b/firmware/export/config-h100.h index 5eef2c7270..c60f25651b 100644 --- a/firmware/export/config-h100.h +++ b/firmware/export/config-h100.h @@ -59,4 +59,7 @@ #define BOOTFILE_EXT ".iriver" #define BOOTFILE "rockbox" BOOTFILE_EXT +/* Define this if you can control the S/PDIF power */ +#define HAVE_SPDIF_POWER + #endif diff --git a/firmware/export/power.h b/firmware/export/power.h index eea3648053..f0c4c302ea 100644 --- a/firmware/export/power.h +++ b/firmware/export/power.h @@ -30,6 +30,10 @@ void ide_power_enable(bool on); bool ide_powered(void); void power_off(void); +#ifdef HAVE_SPDIF_POWER +void spdif_power_enable(bool on); +#endif + #ifdef CONFIG_TUNER /* status values */ #define FMRADIO_OFF 0 /* switched off */ |