From c65dc19c232af10c6c0ccba535b0938ec6bdb45c Mon Sep 17 00:00:00 2001 From: mcuelenaere Date: Mon, 1 Jun 2009 21:21:29 +0000 Subject: [PATCH] Fix reds & yellow git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21162 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/config-ondavx767.h | 8 ++++++++ firmware/target/mips/ingenic_jz47xx/codec-jz4740.c | 4 ++++ .../ingenic_jz47xx/onda_vx747/power-onda_vx747.c | 21 +++++++++++++++++++++ .../ingenic_jz47xx/onda_vx767/power-onda_vx767.c | 19 +++++++++++++++++++ 4 files changed, 52 insertions(+) diff --git a/firmware/export/config-ondavx767.h b/firmware/export/config-ondavx767.h index 76a478753..d23f97c80 100644 --- a/firmware/export/config-ondavx767.h +++ b/firmware/export/config-ondavx767.h @@ -104,6 +104,14 @@ /* Define this if you have the Jz4740 internal codec */ #define HAVE_JZ4740_CODEC +/* Define bitmask of input sources - recordable bitmask can be defined + explicitly if different */ +#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) + +/* Tuner config */ +#define CONFIG_TUNER TEA5767 +#define CONFIG_TUNER_XTAL 32768 + /* Define this if you have a speaker */ //#define HAVE_SPEAKER diff --git a/firmware/target/mips/ingenic_jz47xx/codec-jz4740.c b/firmware/target/mips/ingenic_jz47xx/codec-jz4740.c index 325a3734d..b91b7fae7 100644 --- a/firmware/target/mips/ingenic_jz47xx/codec-jz4740.c +++ b/firmware/target/mips/ingenic_jz47xx/codec-jz4740.c @@ -362,6 +362,7 @@ void audio_input_mux(int source, unsigned flags) } break; +#if INPUT_SRC_CAPS & SRC_CAP_MIC case AUDIO_SRC_MIC: /* recording only */ audio_channels = 1; if(source != last_source) @@ -370,7 +371,9 @@ void audio_input_mux(int source, unsigned flags) | (ICDC_CDCCR1_EADC | ICDC_CDCCR1_SW1ON | ICDC_CDCCR1_EMIC); } break; +#endif +#if INPUT_SRC_CAPS & SRC_CAP_FMRADIO case AUDIO_SRC_FMRADIO: /* recording and playback */ audio_channels = 2; @@ -390,6 +393,7 @@ void audio_input_mux(int source, unsigned flags) ICDC_CDCCR1_SW2ON | ICDC_CDCCR1_HPMUTE)) | (ICDC_CDCCR1_SW1ON | ICDC_CDCCR1_ELININ); } break; +#endif } /* end switch */ last_source = source; diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx747/power-onda_vx747.c b/firmware/target/mips/ingenic_jz47xx/onda_vx747/power-onda_vx747.c index fc77d063f..19d634873 100644 --- a/firmware/target/mips/ingenic_jz47xx/onda_vx747/power-onda_vx747.c +++ b/firmware/target/mips/ingenic_jz47xx/onda_vx747/power-onda_vx747.c @@ -27,6 +27,7 @@ #define UNK_GPIO (32*1+30) /* STAT port */ #define USB_CHARGER_GPIO (32*3+28) +#if CONFIG_CHARGING /* Detect which power sources are present. */ unsigned int power_input_status(void) { @@ -37,6 +38,7 @@ unsigned int power_input_status(void) return status; } +#endif void power_init(void) { @@ -47,3 +49,22 @@ bool charging_state(void) { return false; } + +#if CONFIG_TUNER +static bool tuner_on = false; +bool tuner_power(bool status) +{ + if (status != tuner_on) + { + tuner_on = status; + status = !status; + } + + return status; +} + +bool tuner_powered(void) +{ + return tuner_on; +} +#endif diff --git a/firmware/target/mips/ingenic_jz47xx/onda_vx767/power-onda_vx767.c b/firmware/target/mips/ingenic_jz47xx/onda_vx767/power-onda_vx767.c index 8d007e292..8412b203f 100644 --- a/firmware/target/mips/ingenic_jz47xx/onda_vx767/power-onda_vx767.c +++ b/firmware/target/mips/ingenic_jz47xx/onda_vx767/power-onda_vx767.c @@ -39,3 +39,22 @@ bool charging_state(void) { return false; } + +#if CONFIG_TUNER +static bool tuner_on = false; +bool tuner_power(bool status) +{ + if (status != tuner_on) + { + tuner_on = status; + status = !status; + } + + return status; +} + +bool tuner_powered(void) +{ + return tuner_on; +} +#endif -- 2.11.4.GIT