diff options
Diffstat (limited to 'firmware')
-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) | |||
70 | 70 | ||
71 | GPIO_ENABLE |= 0x80000000; | 71 | GPIO_ENABLE |= 0x80000000; |
72 | GPIO_FUNCTION |= 0x80000000; | 72 | GPIO_FUNCTION |= 0x80000000; |
73 | #ifdef HAVE_SPDIF_POWER | ||
74 | spdif_power_enable(false); | ||
75 | #endif | ||
73 | #else | 76 | #else |
74 | #ifdef HAVE_CHARGE_CTRL | 77 | #ifdef HAVE_CHARGE_CTRL |
75 | or_b(0x20, &PBIORL); /* Set charging control bit to output */ | 78 | or_b(0x20, &PBIORL); /* Set charging control bit to output */ |
@@ -128,6 +131,19 @@ void charger_enable(bool on) | |||
128 | #endif | 131 | #endif |
129 | } | 132 | } |
130 | 133 | ||
134 | #ifdef HAVE_SPDIF_POWER | ||
135 | void spdif_power_enable(bool on) | ||
136 | { | ||
137 | GPIO1_FUNCTION |= 0x01000000; | ||
138 | GPIO1_ENABLE |= 0x01000000; | ||
139 | |||
140 | if(on) | ||
141 | GPIO1_OUT &= ~0x01000000; | ||
142 | else | ||
143 | GPIO1_OUT |= 0x01000000; | ||
144 | } | ||
145 | #endif | ||
146 | |||
131 | #ifndef HAVE_MMC | 147 | #ifndef HAVE_MMC |
132 | void ide_power_enable(bool on) | 148 | void ide_power_enable(bool on) |
133 | { | 149 | { |
@@ -261,4 +277,11 @@ void ide_power_enable(bool on) | |||
261 | (void)on; | 277 | (void)on; |
262 | } | 278 | } |
263 | 279 | ||
280 | #ifdef HAVE_SPDIF_POWER | ||
281 | void spdif_power_enable(bool on) | ||
282 | { | ||
283 | (void)on; | ||
284 | } | ||
285 | #endif | ||
286 | |||
264 | #endif /* SIMULATOR */ | 287 | #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 @@ | |||
59 | #define BOOTFILE_EXT ".iriver" | 59 | #define BOOTFILE_EXT ".iriver" |
60 | #define BOOTFILE "rockbox" BOOTFILE_EXT | 60 | #define BOOTFILE "rockbox" BOOTFILE_EXT |
61 | 61 | ||
62 | /* Define this if you can control the S/PDIF power */ | ||
63 | #define HAVE_SPDIF_POWER | ||
64 | |||
62 | #endif | 65 | #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); | |||
30 | bool ide_powered(void); | 30 | bool ide_powered(void); |
31 | void power_off(void); | 31 | void power_off(void); |
32 | 32 | ||
33 | #ifdef HAVE_SPDIF_POWER | ||
34 | void spdif_power_enable(bool on); | ||
35 | #endif | ||
36 | |||
33 | #ifdef CONFIG_TUNER | 37 | #ifdef CONFIG_TUNER |
34 | /* status values */ | 38 | /* status values */ |
35 | #define FMRADIO_OFF 0 /* switched off */ | 39 | #define FMRADIO_OFF 0 /* switched off */ |