pcf8584var.h revision 1.3.20.1 1 1.3.20.1 uebayasi /* $NetBSD: pcf8584var.h,v 1.3.20.1 2010/04/30 14:43:20 uebayasi Exp $ */
2 1.3.20.1 uebayasi /* $OpenBSD: pcf8584var.h,v 1.5 2007/10/20 18:46:21 kettenis Exp $ */
3 1.1 tnn
4 1.3.20.1 uebayasi /*
5 1.3.20.1 uebayasi * Copyright (c) 2006 David Gwynne <dlg (at) openbsd.org>
6 1.1 tnn *
7 1.3.20.1 uebayasi * Permission to use, copy, modify, and distribute this software for any
8 1.3.20.1 uebayasi * purpose with or without fee is hereby granted, provided that the above
9 1.3.20.1 uebayasi * copyright notice and this permission notice appear in all copies.
10 1.1 tnn *
11 1.3.20.1 uebayasi * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 1.3.20.1 uebayasi * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 1.3.20.1 uebayasi * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 1.3.20.1 uebayasi * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 1.3.20.1 uebayasi * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 1.3.20.1 uebayasi * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 1.3.20.1 uebayasi * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 1.1 tnn */
19 1.1 tnn
20 1.3.20.1 uebayasi struct pcfiic_softc {
21 1.3.20.1 uebayasi device_t sc_dev;
22 1.3.20.1 uebayasi
23 1.3.20.1 uebayasi bus_space_tag_t sc_iot;
24 1.3.20.1 uebayasi bus_space_handle_t sc_ioh;
25 1.3.20.1 uebayasi bus_space_handle_t sc_ioh2;
26 1.3.20.1 uebayasi int sc_master;
27 1.3.20.1 uebayasi u_int8_t sc_addr;
28 1.3.20.1 uebayasi u_int8_t sc_clock;
29 1.3.20.1 uebayasi u_int8_t sc_regmap[2];
30 1.3.20.1 uebayasi
31 1.3.20.1 uebayasi int sc_poll;
32 1.1 tnn
33 1.3.20.1 uebayasi struct i2c_controller sc_i2c;
34 1.3.20.1 uebayasi krwlock_t sc_lock;
35 1.1 tnn };
36 1.1 tnn
37 1.3.20.1 uebayasi /* clock divisor settings */
38 1.3.20.1 uebayasi #define PCF_CLOCK_3 0x00 /* 3 MHz */
39 1.3.20.1 uebayasi #define PCF_CLOCK_4_43 0x10 /* 4.43 MHz */
40 1.3.20.1 uebayasi #define PCF_CLOCK_6 0x14 /* 6 MHz */
41 1.3.20.1 uebayasi #define PCF_CLOCK_8 0x18 /* 8 MHz */
42 1.3.20.1 uebayasi #define PCF_CLOCK_12 0x1c /* 12 MHz */
43 1.3.20.1 uebayasi
44 1.3.20.1 uebayasi /* SCL frequency settings */
45 1.3.20.1 uebayasi #define PCF_FREQ_90 0x00 /* 90 kHz */
46 1.3.20.1 uebayasi #define PCF_FREQ_45 0x01 /* 45 kHz */
47 1.3.20.1 uebayasi #define PCF_FREQ_11 0x02 /* 11 kHz */
48 1.3.20.1 uebayasi #define PCF_FREQ_1_5 0x03 /* 1.5 kHz */
49 1.3.20.1 uebayasi
50 1.3.20.1 uebayasi void pcfiic_attach(struct pcfiic_softc *, i2c_addr_t, u_int8_t, int);
51 1.3.20.1 uebayasi int pcfiic_intr(void *);
52