aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/algos/i2c-algo-pcf.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/i2c/algos/i2c-algo-pcf.h
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/i2c/algos/i2c-algo-pcf.h')
-rw-r--r--drivers/i2c/algos/i2c-algo-pcf.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/drivers/i2c/algos/i2c-algo-pcf.h b/drivers/i2c/algos/i2c-algo-pcf.h
new file mode 100644
index 000000000000..5263a9eeb8d7
--- /dev/null
+++ b/drivers/i2c/algos/i2c-algo-pcf.h
@@ -0,0 +1,76 @@
1/* -------------------------------------------------------------------- */
2/* i2c-pcf8584.h: PCF 8584 global defines */
3/* -------------------------------------------------------------------- */
4/* Copyright (C) 1996 Simon G. Vogl
5 1999 Hans Berglund
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
20/* -------------------------------------------------------------------- */
21
22/* With some changes from Frodo Looijaard <frodol@dds.nl> */
23
24#ifndef I2C_PCF8584_H
25#define I2C_PCF8584_H 1
26
27/* ----- Control register bits ---------------------------------------- */
28#define I2C_PCF_PIN 0x80
29#define I2C_PCF_ESO 0x40
30#define I2C_PCF_ES1 0x20
31#define I2C_PCF_ES2 0x10
32#define I2C_PCF_ENI 0x08
33#define I2C_PCF_STA 0x04
34#define I2C_PCF_STO 0x02
35#define I2C_PCF_ACK 0x01
36
37#define I2C_PCF_START (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)
38#define I2C_PCF_STOP (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STO | I2C_PCF_ACK)
39#define I2C_PCF_REPSTART ( I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)
40#define I2C_PCF_IDLE (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_ACK)
41
42/* ----- Status register bits ----------------------------------------- */
43/*#define I2C_PCF_PIN 0x80 as above*/
44
45#define I2C_PCF_INI 0x40 /* 1 if not initialized */
46#define I2C_PCF_STS 0x20
47#define I2C_PCF_BER 0x10
48#define I2C_PCF_AD0 0x08
49#define I2C_PCF_LRB 0x08
50#define I2C_PCF_AAS 0x04
51#define I2C_PCF_LAB 0x02
52#define I2C_PCF_BB 0x01
53
54/* ----- Chip clock frequencies --------------------------------------- */
55#define I2C_PCF_CLK3 0x00
56#define I2C_PCF_CLK443 0x10
57#define I2C_PCF_CLK6 0x14
58#define I2C_PCF_CLK 0x18
59#define I2C_PCF_CLK12 0x1c
60
61/* ----- transmission frequencies ------------------------------------- */
62#define I2C_PCF_TRNS90 0x00 /* 90 kHz */
63#define I2C_PCF_TRNS45 0x01 /* 45 kHz */
64#define I2C_PCF_TRNS11 0x02 /* 11 kHz */
65#define I2C_PCF_TRNS15 0x03 /* 1.5 kHz */
66
67
68/* ----- Access to internal registers according to ES1,ES2 ------------ */
69/* they are mapped to the data port ( a0 = 0 ) */
70/* available when ESO == 0 : */
71
72#define I2C_PCF_OWNADR 0
73#define I2C_PCF_INTREG I2C_PCF_ES2
74#define I2C_PCF_CLKREG I2C_PCF_ES1
75
76#endif /* I2C_PCF8584_H */