Remove the calls to backlight_lcd_sleep_countdown from target specific code and move...
[kugel-rb.git] / firmware / export / i2c-pp.h
blob230b6bbdc914e75e630c33a2047fd0079fa7c7cf
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
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 * This program is free software; you can redistribute it and/or
20 * modify it under the terms of the GNU General Public License
21 * as published by the Free Software Foundation; either version 2
22 * of the License, or (at your option) any later version.
24 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
25 * KIND, either express or implied.
27 ****************************************************************************/
30 * PortalPlayer i2c driver
34 #ifndef _I2C_PP_H
35 #define _I2C_PP_H
37 #define I2C_CTRL (*(volatile unsigned char*)(I2C_BASE+0x00))
38 #define I2C_ADDR (*(volatile unsigned char*)(I2C_BASE+0x04))
39 #define I2C_DATA(X) (*(volatile unsigned char*)(I2C_BASE+0xc+(4*X)))
40 #define I2C_STATUS (*(volatile unsigned char*)(I2C_BASE+0x1c))
42 /* I2C_CTRL bit definitions */
43 #define I2C_SEND 0x80
45 /* I2C_STATUS bit definitions */
46 #define I2C_BUSY (1<<6)
48 /* TODO: Fully implement i2c driver */
50 /* To be used by drivers that need to do multiple i2c operations
51 atomically */
52 void i2c_lock(void);
53 void i2c_unlock(void);
55 void i2c_init(void);
56 int i2c_readbyte(unsigned int dev_addr, int addr);
57 int pp_i2c_send(unsigned int addr, int data0, int data1);
58 int i2c_readbytes(unsigned int dev_addr, int addr, int len, unsigned char *data);
59 int i2c_sendbytes(unsigned int dev_addr, int len, const unsigned char *data);
61 #endif