From b1298c2c442ebe1db5d58cbea5ffab6d2e302d74 Mon Sep 17 00:00:00 2001 From: Bertrik Sikken Date: Wed, 21 Sep 2011 21:48:19 +0000 Subject: Sansa AMS/AMSv2: analog front-end register CVDD/DCDC3 doesn't exist in AMSv2, so don't modify it git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30579 a1c6a512-1295-4272-9138-f99709370657 --- firmware/export/as3514.h | 2 +- firmware/target/arm/as3525/ascodec-as3525.c | 2 ++ firmware/target/arm/as3525/system-as3525.c | 9 +++++---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/firmware/export/as3514.h b/firmware/export/as3514.h index 0bfd445469..acf13444fa 100644 --- a/firmware/export/as3514.h +++ b/firmware/export/as3514.h @@ -89,9 +89,9 @@ extern void audiohw_set_sampr_dividers(int fsel); #endif #define AS3514_SYSTEM 0x20 -#define AS3514_CVDD_DCDC3 0x21 #ifndef HAVE_AS3543 +#define AS3514_CVDD_DCDC3 0x21 #define AS3514_CHARGER 0x22 #define AS3514_DCDC15 0x23 #define AS3514_SUPERVISOR 0x24 diff --git a/firmware/target/arm/as3525/ascodec-as3525.c b/firmware/target/arm/as3525/ascodec-as3525.c index 39658c0637..405acf3ca0 100644 --- a/firmware/target/arm/as3525/ascodec-as3525.c +++ b/firmware/target/arm/as3525/ascodec-as3525.c @@ -357,8 +357,10 @@ static void ascodec_wait(struct ascodec_request *req) static void ascodec_async_write(unsigned int index, unsigned int value, struct ascodec_request *req) { +#ifndef HAVE_AS3543 if (index == AS3514_CVDD_DCDC3) /* prevent setting of the LREG_CP_not bit */ value &= ~(1 << 5); +#endif ascodec_req_init(req, ASCODEC_REQ_WRITE, index, 1); req->data[0] = value; diff --git a/firmware/target/arm/as3525/system-as3525.c b/firmware/target/arm/as3525/system-as3525.c index 58f08a7d19..78282b905e 100644 --- a/firmware/target/arm/as3525/system-as3525.c +++ b/firmware/target/arm/as3525/system-as3525.c @@ -271,7 +271,8 @@ void system_init(void) ascodec_init(); -#if (CONFIG_CPU == AS3525v2) + /* Initialize power management settings */ +#ifdef HAVE_AS3543 /* PLL: disable audio PLL, we use MCLK already */ ascodec_write_pmu(0x1A, 7, 0x02); /* DCDC_Cntr: set switching speed of CVDD1/2 power supplies to 1 MHz */ @@ -286,7 +287,9 @@ void system_init(void) /* AVDD17: set AVDD17 power supply to 2.5V */ ascodec_write_pmu(0x18, 7, 0x31); #endif -#endif /* (CONFIG_CPU == AS3525v2) */ +#else + ascodec_write(AS3514_CVDD_DCDC3, AS314_CP_DCDC3_SETTING); +#endif /* HAVE_AS3543 */ #ifndef BOOTLOADER /* setup isr for microsd monitoring and for fuzev2 scrollwheel irq */ @@ -296,8 +299,6 @@ void system_init(void) /* pin selection for irq happens in the drivers */ #endif - /* Initialize power management settings */ - ascodec_write(AS3514_CVDD_DCDC3, AS314_CP_DCDC3_SETTING); #if CONFIG_TUNER fmradio_i2c_init(); #endif -- cgit v1.2.3