1
0
Fork 0
forked from len0rd/rockbox

e200/c200: Take advantage of mutex recursion for the tuner driver and dump the awkward *_nolock stuff.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15468 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2007-11-05 07:01:32 +00:00
parent bdfe87c0f1
commit f29c4ccc6a
3 changed files with 6 additions and 13 deletions

View file

@ -914,12 +914,12 @@ int lv24020lp_get(int setting)
bool fmstatus = true; bool fmstatus = true;
if (!(tuner_status & TUNER_PRESENCE_CHECKED)) if (!(tuner_status & TUNER_PRESENCE_CHECKED))
fmstatus = tuner_power_nolock(true); fmstatus = tuner_power(true);
val = (tuner_status & TUNER_PRESENT) != 0; val = (tuner_status & TUNER_PRESENT) != 0;
if (!fmstatus) if (!fmstatus)
tuner_power_nolock(false); tuner_power(false);
break; break;
} }

View file

@ -49,7 +49,6 @@ bool spdif_powered(void);
#if CONFIG_TUNER #if CONFIG_TUNER
bool tuner_power(bool status); bool tuner_power(bool status);
bool tuner_power_nolock(bool status);
#endif #endif
#endif #endif

View file

@ -69,12 +69,14 @@ void ide_power_enable(bool on)
} }
#if CONFIG_TUNER #if CONFIG_TUNER
/** Tuner **/ /** Tuner **/
static bool powered = false; static bool powered = false;
bool tuner_power_nolock(bool status) bool tuner_power(bool status)
{ {
bool old_status; bool old_status;
lv24020lp_lock();
old_status = powered; old_status = powered;
@ -128,16 +130,8 @@ bool tuner_power_nolock(bool status)
powered = status; powered = status;
} }
return old_status;
}
bool tuner_power(bool status)
{
bool old_status;
lv24020lp_lock();
old_status = tuner_power_nolock(status);
lv24020lp_unlock(); lv24020lp_unlock();
return old_status; return old_status;
} }
#endif #endif /* CONFIG_TUNER */