From f29c4ccc6a05cd21ba49afca676a3060cd60f913 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Mon, 5 Nov 2007 07:01:32 +0000 Subject: 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 --- firmware/drivers/tuner/lv24020lp.c | 4 ++-- firmware/export/power.h | 1 - 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 b28b0ede3f..92ea7ade39 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 7c0ed3df89..a78a1eec78 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 da86d97d26..40aa792dce 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 */ -- cgit v1.2.3