summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm
diff options
context:
space:
mode:
authorRob Purchase <shotofadds@rockbox.org>2008-07-09 20:42:47 +0000
committerRob Purchase <shotofadds@rockbox.org>2008-07-09 20:42:47 +0000
commit0eb51e8a73be0713579dfade63447fd5e7858160 (patch)
tree72ec4401b6f24400a3d4c5bde3b64b41f12a1851 /firmware/target/arm
parent34216463beefb9f970a2953409892d73042ae4a1 (diff)
downloadrockbox-0eb51e8a73be0713579dfade63447fd5e7858160.tar.gz
rockbox-0eb51e8a73be0713579dfade63447fd5e7858160.zip
D2: Add the tuner_power() function which was missing from the previous FM commit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17999 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm')
-rw-r--r--firmware/target/arm/tcc780x/cowond2/power-cowond2.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/firmware/target/arm/tcc780x/cowond2/power-cowond2.c b/firmware/target/arm/tcc780x/cowond2/power-cowond2.c
index 5b09cc1c17..9eb0871c6e 100644
--- a/firmware/target/arm/tcc780x/cowond2/power-cowond2.c
+++ b/firmware/target/arm/tcc780x/cowond2/power-cowond2.c
@@ -99,6 +99,55 @@ bool charger_inserted(void)
}
#endif
+#if CONFIG_TUNER
+
+/** Tuner **/
+static bool powered = false;
+
+bool tuner_power(bool status)
+{
+ bool old_status;
+ lv24020lp_lock();
+
+ old_status = powered;
+
+ if (status != old_status)
+ {
+ if (status)
+ {
+ /* When power up, host should initialize the 3-wire bus
+ in host read mode: */
+
+ /* 1. Set direction of the DATA-line to input-mode. */
+ GPIOC_DIR &= ~(1 << 30);
+
+ /* 2. Drive NR_W low */
+ GPIOC_CLEAR = (1 << 31);
+ GPIOC_DIR |= (1 << 31);
+
+ /* 3. Drive CLOCK high */
+ GPIOC_SET = (1 << 29);
+ GPIOC_DIR |= (1 << 29);
+
+ lv24020lp_power(true);
+ }
+ else
+ {
+ lv24020lp_power(false);
+
+ /* set all as inputs */
+ GPIOC_DIR &= ~((1 << 29) | (1 << 30) | (1 << 31));
+ }
+
+ powered = status;
+ }
+
+ lv24020lp_unlock();
+ return old_status;
+}
+
+#endif /* CONFIG_TUNER */
+
#else /* SIMULATOR */
bool charger_inserted(void)