initial commit with v2.6.9
[linux-2.6.9-moxart.git] / include / asm-ppc / pmac_low_i2c.h
blob809a5963d5e70432f51863d6af640604fa722b19
1 /*
2 * include/asm-ppc/pmac_low_i2c.h
4 * Copyright (C) 2003 Ben. Herrenschmidt (benh@kernel.crashing.org)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
12 #ifndef __PMAC_LOW_I2C_H__
13 #define __PMAC_LOW_I2C_H__
15 /* i2c mode (based on the platform functions format) */
16 enum {
17 pmac_low_i2c_mode_dumb = 1,
18 pmac_low_i2c_mode_std = 2,
19 pmac_low_i2c_mode_stdsub = 3,
20 pmac_low_i2c_mode_combined = 4,
23 /* RW bit in address */
24 enum {
25 pmac_low_i2c_read = 0x01,
26 pmac_low_i2c_write = 0x00
29 /* Init, called early during boot */
30 extern void pmac_init_low_i2c(void);
32 /* Locking functions exposed to i2c-keywest */
33 int pmac_low_i2c_lock(struct device_node *np);
34 int pmac_low_i2c_unlock(struct device_node *np);
36 /* Access functions for platform code */
37 int pmac_low_i2c_open(struct device_node *np, int channel);
38 int pmac_low_i2c_close(struct device_node *np);
39 int pmac_low_i2c_setmode(struct device_node *np, int mode);
40 int pmac_low_i2c_xfer(struct device_node *np, u8 addrdir, u8 subaddr, u8 *data, int len);
43 #endif /* __PMAC_LOW_I2C_H__ */