diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2008-12-21 19:39:11 +0000 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2008-12-21 19:39:11 +0000 |
commit | 491ed5ed6a6496b61fe34910a27e6e5416815929 (patch) | |
tree | 66bcae56cacc8634864944d7c2f783593dca8de9 /firmware/target/arm/imx31/gigabeat-s/power-imx31.c | |
parent | 19413fc8060fb80eae668ddfdf3c4fa7e751e5b4 (diff) | |
download | rockbox-491ed5ed6a6496b61fe34910a27e6e5416815929.tar.gz rockbox-491ed5ed6a6496b61fe34910a27e6e5416815929.zip |
Gigabeat S: Make tuner_power have the expected behavior (return old state). Static i2c node structure and add fmradio_i2c_enable to the fmradio i2c API for those that can implement it.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19550 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 | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/firmware/target/arm/imx31/gigabeat-s/power-imx31.c b/firmware/target/arm/imx31/gigabeat-s/power-imx31.c index 39724c7b75..727b38bd96 100644 --- a/firmware/target/arm/imx31/gigabeat-s/power-imx31.c +++ b/firmware/target/arm/imx31/gigabeat-s/power-imx31.c | |||
@@ -28,9 +28,10 @@ | |||
28 | #include "backlight-target.h" | 28 | #include "backlight-target.h" |
29 | #include "avic-imx31.h" | 29 | #include "avic-imx31.h" |
30 | #include "mc13783.h" | 30 | #include "mc13783.h" |
31 | #include "i2c-imx31.h" | 31 | #if CONFIG_TUNER |
32 | #include "fmradio_i2c.h" | ||
33 | #endif | ||
32 | 34 | ||
33 | extern struct i2c_node si4700_i2c_node; | ||
34 | static unsigned int power_status = POWER_INPUT_NONE; | 35 | static unsigned int power_status = POWER_INPUT_NONE; |
35 | 36 | ||
36 | /* Detect which power sources are present. */ | 37 | /* Detect which power sources are present. */ |
@@ -99,11 +100,18 @@ bool ide_powered(void) | |||
99 | #if CONFIG_TUNER | 100 | #if CONFIG_TUNER |
100 | bool tuner_power(bool status) | 101 | bool tuner_power(bool status) |
101 | { | 102 | { |
103 | static bool tuner_powered = false; | ||
104 | |||
105 | if (status == tuner_powered) | ||
106 | return status; | ||
107 | |||
108 | tuner_powered = status; | ||
109 | |||
102 | if (status) | 110 | if (status) |
103 | { | 111 | { |
104 | /* the si4700 is the only thing connected to i2c2 so | 112 | /* the si4700 is the only thing connected to i2c2 so |
105 | we can diable the i2c module when not in use */ | 113 | we can diable the i2c module when not in use */ |
106 | i2c_enable_node(&si4700_i2c_node, true); | 114 | fmradio_i2c_enable(true); |
107 | /* enable the fm chip */ | 115 | /* enable the fm chip */ |
108 | imx31_regset32(&GPIO1_DR, (1 << 26)); | 116 | imx31_regset32(&GPIO1_DR, (1 << 26)); |
109 | /* enable CLK32KMCU clock */ | 117 | /* enable CLK32KMCU clock */ |
@@ -113,13 +121,14 @@ bool tuner_power(bool status) | |||
113 | { | 121 | { |
114 | /* the si4700 is the only thing connected to i2c2 so | 122 | /* the si4700 is the only thing connected to i2c2 so |
115 | we can diable the i2c module when not in use */ | 123 | we can diable the i2c module when not in use */ |
116 | i2c_enable_node(&si4700_i2c_node, false); | 124 | fmradio_i2c_enable(false); |
117 | /* disable the fm chip */ | 125 | /* disable the fm chip */ |
118 | imx31_regclr32(&GPIO1_DR, (1 << 26)); | 126 | imx31_regclr32(&GPIO1_DR, (1 << 26)); |
119 | /* disable CLK32KMCU clock */ | 127 | /* disable CLK32KMCU clock */ |
120 | mc13783_clear(MC13783_POWER_CONTROL0, MC13783_CLK32KMCUEN); | 128 | mc13783_clear(MC13783_POWER_CONTROL0, MC13783_CLK32KMCUEN); |
121 | } | 129 | } |
122 | return true; | 130 | |
131 | return !status; | ||
123 | } | 132 | } |
124 | #endif /* #if CONFIG_TUNER */ | 133 | #endif /* #if CONFIG_TUNER */ |
125 | 134 | ||