From 81381a36b4e5e8fd963f630fdf59c6c947c54de4 Mon Sep 17 00:00:00 2001 From: Michael Sparmann Date: Sun, 14 Nov 2010 15:19:30 +0000 Subject: iPod Nano 2G: Set I2C clock to 374400 Hz, now that we know what it is derived from. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@28589 a1c6a512-1295-4272-9138-f99709370657 --- firmware/target/arm/s5l8700/i2c-s5l8700.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'firmware') diff --git a/firmware/target/arm/s5l8700/i2c-s5l8700.c b/firmware/target/arm/s5l8700/i2c-s5l8700.c index a5661c5848..49dd0b98c0 100644 --- a/firmware/target/arm/s5l8700/i2c-s5l8700.c +++ b/firmware/target/arm/s5l8700/i2c-s5l8700.c @@ -58,7 +58,7 @@ void i2c_init(void) (0 << 6) | /* CLKSEL = PCLK/16 */ (1 << 5) | /* INT_EN */ (1 << 4) | /* IRQ clear */ - (7 << 0); /* CK_REG */ + (3 << 0); /* CK_REG */ /* serial output on */ IICSTAT = (1 << 4); @@ -72,7 +72,7 @@ int i2c_write(unsigned char slave, int address, int len, const unsigned char *da /* START */ IICDS = slave & ~1; IICSTAT = 0xF0; - IICCON = 0xB7; + IICCON = 0xB3; while ((IICCON & 0x10) == 0) if (TIME_AFTER(current_tick, timeout)) { @@ -84,7 +84,7 @@ int i2c_write(unsigned char slave, int address, int len, const unsigned char *da if (address >= 0) { /* write address */ IICDS = address; - IICCON = 0xB7; + IICCON = 0xB3; while ((IICCON & 0x10) == 0) if (TIME_AFTER(current_tick, timeout)) { @@ -96,7 +96,7 @@ int i2c_write(unsigned char slave, int address, int len, const unsigned char *da /* write data */ while (len--) { IICDS = *data++; - IICCON = 0xB7; + IICCON = 0xB3; while ((IICCON & 0x10) == 0) if (TIME_AFTER(current_tick, timeout)) { @@ -107,7 +107,7 @@ int i2c_write(unsigned char slave, int address, int len, const unsigned char *da /* STOP */ IICSTAT = 0xD0; - IICCON = 0xB7; + IICCON = 0xB3; while ((IICSTAT & (1 << 5)) != 0) if (TIME_AFTER(current_tick, timeout)) { @@ -128,7 +128,7 @@ int i2c_read(unsigned char slave, int address, int len, unsigned char *data) /* START */ IICDS = slave & ~1; IICSTAT = 0xF0; - IICCON = 0xB7; + IICCON = 0xB3; while ((IICCON & 0x10) == 0) if (TIME_AFTER(current_tick, timeout)) { @@ -138,7 +138,7 @@ int i2c_read(unsigned char slave, int address, int len, unsigned char *data) /* write address */ IICDS = address; - IICCON = 0xB7; + IICCON = 0xB3; while ((IICCON & 0x10) == 0) if (TIME_AFTER(current_tick, timeout)) { @@ -150,7 +150,7 @@ int i2c_read(unsigned char slave, int address, int len, unsigned char *data) /* (repeated) START */ IICDS = slave | 1; IICSTAT = 0xB0; - IICCON = 0xB7; + IICCON = 0xB3; while ((IICCON & 0x10) == 0) if (TIME_AFTER(current_tick, timeout)) { @@ -159,7 +159,7 @@ int i2c_read(unsigned char slave, int address, int len, unsigned char *data) } while (len--) { - IICCON = (len == 0) ? 0x37 : 0xB7; /* NACK or ACK */ + IICCON = (len == 0) ? 0x33 : 0xB3; /* NAK or ACK */ while ((IICCON & 0x10) == 0) if (TIME_AFTER(current_tick, timeout)) { @@ -171,7 +171,7 @@ int i2c_read(unsigned char slave, int address, int len, unsigned char *data) /* STOP */ IICSTAT = 0x90; - IICCON = 0xB7; + IICCON = 0xB3; while ((IICSTAT & (1 << 5)) != 0) if (TIME_AFTER(current_tick, timeout)) { -- cgit v1.2.3