summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Wilgus <wilgus.william@gmail.com>2020-09-13 13:29:00 -0400
committerWilliam Wilgus <wilgus.william@gmail.com>2020-09-13 13:29:00 -0400
commit3c2b6809d94adcb958c135ca471a666c15fd0060 (patch)
treeacd6cb6018cf42c5a59b56c385c26a87b30503d8
parentc62493e98adfd27c16eb2adb2ecd22716813b705 (diff)
downloadrockbox-3c2b680.tar.gz
rockbox-3c2b680.tar.bz2
rockbox-3c2b680.zip
Xduoo X3 no ADC after ROLO
Speachy suggested we don't shut down the adc on ROLO this fixes the random adc drop out on ROLO Change-Id: Ife7d679ce51a6f767963210ee650815f1de12223
-rw-r--r--firmware/rolo.c2
-rw-r--r--firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c6
2 files changed, 8 insertions, 0 deletions
diff --git a/firmware/rolo.c b/firmware/rolo.c
index e60af46704..7cded0906f 100644
--- a/firmware/rolo.c
+++ b/firmware/rolo.c
@@ -286,7 +286,9 @@ int rolo_load(const char* filename)
lcd_remote_puts(0, 1, "Executing");
lcd_remote_update();
#endif
+#if (CONFIG_KEYPAD != XDUOO_X3_PAD) /* X3 adc hangs on ROLO */
adc_close();
+#endif
#if CONFIG_CPU == AS3525v2
/* Set CVDD1 power supply to default*/
ascodec_write_pmu(0x17, 1, 0);
diff --git a/firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c b/firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c
index 0d251754dd..0db1bada9b 100644
--- a/firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c
+++ b/firmware/target/mips/ingenic_jz47xx/xduoo_x3/sadc-xduoo_x3.c
@@ -260,6 +260,12 @@ int _battery_voltage(void)
void adc_init(void)
{
bat_val = ADC_MASK;
+ /* don't re-init*/
+ if (!(REG_CPM_CLKGR0 & CLKGR0_SADC) && !(REG_SADC_ADENA & ADENA_POWER))
+ {
+ system_enable_irq(IRQ_SADC);
+ return;
+ }
__cpm_start_sadc();
mdelay(20);