diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-10-28 18:48:57 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-10-28 18:48:57 -0400 |
commit | 596c96ba06e5d56e72451e02f93f4e15e17458df (patch) | |
tree | 78bc640acacb8faeb621c51296e99dbb0533a147 /Documentation/i2c | |
parent | ad18b0ea089928367185e13d11424aea91d4b41f (diff) | |
parent | 20731945ae743034353a88c307920d1f16cf8ac8 (diff) |
Merge branch 'master'
Diffstat (limited to 'Documentation/i2c')
-rw-r--r-- | Documentation/i2c/busses/i2c-i810 | 1 | ||||
-rw-r--r-- | Documentation/i2c/busses/i2c-viapro | 27 | ||||
-rw-r--r-- | Documentation/i2c/chips/x1205 | 38 | ||||
-rw-r--r-- | Documentation/i2c/functionality | 7 | ||||
-rw-r--r-- | Documentation/i2c/porting-clients | 2 | ||||
-rw-r--r-- | Documentation/i2c/writing-clients | 27 |
6 files changed, 68 insertions, 34 deletions
diff --git a/Documentation/i2c/busses/i2c-i810 b/Documentation/i2c/busses/i2c-i810 index 0544eb332887..83c3b9743c3c 100644 --- a/Documentation/i2c/busses/i2c-i810 +++ b/Documentation/i2c/busses/i2c-i810 | |||
@@ -2,6 +2,7 @@ Kernel driver i2c-i810 | |||
2 | 2 | ||
3 | Supported adapters: | 3 | Supported adapters: |
4 | * Intel 82810, 82810-DC100, 82810E, and 82815 (GMCH) | 4 | * Intel 82810, 82810-DC100, 82810E, and 82815 (GMCH) |
5 | * Intel 82845G (GMCH) | ||
5 | 6 | ||
6 | Authors: | 7 | Authors: |
7 | Frodo Looijaard <frodol@dds.nl>, | 8 | Frodo Looijaard <frodol@dds.nl>, |
diff --git a/Documentation/i2c/busses/i2c-viapro b/Documentation/i2c/busses/i2c-viapro index 702f5ac68c09..9363b8bd6109 100644 --- a/Documentation/i2c/busses/i2c-viapro +++ b/Documentation/i2c/busses/i2c-viapro | |||
@@ -4,17 +4,18 @@ Supported adapters: | |||
4 | * VIA Technologies, Inc. VT82C596A/B | 4 | * VIA Technologies, Inc. VT82C596A/B |
5 | Datasheet: Sometimes available at the VIA website | 5 | Datasheet: Sometimes available at the VIA website |
6 | 6 | ||
7 | * VIA Technologies, Inc. VT82C686A/B | 7 | * VIA Technologies, Inc. VT82C686A/B |
8 | Datasheet: Sometimes available at the VIA website | 8 | Datasheet: Sometimes available at the VIA website |
9 | 9 | ||
10 | * VIA Technologies, Inc. VT8231, VT8233, VT8233A, VT8235, VT8237 | 10 | * VIA Technologies, Inc. VT8231, VT8233, VT8233A, VT8235, VT8237 |
11 | Datasheet: available on request from Via | 11 | Datasheet: available on request from Via |
12 | 12 | ||
13 | Authors: | 13 | Authors: |
14 | Frodo Looijaard <frodol@dds.nl>, | 14 | Frodo Looijaard <frodol@dds.nl>, |
15 | Philip Edelbrock <phil@netroedge.com>, | 15 | Philip Edelbrock <phil@netroedge.com>, |
16 | Kyösti Mälkki <kmalkki@cc.hut.fi>, | 16 | Kyösti Mälkki <kmalkki@cc.hut.fi>, |
17 | Mark D. Studebaker <mdsxyz123@yahoo.com> | 17 | Mark D. Studebaker <mdsxyz123@yahoo.com>, |
18 | Jean Delvare <khali@linux-fr.org> | ||
18 | 19 | ||
19 | Module Parameters | 20 | Module Parameters |
20 | ----------------- | 21 | ----------------- |
@@ -28,20 +29,22 @@ Description | |||
28 | ----------- | 29 | ----------- |
29 | 30 | ||
30 | i2c-viapro is a true SMBus host driver for motherboards with one of the | 31 | i2c-viapro is a true SMBus host driver for motherboards with one of the |
31 | supported VIA southbridges. | 32 | supported VIA south bridges. |
32 | 33 | ||
33 | Your lspci -n listing must show one of these : | 34 | Your lspci -n listing must show one of these : |
34 | 35 | ||
35 | device 1106:3050 (VT82C596 function 3) | 36 | device 1106:3050 (VT82C596A function 3) |
36 | device 1106:3051 (VT82C596 function 3) | 37 | device 1106:3051 (VT82C596B function 3) |
37 | device 1106:3057 (VT82C686 function 4) | 38 | device 1106:3057 (VT82C686 function 4) |
38 | device 1106:3074 (VT8233) | 39 | device 1106:3074 (VT8233) |
39 | device 1106:3147 (VT8233A) | 40 | device 1106:3147 (VT8233A) |
40 | device 1106:8235 (VT8231) | 41 | device 1106:8235 (VT8231 function 4) |
41 | devide 1106:3177 (VT8235) | 42 | device 1106:3177 (VT8235) |
42 | devide 1106:3227 (VT8237) | 43 | device 1106:3227 (VT8237R) |
43 | 44 | ||
44 | If none of these show up, you should look in the BIOS for settings like | 45 | If none of these show up, you should look in the BIOS for settings like |
45 | enable ACPI / SMBus or even USB. | 46 | enable ACPI / SMBus or even USB. |
46 | 47 | ||
47 | 48 | Except for the oldest chips (VT82C596A/B, VT82C686A and most probably | |
49 | VT8231), this driver supports I2C block transactions. Such transactions | ||
50 | are mainly useful to read from and write to EEPROMs. | ||
diff --git a/Documentation/i2c/chips/x1205 b/Documentation/i2c/chips/x1205 new file mode 100644 index 000000000000..09407c991fe5 --- /dev/null +++ b/Documentation/i2c/chips/x1205 | |||
@@ -0,0 +1,38 @@ | |||
1 | Kernel driver x1205 | ||
2 | =================== | ||
3 | |||
4 | Supported chips: | ||
5 | * Xicor X1205 RTC | ||
6 | Prefix: 'x1205' | ||
7 | Addresses scanned: none | ||
8 | Datasheet: http://www.intersil.com/cda/deviceinfo/0,1477,X1205,00.html | ||
9 | |||
10 | Authors: | ||
11 | Karen Spearel <kas11@tampabay.rr.com>, | ||
12 | Alessandro Zummo <a.zummo@towertech.it> | ||
13 | |||
14 | Description | ||
15 | ----------- | ||
16 | |||
17 | This module aims to provide complete access to the Xicor X1205 RTC. | ||
18 | Recently Xicor has merged with Intersil, but the chip is | ||
19 | still sold under the Xicor brand. | ||
20 | |||
21 | This chip is located at address 0x6f and uses a 2-byte register addressing. | ||
22 | Two bytes need to be written to read a single register, while most | ||
23 | other chips just require one and take the second one as the data | ||
24 | to be written. To prevent corrupting unknown chips, the user must | ||
25 | explicitely set the probe parameter. | ||
26 | |||
27 | example: | ||
28 | |||
29 | modprobe x1205 probe=0,0x6f | ||
30 | |||
31 | The module supports one more option, hctosys, which is used to set the | ||
32 | software clock from the x1205. On systems where the x1205 is the | ||
33 | only hardware rtc, this parameter could be used to achieve a correct | ||
34 | date/time earlier in the system boot sequence. | ||
35 | |||
36 | example: | ||
37 | |||
38 | modprobe x1205 probe=0,0x6f hctosys=1 | ||
diff --git a/Documentation/i2c/functionality b/Documentation/i2c/functionality index 41ffefbdc60c..60cca249e452 100644 --- a/Documentation/i2c/functionality +++ b/Documentation/i2c/functionality | |||
@@ -17,9 +17,10 @@ For the most up-to-date list of functionality constants, please check | |||
17 | I2C_FUNC_I2C Plain i2c-level commands (Pure SMBus | 17 | I2C_FUNC_I2C Plain i2c-level commands (Pure SMBus |
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_REV_DIR_ADDR, | 20 | I2C_FUNC_PROTOCOL_MANGLING Knows about the I2C_M_IGNORE_NAK, |
21 | I2C_M_REV_DIR_ADDR and I2C_M_REV_DIR_NOSTART | 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 protocol!) | ||
23 | I2C_FUNC_SMBUS_QUICK Handles the SMBus write_quick command | 24 | I2C_FUNC_SMBUS_QUICK Handles the SMBus write_quick command |
24 | I2C_FUNC_SMBUS_READ_BYTE Handles the SMBus read_byte command | 25 | I2C_FUNC_SMBUS_READ_BYTE Handles the SMBus read_byte command |
25 | I2C_FUNC_SMBUS_WRITE_BYTE Handles the SMBus write_byte command | 26 | I2C_FUNC_SMBUS_WRITE_BYTE Handles the SMBus write_byte command |
diff --git a/Documentation/i2c/porting-clients b/Documentation/i2c/porting-clients index 4849dfd6961c..184fac2377aa 100644 --- a/Documentation/i2c/porting-clients +++ b/Documentation/i2c/porting-clients | |||
@@ -82,7 +82,7 @@ Technical changes: | |||
82 | exit and exit_free. For i2c+isa drivers, labels should be named | 82 | exit and exit_free. For i2c+isa drivers, labels should be named |
83 | ERROR0, ERROR1 and ERROR2. Don't forget to properly set err before | 83 | ERROR0, ERROR1 and ERROR2. Don't forget to properly set err before |
84 | jumping to error labels. By the way, labels should be left-aligned. | 84 | jumping to error labels. By the way, labels should be left-aligned. |
85 | Use memset to fill the client and data area with 0x00. | 85 | Use kzalloc instead of kmalloc. |
86 | Use i2c_set_clientdata to set the client data (as opposed to | 86 | Use i2c_set_clientdata to set the client data (as opposed to |
87 | a direct access to client->data). | 87 | a direct access to client->data). |
88 | Use strlcpy instead of strcpy to copy the client name. | 88 | Use strlcpy instead of strcpy to copy the client name. |
diff --git a/Documentation/i2c/writing-clients b/Documentation/i2c/writing-clients index 077275722a7c..e94d9c6cc522 100644 --- a/Documentation/i2c/writing-clients +++ b/Documentation/i2c/writing-clients | |||
@@ -33,8 +33,8 @@ static struct i2c_driver foo_driver = { | |||
33 | .command = &foo_command /* may be NULL */ | 33 | .command = &foo_command /* may be NULL */ |
34 | } | 34 | } |
35 | 35 | ||
36 | The name can be chosen freely, and may be upto 40 characters long. Please | 36 | The name field must match the driver name, including the case. It must not |
37 | use something descriptive here. | 37 | contain spaces, and may be up to 31 characters long. |
38 | 38 | ||
39 | Don't worry about the flags field; just put I2C_DF_NOTIFY into it. This | 39 | Don't worry about the flags field; just put I2C_DF_NOTIFY into it. This |
40 | means that your driver will be notified when new adapters are found. | 40 | means that your driver will be notified when new adapters are found. |
@@ -43,9 +43,6 @@ This is almost always what you want. | |||
43 | All other fields are for call-back functions which will be explained | 43 | All other fields are for call-back functions which will be explained |
44 | below. | 44 | below. |
45 | 45 | ||
46 | There use to be two additional fields in this structure, inc_use et dec_use, | ||
47 | for module usage count, but these fields were obsoleted and removed. | ||
48 | |||
49 | 46 | ||
50 | Extra client data | 47 | Extra client data |
51 | ================= | 48 | ================= |
@@ -58,6 +55,7 @@ be very useful. | |||
58 | An example structure is below. | 55 | An example structure is below. |
59 | 56 | ||
60 | struct foo_data { | 57 | struct foo_data { |
58 | struct i2c_client client; | ||
61 | struct semaphore lock; /* For ISA access in `sensors' drivers. */ | 59 | struct semaphore lock; /* For ISA access in `sensors' drivers. */ |
62 | int sysctl_id; /* To keep the /proc directory entry for | 60 | int sysctl_id; /* To keep the /proc directory entry for |
63 | `sensors' drivers. */ | 61 | `sensors' drivers. */ |
@@ -310,22 +308,15 @@ For now, you can ignore the `flags' parameter. It is there for future use. | |||
310 | client structure, even though we cannot fill it completely yet. | 308 | client structure, even though we cannot fill it completely yet. |
311 | But it allows us to access several i2c functions safely */ | 309 | But it allows us to access several i2c functions safely */ |
312 | 310 | ||
313 | /* Note that we reserve some space for foo_data too. If you don't | 311 | if (!(data = kzalloc(sizeof(struct foo_data), GFP_KERNEL))) { |
314 | need it, remove it. We do it here to help to lessen memory | ||
315 | fragmentation. */ | ||
316 | if (! (new_client = kmalloc(sizeof(struct i2c_client) + | ||
317 | sizeof(struct foo_data), | ||
318 | GFP_KERNEL))) { | ||
319 | err = -ENOMEM; | 312 | err = -ENOMEM; |
320 | goto ERROR0; | 313 | goto ERROR0; |
321 | } | 314 | } |
322 | 315 | ||
323 | /* This is tricky, but it will set the data to the right value. */ | 316 | new_client = &data->client; |
324 | client->data = new_client + 1; | 317 | i2c_set_clientdata(new_client, data); |
325 | data = (struct foo_data *) (client->data); | ||
326 | 318 | ||
327 | new_client->addr = address; | 319 | new_client->addr = address; |
328 | new_client->data = data; | ||
329 | new_client->adapter = adapter; | 320 | new_client->adapter = adapter; |
330 | new_client->driver = &foo_driver; | 321 | new_client->driver = &foo_driver; |
331 | new_client->flags = 0; | 322 | new_client->flags = 0; |
@@ -451,7 +442,7 @@ much simpler than the attachment code, fortunately! | |||
451 | release_region(client->addr,LM78_EXTENT); | 442 | release_region(client->addr,LM78_EXTENT); |
452 | /* HYBRID SENSORS CHIP ONLY END */ | 443 | /* HYBRID SENSORS CHIP ONLY END */ |
453 | 444 | ||
454 | kfree(client); /* Frees client data too, if allocated at the same time */ | 445 | kfree(data); |
455 | return 0; | 446 | return 0; |
456 | } | 447 | } |
457 | 448 | ||
@@ -576,12 +567,12 @@ SMBus communication | |||
576 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, | 567 | extern s32 i2c_smbus_write_block_data(struct i2c_client * client, |
577 | u8 command, u8 length, | 568 | u8 command, u8 length, |
578 | u8 *values); | 569 | u8 *values); |
570 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, | ||
571 | u8 command, u8 *values); | ||
579 | 572 | ||
580 | These ones were removed in Linux 2.6.10 because they had no users, but could | 573 | These ones were removed in Linux 2.6.10 because they had no users, but could |
581 | be added back later if needed: | 574 | be added back later if needed: |
582 | 575 | ||
583 | extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, | ||
584 | u8 command, u8 *values); | ||
585 | extern s32 i2c_smbus_read_block_data(struct i2c_client * client, | 576 | extern s32 i2c_smbus_read_block_data(struct i2c_client * client, |
586 | u8 command, u8 *values); | 577 | u8 command, u8 *values); |
587 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, | 578 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, |