diff options
| author | Michael Sevakis <jethead71@rockbox.org> | 2007-11-05 07:01:32 +0000 |
|---|---|---|
| committer | Michael Sevakis <jethead71@rockbox.org> | 2007-11-05 07:01:32 +0000 |
| commit | f29c4ccc6a05cd21ba49afca676a3060cd60f913 (patch) | |
| tree | 4959579c6a04e2a3c6f45f0d6a4ae382a0991e67 | |
| parent | bdfe87c0f11c152e95cb9034d50cd97e94e7be72 (diff) | |
| download | rockbox-f29c4ccc6a05cd21ba49afca676a3060cd60f913.zip rockbox-f29c4ccc6a05cd21ba49afca676a3060cd60f913.tar.gz rockbox-f29c4ccc6a05cd21ba49afca676a3060cd60f913.tar.bz2 rockbox-f29c4ccc6a05cd21ba49afca676a3060cd60f913.tar.xz | |
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
| -rw-r--r-- | firmware/drivers/tuner/lv24020lp.c | 4 | ||||
| -rw-r--r-- | firmware/export/power.h | 1 | ||||
| -rw-r--r-- | firmware/target/arm/sandisk/power-c200_e200.c | 14 |
3 files changed, 6 insertions, 13 deletions
diff --git a/firmware/drivers/tuner/lv24020lp.c b/firmware/drivers/tuner/lv24020lp.c index b28b0ed..92ea7ad 100644 --- a/firmware/drivers/tuner/lv24020lp.c +++ b/firmware/drivers/tuner/lv24020lp.c @@ -914,12 +914,12 @@ int lv24020lp_get(int setting) bool fmstatus = true; if (!(tuner_status & TUNER_PRESENCE_CHECKED)) - fmstatus = tuner_power_nolock(true); + fmstatus = tuner_power(true); val = (tuner_status & TUNER_PRESENT) != 0; if (!fmstatus) - tuner_power_nolock(false); + tuner_power(false); break; } diff --git a/firmware/export/power.h b/firmware/export/power.h index 7c0ed3d..a78a1ee 100644 --- a/firmware/export/power.h +++ b/firmware/export/power.h @@ -49,7 +49,6 @@ bool spdif_powered(void); #if CONFIG_TUNER bool tuner_power(bool status); -bool tuner_power_nolock(bool status); #endif #endif diff --git a/firmware/target/arm/sandisk/power-c200_e200.c b/firmware/target/arm/sandisk/power-c200_e200.c index da86d97..40aa792 100644 --- a/firmware/target/arm/sandisk/power-c200_e200.c +++ b/firmware/target/arm/sandisk/power-c200_e200.c @@ -69,12 +69,14 @@ void ide_power_enable(bool on) } #if CONFIG_TUNER + /** Tuner **/ static bool powered = false; -bool tuner_power_nolock(bool status) +bool tuner_power(bool status) { bool old_status; + lv24020lp_lock(); old_status = powered; @@ -128,16 +130,8 @@ bool tuner_power_nolock(bool status) powered = status; } - return old_status; -} - -bool tuner_power(bool status) -{ - bool old_status; - lv24020lp_lock(); - old_status = tuner_power_nolock(status); lv24020lp_unlock(); return old_status; } -#endif +#endif /* CONFIG_TUNER */ |