diff options
author | Nils Wallménius <nils@rockbox.org> | 2008-12-09 20:48:04 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2008-12-09 20:48:04 +0000 |
commit | 65f61d6cce4a5d3b52860d38a922b01fcddc70cd (patch) | |
tree | 03f8167279828845dcd4923d8184bc58d0e165da /firmware/target/arm/imx31/gigabeat-s/power-imx31.c | |
parent | a13c16271911be641539cace3ea5ea0c1440eeaf (diff) | |
download | rockbox-65f61d6cce4a5d3b52860d38a922b01fcddc70cd.tar.gz rockbox-65f61d6cce4a5d3b52860d38a922b01fcddc70cd.zip |
FS#9609 FM radio support for the Gigabeat S, seeking/scanning is not yet
implemented but manual tuning works nicely. Thanks to Rafaël Carré,
Bertrik Sikken and Robert Menes for suggestions and debugging help.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19372 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/power-imx31.c')
-rw-r--r-- | firmware/target/arm/imx31/gigabeat-s/power-imx31.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/power-imx31.c b/firmware/target/arm/imx31/gigabeat-s/power-imx31.c index de7f5800e6..07e6462bfb 100644 --- a/firmware/target/arm/imx31/gigabeat-s/power-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/power-imx31.c | |||
@@ -26,6 +26,9 @@ | |||
26 | #include "backlight-target.h" | 26 | #include "backlight-target.h" |
27 | #include "avic-imx31.h" | 27 | #include "avic-imx31.h" |
28 | #include "mc13783.h" | 28 | #include "mc13783.h" |
29 | #include "i2c-imx31.h" | ||
30 | |||
31 | extern struct i2c_node si4700_i2c_node; | ||
29 | 32 | ||
30 | static bool charger_detect = false; | 33 | static bool charger_detect = false; |
31 | 34 | ||
@@ -79,6 +82,33 @@ bool ide_powered(void) | |||
79 | return (GPIO3_DR & (1 << 5)) != 0; | 82 | return (GPIO3_DR & (1 << 5)) != 0; |
80 | } | 83 | } |
81 | 84 | ||
85 | #if CONFIG_TUNER | ||
86 | bool tuner_power(bool status) | ||
87 | { | ||
88 | if (status) | ||
89 | { | ||
90 | /* the si4700 is the only thing connected to i2c2 so | ||
91 | we can diable the i2c module when not in use */ | ||
92 | i2c_enable_node(&si4700_i2c_node, true); | ||
93 | /* enable the fm chip */ | ||
94 | imx31_regmod32(&GPIO1_DR, (1 << 26), (1 << 26)); | ||
95 | /* enable CLK32KMCU clock */ | ||
96 | mc13783_set(MC13783_POWER_CONTROL0, MC13783_CLK32KMCUEN); | ||
97 | } | ||
98 | else | ||
99 | { | ||
100 | /* the si4700 is the only thing connected to i2c2 so | ||
101 | we can diable the i2c module when not in use */ | ||
102 | i2c_enable_node(&si4700_i2c_node, false); | ||
103 | /* disable the fm chip */ | ||
104 | imx31_regmod32(&GPIO1_DR, 0, (1 << 26)); | ||
105 | /* disable CLK32KMCU clock */ | ||
106 | mc13783_clear(MC13783_POWER_CONTROL0, MC13783_CLK32KMCUEN); | ||
107 | } | ||
108 | return true; | ||
109 | } | ||
110 | #endif /* #if CONFIG_TUNER */ | ||
111 | |||
82 | void power_off(void) | 112 | void power_off(void) |
83 | { | 113 | { |
84 | /* Cut backlight */ | 114 | /* Cut backlight */ |