forked from len0rd/rockbox
HDD6330: Implement ATA power on/off.
This should fix some errors, panics in some individual cases. Change-Id: I27ce41f0563378e03371724f8b044404c6e69b76
This commit is contained in:
parent
50c1de7092
commit
e3deec949d
1 changed files with 17 additions and 0 deletions
|
@ -99,14 +99,31 @@ unsigned int power_input_status(void)
|
||||||
|
|
||||||
void ide_power_enable(bool on)
|
void ide_power_enable(bool on)
|
||||||
{
|
{
|
||||||
|
#if defined(PHILIPS_HDD6330)
|
||||||
|
if (on)
|
||||||
|
{
|
||||||
|
GPIO_SET_BITWISE(GPIOC_OUTPUT_VAL, 0x08);
|
||||||
|
DEV_EN |= DEV_IDE0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DEV_EN &= ~DEV_IDE0;
|
||||||
|
GPIO_CLEAR_BITWISE(GPIOC_OUTPUT_VAL, 0x08);
|
||||||
|
}
|
||||||
|
#else
|
||||||
(void)on;
|
(void)on;
|
||||||
/* We do nothing */
|
/* We do nothing */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ide_powered(void)
|
bool ide_powered(void)
|
||||||
{
|
{
|
||||||
|
#if defined(PHILIPS_HDD6330)
|
||||||
|
return ((GPIOC_INPUT_VAL & 0x08) != 0);
|
||||||
|
#else
|
||||||
/* pretend we are always powered - we don't turn it off */
|
/* pretend we are always powered - we don't turn it off */
|
||||||
return true;
|
return true;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void power_off(void)
|
void power_off(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue