summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/gigabeat-s/power-imx31.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx31/gigabeat-s/power-imx31.c')
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/power-imx31.c30
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
31extern struct i2c_node si4700_i2c_node;
29 32
30static bool charger_detect = false; 33static 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
86bool 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
82void power_off(void) 112void power_off(void)
83{ 113{
84 /* Cut backlight */ 114 /* Cut backlight */