forked from len0rd/rockbox
Unconditionally drive HD power control pin for player (doesn't hurt even for very old players). Slight optimization for recorders.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5487 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
78acda25b3
commit
127c363e87
1 changed files with 12 additions and 22 deletions
|
|
@ -119,30 +119,22 @@ void ide_power_enable(bool on)
|
|||
if(on)
|
||||
{
|
||||
#ifdef ATA_POWER_PLAYERSTYLE
|
||||
if (is_new_player())
|
||||
{
|
||||
or_b(0x10, &PBDRL);
|
||||
touched = true;
|
||||
}
|
||||
or_b(0x10, &PBDRL);
|
||||
#else
|
||||
or_b(0x20, &PADRL);
|
||||
touched = true;
|
||||
#endif
|
||||
touched = true;
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_ATA_POWER_OFF
|
||||
if(!on)
|
||||
{
|
||||
#ifdef ATA_POWER_PLAYERSTYLE
|
||||
if (is_new_player())
|
||||
{
|
||||
and_b(~0x10, &PBDRL);
|
||||
touched = true;
|
||||
}
|
||||
and_b(~0x10, &PBDRL);
|
||||
#else
|
||||
and_b(~0x20, &PADRL);
|
||||
touched = true;
|
||||
#endif
|
||||
touched = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -166,20 +158,18 @@ bool ide_powered(void)
|
|||
{
|
||||
#if defined(NEEDS_ATA_POWER_ON) || defined(HAVE_ATA_POWER_OFF)
|
||||
#ifdef ATA_POWER_PLAYERSTYLE
|
||||
if (is_new_player())
|
||||
{
|
||||
if ((PBCR2 & 0x0300) || !(PBIOR & 0x0010)) /* not configured for output */
|
||||
return false; /* would be floating low, disk off */
|
||||
else
|
||||
return (PBDR & 0x0010) != 0;
|
||||
}
|
||||
/* This is not correct for very old players, since these are unable to
|
||||
* control hd power. However, driving the pin doesn't hurt, because it
|
||||
* is not connected anywhere */
|
||||
if ((PBCR2 & 0x0300) || !(PBIORL & 0x10)) /* not configured for output */
|
||||
return false; /* would be floating low, disk off */
|
||||
else
|
||||
return true; /* old player: always on */
|
||||
return (PBDRL & 0x10) != 0;
|
||||
#else
|
||||
if ((PACR2 & 0x0400) || !(PAIOR & 0x0020)) /* not configured for output */
|
||||
if ((PACR2 & 0x0400) || !(PAIORL & 0x20)) /* not configured for output */
|
||||
return true; /* would be floating high, disk on */
|
||||
else
|
||||
return (PADR & 0x0020) != 0;
|
||||
return (PADRL & 0x20) != 0;
|
||||
#endif /* ATA_POWER_PLAYERSTYLE */
|
||||
#else
|
||||
return true; /* pretend always powered if not controlable */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue