blob: 3fb8d51540dd8090c68d451767026ccc51636c3b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * include/asm-ppc/pmac_low_i2c.h
3 *
4 * Copyright (C) 2003 Ben. Herrenschmidt (benh@kernel.crashing.org)
5 *
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.
10 *
11 */
12#ifndef __PMAC_LOW_I2C_H__
13#define __PMAC_LOW_I2C_H__
Arnd Bergmann88ced032005-12-16 22:43:46 +010014#ifdef __KERNEL__
Linus Torvalds1da177e2005-04-16 15:20:36 -070015
16/* i2c mode (based on the platform functions format) */
17enum {
18 pmac_low_i2c_mode_dumb = 1,
19 pmac_low_i2c_mode_std = 2,
20 pmac_low_i2c_mode_stdsub = 3,
21 pmac_low_i2c_mode_combined = 4,
22};
23
24/* RW bit in address */
25enum {
26 pmac_low_i2c_read = 0x01,
27 pmac_low_i2c_write = 0x00
28};
29
30/* Init, called early during boot */
31extern void pmac_init_low_i2c(void);
32
33/* Locking functions exposed to i2c-keywest */
34int pmac_low_i2c_lock(struct device_node *np);
35int pmac_low_i2c_unlock(struct device_node *np);
36
37/* Access functions for platform code */
38int pmac_low_i2c_open(struct device_node *np, int channel);
39int pmac_low_i2c_close(struct device_node *np);
40int pmac_low_i2c_setmode(struct device_node *np, int mode);
41int pmac_low_i2c_xfer(struct device_node *np, u8 addrdir, u8 subaddr, u8 *data, int len);
42
43
Arnd Bergmann88ced032005-12-16 22:43:46 +010044#endif /* __KERNEL__ */
Linus Torvalds1da177e2005-04-16 15:20:36 -070045#endif /* __PMAC_LOW_I2C_H__ */