diff options
Diffstat (limited to 'Documentation/i2c')
-rw-r--r-- | Documentation/i2c/busses/i2c-i801 | 60 | ||||
-rw-r--r-- | Documentation/i2c/busses/i2c-parport | 15 | ||||
-rw-r--r-- | Documentation/i2c/busses/i2c-piix4 | 2 | ||||
-rw-r--r-- | Documentation/i2c/busses/i2c-viapro | 7 | ||||
-rw-r--r-- | Documentation/i2c/porting-clients | 6 | ||||
-rw-r--r-- | Documentation/i2c/smbus-protocol | 2 | ||||
-rw-r--r-- | Documentation/i2c/writing-clients | 58 |
7 files changed, 134 insertions, 16 deletions
diff --git a/Documentation/i2c/busses/i2c-i801 b/Documentation/i2c/busses/i2c-i801 index 3db69a086c41..c34f0db78a30 100644 --- a/Documentation/i2c/busses/i2c-i801 +++ b/Documentation/i2c/busses/i2c-i801 | |||
@@ -48,14 +48,9 @@ following: | |||
48 | The SMBus controller is function 3 in device 1f. Class 0c05 is SMBus Serial | 48 | The SMBus controller is function 3 in device 1f. Class 0c05 is SMBus Serial |
49 | Controller. | 49 | Controller. |
50 | 50 | ||
51 | If you do NOT see the 24x3 device at function 3, and you can't figure out | ||
52 | any way in the BIOS to enable it, | ||
53 | |||
54 | The ICH chips are quite similar to Intel's PIIX4 chip, at least in the | 51 | The ICH chips are quite similar to Intel's PIIX4 chip, at least in the |
55 | SMBus controller. | 52 | SMBus controller. |
56 | 53 | ||
57 | See the file i2c-piix4 for some additional information. | ||
58 | |||
59 | 54 | ||
60 | Process Call Support | 55 | Process Call Support |
61 | -------------------- | 56 | -------------------- |
@@ -74,6 +69,61 @@ SMBus 2.0 Support | |||
74 | 69 | ||
75 | The 82801DB (ICH4) and later chips support several SMBus 2.0 features. | 70 | The 82801DB (ICH4) and later chips support several SMBus 2.0 features. |
76 | 71 | ||
72 | |||
73 | Hidden ICH SMBus | ||
74 | ---------------- | ||
75 | |||
76 | If your system has an Intel ICH south bridge, but you do NOT see the | ||
77 | SMBus device at 00:1f.3 in lspci, and you can't figure out any way in the | ||
78 | BIOS to enable it, it means it has been hidden by the BIOS code. Asus is | ||
79 | well known for first doing this on their P4B motherboard, and many other | ||
80 | boards after that. Some vendor machines are affected as well. | ||
81 | |||
82 | The first thing to try is the "i2c_ec" ACPI driver. It could be that the | ||
83 | SMBus was hidden on purpose because it'll be driven by ACPI. If the | ||
84 | i2c_ec driver works for you, just forget about the i2c-i801 driver and | ||
85 | don't try to unhide the ICH SMBus. Even if i2c_ec doesn't work, you | ||
86 | better make sure that the SMBus isn't used by the ACPI code. Try loading | ||
87 | the "fan" and "thermal" drivers, and check in /proc/acpi/fan and | ||
88 | /proc/acpi/thermal_zone. If you find anything there, it's likely that | ||
89 | the ACPI is accessing the SMBus and it's safer not to unhide it. Only | ||
90 | once you are certain that ACPI isn't using the SMBus, you can attempt | ||
91 | to unhide it. | ||
92 | |||
93 | In order to unhide the SMBus, we need to change the value of a PCI | ||
94 | register before the kernel enumerates the PCI devices. This is done in | ||
95 | drivers/pci/quirks.c, where all affected boards must be listed (see | ||
96 | function asus_hides_smbus_hostbridge.) If the SMBus device is missing, | ||
97 | and you think there's something interesting on the SMBus (e.g. a | ||
98 | hardware monitoring chip), you need to add your board to the list. | ||
99 | |||
100 | The motherboard is identified using the subvendor and subdevice IDs of the | ||
101 | host bridge PCI device. Get yours with "lspci -n -v -s 00:00.0": | ||
102 | |||
103 | 00:00.0 Class 0600: 8086:2570 (rev 02) | ||
104 | Subsystem: 1043:80f2 | ||
105 | Flags: bus master, fast devsel, latency 0 | ||
106 | Memory at fc000000 (32-bit, prefetchable) [size=32M] | ||
107 | Capabilities: [e4] #09 [2106] | ||
108 | Capabilities: [a0] AGP version 3.0 | ||
109 | |||
110 | Here the host bridge ID is 2570 (82865G/PE/P), the subvendor ID is 1043 | ||
111 | (Asus) and the subdevice ID is 80f2 (P4P800-X). You can find the symbolic | ||
112 | names for the bridge ID and the subvendor ID in include/linux/pci_ids.h, | ||
113 | and then add a case for your subdevice ID at the right place in | ||
114 | drivers/pci/quirks.c. Then please give it very good testing, to make sure | ||
115 | that the unhidden SMBus doesn't conflict with e.g. ACPI. | ||
116 | |||
117 | If it works, proves useful (i.e. there are usable chips on the SMBus) | ||
118 | and seems safe, please submit a patch for inclusion into the kernel. | ||
119 | |||
120 | Note: There's a useful script in lm_sensors 2.10.2 and later, named | ||
121 | unhide_ICH_SMBus (in prog/hotplug), which uses the fakephp driver to | ||
122 | temporarily unhide the SMBus without having to patch and recompile your | ||
123 | kernel. It's very convenient if you just want to check if there's | ||
124 | anything interesting on your hidden ICH SMBus. | ||
125 | |||
126 | |||
77 | ********************** | 127 | ********************** |
78 | The lm_sensors project gratefully acknowledges the support of Texas | 128 | The lm_sensors project gratefully acknowledges the support of Texas |
79 | Instruments in the initial development of this driver. | 129 | Instruments in the initial development of this driver. |
diff --git a/Documentation/i2c/busses/i2c-parport b/Documentation/i2c/busses/i2c-parport index 77b995dfca22..dceaba1ad930 100644 --- a/Documentation/i2c/busses/i2c-parport +++ b/Documentation/i2c/busses/i2c-parport | |||
@@ -19,6 +19,7 @@ It currently supports the following devices: | |||
19 | * (type=4) Analog Devices ADM1032 evaluation board | 19 | * (type=4) Analog Devices ADM1032 evaluation board |
20 | * (type=5) Analog Devices evaluation boards: ADM1025, ADM1030, ADM1031 | 20 | * (type=5) Analog Devices evaluation boards: ADM1025, ADM1030, ADM1031 |
21 | * (type=6) Barco LPT->DVI (K5800236) adapter | 21 | * (type=6) Barco LPT->DVI (K5800236) adapter |
22 | * (type=7) One For All JP1 parallel port adapter | ||
22 | 23 | ||
23 | These devices use different pinout configurations, so you have to tell | 24 | These devices use different pinout configurations, so you have to tell |
24 | the driver what you have, using the type module parameter. There is no | 25 | the driver what you have, using the type module parameter. There is no |
@@ -157,3 +158,17 @@ many more, using /dev/velleman. | |||
157 | http://home.wanadoo.nl/hihihi/libk8005.htm | 158 | http://home.wanadoo.nl/hihihi/libk8005.htm |
158 | http://struyve.mine.nu:8080/index.php?block=k8000 | 159 | http://struyve.mine.nu:8080/index.php?block=k8000 |
159 | http://sourceforge.net/projects/libk8005/ | 160 | http://sourceforge.net/projects/libk8005/ |
161 | |||
162 | |||
163 | One For All JP1 parallel port adapter | ||
164 | ------------------------------------- | ||
165 | |||
166 | The JP1 project revolves around a set of remote controls which expose | ||
167 | the I2C bus their internal configuration EEPROM lives on via a 6 pin | ||
168 | jumper in the battery compartment. More details can be found at: | ||
169 | |||
170 | http://www.hifi-remote.com/jp1/ | ||
171 | |||
172 | Details of the simple parallel port hardware can be found at: | ||
173 | |||
174 | http://www.hifi-remote.com/jp1/hardware.shtml | ||
diff --git a/Documentation/i2c/busses/i2c-piix4 b/Documentation/i2c/busses/i2c-piix4 index 921476333235..7cbe43fa2701 100644 --- a/Documentation/i2c/busses/i2c-piix4 +++ b/Documentation/i2c/busses/i2c-piix4 | |||
@@ -6,7 +6,7 @@ Supported adapters: | |||
6 | Datasheet: Publicly available at the Intel website | 6 | Datasheet: Publicly available at the Intel website |
7 | * ServerWorks OSB4, CSB5, CSB6 and HT-1000 southbridges | 7 | * ServerWorks OSB4, CSB5, CSB6 and HT-1000 southbridges |
8 | Datasheet: Only available via NDA from ServerWorks | 8 | Datasheet: Only available via NDA from ServerWorks |
9 | * ATI IXP southbridges IXP200, IXP300, IXP400 | 9 | * ATI IXP200, IXP300, IXP400 and SB600 southbridges |
10 | Datasheet: Not publicly available | 10 | Datasheet: Not publicly available |
11 | * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge | 11 | * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge |
12 | Datasheet: Publicly available at the SMSC website http://www.smsc.com | 12 | Datasheet: Publicly available at the SMSC website http://www.smsc.com |
diff --git a/Documentation/i2c/busses/i2c-viapro b/Documentation/i2c/busses/i2c-viapro index 25680346e0ac..775f489e86f6 100644 --- a/Documentation/i2c/busses/i2c-viapro +++ b/Documentation/i2c/busses/i2c-viapro | |||
@@ -13,6 +13,9 @@ Supported adapters: | |||
13 | * VIA Technologies, Inc. VT8235, VT8237R, VT8237A, VT8251 | 13 | * VIA Technologies, Inc. VT8235, VT8237R, VT8237A, VT8251 |
14 | Datasheet: available on request and under NDA from VIA | 14 | Datasheet: available on request and under NDA from VIA |
15 | 15 | ||
16 | * VIA Technologies, Inc. CX700 | ||
17 | Datasheet: available on request and under NDA from VIA | ||
18 | |||
16 | Authors: | 19 | Authors: |
17 | Kyösti Mälkki <kmalkki@cc.hut.fi>, | 20 | Kyösti Mälkki <kmalkki@cc.hut.fi>, |
18 | Mark D. Studebaker <mdsxyz123@yahoo.com>, | 21 | Mark D. Studebaker <mdsxyz123@yahoo.com>, |
@@ -44,6 +47,7 @@ Your lspci -n listing must show one of these : | |||
44 | device 1106:3227 (VT8237R) | 47 | device 1106:3227 (VT8237R) |
45 | device 1106:3337 (VT8237A) | 48 | device 1106:3337 (VT8237A) |
46 | device 1106:3287 (VT8251) | 49 | device 1106:3287 (VT8251) |
50 | device 1106:8324 (CX700) | ||
47 | 51 | ||
48 | If none of these show up, you should look in the BIOS for settings like | 52 | If none of these show up, you should look in the BIOS for settings like |
49 | enable ACPI / SMBus or even USB. | 53 | enable ACPI / SMBus or even USB. |
@@ -51,3 +55,6 @@ enable ACPI / SMBus or even USB. | |||
51 | Except for the oldest chips (VT82C596A/B, VT82C686A and most probably | 55 | Except for the oldest chips (VT82C596A/B, VT82C686A and most probably |
52 | VT8231), this driver supports I2C block transactions. Such transactions | 56 | VT8231), this driver supports I2C block transactions. Such transactions |
53 | are mainly useful to read from and write to EEPROMs. | 57 | are mainly useful to read from and write to EEPROMs. |
58 | |||
59 | The CX700 additionally appears to support SMBus PEC, although this driver | ||
60 | doesn't implement it yet. | ||
diff --git a/Documentation/i2c/porting-clients b/Documentation/i2c/porting-clients index f03c2a02f806..ca272b263a92 100644 --- a/Documentation/i2c/porting-clients +++ b/Documentation/i2c/porting-clients | |||
@@ -129,6 +129,12 @@ Technical changes: | |||
129 | structure, those name member should be initialized to a driver name | 129 | structure, those name member should be initialized to a driver name |
130 | string. i2c_driver itself has no name member anymore. | 130 | string. i2c_driver itself has no name member anymore. |
131 | 131 | ||
132 | * [Driver model] Instead of shutdown or reboot notifiers, provide a | ||
133 | shutdown() method in your driver. | ||
134 | |||
135 | * [Power management] Use the driver model suspend() and resume() | ||
136 | callbacks instead of the obsolete pm_register() calls. | ||
137 | |||
132 | Coding policy: | 138 | Coding policy: |
133 | 139 | ||
134 | * [Copyright] Use (C), not (c), for copyright. | 140 | * [Copyright] Use (C), not (c), for copyright. |
diff --git a/Documentation/i2c/smbus-protocol b/Documentation/i2c/smbus-protocol index 09f5e5ca4927..8a653c60d25a 100644 --- a/Documentation/i2c/smbus-protocol +++ b/Documentation/i2c/smbus-protocol | |||
@@ -97,7 +97,7 @@ SMBus Write Word Data | |||
97 | ===================== | 97 | ===================== |
98 | 98 | ||
99 | This is the opposite operation of the Read Word Data command. 16 bits | 99 | This is the opposite operation of the Read Word Data command. 16 bits |
100 | of data is read from a device, from a designated register that is | 100 | of data is written to a device, to the designated register that is |
101 | specified through the Comm byte. | 101 | specified through the Comm byte. |
102 | 102 | ||
103 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] P | 103 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] P |
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients index 3a057c8e5507..fbcff96f4ca1 100644 --- a/Documentation/i2c/writing-clients +++ b/Documentation/i2c/writing-clients | |||
@@ -21,20 +21,26 @@ The driver structure | |||
21 | 21 | ||
22 | Usually, you will implement a single driver structure, and instantiate | 22 | Usually, you will implement a single driver structure, and instantiate |
23 | all clients from it. Remember, a driver structure contains general access | 23 | all clients from it. Remember, a driver structure contains general access |
24 | routines, a client structure specific information like the actual I2C | 24 | routines, and should be zero-initialized except for fields with data you |
25 | address. | 25 | provide. A client structure holds device-specific information like the |
26 | driver model device node, and its I2C address. | ||
26 | 27 | ||
27 | static struct i2c_driver foo_driver = { | 28 | static struct i2c_driver foo_driver = { |
28 | .driver = { | 29 | .driver = { |
29 | .name = "foo", | 30 | .name = "foo", |
30 | }, | 31 | }, |
31 | .attach_adapter = &foo_attach_adapter, | 32 | .attach_adapter = foo_attach_adapter, |
32 | .detach_client = &foo_detach_client, | 33 | .detach_client = foo_detach_client, |
33 | .command = &foo_command /* may be NULL */ | 34 | .shutdown = foo_shutdown, /* optional */ |
35 | .suspend = foo_suspend, /* optional */ | ||
36 | .resume = foo_resume, /* optional */ | ||
37 | .command = foo_command, /* optional */ | ||
34 | } | 38 | } |
35 | 39 | ||
36 | The name field must match the driver name, including the case. It must not | 40 | The name field is the driver name, and must not contain spaces. It |
37 | contain spaces, and may be up to 31 characters long. | 41 | should match the module name (if the driver can be compiled as a module), |
42 | although you can use MODULE_ALIAS (passing "foo" in this example) to add | ||
43 | another name for the module. | ||
38 | 44 | ||
39 | All other fields are for call-back functions which will be explained | 45 | All other fields are for call-back functions which will be explained |
40 | below. | 46 | below. |
@@ -43,11 +49,18 @@ below. | |||
43 | Extra client data | 49 | Extra client data |
44 | ================= | 50 | ================= |
45 | 51 | ||
46 | The client structure has a special `data' field that can point to any | 52 | Each client structure has a special `data' field that can point to any |
47 | structure at all. You can use this to keep client-specific data. You | 53 | structure at all. You should use this to keep device-specific data, |
54 | especially in drivers that handle multiple I2C or SMBUS devices. You | ||
48 | do not always need this, but especially for `sensors' drivers, it can | 55 | do not always need this, but especially for `sensors' drivers, it can |
49 | be very useful. | 56 | be very useful. |
50 | 57 | ||
58 | /* store the value */ | ||
59 | void i2c_set_clientdata(struct i2c_client *client, void *data); | ||
60 | |||
61 | /* retrieve the value */ | ||
62 | void *i2c_get_clientdata(struct i2c_client *client); | ||
63 | |||
51 | An example structure is below. | 64 | An example structure is below. |
52 | 65 | ||
53 | struct foo_data { | 66 | struct foo_data { |
@@ -493,6 +506,33 @@ by `__init_data'. Hose functions and structures can be removed after | |||
493 | kernel booting (or module loading) is completed. | 506 | kernel booting (or module loading) is completed. |
494 | 507 | ||
495 | 508 | ||
509 | Power Management | ||
510 | ================ | ||
511 | |||
512 | If your I2C device needs special handling when entering a system low | ||
513 | power state -- like putting a transceiver into a low power mode, or | ||
514 | activating a system wakeup mechanism -- do that in the suspend() method. | ||
515 | The resume() method should reverse what the suspend() method does. | ||
516 | |||
517 | These are standard driver model calls, and they work just like they | ||
518 | would for any other driver stack. The calls can sleep, and can use | ||
519 | I2C messaging to the device being suspended or resumed (since their | ||
520 | parent I2C adapter is active when these calls are issued, and IRQs | ||
521 | are still enabled). | ||
522 | |||
523 | |||
524 | System Shutdown | ||
525 | =============== | ||
526 | |||
527 | If your I2C device needs special handling when the system shuts down | ||
528 | or reboots (including kexec) -- like turning something off -- use a | ||
529 | shutdown() method. | ||
530 | |||
531 | Again, this is a standard driver model call, working just like it | ||
532 | would for any other driver stack: the calls can sleep, and can use | ||
533 | I2C messaging. | ||
534 | |||
535 | |||
496 | Command function | 536 | Command function |
497 | ================ | 537 | ================ |
498 | 538 | ||