From 08585e417b4e545752ff9478d28c4da3e8c09844 Mon Sep 17 00:00:00 2001 From: Mark Arigo Date: Fri, 12 Dec 2008 04:56:25 +0000 Subject: FS#9591 by Anton Veretenenko for the Philips GoGear HDD1620/1630 (with a few changes by me). Fixes boot problem, pixel format, sound, and a few other things. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19395 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/adc-pp5020.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'firmware/target/arm/adc-pp5020.c') diff --git a/firmware/target/arm/adc-pp5020.c b/firmware/target/arm/adc-pp5020.c index a8fe8c1560..33950014dc 100644 --- a/firmware/target/arm/adc-pp5020.c +++ b/firmware/target/arm/adc-pp5020.c @@ -35,28 +35,28 @@ unsigned short adc_scan(int channel) /* Start conversion */ ADC_ADDR |= 0x80000000; - + /* Wait for conversion to complete */ while((ADC_STATUS & (0x40<<8*channel))==0); - + /* Stop conversion */ ADC_ADDR &=~ 0x80000000; - + /* ADC_DATA_1 and ADC_DATA_2 are both four bytes, one byte per channel. For each channel, ADC_DATA_1 stores the 8-bit msb, ADC_DATA_2 stores the 2-bit lsb (in bits 0 and 1). Each channel is 10 bits total. */ adc_data_1 = ((ADC_DATA_1 >> (8*channel)) & 0xff); adc_data_2 = ((ADC_DATA_2 >> (8*channel+6)) & 0x3); - + adcdata[channel] = (adc_data_1<<2 | adc_data_2); - + /* ADC values read low if PLL is enabled */ if(PLL_CONTROL & 0x80000000){ adcdata[channel] += 0x14; if(adcdata[channel] > 0x400) adcdata[channel] = 0x400; } - + return adcdata[channel]; } @@ -83,17 +83,18 @@ static void adc_tick(void) /* Figured out from how the OF does things */ void adc_init(void) { + ADC_INIT |= 1; ADC_INIT |= 0x40000000; udelay(100); - + /* Reset ADC */ DEV_RS2 |= 0x20; udelay(100); - + DEV_RS2 &=~ 0x20; udelay(100); - + /* Enable ADC */ DEV_EN2 |= 0x20; udelay(100); @@ -121,7 +122,8 @@ void adc_init(void) ADC_ADDR |= 0x2000000; ADC_STATUS |= 0x2000; -#if defined (IRIVER_H10) || defined(IRIVER_H10_5GB) || defined(MROBE_100) +#if defined (IRIVER_H10) || defined(IRIVER_H10_5GB) || \ + defined(MROBE_100) || defined(PHILIPS_HDD1630) /* Enable channel 2 (H10:remote) */ DEV_INIT1 &=~0x300; DEV_INIT1 |= 0x100; -- cgit v1.2.3