diff options
author | Szymon Dziok <b0hoon@o2.pl> | 2016-09-25 23:11:21 +0200 |
---|---|---|
committer | Szymon Dziok <b0hoon@o2.pl> | 2016-09-25 23:11:21 +0200 |
commit | e3deec949df7ddad13b24103b2a70d9ceaa73ecc (patch) | |
tree | adf26130c46174a7b8a52e241c9b8d5a9471ebd0 /firmware/target/arm | |
parent | 50c1de7092fa75c6c5317ac5338d685191a443c0 (diff) | |
download | rockbox-e3deec949df7ddad13b24103b2a70d9ceaa73ecc.tar.gz rockbox-e3deec949df7ddad13b24103b2a70d9ceaa73ecc.zip |
HDD6330: Implement ATA power on/off.
This should fix some errors, panics in some individual cases.
Change-Id: I27ce41f0563378e03371724f8b044404c6e69b76
Diffstat (limited to 'firmware/target/arm')
-rw-r--r-- | firmware/target/arm/philips/power-hdd.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/firmware/target/arm/philips/power-hdd.c b/firmware/target/arm/philips/power-hdd.c index d38c6de2b4..05ada4b674 100644 --- a/firmware/target/arm/philips/power-hdd.c +++ b/firmware/target/arm/philips/power-hdd.c | |||
@@ -99,14 +99,31 @@ unsigned int power_input_status(void) | |||
99 | 99 | ||
100 | void ide_power_enable(bool on) | 100 | void ide_power_enable(bool on) |
101 | { | 101 | { |
102 | #if defined(PHILIPS_HDD6330) | ||
103 | if (on) | ||
104 | { | ||
105 | GPIO_SET_BITWISE(GPIOC_OUTPUT_VAL, 0x08); | ||
106 | DEV_EN |= DEV_IDE0; | ||
107 | } | ||
108 | else | ||
109 | { | ||
110 | DEV_EN &= ~DEV_IDE0; | ||
111 | GPIO_CLEAR_BITWISE(GPIOC_OUTPUT_VAL, 0x08); | ||
112 | } | ||
113 | #else | ||
102 | (void)on; | 114 | (void)on; |
103 | /* We do nothing */ | 115 | /* We do nothing */ |
116 | #endif | ||
104 | } | 117 | } |
105 | 118 | ||
106 | bool ide_powered(void) | 119 | bool ide_powered(void) |
107 | { | 120 | { |
121 | #if defined(PHILIPS_HDD6330) | ||
122 | return ((GPIOC_INPUT_VAL & 0x08) != 0); | ||
123 | #else | ||
108 | /* pretend we are always powered - we don't turn it off */ | 124 | /* pretend we are always powered - we don't turn it off */ |
109 | return true; | 125 | return true; |
126 | #endif | ||
110 | } | 127 | } |
111 | 128 | ||
112 | void power_off(void) | 129 | void power_off(void) |