summaryrefslogtreecommitdiff
path: root/firmware/target/arm/sandisk/sansa-e200
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-07-14 11:20:31 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-07-14 11:20:31 +0000
commit7d759f6b9ca96a4a64c71ac301eb59cb9702e74c (patch)
treefbaf5104716ccfed888c7d8506dbee15a881d4a2 /firmware/target/arm/sandisk/sansa-e200
parentb51a20fb9b1cc57b813d1c0b90ad8c010b9eab84 (diff)
downloadrockbox-7d759f6b9ca96a4a64c71ac301eb59cb9702e74c.tar.gz
rockbox-7d759f6b9ca96a4a64c71ac301eb59cb9702e74c.zip
Do some planned radio interface cleanup since adding in the LV24020LP.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13880 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/sandisk/sansa-e200')
-rw-r--r--firmware/target/arm/sandisk/sansa-e200/power-e200.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/firmware/target/arm/sandisk/sansa-e200/power-e200.c b/firmware/target/arm/sandisk/sansa-e200/power-e200.c
index dfa4211a91..002dcb8407 100644
--- a/firmware/target/arm/sandisk/sansa-e200/power-e200.c
+++ b/firmware/target/arm/sandisk/sansa-e200/power-e200.c
@@ -21,6 +21,7 @@
21#include "system.h" 21#include "system.h"
22#include "cpu.h" 22#include "cpu.h"
23#include "i2c-pp.h" 23#include "i2c-pp.h"
24#include "tuner.h"
24 25
25void power_init(void) 26void power_init(void)
26{ 27{
@@ -61,3 +62,60 @@ void ide_power_enable(bool on)
61{ 62{
62 (void)on; 63 (void)on;
63} 64}
65
66/** Tuner **/
67static bool powered = false;
68
69bool tuner_power(bool status)
70{
71 bool old_status = powered;
72
73 if (status != old_status)
74 {
75 if (status)
76 {
77 /* init mystery amplification device */
78 outl(inl(0x70000084) | 0x1, 0x70000084);
79 udelay(5);
80
81 /* When power up, host should initialize the 3-wire bus
82 in host read mode: */
83
84 /* 1. Set direction of the DATA-line to input-mode. */
85 GPIOH_OUTPUT_EN &= ~(1 << 5);
86 GPIOH_ENABLE |= (1 << 5);
87
88 /* 2. Drive NR_W low */
89 GPIOH_OUTPUT_VAL &= ~(1 << 3);
90 GPIOH_OUTPUT_EN |= (1 << 3);
91 GPIOH_ENABLE |= (1 << 3);
92
93 /* 3. Drive CLOCK high */
94 GPIOH_OUTPUT_VAL |= (1 << 4);
95 GPIOH_OUTPUT_EN |= (1 << 4);
96 GPIOH_ENABLE |= (1 << 4);
97
98 lv24020lp_power(true);
99 }
100 else
101 {
102 lv24020lp_power(false);
103
104 /* set all as inputs */
105 GPIOH_OUTPUT_EN &= ~((1 << 5) | (1 << 3) | (1 << 4));
106 GPIOH_ENABLE &= ~((1 << 5) | (1 << 3) | (1 << 4));
107
108 /* turn off mystery amplification device */
109 outl(inl(0x70000084) & ~0x1, 0x70000084);
110 }
111
112 powered = status;
113 }
114
115 return old_status;
116}
117
118bool tuner_powered(void)
119{
120 return powered;
121}