1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * PP502X and PP5002 I2C driver
12 * Based on code from the ipodlinux project - http://ipodlinux.org/
13 * Adapted for Rockbox in November 2005
15 * Original file: linux/arch/armnommu/mach-ipod/hardware.c
17 * Copyright (c) 2003-2005 Bernard Leach (leachbj@bouncycastle.org)
19 * All files in this archive are subject to the GNU General Public License.
20 * See the file COPYING in the source tree root for full license agreement.
22 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
23 * KIND, either express or implied.
25 ****************************************************************************/
28 * PortalPlayer i2c driver
35 #define I2C_CTRL (*(volatile unsigned char*)(I2C_BASE+0x00))
36 #define I2C_ADDR (*(volatile unsigned char*)(I2C_BASE+0x04))
37 #define I2C_DATA(X) (*(volatile unsigned char*)(I2C_BASE+0xc+(4*X)))
38 #define I2C_STATUS (*(volatile unsigned char*)(I2C_BASE+0x1c))
40 /* I2C_CTRL bit definitions */
43 /* I2C_STATUS bit definitions */
44 #define I2C_BUSY (1<<6)
46 /* TODO: Fully implement i2c driver */
48 /* To be used by drivers that need to do multiple i2c operations
51 void i2c_unlock(void);
54 int i2c_readbyte(unsigned int dev_addr
, int addr
);
55 int pp_i2c_send(unsigned int addr
, int data0
, int data1
);
56 int i2c_readbytes(unsigned int dev_addr
, int addr
, int len
, unsigned char *data
);