diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /Documentation/i2c | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'Documentation/i2c')
-rw-r--r-- | Documentation/i2c/busses/i2c-i801 | 15 | ||||
-rw-r--r-- | Documentation/i2c/busses/i2c-piix4 | 9 | ||||
-rw-r--r-- | Documentation/i2c/busses/i2c-viapro | 6 | ||||
-rw-r--r-- | Documentation/i2c/busses/scx200_acb | 2 | ||||
-rw-r--r-- | Documentation/i2c/functionality | 9 | ||||
-rw-r--r-- | Documentation/i2c/i2c-protocol | 9 | ||||
-rw-r--r-- | Documentation/i2c/instantiating-devices | 6 | ||||
-rw-r--r-- | Documentation/i2c/muxes/i2c-mux-gpio | 83 | ||||
-rw-r--r-- | Documentation/i2c/smbus-protocol | 48 | ||||
-rw-r--r-- | Documentation/i2c/ten-bit-addresses | 36 | ||||
-rw-r--r-- | Documentation/i2c/writing-clients | 23 |
11 files changed, 46 insertions, 200 deletions
diff --git a/Documentation/i2c/busses/i2c-i801 b/Documentation/i2c/busses/i2c-i801 index 157416e78cc..2871fd50034 100644 --- a/Documentation/i2c/busses/i2c-i801 +++ b/Documentation/i2c/busses/i2c-i801 | |||
@@ -20,8 +20,6 @@ Supported adapters: | |||
20 | * Intel Patsburg (PCH) | 20 | * Intel Patsburg (PCH) |
21 | * Intel DH89xxCC (PCH) | 21 | * Intel DH89xxCC (PCH) |
22 | * Intel Panther Point (PCH) | 22 | * Intel Panther Point (PCH) |
23 | * Intel Lynx Point (PCH) | ||
24 | * Intel Lynx Point-LP (PCH) | ||
25 | Datasheets: Publicly available at the Intel website | 23 | Datasheets: Publicly available at the Intel website |
26 | 24 | ||
27 | On Intel Patsburg and later chipsets, both the normal host SMBus controller | 25 | On Intel Patsburg and later chipsets, both the normal host SMBus controller |
@@ -39,10 +37,9 @@ Module Parameters | |||
39 | Disable selected features normally supported by the device. This makes it | 37 | Disable selected features normally supported by the device. This makes it |
40 | possible to work around possible driver or hardware bugs if the feature in | 38 | possible to work around possible driver or hardware bugs if the feature in |
41 | question doesn't work as intended for whatever reason. Bit values: | 39 | question doesn't work as intended for whatever reason. Bit values: |
42 | 0x01 disable SMBus PEC | 40 | 1 disable SMBus PEC |
43 | 0x02 disable the block buffer | 41 | 2 disable the block buffer |
44 | 0x08 disable the I2C block read functionality | 42 | 8 disable the I2C block read functionality |
45 | 0x10 don't use interrupts | ||
46 | 43 | ||
47 | 44 | ||
48 | Description | 45 | Description |
@@ -88,12 +85,6 @@ SMBus 2.0 Support | |||
88 | The 82801DB (ICH4) and later chips support several SMBus 2.0 features. | 85 | The 82801DB (ICH4) and later chips support several SMBus 2.0 features. |
89 | 86 | ||
90 | 87 | ||
91 | Interrupt Support | ||
92 | ----------------- | ||
93 | |||
94 | PCI interrupt support is supported on the 82801EB (ICH5) and later chips. | ||
95 | |||
96 | |||
97 | Hidden ICH SMBus | 88 | Hidden ICH SMBus |
98 | ---------------- | 89 | ---------------- |
99 | 90 | ||
diff --git a/Documentation/i2c/busses/i2c-piix4 b/Documentation/i2c/busses/i2c-piix4 index 1e6634f54c5..475bb4ae072 100644 --- a/Documentation/i2c/busses/i2c-piix4 +++ b/Documentation/i2c/busses/i2c-piix4 | |||
@@ -8,11 +8,6 @@ Supported adapters: | |||
8 | Datasheet: Only available via NDA from ServerWorks | 8 | Datasheet: Only available via NDA from ServerWorks |
9 | * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges | 9 | * ATI IXP200, IXP300, IXP400, SB600, SB700 and SB800 southbridges |
10 | Datasheet: Not publicly available | 10 | Datasheet: Not publicly available |
11 | SB700 register reference available at: | ||
12 | http://support.amd.com/us/Embedded_TechDocs/43009_sb7xx_rrg_pub_1.00.pdf | ||
13 | * AMD SP5100 (SB700 derivative found on some server mainboards) | ||
14 | Datasheet: Publicly available at the AMD website | ||
15 | http://support.amd.com/us/Embedded_TechDocs/44413.pdf | ||
16 | * AMD Hudson-2 | 11 | * AMD Hudson-2 |
17 | Datasheet: Not publicly available | 12 | Datasheet: Not publicly available |
18 | * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge | 13 | * Standard Microsystems (SMSC) SLC90E66 (Victory66) southbridge |
@@ -73,10 +68,6 @@ this driver on those mainboards. | |||
73 | The ServerWorks Southbridges, the Intel 440MX, and the Victory66 are | 68 | The ServerWorks Southbridges, the Intel 440MX, and the Victory66 are |
74 | identical to the PIIX4 in I2C/SMBus support. | 69 | identical to the PIIX4 in I2C/SMBus support. |
75 | 70 | ||
76 | The AMD SB700 and SP5100 chipsets implement two PIIX4-compatible SMBus | ||
77 | controllers. If your BIOS initializes the secondary controller, it will | ||
78 | be detected by this driver as an "Auxiliary SMBus Host Controller". | ||
79 | |||
80 | If you own Force CPCI735 motherboard or other OSB4 based systems you may need | 71 | If you own Force CPCI735 motherboard or other OSB4 based systems you may need |
81 | to change the SMBus Interrupt Select register so the SMBus controller uses | 72 | to change the SMBus Interrupt Select register so the SMBus controller uses |
82 | the SMI mode. | 73 | the SMI mode. |
diff --git a/Documentation/i2c/busses/i2c-viapro b/Documentation/i2c/busses/i2c-viapro index b88f91ae580..2e758b0e945 100644 --- a/Documentation/i2c/busses/i2c-viapro +++ b/Documentation/i2c/busses/i2c-viapro | |||
@@ -20,10 +20,7 @@ Supported adapters: | |||
20 | Datasheet: available on http://linux.via.com.tw | 20 | Datasheet: available on http://linux.via.com.tw |
21 | 21 | ||
22 | * VIA Technologies, Inc. VX855/VX875 | 22 | * VIA Technologies, Inc. VX855/VX875 |
23 | Datasheet: available on http://linux.via.com.tw | 23 | Datasheet: Availability unknown |
24 | |||
25 | * VIA Technologies, Inc. VX900 | ||
26 | Datasheet: available on http://linux.via.com.tw | ||
27 | 24 | ||
28 | Authors: | 25 | Authors: |
29 | Kyösti Mälkki <kmalkki@cc.hut.fi>, | 26 | Kyösti Mälkki <kmalkki@cc.hut.fi>, |
@@ -60,7 +57,6 @@ Your lspci -n listing must show one of these : | |||
60 | device 1106:8324 (CX700) | 57 | device 1106:8324 (CX700) |
61 | device 1106:8353 (VX800/VX820) | 58 | device 1106:8353 (VX800/VX820) |
62 | device 1106:8409 (VX855/VX875) | 59 | device 1106:8409 (VX855/VX875) |
63 | device 1106:8410 (VX900) | ||
64 | 60 | ||
65 | If none of these show up, you should look in the BIOS for settings like | 61 | If none of these show up, you should look in the BIOS for settings like |
66 | enable ACPI / SMBus or even USB. | 62 | enable ACPI / SMBus or even USB. |
diff --git a/Documentation/i2c/busses/scx200_acb b/Documentation/i2c/busses/scx200_acb index ce83c871fe9..7c07883d4df 100644 --- a/Documentation/i2c/busses/scx200_acb +++ b/Documentation/i2c/busses/scx200_acb | |||
@@ -28,5 +28,5 @@ If the scx200_acb driver is built into the kernel, add the following | |||
28 | parameter to your boot command line: | 28 | parameter to your boot command line: |
29 | scx200_acb.base=0x810,0x820 | 29 | scx200_acb.base=0x810,0x820 |
30 | If the scx200_acb driver is built as a module, add the following line to | 30 | If the scx200_acb driver is built as a module, add the following line to |
31 | a configuration file in /etc/modprobe.d/ instead: | 31 | the file /etc/modprobe.conf instead: |
32 | options scx200_acb base=0x810,0x820 | 32 | options scx200_acb base=0x810,0x820 |
diff --git a/Documentation/i2c/functionality b/Documentation/i2c/functionality index b0ff2ab596c..42c17c1fb3c 100644 --- a/Documentation/i2c/functionality +++ b/Documentation/i2c/functionality | |||
@@ -18,9 +18,9 @@ For the most up-to-date list of functionality constants, please check | |||
18 | adapters typically can not do these) | 18 | adapters typically can not do these) |
19 | I2C_FUNC_10BIT_ADDR Handles the 10-bit address extensions | 19 | I2C_FUNC_10BIT_ADDR Handles the 10-bit address extensions |
20 | I2C_FUNC_PROTOCOL_MANGLING Knows about the I2C_M_IGNORE_NAK, | 20 | I2C_FUNC_PROTOCOL_MANGLING Knows about the I2C_M_IGNORE_NAK, |
21 | I2C_M_REV_DIR_ADDR and I2C_M_NO_RD_ACK | 21 | I2C_M_REV_DIR_ADDR, I2C_M_NOSTART and |
22 | flags (which modify the I2C protocol!) | 22 | I2C_M_NO_RD_ACK flags (which modify the |
23 | I2C_FUNC_NOSTART Can skip repeated start sequence | 23 | I2C protocol!) |
24 | I2C_FUNC_SMBUS_QUICK Handles the SMBus write_quick command | 24 | I2C_FUNC_SMBUS_QUICK Handles the SMBus write_quick command |
25 | I2C_FUNC_SMBUS_READ_BYTE Handles the SMBus read_byte command | 25 | I2C_FUNC_SMBUS_READ_BYTE Handles the SMBus read_byte command |
26 | I2C_FUNC_SMBUS_WRITE_BYTE Handles the SMBus write_byte command | 26 | I2C_FUNC_SMBUS_WRITE_BYTE Handles the SMBus write_byte command |
@@ -50,9 +50,6 @@ A few combinations of the above flags are also defined for your convenience: | |||
50 | emulated by a real I2C adapter (using | 50 | emulated by a real I2C adapter (using |
51 | the transparent emulation layer) | 51 | the transparent emulation layer) |
52 | 52 | ||
53 | In kernel versions prior to 3.5 I2C_FUNC_NOSTART was implemented as | ||
54 | part of I2C_FUNC_PROTOCOL_MANGLING. | ||
55 | |||
56 | 53 | ||
57 | ADAPTER IMPLEMENTATION | 54 | ADAPTER IMPLEMENTATION |
58 | ---------------------- | 55 | ---------------------- |
diff --git a/Documentation/i2c/i2c-protocol b/Documentation/i2c/i2c-protocol index 0b3e62d1f77..10518dd5881 100644 --- a/Documentation/i2c/i2c-protocol +++ b/Documentation/i2c/i2c-protocol | |||
@@ -49,9 +49,7 @@ a byte read, followed by a byte write: | |||
49 | Modified transactions | 49 | Modified transactions |
50 | ===================== | 50 | ===================== |
51 | 51 | ||
52 | The following modifications to the I2C protocol can also be generated, | 52 | We have found some I2C devices that needs the following modifications: |
53 | with the exception of I2C_M_NOSTART these are usually only needed to | ||
54 | work around device issues: | ||
55 | 53 | ||
56 | Flag I2C_M_NOSTART: | 54 | Flag I2C_M_NOSTART: |
57 | In a combined transaction, no 'S Addr Wr/Rd [A]' is generated at some | 55 | In a combined transaction, no 'S Addr Wr/Rd [A]' is generated at some |
@@ -62,11 +60,6 @@ work around device issues: | |||
62 | we do not generate Addr, but we do generate the startbit S. This will | 60 | we do not generate Addr, but we do generate the startbit S. This will |
63 | probably confuse all other clients on your bus, so don't try this. | 61 | probably confuse all other clients on your bus, so don't try this. |
64 | 62 | ||
65 | This is often used to gather transmits from multiple data buffers in | ||
66 | system memory into something that appears as a single transfer to the | ||
67 | I2C device but may also be used between direction changes by some | ||
68 | rare devices. | ||
69 | |||
70 | Flags I2C_M_REV_DIR_ADDR | 63 | Flags I2C_M_REV_DIR_ADDR |
71 | This toggles the Rd/Wr flag. That is, if you want to do a write, but | 64 | This toggles the Rd/Wr flag. That is, if you want to do a write, but |
72 | need to emit an Rd instead of a Wr, or vice versa, you set this | 65 | need to emit an Rd instead of a Wr, or vice versa, you set this |
diff --git a/Documentation/i2c/instantiating-devices b/Documentation/i2c/instantiating-devices index 22182660dda..9edb75d8c9b 100644 --- a/Documentation/i2c/instantiating-devices +++ b/Documentation/i2c/instantiating-devices | |||
@@ -87,11 +87,11 @@ it may have different addresses from one board to the next (manufacturer | |||
87 | changing its design without notice). In this case, you can call | 87 | changing its design without notice). In this case, you can call |
88 | i2c_new_probed_device() instead of i2c_new_device(). | 88 | i2c_new_probed_device() instead of i2c_new_device(). |
89 | 89 | ||
90 | Example (from the nxp OHCI driver): | 90 | Example (from the pnx4008 OHCI driver): |
91 | 91 | ||
92 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; | 92 | static const unsigned short normal_i2c[] = { 0x2c, 0x2d, I2C_CLIENT_END }; |
93 | 93 | ||
94 | static int usb_hcd_nxp_probe(struct platform_device *pdev) | 94 | static int __devinit usb_hcd_pnx4008_probe(struct platform_device *pdev) |
95 | { | 95 | { |
96 | (...) | 96 | (...) |
97 | struct i2c_adapter *i2c_adap; | 97 | struct i2c_adapter *i2c_adap; |
@@ -100,7 +100,7 @@ static int usb_hcd_nxp_probe(struct platform_device *pdev) | |||
100 | (...) | 100 | (...) |
101 | i2c_adap = i2c_get_adapter(2); | 101 | i2c_adap = i2c_get_adapter(2); |
102 | memset(&i2c_info, 0, sizeof(struct i2c_board_info)); | 102 | memset(&i2c_info, 0, sizeof(struct i2c_board_info)); |
103 | strlcpy(i2c_info.type, "isp1301_nxp", I2C_NAME_SIZE); | 103 | strlcpy(i2c_info.type, "isp1301_pnx", I2C_NAME_SIZE); |
104 | isp1301_i2c_client = i2c_new_probed_device(i2c_adap, &i2c_info, | 104 | isp1301_i2c_client = i2c_new_probed_device(i2c_adap, &i2c_info, |
105 | normal_i2c, NULL); | 105 | normal_i2c, NULL); |
106 | i2c_put_adapter(i2c_adap); | 106 | i2c_put_adapter(i2c_adap); |
diff --git a/Documentation/i2c/muxes/i2c-mux-gpio b/Documentation/i2c/muxes/i2c-mux-gpio deleted file mode 100644 index d4d91a53fc3..00000000000 --- a/Documentation/i2c/muxes/i2c-mux-gpio +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | Kernel driver i2c-gpio-mux | ||
2 | |||
3 | Author: Peter Korsgaard <peter.korsgaard@barco.com> | ||
4 | |||
5 | Description | ||
6 | ----------- | ||
7 | |||
8 | i2c-gpio-mux is an i2c mux driver providing access to I2C bus segments | ||
9 | from a master I2C bus and a hardware MUX controlled through GPIO pins. | ||
10 | |||
11 | E.G.: | ||
12 | |||
13 | ---------- ---------- Bus segment 1 - - - - - | ||
14 | | | SCL/SDA | |-------------- | | | ||
15 | | |------------| | | ||
16 | | | | | Bus segment 2 | | | ||
17 | | Linux | GPIO 1..N | MUX |--------------- Devices | ||
18 | | |------------| | | | | ||
19 | | | | | Bus segment M | ||
20 | | | | |---------------| | | ||
21 | ---------- ---------- - - - - - | ||
22 | |||
23 | SCL/SDA of the master I2C bus is multiplexed to bus segment 1..M | ||
24 | according to the settings of the GPIO pins 1..N. | ||
25 | |||
26 | Usage | ||
27 | ----- | ||
28 | |||
29 | i2c-gpio-mux uses the platform bus, so you need to provide a struct | ||
30 | platform_device with the platform_data pointing to a struct | ||
31 | gpio_i2cmux_platform_data with the I2C adapter number of the master | ||
32 | bus, the number of bus segments to create and the GPIO pins used | ||
33 | to control it. See include/linux/i2c-gpio-mux.h for details. | ||
34 | |||
35 | E.G. something like this for a MUX providing 4 bus segments | ||
36 | controlled through 3 GPIO pins: | ||
37 | |||
38 | #include <linux/i2c-gpio-mux.h> | ||
39 | #include <linux/platform_device.h> | ||
40 | |||
41 | static const unsigned myboard_gpiomux_gpios[] = { | ||
42 | AT91_PIN_PC26, AT91_PIN_PC25, AT91_PIN_PC24 | ||
43 | }; | ||
44 | |||
45 | static const unsigned myboard_gpiomux_values[] = { | ||
46 | 0, 1, 2, 3 | ||
47 | }; | ||
48 | |||
49 | static struct gpio_i2cmux_platform_data myboard_i2cmux_data = { | ||
50 | .parent = 1, | ||
51 | .base_nr = 2, /* optional */ | ||
52 | .values = myboard_gpiomux_values, | ||
53 | .n_values = ARRAY_SIZE(myboard_gpiomux_values), | ||
54 | .gpios = myboard_gpiomux_gpios, | ||
55 | .n_gpios = ARRAY_SIZE(myboard_gpiomux_gpios), | ||
56 | .idle = 4, /* optional */ | ||
57 | }; | ||
58 | |||
59 | static struct platform_device myboard_i2cmux = { | ||
60 | .name = "i2c-gpio-mux", | ||
61 | .id = 0, | ||
62 | .dev = { | ||
63 | .platform_data = &myboard_i2cmux_data, | ||
64 | }, | ||
65 | }; | ||
66 | |||
67 | If you don't know the absolute GPIO pin numbers at registration time, | ||
68 | you can instead provide a chip name (.chip_name) and relative GPIO pin | ||
69 | numbers, and the i2c-gpio-mux driver will do the work for you, | ||
70 | including deferred probing if the GPIO chip isn't immediately | ||
71 | available. | ||
72 | |||
73 | Device Registration | ||
74 | ------------------- | ||
75 | |||
76 | When registering your i2c-gpio-mux device, you should pass the number | ||
77 | of any GPIO pin it uses as the device ID. This guarantees that every | ||
78 | instance has a different ID. | ||
79 | |||
80 | Alternatively, if you don't need a stable device name, you can simply | ||
81 | pass PLATFORM_DEVID_AUTO as the device ID, and the platform core will | ||
82 | assign a dynamic ID to your device. If you do not know the absolute | ||
83 | GPIO pin numbers at registration time, this is even the only option. | ||
diff --git a/Documentation/i2c/smbus-protocol b/Documentation/i2c/smbus-protocol index d1f22618e14..7c19d1a2bea 100644 --- a/Documentation/i2c/smbus-protocol +++ b/Documentation/i2c/smbus-protocol | |||
@@ -23,12 +23,6 @@ don't match these function names. For some of the operations which pass a | |||
23 | single data byte, the functions using SMBus protocol operation names execute | 23 | single data byte, the functions using SMBus protocol operation names execute |
24 | a different protocol operation entirely. | 24 | a different protocol operation entirely. |
25 | 25 | ||
26 | Each transaction type corresponds to a functionality flag. Before calling a | ||
27 | transaction function, a device driver should always check (just once) for | ||
28 | the corresponding functionality flag to ensure that the underlying I2C | ||
29 | adapter supports the transaction in question. See | ||
30 | <file:Documentation/i2c/functionality> for the details. | ||
31 | |||
32 | 26 | ||
33 | Key to symbols | 27 | Key to symbols |
34 | ============== | 28 | ============== |
@@ -55,8 +49,6 @@ This sends a single bit to the device, at the place of the Rd/Wr bit. | |||
55 | 49 | ||
56 | A Addr Rd/Wr [A] P | 50 | A Addr Rd/Wr [A] P |
57 | 51 | ||
58 | Functionality flag: I2C_FUNC_SMBUS_QUICK | ||
59 | |||
60 | 52 | ||
61 | SMBus Receive Byte: i2c_smbus_read_byte() | 53 | SMBus Receive Byte: i2c_smbus_read_byte() |
62 | ========================================== | 54 | ========================================== |
@@ -68,8 +60,6 @@ the previous SMBus command. | |||
68 | 60 | ||
69 | S Addr Rd [A] [Data] NA P | 61 | S Addr Rd [A] [Data] NA P |
70 | 62 | ||
71 | Functionality flag: I2C_FUNC_SMBUS_READ_BYTE | ||
72 | |||
73 | 63 | ||
74 | SMBus Send Byte: i2c_smbus_write_byte() | 64 | SMBus Send Byte: i2c_smbus_write_byte() |
75 | ======================================== | 65 | ======================================== |
@@ -79,8 +69,6 @@ to a device. See Receive Byte for more information. | |||
79 | 69 | ||
80 | S Addr Wr [A] Data [A] P | 70 | S Addr Wr [A] Data [A] P |
81 | 71 | ||
82 | Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE | ||
83 | |||
84 | 72 | ||
85 | SMBus Read Byte: i2c_smbus_read_byte_data() | 73 | SMBus Read Byte: i2c_smbus_read_byte_data() |
86 | ============================================ | 74 | ============================================ |
@@ -90,8 +78,6 @@ The register is specified through the Comm byte. | |||
90 | 78 | ||
91 | S Addr Wr [A] Comm [A] S Addr Rd [A] [Data] NA P | 79 | S Addr Wr [A] Comm [A] S Addr Rd [A] [Data] NA P |
92 | 80 | ||
93 | Functionality flag: I2C_FUNC_SMBUS_READ_BYTE_DATA | ||
94 | |||
95 | 81 | ||
96 | SMBus Read Word: i2c_smbus_read_word_data() | 82 | SMBus Read Word: i2c_smbus_read_word_data() |
97 | ============================================ | 83 | ============================================ |
@@ -102,12 +88,6 @@ byte. But this time, the data is a complete word (16 bits). | |||
102 | 88 | ||
103 | S Addr Wr [A] Comm [A] S Addr Rd [A] [DataLow] A [DataHigh] NA P | 89 | S Addr Wr [A] Comm [A] S Addr Rd [A] [DataLow] A [DataHigh] NA P |
104 | 90 | ||
105 | Functionality flag: I2C_FUNC_SMBUS_READ_WORD_DATA | ||
106 | |||
107 | Note the convenience function i2c_smbus_read_word_swapped is | ||
108 | available for reads where the two data bytes are the other way | ||
109 | around (not SMBus compliant, but very popular.) | ||
110 | |||
111 | 91 | ||
112 | SMBus Write Byte: i2c_smbus_write_byte_data() | 92 | SMBus Write Byte: i2c_smbus_write_byte_data() |
113 | ============================================== | 93 | ============================================== |
@@ -118,8 +98,6 @@ the Read Byte operation. | |||
118 | 98 | ||
119 | S Addr Wr [A] Comm [A] Data [A] P | 99 | S Addr Wr [A] Comm [A] Data [A] P |
120 | 100 | ||
121 | Functionality flag: I2C_FUNC_SMBUS_WRITE_BYTE_DATA | ||
122 | |||
123 | 101 | ||
124 | SMBus Write Word: i2c_smbus_write_word_data() | 102 | SMBus Write Word: i2c_smbus_write_word_data() |
125 | ============================================== | 103 | ============================================== |
@@ -130,12 +108,6 @@ specified through the Comm byte. | |||
130 | 108 | ||
131 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] P | 109 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] P |
132 | 110 | ||
133 | Functionality flag: I2C_FUNC_SMBUS_WRITE_WORD_DATA | ||
134 | |||
135 | Note the convenience function i2c_smbus_write_word_swapped is | ||
136 | available for writes where the two data bytes are the other way | ||
137 | around (not SMBus compliant, but very popular.) | ||
138 | |||
139 | 111 | ||
140 | SMBus Process Call: i2c_smbus_process_call() | 112 | SMBus Process Call: i2c_smbus_process_call() |
141 | ============================================= | 113 | ============================================= |
@@ -146,8 +118,6 @@ This command selects a device register (through the Comm byte), sends | |||
146 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] | 118 | S Addr Wr [A] Comm [A] DataLow [A] DataHigh [A] |
147 | S Addr Rd [A] [DataLow] A [DataHigh] NA P | 119 | S Addr Rd [A] [DataLow] A [DataHigh] NA P |
148 | 120 | ||
149 | Functionality flag: I2C_FUNC_SMBUS_PROC_CALL | ||
150 | |||
151 | 121 | ||
152 | SMBus Block Read: i2c_smbus_read_block_data() | 122 | SMBus Block Read: i2c_smbus_read_block_data() |
153 | ============================================== | 123 | ============================================== |
@@ -159,8 +129,6 @@ of data is specified by the device in the Count byte. | |||
159 | S Addr Wr [A] Comm [A] | 129 | S Addr Wr [A] Comm [A] |
160 | S Addr Rd [A] [Count] A [Data] A [Data] A ... A [Data] NA P | 130 | S Addr Rd [A] [Count] A [Data] A [Data] A ... A [Data] NA P |
161 | 131 | ||
162 | Functionality flag: I2C_FUNC_SMBUS_READ_BLOCK_DATA | ||
163 | |||
164 | 132 | ||
165 | SMBus Block Write: i2c_smbus_write_block_data() | 133 | SMBus Block Write: i2c_smbus_write_block_data() |
166 | ================================================ | 134 | ================================================ |
@@ -171,8 +139,6 @@ Comm byte. The amount of data is specified in the Count byte. | |||
171 | 139 | ||
172 | S Addr Wr [A] Comm [A] Count [A] Data [A] Data [A] ... [A] Data [A] P | 140 | S Addr Wr [A] Comm [A] Count [A] Data [A] Data [A] ... [A] Data [A] P |
173 | 141 | ||
174 | Functionality flag: I2C_FUNC_SMBUS_WRITE_BLOCK_DATA | ||
175 | |||
176 | 142 | ||
177 | SMBus Block Write - Block Read Process Call | 143 | SMBus Block Write - Block Read Process Call |
178 | =========================================== | 144 | =========================================== |
@@ -186,8 +152,6 @@ This command selects a device register (through the Comm byte), sends | |||
186 | S Addr Wr [A] Comm [A] Count [A] Data [A] ... | 152 | S Addr Wr [A] Comm [A] Count [A] Data [A] ... |
187 | S Addr Rd [A] [Count] A [Data] ... A P | 153 | S Addr Rd [A] [Count] A [Data] ... A P |
188 | 154 | ||
189 | Functionality flag: I2C_FUNC_SMBUS_BLOCK_PROC_CALL | ||
190 | |||
191 | 155 | ||
192 | SMBus Host Notify | 156 | SMBus Host Notify |
193 | ================= | 157 | ================= |
@@ -257,7 +221,15 @@ designated register that is specified through the Comm byte. | |||
257 | S Addr Wr [A] Comm [A] | 221 | S Addr Wr [A] Comm [A] |
258 | S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P | 222 | S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P |
259 | 223 | ||
260 | Functionality flag: I2C_FUNC_SMBUS_READ_I2C_BLOCK | 224 | |
225 | I2C Block Read (2 Comm bytes) | ||
226 | ============================= | ||
227 | |||
228 | This command reads a block of bytes from a device, from a | ||
229 | designated register that is specified through the two Comm bytes. | ||
230 | |||
231 | S Addr Wr [A] Comm1 [A] Comm2 [A] | ||
232 | S Addr Rd [A] [Data] A [Data] A ... A [Data] NA P | ||
261 | 233 | ||
262 | 234 | ||
263 | I2C Block Write: i2c_smbus_write_i2c_block_data() | 235 | I2C Block Write: i2c_smbus_write_i2c_block_data() |
@@ -269,5 +241,3 @@ Comm byte. Note that command lengths of 0, 2, or more bytes are | |||
269 | supported as they are indistinguishable from data. | 241 | supported as they are indistinguishable from data. |
270 | 242 | ||
271 | S Addr Wr [A] Comm [A] Data [A] Data [A] ... [A] Data [A] P | 243 | S Addr Wr [A] Comm [A] Data [A] Data [A] ... [A] Data [A] P |
272 | |||
273 | Functionality flag: I2C_FUNC_SMBUS_WRITE_I2C_BLOCK | ||
diff --git a/Documentation/i2c/ten-bit-addresses b/Documentation/i2c/ten-bit-addresses index cdfe13901b9..e9890709c50 100644 --- a/Documentation/i2c/ten-bit-addresses +++ b/Documentation/i2c/ten-bit-addresses | |||
@@ -1,24 +1,22 @@ | |||
1 | The I2C protocol knows about two kinds of device addresses: normal 7 bit | 1 | The I2C protocol knows about two kinds of device addresses: normal 7 bit |
2 | addresses, and an extended set of 10 bit addresses. The sets of addresses | 2 | addresses, and an extended set of 10 bit addresses. The sets of addresses |
3 | do not intersect: the 7 bit address 0x10 is not the same as the 10 bit | 3 | do not intersect: the 7 bit address 0x10 is not the same as the 10 bit |
4 | address 0x10 (though a single device could respond to both of them). | 4 | address 0x10 (though a single device could respond to both of them). You |
5 | select a 10 bit address by adding an extra byte after the address | ||
6 | byte: | ||
7 | S Addr7 Rd/Wr .... | ||
8 | becomes | ||
9 | S 11110 Addr10 Rd/Wr | ||
10 | S is the start bit, Rd/Wr the read/write bit, and if you count the number | ||
11 | of bits, you will see the there are 8 after the S bit for 7 bit addresses, | ||
12 | and 16 after the S bit for 10 bit addresses. | ||
5 | 13 | ||
6 | I2C messages to and from 10-bit address devices have a different format. | 14 | WARNING! The current 10 bit address support is EXPERIMENTAL. There are |
7 | See the I2C specification for the details. | 15 | several places in the code that will cause SEVERE PROBLEMS with 10 bit |
16 | addresses, even though there is some basic handling and hooks. Also, | ||
17 | almost no supported adapter handles the 10 bit addresses correctly. | ||
8 | 18 | ||
9 | The current 10 bit address support is minimal. It should work, however | 19 | As soon as a real 10 bit address device is spotted 'in the wild', we |
10 | you can expect some problems along the way: | 20 | can and will add proper support. Right now, 10 bit address devices |
11 | * Not all bus drivers support 10-bit addresses. Some don't because the | 21 | are defined by the I2C protocol, but we have never seen a single device |
12 | hardware doesn't support them (SMBus doesn't require 10-bit address | 22 | which supports them. |
13 | support for example), some don't because nobody bothered adding the | ||
14 | code (or it's there but not working properly.) Software implementation | ||
15 | (i2c-algo-bit) is known to work. | ||
16 | * Some optional features do not support 10-bit addresses. This is the | ||
17 | case of automatic detection and instantiation of devices by their, | ||
18 | drivers, for example. | ||
19 | * Many user-space packages (for example i2c-tools) lack support for | ||
20 | 10-bit addresses. | ||
21 | |||
22 | Note that 10-bit address devices are still pretty rare, so the limitations | ||
23 | listed above could stay for a long time, maybe even forever if nobody | ||
24 | needs them to be fixed. | ||
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients index 3a94b0e6f60..5aa53374ea2 100644 --- a/Documentation/i2c/writing-clients +++ b/Documentation/i2c/writing-clients | |||
@@ -245,26 +245,11 @@ static int __init foo_init(void) | |||
245 | { | 245 | { |
246 | return i2c_add_driver(&foo_driver); | 246 | return i2c_add_driver(&foo_driver); |
247 | } | 247 | } |
248 | module_init(foo_init); | ||
249 | 248 | ||
250 | static void __exit foo_cleanup(void) | 249 | static void __exit foo_cleanup(void) |
251 | { | 250 | { |
252 | i2c_del_driver(&foo_driver); | 251 | i2c_del_driver(&foo_driver); |
253 | } | 252 | } |
254 | module_exit(foo_cleanup); | ||
255 | |||
256 | The module_i2c_driver() macro can be used to reduce above code. | ||
257 | |||
258 | module_i2c_driver(foo_driver); | ||
259 | |||
260 | Note that some functions are marked by `__init'. These functions can | ||
261 | be removed after kernel booting (or module loading) is completed. | ||
262 | Likewise, functions marked by `__exit' are dropped by the compiler when | ||
263 | the code is built into the kernel, as they would never be called. | ||
264 | |||
265 | |||
266 | Driver Information | ||
267 | ================== | ||
268 | 253 | ||
269 | /* Substitute your own name and email address */ | 254 | /* Substitute your own name and email address */ |
270 | MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>" | 255 | MODULE_AUTHOR("Frodo Looijaard <frodol@dds.nl>" |
@@ -273,6 +258,14 @@ MODULE_DESCRIPTION("Driver for Barf Inc. Foo I2C devices"); | |||
273 | /* a few non-GPL license types are also allowed */ | 258 | /* a few non-GPL license types are also allowed */ |
274 | MODULE_LICENSE("GPL"); | 259 | MODULE_LICENSE("GPL"); |
275 | 260 | ||
261 | module_init(foo_init); | ||
262 | module_exit(foo_cleanup); | ||
263 | |||
264 | Note that some functions are marked by `__init'. These functions can | ||
265 | be removed after kernel booting (or module loading) is completed. | ||
266 | Likewise, functions marked by `__exit' are dropped by the compiler when | ||
267 | the code is built into the kernel, as they would never be called. | ||
268 | |||
276 | 269 | ||
277 | Power Management | 270 | Power Management |
278 | ================ | 271 | ================ |