1 /* $NetBSD: pxa2x0_i2c.h,v 1.1 2006/12/17 16:03:33 peter Exp $ */
2 /* $OpenBSD: pxa2x0_i2c.h,v 1.2 2005/05/26 03:52:07 pascoe Exp $ */
5 * Copyright (c) 2005 Christopher Pascoe <pascoe@openbsd.org>
7 * Permission to use, copy, modify, and distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 #ifndef _PXA2X0_I2C_H_
21 #define _PXA2X0_I2C_H_
23 #include <machine/bus.h>
25 struct pxa2x0_i2c_softc
{
27 bus_space_tag_t sc_iot
;
28 bus_space_handle_t sc_ioh
;
32 int pxa2x0_i2c_attach_sub(struct pxa2x0_i2c_softc
*);
33 int pxa2x0_i2c_detach_sub(struct pxa2x0_i2c_softc
*);
34 void pxa2x0_i2c_init(struct pxa2x0_i2c_softc
*);
35 void pxa2x0_i2c_open(struct pxa2x0_i2c_softc
*);
36 void pxa2x0_i2c_close(struct pxa2x0_i2c_softc
*);
37 int pxa2x0_i2c_read(struct pxa2x0_i2c_softc
*sc
, u_char
, u_char
*);
38 int pxa2x0_i2c_write(struct pxa2x0_i2c_softc
*, u_char
, u_char
);
39 int pxa2x0_i2c_write_2(struct pxa2x0_i2c_softc
*, u_char
, u_short
);
40 int pxa2x0_i2c_quick(struct pxa2x0_i2c_softc
*sc
, u_char slave
, u_char rw
);