diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2006-10-30 08:56:06 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2006-10-30 08:56:06 +0000 |
commit | 139f9f28e9179a881c0bdd5c6bed6790591a07cb (patch) | |
tree | 21920a9ca8bf5e9123ff230c6aa3ec5e9b7acb1b /firmware/drivers | |
parent | 145ec81d2f879482fbfe192dcf39350f36bda3d7 (diff) |
move the iriver h1x0/h3x0 targets to the target tree
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11392 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/drivers')
-rw-r--r-- | firmware/drivers/adc.c | 129 | ||||
-rw-r--r-- | firmware/drivers/ata.c | 16 |
2 files changed, 0 insertions, 145 deletions
diff --git a/firmware/drivers/adc.c b/firmware/drivers/adc.c index 646509b8a8..388ff66d5f 100644 --- a/firmware/drivers/adc.c +++ b/firmware/drivers/adc.c @@ -108,135 +108,6 @@ void adc_init(void) sleep(2); /* Ensure valid readings when adc_init returns */ } -#elif CONFIG_CPU == MCF5249 -static unsigned char adcdata[NUM_ADC_CHANNELS]; - -#ifdef IRIVER_H300_SERIES -static int adcc2_parms[] = -{ - [ADC_BUTTONS] = 0x80 | (5 << 1) | 1, /* ADCIN2 */ - [ADC_REMOTE] = 0x80 | (6 << 1) | 1, /* ADCIN3 */ - [ADC_BATTERY] = 0x80 | (0 << 1) | 1, /* BATVOLT, resistive divider */ - [ADC_REMOTEDETECT] = 0x80 | (2 << 1) | 1, /* ADCIN1, resistive divider */ -}; - -unsigned short adc_scan(int channel) -{ - int level = set_irq_level(HIGHEST_IRQ_LEVEL); - unsigned char data; - - pcf50606_write(0x2f, adcc2_parms[channel]); - data = pcf50606_read(0x30); - - adcdata[channel] = data; - - set_irq_level(level); - return data; -} -#else - -#define CS_LO and_l(~0x80, &GPIO_OUT) -#define CS_HI or_l(0x80, &GPIO_OUT) -#define CLK_LO and_l(~0x00400000, &GPIO_OUT) -#define CLK_HI or_l(0x00400000, &GPIO_OUT) -#define DO (GPIO_READ & 0x80000000) -#define DI_LO and_l(~0x00200000, &GPIO_OUT) -#define DI_HI or_l(0x00200000, &GPIO_OUT) - -/* delay loop */ -#define DELAY do { int _x; for(_x=0;_x<10;_x++);} while (0) - -unsigned short adc_scan(int channel) -{ - unsigned char data = 0; - int i; - - CS_LO; - - DI_HI; /* Start bit */ - DELAY; - CLK_HI; - DELAY; - CLK_LO; - - DI_HI; /* Single channel */ - DELAY; - CLK_HI; - DELAY; - CLK_LO; - - if(channel & 1) /* LSB of channel number */ - DI_HI; - else - DI_LO; - DELAY; - CLK_HI; - DELAY; - CLK_LO; - - if(channel & 2) /* MSB of channel number */ - DI_HI; - else - DI_LO; - DELAY; - CLK_HI; - DELAY; - CLK_LO; - - DELAY; - - for(i = 0;i < 8;i++) /* 8 bits of data */ - { - CLK_HI; - DELAY; - CLK_LO; - DELAY; - data <<= 1; - data |= DO?1:0; - } - - CS_HI; - - adcdata[channel] = data; - - return data; -} -#endif - -unsigned short adc_read(int channel) -{ - return adcdata[channel]; -} - -static int adc_counter; - -static void adc_tick(void) -{ - if(++adc_counter == HZ) - { - adc_counter = 0; - adc_scan(ADC_BATTERY); - adc_scan(ADC_REMOTEDETECT); /* Temporary. Remove when the remote - detection feels stable. */ - } -} - -void adc_init(void) -{ -#ifndef IRIVER_H300_SERIES - or_l(0x80600080, &GPIO_FUNCTION); /* GPIO7: CS - GPIO21: Data In (to the ADC) - GPIO22: CLK - GPIO31: Data Out (from the ADC) */ - or_l(0x00600080, &GPIO_ENABLE); - or_l(0x80, &GPIO_OUT); /* CS high */ - and_l(~0x00400000, &GPIO_OUT); /* CLK low */ -#endif - - adc_scan(ADC_BATTERY); - - tick_add_task(adc_tick); -} #elif CONFIG_CPU == TCC730 diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index babbab016a..39827f7188 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -1476,12 +1476,6 @@ int ata_hard_reset(void) /* state HRR1 */ or_b(0x02, &PADRH); /* negate _RESET */ sleep(1); /* > 2ms */ -#elif defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) - and_l(~0x00080000, &GPIO_OUT); - sleep(1); /* > 25us */ - - or_l(0x00080000, &GPIO_OUT); - sleep(1); /* > 25us */ #elif CONFIG_CPU == TCC730 P6 &= ~0x40; @@ -1627,14 +1621,6 @@ void ata_enable(bool on) or_b(0x80, &PADRL); /* disable ATA */ or_b(0x80, &PAIORL); -#elif defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) - if(on) - and_l(~0x0040000, &GPIO_OUT); - else - or_l(0x0040000, &GPIO_OUT); - - or_l(0x00040000, &GPIO_ENABLE); - or_l(0x00040000, &GPIO_FUNCTION); #elif CONFIG_CPU == TCC730 #endif @@ -1788,8 +1774,6 @@ int ata_init(void) bool coldstart = ata_is_coldstart(); #elif CONFIG_CPU == TCC730 bool coldstart = (P1 & 0x80) == 0; -#elif defined(IRIVER_H100_SERIES) || defined(IRIVER_H300_SERIES) - bool coldstart = (GPIO_FUNCTION & 0x00080000) == 0; #else bool coldstart = (PACR2 & 0x4000) != 0; #endif |