diff options
Diffstat (limited to 'firmware/target/arm')
4 files changed, 64 insertions, 6 deletions
diff --git a/firmware/target/arm/archos/av300/power-av300.c b/firmware/target/arm/archos/av300/power-av300.c index cfdce69b13..6cc8b4f7c7 100644 --- a/firmware/target/arm/archos/av300/power-av300.c +++ b/firmware/target/arm/archos/av300/power-av300.c @@ -84,12 +84,12 @@ void ide_power_enable(bool on) static bool powered = false; -bool radio_powered() +bool tuner_powered() { return powered; } -bool radio_power(bool status) +bool tuner_power(bool status) { bool old_status = powered; powered = status; diff --git a/firmware/target/arm/iriver/h10/power-h10.c b/firmware/target/arm/iriver/h10/power-h10.c index 63eb2dc189..d0d3ce59d1 100644 --- a/firmware/target/arm/iriver/h10/power-h10.c +++ b/firmware/target/arm/iriver/h10/power-h10.c @@ -40,12 +40,12 @@ bool charger_enabled; static bool powered = false; -bool radio_powered() +bool tuner_powered() { return powered; } -bool radio_power(bool status) +bool tuner_power(bool status) { bool old_status = powered; powered = status; diff --git a/firmware/target/arm/pnx0101/iriver-ifp7xx/power-ifp7xx.c b/firmware/target/arm/pnx0101/iriver-ifp7xx/power-ifp7xx.c index 4e4f585298..dfdcb1d27a 100644 --- a/firmware/target/arm/pnx0101/iriver-ifp7xx/power-ifp7xx.c +++ b/firmware/target/arm/pnx0101/iriver-ifp7xx/power-ifp7xx.c @@ -30,12 +30,12 @@ static bool powered = false; -bool radio_powered(void) +bool tuner_powered(void) { return powered; } -bool radio_power(bool status) +bool tuner_power(bool status) { bool old_status = powered; powered = status; 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 @@ #include "system.h" #include "cpu.h" #include "i2c-pp.h" +#include "tuner.h" void power_init(void) { @@ -61,3 +62,60 @@ void ide_power_enable(bool on) { (void)on; } + +/** Tuner **/ +static bool powered = false; + +bool tuner_power(bool status) +{ + bool old_status = powered; + + if (status != old_status) + { + if (status) + { + /* init mystery amplification device */ + outl(inl(0x70000084) | 0x1, 0x70000084); + udelay(5); + + /* When power up, host should initialize the 3-wire bus + in host read mode: */ + + /* 1. Set direction of the DATA-line to input-mode. */ + GPIOH_OUTPUT_EN &= ~(1 << 5); + GPIOH_ENABLE |= (1 << 5); + + /* 2. Drive NR_W low */ + GPIOH_OUTPUT_VAL &= ~(1 << 3); + GPIOH_OUTPUT_EN |= (1 << 3); + GPIOH_ENABLE |= (1 << 3); + + /* 3. Drive CLOCK high */ + GPIOH_OUTPUT_VAL |= (1 << 4); + GPIOH_OUTPUT_EN |= (1 << 4); + GPIOH_ENABLE |= (1 << 4); + + lv24020lp_power(true); + } + else + { + lv24020lp_power(false); + + /* set all as inputs */ + GPIOH_OUTPUT_EN &= ~((1 << 5) | (1 << 3) | (1 << 4)); + GPIOH_ENABLE &= ~((1 << 5) | (1 << 3) | (1 << 4)); + + /* turn off mystery amplification device */ + outl(inl(0x70000084) & ~0x1, 0x70000084); + } + + powered = status; + } + + return old_status; +} + +bool tuner_powered(void) +{ + return powered; +} |