summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/export/config-ondavx767.h8
-rw-r--r--firmware/target/mips/ingenic_jz47xx/codec-jz4740.c4
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx747/power-onda_vx747.c21
-rw-r--r--firmware/target/mips/ingenic_jz47xx/onda_vx767/power-onda_vx767.c19
4 files changed, 52 insertions, 0 deletions
diff --git a/firmware/export/config-ondavx767.h b/firmware/export/config-ondavx767.h
index 76a4787539..d23f97c809 100644
--- a/firmware/export/config-ondavx767.h
+++ b/firmware/export/config-ondavx767.h
@@ -104,6 +104,14 @@
104/* Define this if you have the Jz4740 internal codec */ 104/* Define this if you have the Jz4740 internal codec */
105#define HAVE_JZ4740_CODEC 105#define HAVE_JZ4740_CODEC
106 106
107/* Define bitmask of input sources - recordable bitmask can be defined
108 explicitly if different */
109#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO)
110
111/* Tuner config */
112#define CONFIG_TUNER TEA5767
113#define CONFIG_TUNER_XTAL 32768
114
107/* Define this if you have a speaker */ 115/* Define this if you have a speaker */
108//#define HAVE_SPEAKER 116//#define HAVE_SPEAKER
109 117
diff --git a/firmware/target/mips/ingenic_jz47xx/codec-jz4740.c b/firmware/target/mips/ingenic_jz47xx/codec-jz4740.c
index 325a3734d8..b91b7fae70 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)
362 } 362 }
363 break; 363 break;
364 364
365#if INPUT_SRC_CAPS & SRC_CAP_MIC
365 case AUDIO_SRC_MIC: /* recording only */ 366 case AUDIO_SRC_MIC: /* recording only */
366 audio_channels = 1; 367 audio_channels = 1;
367 if(source != last_source) 368 if(source != last_source)
@@ -370,7 +371,9 @@ void audio_input_mux(int source, unsigned flags)
370 | (ICDC_CDCCR1_EADC | ICDC_CDCCR1_SW1ON | ICDC_CDCCR1_EMIC); 371 | (ICDC_CDCCR1_EADC | ICDC_CDCCR1_SW1ON | ICDC_CDCCR1_EMIC);
371 } 372 }
372 break; 373 break;
374#endif
373 375
376#if INPUT_SRC_CAPS & SRC_CAP_FMRADIO
374 case AUDIO_SRC_FMRADIO: /* recording and playback */ 377 case AUDIO_SRC_FMRADIO: /* recording and playback */
375 audio_channels = 2; 378 audio_channels = 2;
376 379
@@ -390,6 +393,7 @@ void audio_input_mux(int source, unsigned flags)
390 ICDC_CDCCR1_SW2ON | ICDC_CDCCR1_HPMUTE)) | (ICDC_CDCCR1_SW1ON | ICDC_CDCCR1_ELININ); 393 ICDC_CDCCR1_SW2ON | ICDC_CDCCR1_HPMUTE)) | (ICDC_CDCCR1_SW1ON | ICDC_CDCCR1_ELININ);
391 } 394 }
392 break; 395 break;
396#endif
393 } /* end switch */ 397 } /* end switch */
394 398
395 last_source = source; 399 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 fc77d063f9..19d634873c 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 @@
27#define UNK_GPIO (32*1+30) /* STAT port */ 27#define UNK_GPIO (32*1+30) /* STAT port */
28#define USB_CHARGER_GPIO (32*3+28) 28#define USB_CHARGER_GPIO (32*3+28)
29 29
30#if CONFIG_CHARGING
30/* Detect which power sources are present. */ 31/* Detect which power sources are present. */
31unsigned int power_input_status(void) 32unsigned int power_input_status(void)
32{ 33{
@@ -37,6 +38,7 @@ unsigned int power_input_status(void)
37 38
38 return status; 39 return status;
39} 40}
41#endif
40 42
41void power_init(void) 43void power_init(void)
42{ 44{
@@ -47,3 +49,22 @@ bool charging_state(void)
47{ 49{
48 return false; 50 return false;
49} 51}
52
53#if CONFIG_TUNER
54static bool tuner_on = false;
55bool tuner_power(bool status)
56{
57 if (status != tuner_on)
58 {
59 tuner_on = status;
60 status = !status;
61 }
62
63 return status;
64}
65
66bool tuner_powered(void)
67{
68 return tuner_on;
69}
70#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 8d007e292a..8412b203f4 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)
39{ 39{
40 return false; 40 return false;
41} 41}
42
43#if CONFIG_TUNER
44static bool tuner_on = false;
45bool tuner_power(bool status)
46{
47 if (status != tuner_on)
48 {
49 tuner_on = status;
50 status = !status;
51 }
52
53 return status;
54}
55
56bool tuner_powered(void)
57{
58 return tuner_on;
59}
60#endif